diff --git a/Matomat/Controller/Instruction.cs b/Matomat/Controller/Instruction.cs index 3d4ebe2..3397ebb 100644 --- a/Matomat/Controller/Instruction.cs +++ b/Matomat/Controller/Instruction.cs @@ -252,8 +252,8 @@ namespace Matomat } Factory.getLCD().print("Koffein im Umlauf: " + k.ToString().PadLeft(4, ' ') + " mg (" + avg.ToString().PadLeft(4, ' ') + " mg/Per)" + "²²²²²²²²²²²²²²²²²²²²²²²²²²²²" + p[0] + - "² MATOMAT Wilkommen! ²" + p[1] + - "² Frohes genießen der Mate ²" + p[2]); + "² MATOMAT Willkommen! ²" + p[1] + + "² Frohes Genießen der Mate ²" + p[2]); } public static void showUserInfo(User user) diff --git a/Matomat/Matomat.csproj b/Matomat/Matomat.csproj index b418683..c9e2665 100644 --- a/Matomat/Matomat.csproj +++ b/Matomat/Matomat.csproj @@ -29,10 +29,13 @@ pdbonly true bin\Release\ - TRACE + DEBUG;TRACE prompt 4 + + icon.ico + False @@ -90,6 +93,7 @@ + diff --git a/Matomat/Output/LCDDisplay.cs b/Matomat/Output/LCDDisplay.cs index c527221..5945004 100644 --- a/Matomat/Output/LCDDisplay.cs +++ b/Matomat/Output/LCDDisplay.cs @@ -41,9 +41,11 @@ namespace Matomat.Output private volatile bool _shouldStop; private SerialPort serialPort; private bool disable = false; + private string ComPort; private LCDDisplay(string port) { + this.ComPort = port; this.serialPort = new SerialPort(port, 19200, Parity.None, 8, StopBits.One); try { @@ -132,6 +134,14 @@ namespace Matomat.Output text = text.PadRight(160, ' '); text = text.Substring(0, 40) + "\n" + text.Substring(40, 40) + "\n" + text.Substring(80, 40) + "\n" + text.Substring(120, 40); Console.WriteLine(text); + if (!disable) + { + if (this.serialPort.IsOpen) + { + this.serialPort.Close(); + } + this.serialPort.Open(); + } } private void displayClear() diff --git a/Matomat/Properties/AssemblyInfo.cs b/Matomat/Properties/AssemblyInfo.cs index 6c41eab..80da6b3 100644 --- a/Matomat/Properties/AssemblyInfo.cs +++ b/Matomat/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ using System.Resources; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BlubbFish")] [assembly: AssemblyProduct("Matomat")] -[assembly: AssemblyCopyright("Copyright © BlubbFish 2013")] +[assembly: AssemblyCopyright("Copyright © BlubbFish 2013-2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -33,6 +33,6 @@ using System.Resources; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyVersion("1.0.0.2")] +[assembly: AssemblyFileVersion("1.0.0.2")] [assembly: NeutralResourcesLanguageAttribute("de-DE")] diff --git a/Matomat/icon.ico b/Matomat/icon.ico new file mode 100644 index 0000000..c1921a9 Binary files /dev/null and b/Matomat/icon.ico differ diff --git a/firmware/.dep/Cstartup_SAM7.o.d b/firmware/.dep/Cstartup_SAM7.o.d new file mode 100644 index 0000000..c57b75e --- /dev/null +++ b/firmware/.dep/Cstartup_SAM7.o.d @@ -0,0 +1,8 @@ +src/start/Cstartup_SAM7.o: src/start/Cstartup_SAM7.c include/board.h \ + include/AT91SAM7.h include/lib_AT91SAM7.h + +include/board.h: + +include/AT91SAM7.h: + +include/lib_AT91SAM7.h: diff --git a/firmware/.dep/blinkcode.o.d b/firmware/.dep/blinkcode.o.d new file mode 100644 index 0000000..99e6a42 --- /dev/null +++ b/firmware/.dep/blinkcode.o.d @@ -0,0 +1,46 @@ +src/os/blinkcode.o: src/os/blinkcode.c src/os/pit.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + src/os/dbgu.h src/os/led.h src/os/blinkcode.h + +src/os/pit.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +src/os/dbgu.h: + +src/os/led.h: + +src/os/blinkcode.h: diff --git a/firmware/.dep/ctype.o.d b/firmware/.dep/ctype.o.d new file mode 100644 index 0000000..d3cd4f4 --- /dev/null +++ b/firmware/.dep/ctype.o.d @@ -0,0 +1,3 @@ +lib/ctype.o: lib/ctype.c include/asm/ctype.h + +include/asm/ctype.h: diff --git a/firmware/.dep/dbgu.o.d b/firmware/.dep/dbgu.o.d new file mode 100644 index 0000000..e43fb1c --- /dev/null +++ b/firmware/.dep/dbgu.o.d @@ -0,0 +1,67 @@ +src/dfu/dbgu.o: src/dfu/dbgu.c include/lib_AT91SAM7.h include/AT91SAM7.h \ + include/board.h src/dfu/dbgu.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/board.h: + +src/dfu/dbgu.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: diff --git a/firmware/.dep/dfu.o.d b/firmware/.dep/dfu.o.d new file mode 100644 index 0000000..3af1d63 --- /dev/null +++ b/firmware/.dep/dfu.o.d @@ -0,0 +1,86 @@ +src/dfu/dfu.o: src/dfu/dfu.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + include/usb_ch9.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/usb_dfu.h include/board.h include/AT91SAM7.h \ + include/lib_AT91SAM7.h src/pcd/usb_strings_dfu.h src/dfu/dfu.h \ + src/dfu/../config.h src/dfu/dbgu.h src/os/flash.h src/os/pcd_enumerate.h \ + include/asm/atomic.h include/asm/system.h include/asm/compiler.h \ + include/openpcd.h src/dfu/../openpcd.h include/compile.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +include/usb_ch9.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/usb_dfu.h: + +include/board.h: + +include/AT91SAM7.h: + +include/lib_AT91SAM7.h: + +src/pcd/usb_strings_dfu.h: + +src/dfu/dfu.h: + +src/dfu/../config.h: + +src/dfu/dbgu.h: + +src/os/flash.h: + +src/os/pcd_enumerate.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +include/openpcd.h: + +src/dfu/../openpcd.h: + +include/compile.h: diff --git a/firmware/.dep/fifo.o.d b/firmware/.dep/fifo.o.d new file mode 100644 index 0000000..94db243 --- /dev/null +++ b/firmware/.dep/fifo.o.d @@ -0,0 +1,57 @@ +src/os/fifo.o: src/os/fifo.c src/os/fifo.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h + +src/os/fifo.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: diff --git a/firmware/.dep/flash.o.d b/firmware/.dep/flash.o.d new file mode 100644 index 0000000..999540d --- /dev/null +++ b/firmware/.dep/flash.o.d @@ -0,0 +1,46 @@ +src/os/flash.o: src/os/flash.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h src/dfu/dbgu.h include/board.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/dfu/dbgu.h: + +include/board.h: diff --git a/firmware/.dep/led.o.d b/firmware/.dep/led.o.d new file mode 100644 index 0000000..442204e --- /dev/null +++ b/firmware/.dep/led.o.d @@ -0,0 +1,62 @@ +src/os/led.o: src/os/led.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h include/openpcd.h \ + src/os/../openpcd.h src/os/usb_handler.h src/os/req_ctx.h src/os/dbgu.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/openpcd.h: + +src/os/../openpcd.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/os/dbgu.h: diff --git a/firmware/.dep/lib_AT91SAM7.o.d b/firmware/.dep/lib_AT91SAM7.o.d new file mode 100644 index 0000000..271b4ae --- /dev/null +++ b/firmware/.dep/lib_AT91SAM7.o.d @@ -0,0 +1,44 @@ +lib/lib_AT91SAM7.o: lib/lib_AT91SAM7.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/AT91SAM7.h include/lib_AT91SAM7.h include/AT91SAM7.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/AT91SAM7.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: diff --git a/firmware/.dep/main.o.d b/firmware/.dep/main.o.d new file mode 100644 index 0000000..3bfbbcb --- /dev/null +++ b/firmware/.dep/main.o.d @@ -0,0 +1,108 @@ +src/os/main.o: src/os/main.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + include/compile.h include/lib_AT91SAM7.h include/AT91SAM7.h \ + src/os/dbgu.h src/os/led.h src/os/blinkcode.h src/os/main.h \ + src/os/power.h src/os/system_irq.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + src/os/pit.h src/os/wdt.h src/os/usbcmd_generic.h src/os/pcd_enumerate.h \ + include/lib_AT91SAM7.h include/asm/atomic.h include/asm/system.h \ + include/asm/compiler.h include/openpcd.h src/dfu/dfu.h include/usb_ch9.h \ + include/usb_dfu.h src/dfu/../config.h src/os/../openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +include/compile.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/dbgu.h: + +src/os/led.h: + +src/os/blinkcode.h: + +src/os/main.h: + +src/os/power.h: + +src/os/system_irq.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +src/os/pit.h: + +src/os/wdt.h: + +src/os/usbcmd_generic.h: + +src/os/pcd_enumerate.h: + +include/lib_AT91SAM7.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +include/openpcd.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/../openpcd.h: diff --git a/firmware/.dep/main_dumbreader.o.d b/firmware/.dep/main_dumbreader.o.d new file mode 100644 index 0000000..476319b --- /dev/null +++ b/firmware/.dep/main_dumbreader.o.d @@ -0,0 +1,136 @@ +src/pcd/main_dumbreader.o: src/pcd/main_dumbreader.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h include/openpcd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + src/os/dbgu.h src/pcd/rc632.h include/cl_rc632.h \ + ../librfid//include/librfid/rfid.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h \ + ../librfid//include/librfid/rfid_system.h \ + ../librfid//include/librfid/rfid_asic.h \ + ../librfid//include/librfid/rfid_asic_rc632.h \ + ../librfid//include/librfid/rfid_layer2.h \ + ../librfid//include/librfid/rfid_layer2_iso14443a.h \ + ../librfid//include/librfid/rfid_layer2_iso14443b.h \ + ../librfid//include/librfid/rfid_layer2_iso15693.h \ + ../librfid//include/librfid/rfid_layer2_icode1.h \ + src/pcd/rc632_highlevel.h src/os/led.h src/os/pcd_enumerate.h \ + include/lib_AT91SAM7.h include/asm/atomic.h include/asm/system.h \ + include/asm/compiler.h include/openpcd.h src/dfu/dfu.h include/usb_ch9.h \ + include/usb_dfu.h src/dfu/../config.h src/os/usb_handler.h \ + src/os/req_ctx.h src/pcd/../openpcd.h src/os/main.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/openpcd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +src/os/dbgu.h: + +src/pcd/rc632.h: + +include/cl_rc632.h: + +../librfid//include/librfid/rfid.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h: + +../librfid//include/librfid/rfid_system.h: + +../librfid//include/librfid/rfid_asic.h: + +../librfid//include/librfid/rfid_asic_rc632.h: + +../librfid//include/librfid/rfid_layer2.h: + +../librfid//include/librfid/rfid_layer2_iso14443a.h: + +../librfid//include/librfid/rfid_layer2_iso14443b.h: + +../librfid//include/librfid/rfid_layer2_iso15693.h: + +../librfid//include/librfid/rfid_layer2_icode1.h: + +src/pcd/rc632_highlevel.h: + +src/os/led.h: + +src/os/pcd_enumerate.h: + +include/lib_AT91SAM7.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +include/openpcd.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/pcd/../openpcd.h: + +src/os/main.h: diff --git a/firmware/.dep/pcd_enumerate.o.d b/firmware/.dep/pcd_enumerate.o.d new file mode 100644 index 0000000..8c5ea2f --- /dev/null +++ b/firmware/.dep/pcd_enumerate.o.d @@ -0,0 +1,87 @@ +src/os/pcd_enumerate.o: src/os/pcd_enumerate.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + include/usb_ch9.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/asm/atomic.h include/asm/system.h include/asm/compiler.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h include/openpcd.h \ + src/pcd/usb_strings_app.h src/os/pcd_enumerate.h src/dfu/dfu.h \ + include/usb_dfu.h src/dfu/../config.h src/os/req_ctx.h \ + src/os/../openpcd.h src/os/dbgu.h src/os/../config.h \ + src/os/usb_descriptors_openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +include/usb_ch9.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/openpcd.h: + +src/pcd/usb_strings_app.h: + +src/os/pcd_enumerate.h: + +src/dfu/dfu.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/req_ctx.h: + +src/os/../openpcd.h: + +src/os/dbgu.h: + +src/os/../config.h: + +src/os/usb_descriptors_openpcd.h: diff --git a/firmware/.dep/pio_irq.o.d b/firmware/.dep/pio_irq.o.d new file mode 100644 index 0000000..e832ad6 --- /dev/null +++ b/firmware/.dep/pio_irq.o.d @@ -0,0 +1,60 @@ +src/os/pio_irq.o: src/os/pio_irq.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h src/os/pio_irq.h src/os/dbgu.h \ + src/os/req_ctx.h include/openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/pio_irq.h: + +src/os/dbgu.h: + +src/os/req_ctx.h: + +include/openpcd.h: diff --git a/firmware/.dep/pit.o.d b/firmware/.dep/pit.o.d new file mode 100644 index 0000000..7c82929 --- /dev/null +++ b/firmware/.dep/pit.o.d @@ -0,0 +1,65 @@ +src/os/pit.o: src/os/pit.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/asm/system.h include/lib_AT91SAM7.h include/AT91SAM7.h \ + src/os/pit.h src/os/dbgu.h src/os/system_irq.h src/os/../openpcd.h \ + include/openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/asm/system.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/pit.h: + +src/os/dbgu.h: + +src/os/system_irq.h: + +src/os/../openpcd.h: + +include/openpcd.h: diff --git a/firmware/.dep/pwm.o.d b/firmware/.dep/pwm.o.d new file mode 100644 index 0000000..7ab5c14 --- /dev/null +++ b/firmware/.dep/pwm.o.d @@ -0,0 +1,80 @@ +src/os/pwm.o: src/os/pwm.c include/lib_AT91SAM7.h include/AT91SAM7.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + include/openpcd.h src/os/usb_handler.h src/os/req_ctx.h \ + src/os/pcd_enumerate.h include/asm/atomic.h include/asm/system.h \ + include/asm/compiler.h src/dfu/dfu.h include/usb_ch9.h include/usb_dfu.h \ + src/dfu/../config.h src/os/dbgu.h src/os/../openpcd.h + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +include/openpcd.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/os/pcd_enumerate.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/dbgu.h: + +src/os/../openpcd.h: diff --git a/firmware/.dep/rc632.o.d b/firmware/.dep/rc632.o.d new file mode 100644 index 0000000..12fd1dd --- /dev/null +++ b/firmware/.dep/rc632.o.d @@ -0,0 +1,133 @@ +src/pcd/rc632.o: src/pcd/rc632.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h include/cl_rc632.h \ + include/openpcd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + src/pcd/../openpcd.h src/os/fifo.h src/os/dbgu.h src/os/pcd_enumerate.h \ + include/asm/atomic.h include/asm/system.h include/asm/compiler.h \ + src/dfu/dfu.h include/usb_ch9.h include/usb_dfu.h src/dfu/../config.h \ + src/os/usb_handler.h src/os/req_ctx.h src/pcd/rc632.h \ + ../librfid//include/librfid/rfid.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h \ + ../librfid//include/librfid/rfid_system.h \ + ../librfid//include/librfid/rfid_asic.h \ + ../librfid//include/librfid/rfid_asic_rc632.h \ + ../librfid//include/librfid/rfid_layer2.h \ + ../librfid//include/librfid/rfid_layer2_iso14443a.h \ + ../librfid//include/librfid/rfid_layer2_iso14443b.h \ + ../librfid//include/librfid/rfid_layer2_iso15693.h \ + ../librfid//include/librfid/rfid_layer2_icode1.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/cl_rc632.h: + +include/openpcd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +src/pcd/../openpcd.h: + +src/os/fifo.h: + +src/os/dbgu.h: + +src/os/pcd_enumerate.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/pcd/rc632.h: + +../librfid//include/librfid/rfid.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h: + +../librfid//include/librfid/rfid_system.h: + +../librfid//include/librfid/rfid_asic.h: + +../librfid//include/librfid/rfid_asic_rc632.h: + +../librfid//include/librfid/rfid_layer2.h: + +../librfid//include/librfid/rfid_layer2_iso14443a.h: + +../librfid//include/librfid/rfid_layer2_iso14443b.h: + +../librfid//include/librfid/rfid_layer2_iso15693.h: + +../librfid//include/librfid/rfid_layer2_icode1.h: diff --git a/firmware/.dep/rc632_highlevel.o.d b/firmware/.dep/rc632_highlevel.o.d new file mode 100644 index 0000000..dd103fc --- /dev/null +++ b/firmware/.dep/rc632_highlevel.o.d @@ -0,0 +1,112 @@ +src/pcd/rc632_highlevel.o: src/pcd/rc632_highlevel.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + include/cl_rc632.h src/pcd/rc632.h ../librfid//include/librfid/rfid.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h \ + ../librfid//include/librfid/rfid_system.h \ + ../librfid//include/librfid/rfid_asic.h \ + ../librfid//include/librfid/rfid_asic_rc632.h \ + ../librfid//include/librfid/rfid_layer2.h \ + ../librfid//include/librfid/rfid_layer2_iso14443a.h \ + ../librfid//include/librfid/rfid_layer2_iso14443b.h \ + ../librfid//include/librfid/rfid_layer2_iso15693.h \ + ../librfid//include/librfid/rfid_layer2_icode1.h src/os/dbgu.h \ + ../librfid//include/librfid/rfid_protocol_mifare_classic.h \ + ../librfid//include/librfid/rfid_protocol.h \ + ../librfid//include/librfid/rfid_protocol_tcl.h \ + ../librfid//include/librfid/rfid_protocol_mifare_ul.h \ + ../librfid//include/librfid/rfid_protocol_tagit.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +include/cl_rc632.h: + +src/pcd/rc632.h: + +../librfid//include/librfid/rfid.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h: + +../librfid//include/librfid/rfid_system.h: + +../librfid//include/librfid/rfid_asic.h: + +../librfid//include/librfid/rfid_asic_rc632.h: + +../librfid//include/librfid/rfid_layer2.h: + +../librfid//include/librfid/rfid_layer2_iso14443a.h: + +../librfid//include/librfid/rfid_layer2_iso14443b.h: + +../librfid//include/librfid/rfid_layer2_iso15693.h: + +../librfid//include/librfid/rfid_layer2_icode1.h: + +src/os/dbgu.h: + +../librfid//include/librfid/rfid_protocol_mifare_classic.h: + +../librfid//include/librfid/rfid_protocol.h: + +../librfid//include/librfid/rfid_protocol_tcl.h: + +../librfid//include/librfid/rfid_protocol_mifare_ul.h: + +../librfid//include/librfid/rfid_protocol_tagit.h: diff --git a/firmware/.dep/req_ctx.o.d b/firmware/.dep/req_ctx.o.d new file mode 100644 index 0000000..8ec1536 --- /dev/null +++ b/firmware/.dep/req_ctx.o.d @@ -0,0 +1,77 @@ +src/os/req_ctx.o: src/os/req_ctx.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/unistd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/unistd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/stdlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/alloca.h \ + include/asm/bitops.h include/asm/system.h src/os/dbgu.h src/os/req_ctx.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h src/os/../openpcd.h \ + include/openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/unistd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/unistd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/stdlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/alloca.h: + +include/asm/bitops.h: + +include/asm/system.h: + +src/os/dbgu.h: + +src/os/req_ctx.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/../openpcd.h: + +include/openpcd.h: diff --git a/firmware/.dep/string.o.d b/firmware/.dep/string.o.d new file mode 100644 index 0000000..11d5c2e --- /dev/null +++ b/firmware/.dep/string.o.d @@ -0,0 +1,52 @@ +lib/string.o: lib/string.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + include/asm/ctype.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +include/asm/ctype.h: diff --git a/firmware/.dep/syscalls.o.d b/firmware/.dep/syscalls.o.d new file mode 100644 index 0000000..feedc22 --- /dev/null +++ b/firmware/.dep/syscalls.o.d @@ -0,0 +1,71 @@ +src/os/syscalls.o: src/os/syscalls.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/stdlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/alloca.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stat.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/time.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/time.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + include/board.h include/AT91SAM7.h include/lib_AT91SAM7.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/stdlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/alloca.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stat.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/time.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/time.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +include/board.h: + +include/AT91SAM7.h: + +include/lib_AT91SAM7.h: diff --git a/firmware/.dep/system_irq.o.d b/firmware/.dep/system_irq.o.d new file mode 100644 index 0000000..d44a595 --- /dev/null +++ b/firmware/.dep/system_irq.o.d @@ -0,0 +1,51 @@ +src/os/system_irq.o: src/os/system_irq.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h src/os/system_irq.h \ + src/os/dbgu.h src/os/../openpcd.h include/openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/system_irq.h: + +src/os/dbgu.h: + +src/os/../openpcd.h: + +include/openpcd.h: diff --git a/firmware/.dep/tc_cdiv.o.d b/firmware/.dep/tc_cdiv.o.d new file mode 100644 index 0000000..08638d6 --- /dev/null +++ b/firmware/.dep/tc_cdiv.o.d @@ -0,0 +1,51 @@ +src/os/tc_cdiv.o: src/os/tc_cdiv.c include/lib_AT91SAM7.h \ + include/AT91SAM7.h src/os/dbgu.h src/os/../openpcd.h include/openpcd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + src/os/tc_cdiv.h + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/dbgu.h: + +src/os/../openpcd.h: + +include/openpcd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +src/os/tc_cdiv.h: diff --git a/firmware/.dep/trigger.o.d b/firmware/.dep/trigger.o.d new file mode 100644 index 0000000..4f6cbc0 --- /dev/null +++ b/firmware/.dep/trigger.o.d @@ -0,0 +1,49 @@ +src/os/trigger.o: src/os/trigger.c include/lib_AT91SAM7.h \ + include/AT91SAM7.h src/os/trigger.h src/os/../openpcd.h \ + include/openpcd.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/trigger.h: + +src/os/../openpcd.h: + +include/openpcd.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: diff --git a/firmware/.dep/usb_benchmark.o.d b/firmware/.dep/usb_benchmark.o.d new file mode 100644 index 0000000..1520964 --- /dev/null +++ b/firmware/.dep/usb_benchmark.o.d @@ -0,0 +1,93 @@ +src/os/usb_benchmark.o: src/os/usb_benchmark.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + include/lib_AT91SAM7.h include/AT91SAM7.h src/os/led.h src/os/dbgu.h \ + src/os/pcd_enumerate.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/asm/atomic.h include/asm/system.h include/asm/compiler.h \ + include/openpcd.h src/dfu/dfu.h include/usb_ch9.h include/usb_dfu.h \ + src/dfu/../config.h src/os/usb_handler.h src/os/req_ctx.h \ + src/os/../openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/led.h: + +src/os/dbgu.h: + +src/os/pcd_enumerate.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +include/openpcd.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/os/../openpcd.h: diff --git a/firmware/.dep/usb_handler.o.d b/firmware/.dep/usb_handler.o.d new file mode 100644 index 0000000..1854399 --- /dev/null +++ b/firmware/.dep/usb_handler.o.d @@ -0,0 +1,92 @@ +src/os/usb_handler.o: src/os/usb_handler.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + include/openpcd.h src/os/pcd_enumerate.h include/lib_AT91SAM7.h \ + include/AT91SAM7.h include/asm/atomic.h include/asm/system.h \ + include/asm/compiler.h src/dfu/dfu.h include/usb_ch9.h include/usb_dfu.h \ + src/dfu/../config.h src/os/usb_handler.h src/os/req_ctx.h src/os/led.h \ + src/os/dbgu.h src/os/../openpcd.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/errno.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +include/openpcd.h: + +src/os/pcd_enumerate.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +include/asm/atomic.h: + +include/asm/system.h: + +include/asm/compiler.h: + +src/dfu/dfu.h: + +include/usb_ch9.h: + +include/usb_dfu.h: + +src/dfu/../config.h: + +src/os/usb_handler.h: + +src/os/req_ctx.h: + +src/os/led.h: + +src/os/dbgu.h: + +src/os/../openpcd.h: diff --git a/firmware/.dep/usbcmd_generic.o.d b/firmware/.dep/usbcmd_generic.o.d new file mode 100644 index 0000000..663ffd4 --- /dev/null +++ b/firmware/.dep/usbcmd_generic.o.d @@ -0,0 +1,110 @@ +src/os/usbcmd_generic.o: src/os/usbcmd_generic.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + include/openpcd.h src/os/req_ctx.h include/lib_AT91SAM7.h \ + include/AT91SAM7.h src/os/usb_handler.h src/os/led.h src/os/dbgu.h \ + src/os/main.h src/os/flash.h include/board.h src/pcd/rc632_highlevel.h \ + ../librfid//include/librfid/rfid_asic.h \ + ../librfid//include/librfid/rfid_asic_rc632.h \ + ../librfid//include/librfid/rfid.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h \ + ../librfid//include/librfid/rfid_system.h \ + ../librfid//include/librfid/rfid_layer2.h \ + ../librfid//include/librfid/rfid_layer2_iso14443a.h \ + ../librfid//include/librfid/rfid_layer2_iso14443b.h \ + ../librfid//include/librfid/rfid_layer2_iso15693.h \ + ../librfid//include/librfid/rfid_layer2_icode1.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +include/openpcd.h: + +src/os/req_ctx.h: + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/usb_handler.h: + +src/os/led.h: + +src/os/dbgu.h: + +src/os/main.h: + +src/os/flash.h: + +include/board.h: + +src/pcd/rc632_highlevel.h: + +../librfid//include/librfid/rfid_asic.h: + +../librfid//include/librfid/rfid_asic_rc632.h: + +../librfid//include/librfid/rfid.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/stdio.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/stdio.h: + +../librfid//include/librfid/rfid_system.h: + +../librfid//include/librfid/rfid_layer2.h: + +../librfid//include/librfid/rfid_layer2_iso14443a.h: + +../librfid//include/librfid/rfid_layer2_iso14443b.h: + +../librfid//include/librfid/rfid_layer2_iso15693.h: + +../librfid//include/librfid/rfid_layer2_icode1.h: diff --git a/firmware/.dep/vsprintf.o.d b/firmware/.dep/vsprintf.o.d new file mode 100644 index 0000000..dc6a47c --- /dev/null +++ b/firmware/.dep/vsprintf.o.d @@ -0,0 +1,68 @@ +lib/vsprintf.o: lib/vsprintf.c \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h \ + include/asm/ctype.h include/asm/div64.h include/asm/system.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include-fixed/limits.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include-fixed/syslimits.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/limits.h + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stdarg.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/string.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/reent.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/string.h: + +include/asm/ctype.h: + +include/asm/div64.h: + +include/asm/system.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include-fixed/limits.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include-fixed/syslimits.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/limits.h: diff --git a/firmware/.dep/wdt.o.d b/firmware/.dep/wdt.o.d new file mode 100644 index 0000000..124c142 --- /dev/null +++ b/firmware/.dep/wdt.o.d @@ -0,0 +1,46 @@ +src/os/wdt.o: src/os/wdt.c include/lib_AT91SAM7.h include/AT91SAM7.h \ + src/os/dbgu.h src/os/system_irq.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h \ + e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h + +include/lib_AT91SAM7.h: + +include/AT91SAM7.h: + +src/os/dbgu.h: + +src/os/system_irq.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/_ansi.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/newlib.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/config.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/ieeefp.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/features.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/_default_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/_types.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/sys/lock.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/include/stddef.h: + +e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include/machine/types.h: diff --git a/firmware/COPYING b/firmware/COPYING new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/firmware/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General +Public License instead of this License. diff --git a/firmware/Makefile b/firmware/Makefile new file mode 100644 index 0000000..0a8bdb2 --- /dev/null +++ b/firmware/Makefile @@ -0,0 +1,613 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# WinARM makefile for the FreeRTOS-demo on LPC2138 +# based in information from the FreeRTOS LPC2106 example +# +# by Martin Thomas, Kaiserslautern, Germany +# +# +# based on the WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al. +# Released to the Public Domain +# Please read the make user manual! +# +# +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make program = Download the hex file to the device +# +# (TODO: make filename.s = Just compile filename.c into the assembler code only) +# +# To rebuild project do "make clean" then "make all". +# +# Changelog: +# - 17. Feb. 2005 - added thumb-interwork support (mth) +# - 28. Apr. 2005 - added C++ support (mth) +# - 29. Arp. 2005 - changed handling for lst-Filename (mth) +# - 1. Nov. 2005 - exception-vector placement options (mth) +# - 15. Nov. 2005 - added library-search-path (EXTRA_LIB...) (mth) +# - 2. Dec. 2005 - fixed ihex and binary file extensions (mth) +# - 22. Feb. 2006 - added AT91LIBNOWARN setting (mth) +# - 19. Apr. 2006 - option FLASH_TOOL (default lpc21isp); variable IMGEXT (mth) +# - 19. Mai. 2006 - USE_THUMB_MODE switch, ROM_RUN->RUN_FROM_ROM RAM_RUN->RUN_FROM_RAM + +LIBRFID_DIR:=../librfid/ + +FLASH_TOOL = AT91FLASH +#FLASH_TOOL = UVISION +#FLASH_TOOL = OPENOCD + +# MCU name and submodel +MCU = arm7tdmi +#SUBMDL = AT91SAM7S64 +SUBMDL = AT91SAM7S128 + +USE_THUMB_MODE = NO +#USE_THUMB_MODE = YES + +## Create ROM-Image (final) +RUN_MODE=RUN_FROM_ROM +## Create RAM-Image (debugging) - not used in this example +#RUN_MODE=RUN_FROM_RAM + +## We want to produce a full-flash image, but including DFU +IMGTYPE=-sam7dfu-app + +# with / at end +PATH_TO_LINKSCRIPTS=link/ + +#### not used in this example: +## Exception-Vector placement only supported for "ROM_RUN" +## (placement settings ignored when using "RAM_RUN") +## - Exception vectors in ROM: +#VECTOR_LOCATION=VECTORS_IN_ROM +## - Exception vectors in RAM: +#VECTOR_LOCATION=VECTORS_IN_RAM + +# Target file name (without extension). +TARGET:=main_reqa + +USBSTRINGS=src/picc/usb_strings_app.h src/pcd/usb_strings_app.h + +# List C source files here. (C dependencies are automatically generated.) +# use file-extension c for "c-only"-files +SRC = + +# List C source files here which must be compiled in ARM-Mode. +# use file-extension c for "c-only"-files + +# First, build library ... +SRCARM = lib/lib_AT91SAM7.c +ifdef DEBUG +SRCARM += lib/vsprintf.c lib/ctype.c lib/string.c +endif + +# then, OS ... +SRCARM += src/os/pcd_enumerate.c src/os/fifo.c src/os/dbgu.c \ + src/os/led.c src/os/req_ctx.c src/os/trigger.c \ + src/os/main.c src/os/syscalls.c src/os/usb_handler.c \ + src/os/usb_benchmark.c src/os/tc_cdiv.c src/os/pit.c \ + src/os/pwm.c src/os/pio_irq.c src/os/usbcmd_generic.c \ + src/os/wdt.c src/os/blinkcode.c src/os/system_irq.c \ + src/os/flash.c + +ifeq ($(BOARD), PCD) +# PCD support code +SRCARM += src/pcd/rc632.c src/pcd/rc632_highlevel.c +# finally, the actual main application +SRCARM += src/pcd/$(TARGET).c +endif + +ifeq ($(BOARD), PICC) +# PICC support code +SRCARM += src/picc/tc_fdt.c src/picc/ssc_picc.c src/picc/adc.c \ + src/picc/decoder.c src/picc/decoder_miller.c \ + src/picc/load_modulation.c src/picc/tc_cdiv_sync.c \ + src/picc/decoder_nrzl.c src/picc/da.c src/picc/pll.c \ + src/picc/openpicc.c +# finally, the actual main application +SRCARM += src/picc/$(TARGET).c +endif + + +# List C++ source files here. +# use file-extension cpp for C++-files (use extension .cpp) +CPPSRC = + +# List C++ source files here which must be compiled in ARM-Mode. +# use file-extension cpp for C++-files (use extension .cpp) +#CPPSRCARM = $(TARGET).cpp +CPPSRCARM = + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + +ASRCLIB = lib/changebit.S lib/clearbit.S lib/setbit.S lib/testchangebit.S \ + lib/testclearbit.S lib/testsetbit.S +ifdef DEBUG +#ASRCLIB += lib/memcpy.S lib/memset.S lib/lib1funcs.S lib/div64.S +ASRCLIB += lib/lib1funcs.S lib/div64.S +endif + +# List Assembler source files here which must be assembled in ARM-Mode.. +ASRCARM = src/start/Cstartup_app.S $(ASRCLIB) + +## Output format. (can be ihex or binary) +## (binary i.e. for openocd and SAM-BA, hex i.e. for lpc21isp and uVision) +#FORMAT = ihex +FORMAT = binary + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = 2 +#OPT = 0 + +# Debugging format. +# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. +# AVR (extended) COFF requires stabs, plus an avr-objcopy run. +#DEBUGF = stabs +DEBUGF = dwarf-2 + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +#### FreeRTOS +EXTRAINCDIRS = $(LIBRFID_DIR)/include/ + +# List any extra directories to look for library files here. +# Each directory must be seperated by a space. +#EXTRA_LIBDIRS = ../arm7_efsl_0_2_4 +EXTRA_LIBDIRS = $(LIBRFID_DIR)/src/.libs/ + +## Using the Atmel AT91_lib produces warning with +## the default warning-levels. +## yes - disable these warnings; no - keep default settings +AT91LIBNOWARN = yes +#AT91LIBNOWARN = no + +# Compiler flag to set the C Standard level. +# c89 - "ANSI" C +# gnu89 - c89 plus GCC extensions +# c99 - ISO C99 standard (not yet fully implemented) +# gnu99 - c99 plus GCC extensions +CSTANDARD = -std=gnu99 + +# Place -D or -U options for C here +CDEFS = -D$(RUN_MODE) -D__MS_types__ -D__LIBRFID__ + +ifdef DEBUG +CDEFS += -DDEBUG +endif + +ifdef OLIMEX +CDEFS += -DOLIMEX +endif + +ifeq ($(BOARD),PICC) +CDEFS += -DPICC +CINCS = -Isrc/picc +endif + +ifeq ($(BOARD),PCD) +CDEFS += -DPCD +CINCS = -Isrc/pcd +endif + +# Place -I options here +CINCS += -Iinclude -Isrc + +# Place -D or -U options for ASM here +ADEFS = -D$(RUN_MODE) + +ifdef VECTOR_LOCATION +CDEFS += -D$(VECTOR_LOCATION) +ADEFS += -D$(VECTOR_LOCATION) +endif + +CDEFS += -D__$(SUBMDL)__ +ADEFS += -D__$(SUBMDL)__ + + +# Compiler flags. +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +# +# Flags for C and C++ (arm-elf-gcc/arm-elf-g++) +CFLAGS = -g$(DEBUGF) +CFLAGS += $(CDEFS) $(CINCS) +CFLAGS += -O$(OPT) +CFLAGS += -Wall -Wextra -Wcast-align -Wimplicit -Wunused +CFLAGS += -Wpointer-arith -Wswitch +CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow +CFLAGS += -Wbad-function-cast -Wsign-compare -Waggregate-return +CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CFLAGS += -ffunction-sections -fdata-sections + +# flags only for C +CONLYFLAGS += -Wnested-externs +CONLYFLAGS += $(CSTANDARD) + +ifneq ($(AT91LIBNOWARN),yes) +#AT91-lib warnings with: +CFLAGS += -Wcast-qual +CONLYFLAGS += -Wmissing-prototypes +CONLYFLAGS += -Wstrict-prototypes +CONLYFLAGS += -Wmissing-declarations +endif + +# flags only for C++ (arm-elf-g++) +# CPPFLAGS = -fno-rtti -fno-exceptions +CPPFLAGS = + +# Assembler flags. +# -Wa,...: tell GCC to pass this to the assembler. +# -ahlns: create listing +# -g$(DEBUGF): have the assembler create line number information +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:.S=.lst),--g$(DEBUGF) -Iinclude/ -D__ASSEMBLY__ + + +#Additional libraries. + +# Extra libraries +# Each library-name must be seperated by a space. +# To add libxyz.a, libabc.a and libefsl.a: +# EXTRA_LIBS = xyz abc efsl +#EXTRA_LIBS = efsl +ifeq ($(TARGET),main_librfid) +EXTRA_LIBS = rfid +endif + +ifeq ($(TARGET),main_reqa) +EXTRA_LIBS = rfid +endif + +ifeq ($(TARGET),main_presence) +EXTRA_LIBS = rfid +endif + +ifeq ($(TARGET),main_mifare) +EXTRA_LIBS = rfid +endif + +#Support for newlibc-lpc (file: libnewlibc-lpc.a) +#NEWLIBLPC = -lnewlib-lpc + +MATH_LIB = #-lm + +# CPLUSPLUS_LIB = -lstdc++ + + +# Linker flags. +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -nostartfiles -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += $(NEWLIBLPC) $(MATH_LIB) +LDFLAGS += -lc -lgcc +LDFLAGS += $(CPLUSPLUS_LIB) +LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) +LDFLAGS += $(patsubst %,-l%,$(EXTRA_LIBS)) +#LDFLAGS += --gc-sections + +# Set Linker-Script Depending On Selected Memory and Controller +ifeq ($(RUN_MODE),RUN_FROM_RAM) +LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-RAM.ld +else +LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-ROM$(IMGTYPE).ld +endif + + +# --------------------------------------------------------------------------- +# Flash-Programming support using lpc21isp by Martin Maurer +# only for Philips LPC and Analog ADuC ARMs +# +# Settings and variables: +#LPC21ISP = lpc21isp +LPC21ISP = lpc21isp +LPC21ISP_PORT = com1 +LPC21ISP_BAUD = 38400 +LPC21ISP_XTAL = 12000 +LPC21ISP_FLASHFILE = $(TARGET).hex +# verbose output: +#LPC21ISP_DEBUG = -debug +# enter bootloader via RS232 DTR/RTS (only if hardware supports this +# feature - see Philips AppNote): +LPC21ISP_CONTROL = -control +# --------------------------------------------------------------------------- + + +# Define directories, if needed. +## DIRARM = c:/WinARM/ +## DIRARMBIN = $(DIRAVR)/bin/ +## DIRAVRUTILS = $(DIRAVR)/utils/bin/ + +# Define programs and commands. +SHELL = sh +CC = arm-none-eabi-gcc +CPP = arm-none-eabi-g++ +OBJCOPY = arm-none-eabi-objcopy +OBJDUMP = arm-none-eabi-objdump +SIZE = arm-none-eabi-size +NM = arm-none-eabi-nm +#CC = arm-elf-gcc +#CPP = arm-elf-g++ +#OBJCOPY = arm-elf-objcopy +#OBJDUMP = arm-elf-objdump +#SIZE = arm-elf-size +#NM = arm-elf-nm +REMOVE = rm -f +COPY = cp + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = "-------- begin (mode: $(RUN_MODE)) --------" +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_FLASH = Creating load file for Flash: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_ARM = "Compiling C (ARM-only):" +MSG_COMPILINGCPP = Compiling C++: +MSG_COMPILINGCPP_ARM = "Compiling C++ (ARM-only):" +MSG_ASSEMBLING = Assembling: +MSG_ASSEMBLING_ARM = "Assembling (ARM-only):" +MSG_CLEANING = Cleaning project: +MSG_FORMATERROR = Can not handle output-format +MSG_LPC21_RESETREMINDER = You may have to bring the target in bootloader-mode now. + +# Define all object files. +COBJ = $(SRC:.c=.o) +AOBJ = $(ASRC:.S=.o) +COBJARM = $(SRCARM:.c=.o) +AOBJARM = $(ASRCARM:.S=.o) +CPPOBJ = $(CPPSRC:.cpp=.o) +CPPOBJARM = $(CPPSRCARM:.cpp=.o) + +# Define all listing files. +LST = $(ASRC:.S=.lst) $(ASRCARM:.S=.lst) $(SRC:.c=.lst) $(SRCARM:.c=.lst) +LST += $(CPPSRC:.cpp=.lst) $(CPPSRCARM:.cpp=.lst) + +# Compiler flags to generate dependency files. +### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d +GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mcpu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + +# Default target. +all: begin gccversion sizebefore build sizeafter finished end + +ifeq ($(FORMAT),ihex) +build: elf hex lss sym +hex: $(TARGET).hex +IMGEXT=hex +else +ifeq ($(FORMAT),binary) +build: elf bin lss sym +bin: $(TARGET).bin +IMGEXT=bin +else +$(error "$(MSG_FORMATERROR) $(FORMAT)") +endif +endif + +elf: $(TARGET).elf +lss: $(TARGET).lss +sym: $(TARGET).sym + +# Eye candy. +begin: + @echo + @echo $(MSG_BEGIN) + +finished: + @echo $(MSG_ERRORS_NONE) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) -A $(TARGET).elf +sizebefore: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi + +sizeafter: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +# Program the device by using our relais card robot over USB +ifeq ($(FLASH_TOOL),AT91FLASH) +program: $(TARGET).$(IMGEXT) + ls -l $(TARGET).$(IMGEXT) + at91flash $(TARGET).$(IMGEXT) +else +ifeq ($(FLASH_TOOL),UVISION) +# Program the device with Keil's uVision (needs configured uVision-Workspace). +program: $(TARGET).$(IMGEXT) + @echo + @echo "Programming with uVision" + C:\Keil\uv3\Uv3.exe -f uvisionflash.Uv2 -ouvisionflash.txt +else +ifeq ($(FLASH_TOOL),OPENOCD) +# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". +program: $(TARGET).$(IMGEXT) + @echo + @echo "Programming with OPENOCD" + C:\WinARM\utils\openocd\openocd_svn59\openocd.exe -f oocd_sam7_flash.cfg +else +# Program the device. - lpc21isp will not work for SAM7 +program: $(TARGET).$(IMGEXT) + @echo + @echo $(MSG_LPC21_RESETREMINDER) + $(LPC21ISP) $(LPC21ISP_OPTIONS) $(LPC21ISP_DEBUG) $(LPC21ISP_FLASHFILE) $(LPC21ISP_PORT) $(LPC21ISP_BAUD) $(LPC21ISP_XTAL) +endif +endif +endif + + +# Create final output file (.hex) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) $< $@ + +# Create final output file (.bin) from ELF output file. +%.bin: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) $< $@ + + +# Create extended listing file from ELF output file. +# testing: option -C +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -C $< > $@ + + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) +%.elf: $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) --output $@ $(LDFLAGS) + +# Compile: create object files from C source files. ARM/Thumb +$(COBJ) : %.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $(CONLYFLAGS) $< -o $@ + +# Compile: create object files from C source files. ARM-only +$(COBJARM) : %.o : %.c include/compile.h $(USBSTRINGS) + @echo + @echo $(MSG_COMPILING_ARM) $< + $(CC) -c $(ALL_CFLAGS) $(CONLYFLAGS) $< -o $@ + +# Compile: create object files from C++ source files. ARM/Thumb +$(CPPOBJ) : %.o : %.cpp + @echo + @echo $(MSG_COMPILINGCPP) $< + $(CPP) -c $(ALL_CFLAGS) $(CPPFLAGS) $< -o $@ + +# Compile: create object files from C++ source files. ARM-only +$(CPPOBJARM) : %.o : %.cpp + @echo + @echo $(MSG_COMPILINGCPP_ARM) $< + $(CPP) -c $(ALL_CFLAGS) $(CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. ARM/Thumb +## does not work - TODO - hints welcome +##$(COBJ) : %.s : %.c +## $(CC) $(THUMB) -S $(ALL_CFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. ARM/Thumb +$(AOBJ) : %.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. ARM-only +$(AOBJARM) : %.o : %.S + @echo + @echo $(MSG_ASSEMBLING_ARM) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list finished end + + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).bin + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).a90 + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lnk + $(REMOVE) $(TARGET).lss + $(REMOVE) $(COBJ) + $(REMOVE) $(CPPOBJ) + $(REMOVE) $(AOBJ) + $(REMOVE) $(COBJARM) + $(REMOVE) $(CPPOBJARM) + $(REMOVE) $(AOBJARM) + $(REMOVE) $(LST) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRCARM:.c=.s) + $(REMOVE) $(SRCARM:.c=.d) + $(REMOVE) $(CPPSRC:.cpp=.s) + $(REMOVE) $(CPPSRC:.cpp=.d) + $(REMOVE) $(CPPSRCARM:.cpp=.s) + $(REMOVE) $(CPPSRCARM:.cpp=.d) + $(REMOVE) .dep/* + $(REMOVE) include/compile.h + $(REMOVE) src/picc/usb_strings_app.h + $(REMOVE) scripts/usbstring + +.PHONY: include/compile.h +include/compile.h: + scripts/mkcompile_h > $@ + +$(USBSTRINGS): %.h : %.txt ./scripts/usbstring + cat $< | ./scripts/usbstring > $@ + +scripts/usbstring: scripts/usbstring.c + gcc $^ -o $@ + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex bin lss sym clean clean_list program + diff --git a/firmware/Makefile.dfu b/firmware/Makefile.dfu new file mode 100644 index 0000000..a48be63 --- /dev/null +++ b/firmware/Makefile.dfu @@ -0,0 +1,572 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# WinARM makefile for the FreeRTOS-demo on LPC2138 +# based in information from the FreeRTOS LPC2106 example +# +# by Martin Thomas, Kaiserslautern, Germany +# +# +# based on the WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al. +# Released to the Public Domain +# Please read the make user manual! +# +# +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make program = Download the hex file to the device +# +# (TODO: make filename.s = Just compile filename.c into the assembler code only) +# +# To rebuild project do "make clean" then "make all". +# +# Changelog: +# - 17. Feb. 2005 - added thumb-interwork support (mth) +# - 28. Apr. 2005 - added C++ support (mth) +# - 29. Arp. 2005 - changed handling for lst-Filename (mth) +# - 1. Nov. 2005 - exception-vector placement options (mth) +# - 15. Nov. 2005 - added library-search-path (EXTRA_LIB...) (mth) +# - 2. Dec. 2005 - fixed ihex and binary file extensions (mth) +# - 22. Feb. 2006 - added AT91LIBNOWARN setting (mth) +# - 19. Apr. 2006 - option FLASH_TOOL (default lpc21isp); variable IMGEXT (mth) +# - 19. Mai. 2006 - USE_THUMB_MODE switch, ROM_RUN->RUN_FROM_ROM RAM_RUN->RUN_FROM_RAM + + +FLASH_TOOL = AT91FLASH +#FLASH_TOOL = UVISION +#FLASH_TOOL = OPENOCD + +# MCU name and submodel +MCU = arm7tdmi +#SUBMDL = AT91SAM7S64 +SUBMDL = AT91SAM7S256 + +USE_THUMB_MODE = NO +#USE_THUMB_MODE = YES + +## Create ROM-Image (final) +RUN_MODE=RUN_FROM_ROM +## Create RAM-Image (debugging) - not used in this example +#RUN_MODE=RUN_FROM_RAM + +## We want to produce a full-flash image, but including DFU +IMGTYPE=-sam7dfu-dfu + +# with / at end +PATH_TO_LINKSCRIPTS=link/ + +#### not used in this example: +## Exception-Vector placement only supported for "ROM_RUN" +## (placement settings ignored when using "RAM_RUN") +## - Exception vectors in ROM: +#VECTOR_LOCATION=VECTORS_IN_ROM +## - Exception vectors in RAM: +#VECTOR_LOCATION=VECTORS_IN_RAM + +# Target file name (without extension). +TARGET:=dfu + +USBSTRINGS=src/picc/usb_strings_dfu.h src/pcd/usb_strings_dfu.h + +# List C source files here. (C dependencies are automatically generated.) +# use file-extension c for "c-only"-files +SRC = + +# List C source files here which must be compiled in ARM-Mode. +# use file-extension c for "c-only"-files + +SRCARM = src/start/Cstartup_SAM7.c lib/lib_AT91SAM7.c \ + src/dfu/dfu.c src/dfu/dbgu.c src/os/flash.c + +# List C++ source files here. +# use file-extension cpp for C++-files (use extension .cpp) +CPPSRC = + +# List C++ source files here which must be compiled in ARM-Mode. +# use file-extension cpp for C++-files (use extension .cpp) +#CPPSRCARM = $(TARGET).cpp +CPPSRCARM = + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + +# List Assembler source files here which must be assembled in ARM-Mode.. +ASRCARM = src/start/Cstartup.S + +ifeq ($(DEBUG),1) +SRCARM += lib/vsprintf.c lib/ctype.c lib/string.c +ASRCARM += lib/div64.S +endif + +## Output format. (can be ihex or binary) +## (binary i.e. for openocd and SAM-BA, hex i.e. for lpc21isp and uVision) +#FORMAT = ihex +FORMAT = binary + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s +#OPT = 0 + +# Debugging format. +# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. +# AVR (extended) COFF requires stabs, plus an avr-objcopy run. +#DEBUGF = stabs +DEBUGF = dwarf-2 + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +#### FreeRTOS +EXTRAINCDIRS = + +# List any extra directories to look for library files here. +# Each directory must be seperated by a space. +#EXTRA_LIBDIRS = ../arm7_efsl_0_2_4 +EXTRA_LIBDIRS = + +## Using the Atmel AT91_lib produces warning with +## the default warning-levels. +## yes - disable these warnings; no - keep default settings +AT91LIBNOWARN = yes +#AT91LIBNOWARN = no + +# Compiler flag to set the C Standard level. +# c89 - "ANSI" C +# gnu89 - c89 plus GCC extensions +# c99 - ISO C99 standard (not yet fully implemented) +# gnu99 - c99 plus GCC extensions +CSTANDARD = -std=gnu99 + +# Place -D or -U options for C here +CDEFS = -D$(RUN_MODE) -D__MS_types__ -D__LIBRFID__ + +ifdef DEBUG +CDEFS += -DDEBUG +ADEFS += -DDEBUG +endif + +ifeq ($(BOARD),OLIMEX) +CDEFS += -DOLIMEX +ADEFS += -DOLIMEX +endif + +ifeq ($(BOARD),PICC) +CDEFS += -DPICC +ADEFS += -DPICC +CINCS = -Isrc/picc +endif + +ifeq ($(BOARD),PCD) +SUBMDL = AT91SAM7S128 +CDEFS += -DPCD +ADEFS += -DPCD +CINCS = -Isrc/pcd +endif + +# Place -I options here +CINCS += -Iinclude -Isrc + +# Place -D or -U options for ASM here +ADEFS += -D$(RUN_MODE) + +ifdef VECTOR_LOCATION +CDEFS += -D$(VECTOR_LOCATION) +ADEFS += -D$(VECTOR_LOCATION) +endif + +CDEFS += -D__$(SUBMDL)__ +ADEFS += -D__$(SUBMDL)__ + + +# Compiler flags. +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +# +# Flags for C and C++ (arm-elf-gcc/arm-elf-g++) +CFLAGS += -g$(DEBUGF) -DBOARD=$(BOARD) +CFLAGS += $(CDEFS) $(CINCS) +CFLAGS += -O$(OPT) +CFLAGS += -Wall -Wextra -Wcast-align -Wimplicit -Wunused +CFLAGS += -Wpointer-arith -Wswitch +CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow +CFLAGS += -Wbad-function-cast -Wsign-compare -Waggregate-return +CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CFLAGS += -ffunction-sections -fdata-sections + +# flags only for C +CONLYFLAGS += -Wnested-externs +CONLYFLAGS += $(CSTANDARD) + +ifneq ($(AT91LIBNOWARN),yes) +#AT91-lib warnings with: +CFLAGS += -Wcast-qual +CONLYFLAGS += -Wmissing-prototypes +CONLYFLAGS += -Wstrict-prototypes +CONLYFLAGS += -Wmissing-declarations +endif + +# flags only for C++ (arm-elf-g++) +# CPPFLAGS = -fno-rtti -fno-exceptions +CPPFLAGS = + +# Assembler flags. +# -Wa,...: tell GCC to pass this to the assembler. +# -ahlns: create listing +# -g$(DEBUGF): have the assembler create line number information +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:.S=.lst),--g$(DEBUGF) -Iinclude/ -D__ASSEMBLY__ + + +#Additional libraries. + +# Extra libraries +# Each library-name must be seperated by a space. +# To add libxyz.a, libabc.a and libefsl.a: +# EXTRA_LIBS = xyz abc efsl +#EXTRA_LIBS = efsl +EXTRA_LIBS = + +#Support for newlibc-lpc (file: libnewlibc-lpc.a) +#NEWLIBLPC = -lnewlib-lpc + +MATH_LIB = #-lm + +# CPLUSPLUS_LIB = -lstdc++ + + +# Linker flags. +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -nostartfiles -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += $(NEWLIBLPC) $(MATH_LIB) +LDFLAGS += -lc -lgcc +LDFLAGS += $(CPLUSPLUS_LIB) +LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) +LDFLAGS += $(patsubst %,-l%,$(EXTRA_LIBS)) +#LDFLAGS += --gc-sections + +# Set Linker-Script Depending On Selected Memory and Controller +ifeq ($(RUN_MODE),RUN_FROM_RAM) +LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-RAM.ld +else +LDFLAGS +=-T$(PATH_TO_LINKSCRIPTS)$(SUBMDL)-ROM$(IMGTYPE).ld +endif + + +# --------------------------------------------------------------------------- +# Flash-Programming support using lpc21isp by Martin Maurer +# only for Philips LPC and Analog ADuC ARMs +# +# Settings and variables: +#LPC21ISP = lpc21isp +LPC21ISP = lpc21isp +LPC21ISP_PORT = com1 +LPC21ISP_BAUD = 38400 +LPC21ISP_XTAL = 12000 +LPC21ISP_FLASHFILE = $(TARGET).hex +# verbose output: +#LPC21ISP_DEBUG = -debug +# enter bootloader via RS232 DTR/RTS (only if hardware supports this +# feature - see Philips AppNote): +LPC21ISP_CONTROL = -control +# --------------------------------------------------------------------------- + + +# Define directories, if needed. +## DIRARM = c:/WinARM/ +## DIRARMBIN = $(DIRAVR)/bin/ +## DIRAVRUTILS = $(DIRAVR)/utils/bin/ + +# Define programs and commands. +SHELL = sh +CC = arm-none-eabi-gcc +CPP = arm-none-eabi-g++ +OBJCOPY = arm-none-eabi-objcopy +OBJDUMP = arm-none-eabi-objdump +SIZE = arm-none-eabi-size +NM = arm-none-eabi-nm +#CC = arm-elf-gcc +#CPP = arm-elf-g++ +#OBJCOPY = arm-elf-objcopy +#OBJDUMP = arm-elf-objdump +#SIZE = arm-elf-size +#NM = arm-elf-nm +REMOVE = rm -f +COPY = cp + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = "-------- begin (mode: $(RUN_MODE)) --------" +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_FLASH = Creating load file for Flash: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_ARM = "Compiling C (ARM-only):" +MSG_COMPILINGCPP = Compiling C++: +MSG_COMPILINGCPP_ARM = "Compiling C++ (ARM-only):" +MSG_ASSEMBLING = Assembling: +MSG_ASSEMBLING_ARM = "Assembling (ARM-only):" +MSG_CLEANING = Cleaning project: +MSG_FORMATERROR = Can not handle output-format +MSG_LPC21_RESETREMINDER = You may have to bring the target in bootloader-mode now. + +# Define all object files. +COBJ = $(SRC:.c=.o) +AOBJ = $(ASRC:.S=.o) +COBJARM = $(SRCARM:.c=.o) +AOBJARM = $(ASRCARM:.S=.o) +CPPOBJ = $(CPPSRC:.cpp=.o) +CPPOBJARM = $(CPPSRCARM:.cpp=.o) + +# Define all listing files. +LST = $(ASRC:.S=.lst) $(ASRCARM:.S=.lst) $(SRC:.c=.lst) $(SRCARM:.c=.lst) +LST += $(CPPSRC:.cpp=.lst) $(CPPSRCARM:.cpp=.lst) + +# Compiler flags to generate dependency files. +### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d +GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mcpu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + +# Default target. +all: begin gccversion sizebefore build sizeafter finished end + +ifeq ($(FORMAT),ihex) +build: elf hex lss sym +hex: $(TARGET).hex +IMGEXT=hex +else +ifeq ($(FORMAT),binary) +build: elf bin lss sym +bin: $(TARGET).bin +IMGEXT=bin +else +$(error "$(MSG_FORMATERROR) $(FORMAT)") +endif +endif + +elf: $(TARGET).elf +lss: $(TARGET).lss +sym: $(TARGET).sym + +# Eye candy. +begin: + @echo + @echo $(MSG_BEGIN) + +finished: + @echo $(MSG_ERRORS_NONE) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) -A $(TARGET).elf +sizebefore: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi + +sizeafter: + @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +# Program the device by using our relais card robot over USB +ifeq ($(FLASH_TOOL),AT91FLASH) +program: $(TARGET).$(IMGEXT) + ls -l $(TARGET).$(IMGEXT) + at91flash $(TARGET).$(IMGEXT) +else +ifeq ($(FLASH_TOOL),UVISION) +# Program the device with Keil's uVision (needs configured uVision-Workspace). +program: $(TARGET).$(IMGEXT) + @echo + @echo "Programming with uVision" + C:\Keil\uv3\Uv3.exe -f uvisionflash.Uv2 -ouvisionflash.txt +else +ifeq ($(FLASH_TOOL),OPENOCD) +# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". +program: $(TARGET).$(IMGEXT) + @echo + @echo "Programming with OPENOCD" + C:\WinARM\utils\openocd\openocd_svn59\openocd.exe -f oocd_sam7_flash.cfg +else +# Program the device. - lpc21isp will not work for SAM7 +program: $(TARGET).$(IMGEXT) + @echo + @echo $(MSG_LPC21_RESETREMINDER) + $(LPC21ISP) $(LPC21ISP_OPTIONS) $(LPC21ISP_DEBUG) $(LPC21ISP_FLASHFILE) $(LPC21ISP_PORT) $(LPC21ISP_BAUD) $(LPC21ISP_XTAL) +endif +endif +endif + + +# Create final output file (.hex) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) $< $@ + +# Create final output file (.bin) from ELF output file. +%.bin: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) $< $@ + + +# Create extended listing file from ELF output file. +# testing: option -C +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -C $< > $@ + + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) +%.elf: $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $(AOBJARM) $(AOBJ) $(COBJARM) $(COBJ) $(CPPOBJ) $(CPPOBJARM) --output $@ $(LDFLAGS) + +# Compile: create object files from C source files. ARM/Thumb +$(COBJ) : %.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $(CONLYFLAGS) $< -o $@ + +# Compile: create object files from C source files. ARM-only +$(COBJARM) : %.o : %.c include/compile.h $(USBSTRINGS) + @echo + @echo $(MSG_COMPILING_ARM) $< + $(CC) -c $(ALL_CFLAGS) $(CONLYFLAGS) $< -o $@ + +# Compile: create object files from C++ source files. ARM/Thumb +$(CPPOBJ) : %.o : %.cpp + @echo + @echo $(MSG_COMPILINGCPP) $< + $(CPP) -c $(ALL_CFLAGS) $(CPPFLAGS) $< -o $@ + +# Compile: create object files from C++ source files. ARM-only +$(CPPOBJARM) : %.o : %.cpp + @echo + @echo $(MSG_COMPILINGCPP_ARM) $< + $(CPP) -c $(ALL_CFLAGS) $(CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. ARM/Thumb +## does not work - TODO - hints welcome +##$(COBJ) : %.s : %.c +## $(CC) $(THUMB) -S $(ALL_CFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. ARM/Thumb +$(AOBJ) : %.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. ARM-only +$(AOBJARM) : %.o : %.S + @echo + @echo $(MSG_ASSEMBLING_ARM) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list finished end + + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).bin + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).obj + $(REMOVE) $(TARGET).a90 + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lnk + $(REMOVE) $(TARGET).lss + $(REMOVE) $(COBJ) + $(REMOVE) $(CPPOBJ) + $(REMOVE) $(AOBJ) + $(REMOVE) $(COBJARM) + $(REMOVE) $(CPPOBJARM) + $(REMOVE) $(AOBJARM) + $(REMOVE) $(LST) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRCARM:.c=.s) + $(REMOVE) $(SRCARM:.c=.d) + $(REMOVE) $(CPPSRC:.cpp=.s) + $(REMOVE) $(CPPSRC:.cpp=.d) + $(REMOVE) $(CPPSRCARM:.cpp=.s) + $(REMOVE) $(CPPSRCARM:.cpp=.d) + $(REMOVE) .dep/* + $(REMOVE) src/picc/usb_strings_dfu.h + $(REMOVE) src/dfu/usb_strings_dfu.h + $(REMOVE) scripts/usbstring + +.PHONY: include/compile.h +include/compile.h: + scripts/mkcompile_h > $@ + +.PHONY: +$(USBSTRINGS): %.h : %.txt ./scripts/usbstring + cat $< | ./scripts/usbstring > $@ + +scripts/usbstring: scripts/usbstring.c + gcc $^ -o $@ + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex bin lss sym clean clean_list program + diff --git a/firmware/README b/firmware/README new file mode 100644 index 0000000..b7caba7 --- /dev/null +++ b/firmware/README @@ -0,0 +1,13 @@ +Different Targets can be built by implementing a _init_func() and _main_func()_ +function in src/main_foo.c + +The resulting binary main_foo.bin can be built by issuing + make BOARD=PCD TARGET=main_foo + +If you want to add debugging support (debug unit aka DBGU, RS232), add DEBUG=1 + + +Building dfu.bin (the DFU loader binary): + make -f Makefile.dfu BOARD=PCD + +For more information, please read http://wiki.openpcd.org/wiki/Firmware diff --git a/firmware/TODO b/firmware/TODO new file mode 100644 index 0000000..d319ee8 --- /dev/null +++ b/firmware/TODO @@ -0,0 +1,23 @@ +SPI: +- use PDC DMA for SPI transfers + +RC632: +- Fix locking between 'atomic' ops like set/clear bit and RC632 IRQ +- Implement VFIFO handling + +USB: +- Implement suspend/resume handshake +- Make sure we don't eat a lot of power before entering the configured state + +DFU: +- fix DFU download (usb control write / zlp at end) +- add capability to flash DFU itself +- add a header to the application program, checksum and size +- checksum application image. If wrong, enter DFU recovery mode +- Get rid of lots of constant values and replace them by proper defines + +Generic: +- why is watchdog apparently not working? + +Way Later, for librfid: +- Implement parts (or all of) 14443 in firmware as alternative configuration diff --git a/firmware/dfu.bin b/firmware/dfu.bin new file mode 100644 index 0000000..eec3f2b Binary files /dev/null and b/firmware/dfu.bin differ diff --git a/firmware/dfu.elf b/firmware/dfu.elf new file mode 100644 index 0000000..928ad46 Binary files /dev/null and b/firmware/dfu.elf differ diff --git a/firmware/dfu.lss b/firmware/dfu.lss new file mode 100644 index 0000000..b8124ed --- /dev/null +++ b/firmware/dfu.lss @@ -0,0 +1,4097 @@ + +dfu.elf: file format elf32-littlearm + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 00001ac0 00000000 00000000 00008000 2**2 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .data.shared 00000008 00200020 00001ac0 00010020 2**2 + CONTENTS, ALLOC, LOAD, DATA + 2 .data 00000024 00201ac0 00001ac8 00011ac0 2**2 + CONTENTS, ALLOC, LOAD, CODE + 3 .dfu.functab 00000030 00003fd0 00003fd0 00013fd0 2**2 + CONTENTS, ALLOC, LOAD, READONLY, DATA + 4 .bss 00000105 00201ae4 00001aec 00011ae4 2**2 + ALLOC + 5 .ARM.attributes 0000002e 00000000 00000000 00014000 2**0 + CONTENTS, READONLY + 6 .comment 0000002a 00000000 00000000 0001402e 2**0 + CONTENTS, READONLY + 7 .debug_aranges 000000c8 00000000 00000000 00014058 2**3 + CONTENTS, READONLY, DEBUGGING + 8 .debug_pubnames 000002b7 00000000 00000000 00014120 2**0 + CONTENTS, READONLY, DEBUGGING + 9 .debug_info 000040e7 00000000 00000000 000143d7 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_abbrev 00000bb3 00000000 00000000 000184be 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_line 0000089e 00000000 00000000 00019071 2**0 + CONTENTS, READONLY, DEBUGGING + 12 .debug_frame 00000540 00000000 00000000 00019910 2**2 + CONTENTS, READONLY, DEBUGGING + 13 .debug_str 00001637 00000000 00000000 00019e50 2**0 + CONTENTS, READONLY, DEBUGGING + 14 .debug_loc 00001193 00000000 00000000 0001b487 2**0 + CONTENTS, READONLY, DEBUGGING + 15 .debug_ranges 000001d0 00000000 00000000 0001c620 2**3 + CONTENTS, READONLY, DEBUGGING + 16 .debug_pubtypes 00000485 00000000 00000000 0001c7f0 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 : +//*- guarantee a valid jump. For the moment, all are just looping. +//*- If an exception occurs before remap, this would result in an infinite loop. +//*- To ensure if a exeption occurs before start application to infinite loop. +//*------------------------------------------------------------------------------*/ + + B InitReset /* 0x00 Reset handler */ + 0: ea000026 b a0 + +00000004 : +undefvec: + B undefvec /* 0x04 Undefined Instruction */ + 4: eafffffe b 4 + +00000008 : +swivec: + B swivec /* 0x08 Software Interrupt */ + 8: eafffffe b 8 + +0000000c : +pabtvec: + B pabtvec /* 0x0C Prefetch Abort */ + c: eafffffe b c + +00000010 : +dabtvec: + b dabtvec /* 0x10 Data Abort */ + 10: eafffffe b 10 + +00000014 : +rsvdvec: + b rsvdvec /* 0x14 reserved */ + 14: eafffffe b 14 + +00000018 : +irqvec: + b IRQ_Handler_Entry /* 0x18 IRQ */ + 18: ea00000b b 4c + +0000001c : +fiqvec: + ldr pc, [pc, #-0xF20] /* 0x1c FIQ */ + 1c: e51fff20 ldr pc, [pc, #-3872] ; fffff104 + +00000020 : + 20: 00000000 .word 0x00000000 + +00000024 : + +/*- Switch in SVC/User Mode to allow User Stack access for C code */ +/* because the FIQ is not yet acknowledged*/ + +/*- Save and r0 in FIQ_Register */ + mov r9, r0 + 24: e1a09000 mov r9, r0 + ldr r0, [r8, #AIC_FVR] + 28: e5980104 ldr r0, [r8, #260] ; 0x104 + msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_SVC + 2c: e321f0d3 msr CPSR_c, #211 ; 0xd3 + + /*- Save scratch/used registers and LR in User Stack */ + stmfd sp!, { r1-r3, r12, lr} + 30: e92d500e push {r1, r2, r3, ip, lr} + + /*- Branch to the routine pointed by the AIC_FVR */ + mov r14, pc + 34: e1a0e00f mov lr, pc + bx r0 + 38: e12fff10 bx r0 + + /*- Restore scratch/used registers and LR from User Stack */ + ldmia sp!, { r1-r3, r12, lr} + 3c: e8bd500e pop {r1, r2, r3, ip, lr} + + /*- Leave Interrupts disabled and switch back in FIQ mode */ + msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ + 40: e321f0d1 msr CPSR_c, #209 ; 0xd1 + + /*- Restore the R0 ARM_MODE_SVC register */ + mov r0,r9 + 44: e1a00009 mov r0, r9 + + /*- Restore the Program Counter using the LR_fiq directly in the PC */ + subs pc, lr, #4 + 48: e25ef004 subs pc, lr, #4 + +0000004c : + +IRQ_Handler_Entry: + + /*- Manage Exception Entry */ + /*- Adjust and save LR_irq in IRQ stack */ + sub lr, lr, #4 + 4c: e24ee004 sub lr, lr, #4 + stmfd sp!, {lr} + 50: e52de004 push {lr} ; (str lr, [sp, #-4]!) + + /*- Save SPSR need to be saved for nested interrupt */ + mrs r14, SPSR + 54: e14fe000 mrs lr, SPSR + stmfd sp!, {r14} + 58: e52de004 push {lr} ; (str lr, [sp, #-4]!) + + /*- Save and r0 in IRQ stack */ + stmfd sp!, {r0} + 5c: e52d0004 push {r0} ; (str r0, [sp, #-4]!) + + /*- Write in the IVR to support Protect Mode */ + /*- No effect in Normal Mode */ + /*- De-assert the NIRQ and clear the source in Protect Mode */ + ldr r14, =AT91C_BASE_AIC + 60: e59fe148 ldr lr, [pc, #328] ; 1b0 + ldr r0 , [r14, #AIC_IVR] + 64: e59e0100 ldr r0, [lr, #256] ; 0x100 + str r14, [r14, #AIC_IVR] + 68: e58ee100 str lr, [lr, #256] ; 0x100 + + /*- Enable Interrupt and Switch in Supervisor Mode */ + msr CPSR_c, #ARM_MODE_SVC + 6c: e321f013 msr CPSR_c, #19 + + /*- Save scratch/used registers and LR in User Stack */ + stmfd sp!, { r1-r3, r12, r14} + 70: e92d500e push {r1, r2, r3, ip, lr} + + /*- Branch to the routine pointed by the AIC_IVR */ + mov r14, pc + 74: e1a0e00f mov lr, pc + bx r0 + 78: e12fff10 bx r0 + + /*- Restore scratch/used registers and LR from User Stack*/ + ldmia sp!, { r1-r3, r12, r14} + 7c: e8bd500e pop {r1, r2, r3, ip, lr} + + /*- Disable Interrupt and switch back in IRQ mode */ + msr CPSR_c, #I_BIT | ARM_MODE_IRQ + 80: e321f092 msr CPSR_c, #146 ; 0x92 + + /*- Mark the End of Interrupt on the AIC */ + ldr r14, =AT91C_BASE_AIC + 84: e59fe124 ldr lr, [pc, #292] ; 1b0 + str r14, [r14, #AIC_EOICR] + 88: e58ee130 str lr, [lr, #304] ; 0x130 + + /*- Restore SPSR_irq and r0 from IRQ stack */ + ldmia sp!, {r0} + 8c: e49d0004 pop {r0} ; (ldr r0, [sp], #4) + + /*- Restore SPSR_irq and r0 from IRQ stack */ + ldmia sp!, {r14} + 90: e49de004 pop {lr} ; (ldr lr, [sp], #4) + msr SPSR_cxsf, r14 + 94: e16ff00e msr SPSR_fsxc, lr + + /*- Restore adjusted LR_irq from IRQ stack directly in the PC */ + ldmia sp!, {pc}^ + 98: e8fd8000 ldm sp!, {pc}^ + +0000009c <.RAM_TOP>: + 9c: 00208000 .word 0x00208000 + +000000a0 : +/*------------------------------------------------------------------------------*/ + .extern AT91F_LowLevelInit +/*- minumum C initialization */ +/*- call AT91F_LowLevelInit( void) */ + + ldr r13,.RAM_TOP /* temporary stack in internal RAM */ + a0: e51fd00c ldr sp, [pc, #-12] ; 9c <.RAM_TOP> +/*--Call Low level init function in ABSOLUTE through the Interworking */ + ldr r0,=AT91F_LowLevelInit + a4: e59f0108 ldr r0, [pc, #264] ; 1b4 + mov lr, pc + a8: e1a0e00f mov lr, pc + bx r0 + ac: e12fff10 bx r0 + + +/*------------------------------------------------------------------------------ +//*- Setup the stack for each mode +//*-------------------------------*/ + mov r0,r13 + b0: e1a0000d mov r0, sp + +/*- Set up Fast Interrupt Mode and set FIQ Mode Stack*/ + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + b4: e321f0d1 msr CPSR_c, #209 ; 0xd1 + mov r13, r0 + b8: e1a0d000 mov sp, r0 + sub r0, r0, #FIQ_Stack_Size + bc: e2400b01 sub r0, r0, #1024 ; 0x400 + +/*- Init the FIQ register*/ + ldr r8, =AT91C_BASE_AIC + c0: e59f80e8 ldr r8, [pc, #232] ; 1b0 + +/*- Set up Interrupt Mode and set IRQ Mode Stack*/ + msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT + c4: e321f0d2 msr CPSR_c, #210 ; 0xd2 + mov r13, r0 /* Init stack IRQ */ + c8: e1a0d000 mov sp, r0 + sub r0, r0, #IRQ_Stack_Size + cc: e2400b01 sub r0, r0, #1024 ; 0x400 + +/*- Set up Supervisor Mode and set Supervisor Mode Stack*/ + msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT + d0: e321f0d3 msr CPSR_c, #211 ; 0xd3 + mov r13, r0 /* Init stack Sup */ + d4: e1a0d000 mov sp, r0 + +/* - Enable Interrupts and FIQ */ + msr CPSR_c, #ARM_MODE_SVC + d8: e321f013 msr CPSR_c, #19 + +#ifdef CONFIG_DFU_MAGIC + ldr r1, =AT91C_RSTC_RSR + dc: e59f10d4 ldr r1, [pc, #212] ; 1b8 + ldr r2, [r1] + e0: e5912000 ldr r2, [r1] + #and r2, r2, AT91C_RSTC_RSTTYP + tst r2, #AT91C_RSTC_RSTTYP_SOFTWARE + e4: e3120c03 tst r2, #768 ; 0x300 + beq dfu_magic_end + e8: 0a000003 beq fc + + ldr r1, =dfu_state + ec: e59f10c8 ldr r1, [pc, #200] ; 1bc + ldr r2, [r1] + f0: e5912000 ldr r2, [r1] + cmp r2, #DFU_STATE_appDETACH + f4: e3520001 cmp r2, #1 + beq _reloc_dfu + f8: 0a000011 beq 144 <_reloc_dfu> + +000000fc : +dfu_magic_end: +#endif + +# Relocate DFU .data.shared section (Copy from ROM to RAM) + LDR R1, =_etext + fc: e59f10bc ldr r1, [pc, #188] ; 1c0 + LDR R2, =_data_shared + 100: e59f20bc ldr r2, [pc, #188] ; 1c4 + LDR R3, =_edata_shared + 104: e59f30bc ldr r3, [pc, #188] ; 1c8 + +00000108 : +LoopRelDS: CMP R2, R3 + 108: e1520003 cmp r2, r3 + LDRLO R0, [R1], #4 + 10c: 34910004 ldrcc r0, [r1], #4 + STRLO R0, [R2], #4 + 110: 34820004 strcc r0, [r2], #4 + BLO LoopRelDS + 114: 3afffffb bcc 108 + STRLO R0, [R1], #4 + BLO LoopZI +*/ + + /* prepare c function call to main */ + mov r0, #0 /* argc = 0 */ + 118: e3a00000 mov r0, #0 + ldr lr, =exit + 11c: e59fe0a8 ldr lr, [pc, #168] ; 1cc + ldr r10, =0x00104000 + 120: e3a0a941 mov sl, #1064960 ; 0x104000 + +#ifdef CONFIG_DFU_SWITCH + /* check whether bootloader button is pressed */ + ldr r1, =AT91C_PMC_PCER + 124: e59f10a4 ldr r1, [pc, #164] ; 1d0 + mov r2, #(1 << AT91C_ID_PIOA) + 128: e3a02004 mov r2, #4 + str r2, [r1] + 12c: e5812000 str r2, [r1] + + ldr r1, =AT91C_BASE_PIOA + 130: e59f109c ldr r1, [pc, #156] ; 1d4 + ldr r2, [r1, #PIOA_PDSR] + 134: e591203c ldr r2, [r1, #60] ; 0x3c + tst r2, #PIO_BOOTLDR + 138: e3120302 tst r2, #134217728 ; 0x8000000 + bne _reloc_dfu + 13c: 1a000000 bne 144 <_reloc_dfu> +#endif + + bx r10 + 140: e12fff1a bx sl + +00000144 <_reloc_dfu>: + +_reloc_dfu: + /* Relocate DFU .data section (Copy from ROM to RAM) */ + LDR R1, =_data_flash + 144: e59f108c ldr r1, [pc, #140] ; 1d8 + LDR R2, =_data + 148: e59f208c ldr r2, [pc, #140] ; 1dc + LDR R3, =_edata + 14c: e59f308c ldr r3, [pc, #140] ; 1e0 + +00000150 : +LoopRel: CMP R2, R3 + 150: e1520003 cmp r2, r3 + LDRLO R0, [R1], #4 + 154: 34910004 ldrcc r0, [r1], #4 + STRLO R0, [R2], #4 + 158: 34820004 strcc r0, [r2], #4 + BLO LoopRel + 15c: 3afffffb bcc 150 + + /* Clear DFU .bss section (Zero init) */ + MOV R0, #0 + 160: e3a00000 mov r0, #0 + LDR R1, =__bss_start__ + 164: e59f1078 ldr r1, [pc, #120] ; 1e4 + LDR R2, =__bss_end__ + 168: e59f2078 ldr r2, [pc, #120] ; 1e8 + +0000016c : +LoopZI: CMP R1, R2 + 16c: e1510002 cmp r1, r2 + STRLO R0, [R1], #4 + 170: 34810004 strcc r0, [r1], #4 + BLO LoopZI + 174: 3afffffc bcc 16c + + /* relocate DFU .text into RAM */ + ldr r1, =0x00100000 + 178: e3a01601 mov r1, #1048576 ; 0x100000 + ldr r2, =0x00200000 + 17c: e3a02602 mov r2, #2097152 ; 0x200000 + ldr r3, =_etext + 180: e59f3038 ldr r3, [pc, #56] ; 1c0 + add r3, r3, r2 + 184: e0833002 add r3, r3, r2 + +00000188 : +loop_rel_t: cmp r2, r3 + 188: e1520003 cmp r2, r3 + ldrlo r4, [r1], #4 + 18c: 34914004 ldrcc r4, [r1], #4 + strlo r4, [r2], #4 + 190: 34824004 strcc r4, [r2], #4 + blo loop_rel_t + 194: 3afffffb bcc 188 + ldr r4, =_remap_call_dfu + 198: e59f404c ldr r4, [pc, #76] ; 1ec + bx r4 + 19c: e12fff14 bx r4 + +000001a0 : + +/* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + .global exit + .func exit +exit: + b . + 1a0: eafffffe b 1a0 + +000001a4 : +//* This module is only linked if needed for closing files. +//*---------------------------------------------------------------*/ + .global AT91F_Default_FIQ_handler + .func AT91F_Default_FIQ_handler +AT91F_Default_FIQ_handler: + b AT91F_Default_FIQ_handler + 1a4: eafffffe b 1a4 + +000001a8 : + .endfunc + + .global AT91F_Default_IRQ_handler + .func AT91F_Default_IRQ_handler +AT91F_Default_IRQ_handler: + b AT91F_Default_IRQ_handler + 1a8: eafffffe b 1a8 + +000001ac : + .endfunc + + .global AT91F_Spurious_handler + .func AT91F_Spurious_handler +AT91F_Spurious_handler: + b AT91F_Spurious_handler + 1ac: eafffffe b 1ac + 1b0: fffff000 .word 0xfffff000 + 1b4: 000001f0 .word 0x000001f0 + 1b8: fffffd04 .word 0xfffffd04 + 1bc: 00200020 .word 0x00200020 + 1c0: 00001ac0 .word 0x00001ac0 + 1c4: 00200020 .word 0x00200020 + 1c8: 00200028 .word 0x00200028 + 1cc: 000001a0 .word 0x000001a0 + 1d0: fffffc10 .word 0xfffffc10 + 1d4: fffff400 .word 0xfffff400 + 1d8: 00001ac8 .word 0x00001ac8 + 1dc: 00201ac0 .word 0x00201ac0 + 1e0: 00201ae4 .word 0x00201ae4 + 1e4: 00201ae4 .word 0x00201ae4 + 1e8: 00201bec .word 0x00201bec + 1ec: 00201ac0 .word 0x00201ac0 + +000001f0 : +//* this function can be use a Stack, depending the compilation +//* optimization mode +//*---------------------------------------------------------------------------- +void +AT91F_LowLevelInit (void) +{ + 1f0: e24dd008 sub sp, sp, #8 + volatile int i; + + //* Debounce power supply + for(i=0;i<1024;i++); + 1f4: e3a03000 mov r3, #0 + 1f8: ea000001 b 204 + 1fc: e59d3004 ldr r3, [sp, #4] + 200: e2833001 add r3, r3, #1 + 204: e58d3004 str r3, [sp, #4] + 208: e59d3004 ldr r3, [sp, #4] + 20c: e3530b01 cmp r3, #1024 ; 0x400 + 210: bafffff9 blt 1fc + + AT91PS_PMC pPMC = AT91C_BASE_PMC; + //* Set Flash Waite sate + // Single Cycle Access at Up to 30 MHz, or 40 + // if MCK = 47923200 I have 50 Cycle for 1 usecond ( flied MC_FMR->FMCN + AT91C_BASE_MC->MC_FMR = ((AT91C_MC_FMCN) & (48 << 16)) | AT91C_MC_FWS_1FWS; + 214: e59f20c8 ldr r2, [pc, #200] ; 2e4 + 218: e3e03000 mvn r3, #0 + 21c: e503209f str r2, [r3, #-159] ; 0xffffff61 + + //* Set MCK at 47 923 200 + // 1 Enabling the Main Oscillator: + // SCK = 1/32768 = 30.51 uSecond + // Start up time = 8 * 6 / SCK = 56 * 30.51 = 1,46484375 ms + pPMC->PMC_MOR = ((AT91C_CKGR_OSCOUNT) & (0x06 << 8)) | AT91C_CKGR_MOSCEN; + 220: e59f20c0 ldr r2, [pc, #192] ; 2e8 + 224: e50323df str r2, [r3, #-991] ; 0xfffffc21 + // Wait the startup time + while (!(pPMC->PMC_SR & AT91C_PMC_MOSCS)); + 228: e3e03c03 mvn r3, #768 ; 0x300 + 22c: e5132097 ldr r2, [r3, #-151] ; 0xffffff69 + 230: e3120001 tst r2, #1 + 234: 0afffffb beq 228 +#if 0 + pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) | + (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + (AT91C_CKGR_MUL & (25 << 16))); +#else + pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 24) | + 238: e59f20ac ldr r2, [pc, #172] ; 2ec + 23c: e50320d3 str r2, [r3, #-211] ; 0xffffff2d + (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + (AT91C_CKGR_MUL & (125 << 16))); +#endif + + // Wait the startup time + while (!(pPMC->PMC_SR & AT91C_PMC_LOCK)); + 240: e3e03c03 mvn r3, #768 ; 0x300 + 244: e5133097 ldr r3, [r3, #-151] ; 0xffffff69 + 248: e3130004 tst r3, #4 + 24c: 0afffffb beq 240 + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 250: e3e03c03 mvn r3, #768 ; 0x300 + 254: e5132097 ldr r2, [r3, #-151] ; 0xffffff69 + 258: e3120008 tst r2, #8 + 25c: 0afffffb beq 250 + // 4. Selection of Master Clock and Processor Clock + // select the PLL clock divided by 2 + pPMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; + 260: e3a02004 mov r2, #4 + 264: e50320cf str r2, [r3, #-207] ; 0xffffff31 + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 268: e3e03c03 mvn r3, #768 ; 0x300 + 26c: e5132097 ldr r2, [r3, #-151] ; 0xffffff69 + 270: e3120008 tst r2, #8 + 274: 0afffffb beq 268 + + pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; + 278: e51320cf ldr r2, [r3, #-207] ; 0xffffff31 + 27c: e3822003 orr r2, r2, #3 + 280: e50320cf str r2, [r3, #-207] ; 0xffffff31 + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 284: e3e03c03 mvn r3, #768 ; 0x300 + 288: e5133097 ldr r3, [r3, #-151] ; 0xffffff69 + 28c: e3130008 tst r3, #8 + 290: 0afffffb beq 284 + + // Set up the default interrupts handler vectors + AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler; + 294: e59f2054 ldr r2, [pc, #84] ; 2f0 + 298: e3e03c0f mvn r3, #3840 ; 0xf00 + 29c: e503207f str r2, [r3, #-127] ; 0xffffff81 + for (i = 1; i < 31; i++) + 2a0: e3a03001 mov r3, #1 + 2a4: ea000005 b 2c0 + { + AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler; + 2a8: e59d3004 ldr r3, [sp, #4] + 2ac: e59f2040 ldr r2, [pc, #64] ; 2f4 + 2b0: e1a03103 lsl r3, r3, #2 + 2b4: e5032f80 str r2, [r3, #-3968] ; 0xfffff080 + pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + + // Set up the default interrupts handler vectors + AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler; + for (i = 1; i < 31; i++) + 2b8: e59d3004 ldr r3, [sp, #4] + 2bc: e2833001 add r3, r3, #1 + 2c0: e58d3004 str r3, [sp, #4] + 2c4: e59d3004 ldr r3, [sp, #4] + 2c8: e353001e cmp r3, #30 + 2cc: dafffff5 ble 2a8 + { + AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler; + } + AT91C_BASE_AIC->AIC_SPU = (int) AT91F_Spurious_handler; + 2d0: e59f2020 ldr r2, [pc, #32] ; 2f8 + 2d4: e3e03c0f mvn r3, #3840 ; 0xf00 + 2d8: e5832035 str r2, [r3, #53] ; 0x35 + +} + 2dc: e28dd008 add sp, sp, #8 + 2e0: e12fff1e bx lr + 2e4: 00300100 .word 0x00300100 + 2e8: 00000601 .word 0x00000601 + 2ec: 007d1c18 .word 0x007d1c18 + 2f0: 000001a4 .word 0x000001a4 + 2f4: 000001a8 .word 0x000001a8 + 2f8: 000001ac .word 0x000001ac + +000002fc : +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 2fc: e5801010 str r1, [r0, #16] + pPDC->PDC_RNCR = bytes; + 300: e5802014 str r2, [r0, #20] +} + 304: e12fff1e bx lr + +00000308 : +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 308: e5801018 str r1, [r0, #24] + pPDC->PDC_TNCR = bytes; + 30c: e580201c str r2, [r0, #28] +} + 310: e12fff1e bx lr + +00000314 : +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 314: e5801000 str r1, [r0] + pPDC->PDC_RCR = bytes; + 318: e5802004 str r2, [r0, #4] +} + 31c: e12fff1e bx lr + +00000320 : +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 320: e5801008 str r1, [r0, #8] + pPDC->PDC_TCR = bytes; + 324: e580200c str r2, [r0, #12] +} + 328: e12fff1e bx lr + +0000032c : +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 32c: e3a03c02 mov r3, #512 ; 0x200 + 330: e5803020 str r3, [r0, #32] +} + 334: e12fff1e bx lr + +00000338 : +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 338: e3a03002 mov r3, #2 + 33c: e5803020 str r3, [r0, #32] +} + 340: e12fff1e bx lr + +00000344 : +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetMainClock ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; + 344: e5900004 ldr r0, [r0, #4] + 348: e1a00800 lsl r0, r0, #16 + 34c: e1a00820 lsr r0, r0, #16 + 350: e0000091 mul r0, r1, r0 +} + 354: e1a00220 lsr r0, r0, #4 + 358: e12fff1e bx lr + +0000035c : + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + + mask = 0x1 << irq_id ; + 35c: e3a0c001 mov ip, #1 + 360: e1a0c11c lsl ip, ip, r1 + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id, // \arg interrupt number to initialize + unsigned int priority, // \arg priority to give to the interrupt + unsigned int src_type, // \arg activation and sense of activation + void (*newHandler) () ) // \arg address of the interrupt handler +{ + 364: e92d0070 push {r4, r5, r6} + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + 368: e2814020 add r4, r1, #32 + 36c: e7905104 ldr r5, [r0, r4, lsl #2] + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 370: e59d600c ldr r6, [sp, #12] + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 374: e1833002 orr r3, r3, r2 + + oldHandler = pAic->AIC_SVR[irq_id]; + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 378: e580c124 str ip, [r0, #292] ; 0x124 + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 37c: e7806104 str r6, [r0, r4, lsl #2] + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 380: e7803101 str r3, [r0, r1, lsl #2] + //* Clear the interrupt on the interrupt controller + pAic->AIC_ICCR = mask ; + 384: e580c128 str ip, [r0, #296] ; 0x128 + + return oldHandler; +} + 388: e1a00005 mov r0, r5 + 38c: e8bd0070 pop {r4, r5, r6} + 390: e12fff1e bx lr + +00000394 : + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 394: e59f2028 ldr r2, [pc, #40] ; 3c4 +//* \brief Configure vector handler +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + 398: e1a03000 mov r3, r0 + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 39c: e1510002 cmp r1, r2 + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 3a0: 10632001 rsbne r2, r3, r1 + 3a4: 12422008 subne r2, r2, #8 + 3a8: 11a02122 lsrne r2, r2, #2 + 3ac: 13c224ff bicne r2, r2, #-16777216 ; 0xff000000 + 3b0: 138224ea orrne r2, r2, #-369098752 ; 0xea000000 +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + 3b4: e5900000 ldr r0, [r0] + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + 3b8: 05831000 streq r1, [r3] + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 3bc: 15832000 strne r2, [r3] + + return oldVector; +} + 3c0: e12fff1e bx lr + 3c4: e51fff20 .word 0xe51fff20 + +000003c8 : + void (*IrqHandler) (), // \arg Default IRQ vector exception + void (*FiqHandler) (), // \arg Default FIQ vector exception + void (*DefaultHandler) (), // \arg Default Handler set in ISR + void (*SpuriousHandler) (), // \arg Default Spurious Handler + unsigned int protectMode) // \arg Debug Control Register +{ + 3c8: e92d41f3 push {r0, r1, r4, r5, r6, r7, r8, lr} + 3cc: e1a04000 mov r4, r0 + 3d0: e1a06001 mov r6, r1 + 3d4: e1a08002 mov r8, r2 + 3d8: e1a07003 mov r7, r3 + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 3dc: e3a05000 mov r5, #0 +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_DisableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + 3e0: e3a03001 mov r3, #1 + 3e4: e1a03513 lsl r3, r3, r5 + AT91F_AIC_DisableIt(pAic, i); + AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); + 3e8: e1a01005 mov r1, r5 + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 3ec: e5843124 str r3, [r4, #292] ; 0x124 + 3f0: e1a00004 mov r0, r4 + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; + 3f4: e5843128 str r3, [r4, #296] ; 0x128 + 3f8: e3a02000 mov r2, #0 + 3fc: e3a03040 mov r3, #64 ; 0x40 + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 400: e2855001 add r5, r5, #1 + AT91F_AIC_DisableIt(pAic, i); + AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); + 404: e58d7000 str r7, [sp] + 408: ebffffd3 bl 35c + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 40c: e3550020 cmp r5, #32 + 410: 1afffff2 bne 3e0 + AT91F_AIC_DisableIt(pAic, i); + AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); + } + + // Set the IRQ exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); + 414: e1a01006 mov r1, r6 + 418: e3a00018 mov r0, #24 + 41c: ebffffdc bl 394 + // Set the Fast Interrupt exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); + 420: e3a0001c mov r0, #28 + 424: e1a01008 mov r1, r8 + 428: ebffffd9 bl 394 + + pAic->AIC_SPU = (unsigned int) SpuriousHandler; + 42c: e59d3020 ldr r3, [sp, #32] + 430: e5843134 str r3, [r4, #308] ; 0x134 + pAic->AIC_DCR = protectMode; + 434: e59d3024 ldr r3, [sp, #36] ; 0x24 + 438: e5843138 str r3, [r4, #312] ; 0x138 +} + 43c: e8bd41fc pop {r2, r3, r4, r5, r6, r7, r8, lr} + 440: e12fff1e bx lr + +00000444 : +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Open +//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX +//*---------------------------------------------------------------------------- +void AT91F_PDC_Open(AT91PS_PDC pPDC) // \arg pointer to a PDC controller +{ + 444: e92d4010 push {r4, lr} + 448: e1a04000 mov r4, r0 + //* Disable the RX and TX PDC transfer requests + AT91F_PDC_DisableRx(pPDC); + 44c: ebffffb9 bl 338 + AT91F_PDC_DisableTx(pPDC); + 450: e1a00004 mov r0, r4 + 454: ebffffb4 bl 32c + + //* Reset all Counter register Next buffer first + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + 458: e3a01000 mov r1, #0 + 45c: e1a02001 mov r2, r1 + 460: e1a00004 mov r0, r4 + 464: ebffffa7 bl 308 + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + 468: e3a01000 mov r1, #0 + 46c: e1a02001 mov r2, r1 + 470: e1a00004 mov r0, r4 + 474: ebffffa0 bl 2fc + AT91F_PDC_SetTx(pPDC, NULL, 0); + 478: e3a01000 mov r1, #0 + 47c: e1a02001 mov r2, r1 + 480: e1a00004 mov r0, r4 + 484: ebffffa5 bl 320 + AT91F_PDC_SetRx(pPDC, NULL, 0); + 488: e3a01000 mov r1, #0 + 48c: e1a00004 mov r0, r4 + 490: e1a02001 mov r2, r1 + 494: ebffff9e bl 314 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 498: e3a03001 mov r3, #1 + 49c: e5843020 str r3, [r4, #32] +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 4a0: e28330ff add r3, r3, #255 ; 0xff + 4a4: e5843020 str r3, [r4, #32] + + //* Enable the RX and TX PDC transfer requests + AT91F_PDC_EnableRx(pPDC); + AT91F_PDC_EnableTx(pPDC); +} + 4a8: e8bd4010 pop {r4, lr} + 4ac: e12fff1e bx lr + +000004b0 : +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Close +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +void AT91F_PDC_Close(AT91PS_PDC pPDC) // \arg pointer to a PDC controller +{ + 4b0: e92d4010 push {r4, lr} + 4b4: e1a04000 mov r4, r0 + //* Disable the RX and TX PDC transfer requests + AT91F_PDC_DisableRx(pPDC); + 4b8: ebffff9e bl 338 + AT91F_PDC_DisableTx(pPDC); + 4bc: e1a00004 mov r0, r4 + 4c0: ebffff99 bl 32c + + //* Reset all Counter register Next buffer first + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + 4c4: e3a01000 mov r1, #0 + 4c8: e1a00004 mov r0, r4 + 4cc: e1a02001 mov r2, r1 + 4d0: ebffff8c bl 308 + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + 4d4: e3a01000 mov r1, #0 + 4d8: e1a00004 mov r0, r4 + 4dc: e1a02001 mov r2, r1 + 4e0: ebffff85 bl 2fc + AT91F_PDC_SetTx(pPDC, NULL, 0); + 4e4: e3a01000 mov r1, #0 + 4e8: e1a00004 mov r0, r4 + 4ec: e1a02001 mov r2, r1 + 4f0: ebffff8a bl 320 + AT91F_PDC_SetRx(pPDC, NULL, 0); + 4f4: e3a01000 mov r1, #0 + 4f8: e1a00004 mov r0, r4 + 4fc: e1a02001 mov r2, r1 + +} + 500: e8bd4010 pop {r4, lr} + + //* Reset all Counter register Next buffer first + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); + 504: eaffff82 b 314 + +00000508 : + AT91PS_PDC pPDC, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + 508: e92d4038 push {r3, r4, r5, lr} + 50c: e1a05003 mov r5, r3 +//* \brief Test if the current transfer descriptor has been sent +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TCR); + 510: e590300c ldr r3, [r0, #12] + if (AT91F_PDC_IsTxEmpty(pPDC)) { + 514: e3530000 cmp r3, #0 + AT91PS_PDC pPDC, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + 518: e1a04000 mov r4, r0 + if (AT91F_PDC_IsTxEmpty(pPDC)) { + 51c: 1a000006 bne 53c + //* Buffer and next buffer can be initialized + AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + 520: ebffff7e bl 320 + AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + 524: e1a00004 mov r0, r4 + 528: e1a01005 mov r1, r5 + 52c: e59d2010 ldr r2, [sp, #16] + 530: ebffff74 bl 308 + return 2; + 534: e3a00002 mov r0, #2 + 538: ea000005 b 554 +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TNCR); + 53c: e590301c ldr r3, [r0, #28] + } + else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + 540: e3530000 cmp r3, #0 + AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + 544: 13a00000 movne r0, #0 + //* Buffer and next buffer can be initialized + AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + 548: 1a000001 bne 554 + //* Only one buffer can be initialized + AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + 54c: ebffff6d bl 308 + return 1; + 550: e3a00001 mov r0, #1 + } + else { + //* All buffer are in use... + return 0; + } +} + 554: e8bd4038 pop {r3, r4, r5, lr} + 558: e12fff1e bx lr + +0000055c : + AT91PS_PDC pPDC, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + 55c: e92d4038 push {r3, r4, r5, lr} + 560: e1a05003 mov r5, r3 +//* \brief Test if the current transfer descriptor has been filled +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RCR); + 564: e5903004 ldr r3, [r0, #4] + if (AT91F_PDC_IsRxEmpty(pPDC)) { + 568: e3530000 cmp r3, #0 + AT91PS_PDC pPDC, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + 56c: e1a04000 mov r4, r0 + if (AT91F_PDC_IsRxEmpty(pPDC)) { + 570: 1a000006 bne 590 + //* Buffer and next buffer can be initialized + AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + 574: ebffff66 bl 314 + AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + 578: e1a00004 mov r0, r4 + 57c: e1a01005 mov r1, r5 + 580: e59d2010 ldr r2, [sp, #16] + 584: ebffff5c bl 2fc + return 2; + 588: e3a00002 mov r0, #2 + 58c: ea000005 b 5a8 +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RNCR); + 590: e5903014 ldr r3, [r0, #20] + } + else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + 594: e3530000 cmp r3, #0 + AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + 598: 13a00000 movne r0, #0 + //* Buffer and next buffer can be initialized + AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + 59c: 1a000001 bne 5a8 + //* Only one buffer can be initialized + AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + 5a0: ebffff55 bl 2fc + return 1; + 5a4: e3a00001 mov r0, #1 + } + else { + //* All buffer are in use... + return 0; + } +} + 5a8: e8bd4038 pop {r3, r4, r5, lr} + 5ac: e12fff1e bx lr + +000005b0 : +//*------------------------------------------------------------------------------ +unsigned int AT91F_PMC_GetMasterClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + 5b0: e92d4038 push {r3, r4, r5, lr} + 5b4: e1a03000 mov r3, r0 + unsigned int reg = pPMC->PMC_MCKR; + 5b8: e5933030 ldr r3, [r3, #48] ; 0x30 +//*------------------------------------------------------------------------------ +unsigned int AT91F_PMC_GetMasterClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + 5bc: e1a00001 mov r0, r1 + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 5c0: e203401c and r4, r3, #28 + 5c4: e3a01001 mov r1, #1 + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 5c8: e2033003 and r3, r3, #3 + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 5cc: e1a04124 lsr r4, r4, #2 + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 5d0: e1530001 cmp r3, r1 + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 5d4: e1a04411 lsl r4, r1, r4 + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 5d8: 0a000005 beq 5f4 + case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + return slowClock / prescaler; + 5dc: 31a00002 movcc r0, r2 +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 5e0: 3a000010 bcc 628 + 5e4: e3530003 cmp r3, #3 + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + } + return 0; + 5e8: 13a00000 movne r0, #0 +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 5ec: 1a00000f bne 630 + 5f0: ea000002 b 600 + case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + return slowClock / prescaler; + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + 5f4: e1a01002 mov r1, r2 + 5f8: ebffff51 bl 344 + 5fc: ea000009 b 628 + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + 600: e590500c ldr r5, [r0, #12] + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 604: e1a01002 mov r1, r2 + 608: ebffff4d bl 344 + return slowClock / prescaler; + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + 60c: e20510ff and r1, r5, #255 ; 0xff + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 610: eb0003d0 bl 1558 <__aeabi_uidiv> + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + 614: e59f301c ldr r3, [pc, #28] ; 638 + 618: e0053003 and r3, r5, r3 + 61c: e1a03823 lsr r3, r3, #16 + 620: e2833001 add r3, r3, #1 + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 624: e0000093 mul r0, r3, r0 + 628: e1a01004 mov r1, r4 + 62c: eb0003c9 bl 1558 <__aeabi_uidiv> + } + return 0; +} + 630: e8bd4038 pop {r3, r4, r5, lr} + 634: e12fff1e bx lr + 638: 07ff0000 .word 0x07ff0000 + +0000063c : +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ReadValue() +//* \brief Read the RTT value +//*-------------------------------------------------------------------------------------- +unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC) +{ + 63c: e24dd008 sub sp, sp, #8 + register volatile unsigned int val1,val2; + do + { + val1 = pRTTC->RTTC_RTVR; + 640: e5903008 ldr r3, [r0, #8] + 644: e58d3004 str r3, [sp, #4] + val2 = pRTTC->RTTC_RTVR; + 648: e5903008 ldr r3, [r0, #8] + 64c: e58d3000 str r3, [sp] + } + while(val1 != val2); + 650: e59d2004 ldr r2, [sp, #4] + 654: e59d3000 ldr r3, [sp] + 658: e1520003 cmp r2, r3 + 65c: 1afffff7 bne 640 + return(val1); + 660: e59d0004 ldr r0, [sp, #4] +} + 664: e28dd008 add sp, sp, #8 + 668: e12fff1e bx lr + +0000066c : +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + //* Reset all the Chip Select register + pSPI->SPI_CSR[0] = 0 ; + 66c: e3a03000 mov r3, #0 +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Close +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + 670: e92d4010 push {r4, lr} + //* Reset all the Chip Select register + pSPI->SPI_CSR[0] = 0 ; + 674: e5803030 str r3, [r0, #48] ; 0x30 + pSPI->SPI_CSR[1] = 0 ; + 678: e5803034 str r3, [r0, #52] ; 0x34 + pSPI->SPI_CSR[2] = 0 ; + 67c: e5803038 str r3, [r0, #56] ; 0x38 + pSPI->SPI_CSR[3] = 0 ; + 680: e580303c str r3, [r0, #60] ; 0x3c + + //* Reset the SPI mode + pSPI->SPI_MR = 0 ; + 684: e5803004 str r3, [r0, #4] + + //* Disable all interrupts + pSPI->SPI_IDR = 0xFFFFFFFF ; + 688: e3e03000 mvn r3, #0 + 68c: e5803018 str r3, [r0, #24] +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Close +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + 690: e1a04000 mov r4, r0 + + //* Disable all interrupts + pSPI->SPI_IDR = 0xFFFFFFFF ; + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); + 694: e2800c01 add r0, r0, #256 ; 0x100 + 698: ebffff84 bl 4b0 + + //* Disable receiver and transmitter and stop any activity immediately + pSPI->SPI_CR = AT91C_SPI_SPIDIS; + 69c: e3a03002 mov r3, #2 + 6a0: e5843000 str r3, [r4] +} + 6a4: e8bd4010 pop {r4, lr} + 6a8: e12fff1e bx lr + +000006ac : + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + 6ac: e92d40f8 push {r3, r4, r5, r6, r7, lr} + 6b0: e1a04000 mov r4, r0 + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + 6b4: e1a00001 mov r0, r1 + 6b8: e1a01082 lsl r1, r2, #1 + startup = adc_clock*startup_time/8 - 1; + 6bc: e0070392 mul r7, r2, r3 + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + 6c0: e1a05002 mov r5, r2 + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + 6c4: eb0003a3 bl 1558 <__aeabi_uidiv> + 6c8: e2406001 sub r6, r0, #1 + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + 6cc: e59d0018 ldr r0, [sp, #24] + 6d0: e3a01ffa mov r1, #1000 ; 0x3e8 + 6d4: e0000095 mul r0, r5, r0 + 6d8: eb00039e bl 1558 <__aeabi_uidiv> + unsigned int sample_and_hold_time) // in ns +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + 6dc: e1a071a7 lsr r7, r7, #3 + 6e0: e2477001 sub r7, r7, #1 + shtim = adc_clock*sample_and_hold_time/1000 - 1; + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 6e4: e1a07807 lsl r7, r7, #16 + 6e8: e1a06406 lsl r6, r6, #8 +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + 6ec: e2403001 sub r3, r0, #1 + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 6f0: e207781f and r7, r7, #2031616 ; 0x1f0000 + 6f4: e2066c3f and r6, r6, #16128 ; 0x3f00 + 6f8: e1a03c03 lsl r3, r3, #24 + 6fc: e1876006 orr r6, r7, r6 + 700: e203340f and r3, r3, #251658240 ; 0xf000000 + 704: e1866003 orr r6, r6, r3 + 708: e5846004 str r6, [r4, #4] +} + 70c: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} + 710: e12fff1e bx lr + +00000714 : + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 714: e3520000 cmp r2, #0 +//*---------------------------------------------------------------------------- +void AT91F_SSC_SetBaudrate ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + 718: e92d4070 push {r4, r5, r6, lr} + 71c: e1a04000 mov r4, r0 + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + baud_value = 0; + 720: 01a00002 moveq r0, r2 + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 724: 0a000010 beq 76c + baud_value = 0; + else + { + baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 728: e3a0500a mov r5, #10 + 72c: e0000195 mul r0, r5, r1 + 730: e1a01082 lsl r1, r2, #1 + 734: eb000387 bl 1558 <__aeabi_uidiv> + if ((baud_value % 10) >= 5) + 738: e1a01005 mov r1, r5 + //* Define the baud rate divisor register + if (speed == 0) + baud_value = 0; + else + { + baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 73c: e1a06000 mov r6, r0 + if ((baud_value % 10) >= 5) + 740: eb0003c1 bl 164c <__aeabi_uidivmod> + 744: e3510004 cmp r1, #4 + 748: 9a000004 bls 760 + baud_value = (baud_value / 10) + 1; + 74c: e1a00006 mov r0, r6 + 750: e1a01005 mov r1, r5 + 754: eb00037f bl 1558 <__aeabi_uidiv> + 758: e2800001 add r0, r0, #1 + 75c: ea000002 b 76c + else + baud_value /= 10; + 760: e1a00006 mov r0, r6 + 764: e1a01005 mov r1, r5 + 768: eb00037a bl 1558 <__aeabi_uidiv> + } + + pSSC->SSC_CMR = baud_value; + 76c: e5840004 str r0, [r4, #4] +} + 770: e8bd4070 pop {r4, r5, r6, lr} + 774: e12fff1e bx lr + +00000778 : + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + 778: e92d41f0 push {r4, r5, r6, r7, r8, lr} + 77c: e1a08003 mov r8, r3 + //* Disable interrupts + pSSC->SSC_IDR = (unsigned int) -1; + 780: e3e03000 mvn r3, #0 + 784: e5803048 str r3, [r0, #72] ; 0x48 + + //* Reset receiver and transmitter + pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + 788: e59f3030 ldr r3, [pc, #48] ; 7c0 + 78c: e5803000 str r3, [r0] + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + 790: e1a04000 mov r4, r0 + 794: e28d6018 add r6, sp, #24 + 798: e89600c0 ldm r6, {r6, r7} + 79c: e59d5020 ldr r5, [sp, #32] + + //* Reset receiver and transmitter + pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + + //* Define the Clock Mode Register + AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); + 7a0: ebffffdb bl 714 + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + 7a4: e2840c01 add r0, r4, #256 ; 0x100 + + //* Define the Clock Mode Register + AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); + + //* Write the Receive Clock Mode Register + pSSC->SSC_RCMR = clock_rx; + 7a8: e5848010 str r8, [r4, #16] + + //* Write the Transmit Clock Mode Register + pSSC->SSC_TCMR = clock_tx; + 7ac: e5847018 str r7, [r4, #24] + + //* Write the Receive Frame Mode Register + pSSC->SSC_RFMR = mode_rx; + 7b0: e5846014 str r6, [r4, #20] + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + 7b4: e584501c str r5, [r4, #28] + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + + +} + 7b8: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + 7bc: eaffff20 b 444 + 7c0: 00008202 .word 0x00008202 + +000007c4 : + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + 7c4: e92d40f8 push {r3, r4, r5, r6, r7, lr} + 7c8: e1a06002 mov r6, r2 + //* Disable interrupts + pUSART->US_IDR = (unsigned int) -1; + 7cc: e3e02000 mvn r2, #0 + 7d0: e580200c str r2, [r0, #12] +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_Baudrate ( + const unsigned int main_clock, // \arg peripheral clock + const unsigned int baud_rate) // \arg UART baudrate +{ + unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + 7d4: e3a0500a mov r5, #10 + + //* Reset receiver and transmitter + pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; + 7d8: e28220ad add r2, r2, #173 ; 0xad + 7dc: e5802000 str r2, [r0] + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + 7e0: e1a04000 mov r4, r0 + 7e4: e0000195 mul r0, r5, r1 + 7e8: e1a01203 lsl r1, r3, #4 + 7ec: eb000359 bl 1558 <__aeabi_uidiv> + if ((baud_value % 10) >= 5) + 7f0: e1a01005 mov r1, r5 +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_Baudrate ( + const unsigned int main_clock, // \arg peripheral clock + const unsigned int baud_rate) // \arg UART baudrate +{ + unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + 7f4: e1a07000 mov r7, r0 + if ((baud_value % 10) >= 5) + 7f8: eb000393 bl 164c <__aeabi_uidivmod> + 7fc: e3510004 cmp r1, #4 + 800: 9a000004 bls 818 + baud_value = (baud_value / 10) + 1; + 804: e1a00007 mov r0, r7 + 808: e1a01005 mov r1, r5 + 80c: eb000351 bl 1558 <__aeabi_uidiv> + 810: e2800001 add r0, r0, #1 + 814: ea000002 b 824 + else + baud_value /= 10; + 818: e1a00007 mov r0, r7 + 81c: e1a01005 mov r1, r5 + 820: eb00034c bl 1558 <__aeabi_uidiv> +static inline void AT91F_US_SetTimeguard ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int timeguard) // \arg timeguard value +{ + //* Write the Timeguard Register + pUSART->US_TTGR = timeguard ; + 824: e59d3018 ldr r3, [sp, #24] + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg UART baudrate +{ + //* Define the baud rate divisor register + pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); + 828: e5840020 str r0, [r4, #32] +static inline void AT91F_US_SetTimeguard ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int timeguard) // \arg timeguard value +{ + //* Write the Timeguard Register + pUSART->US_TTGR = timeguard ; + 82c: e5843028 str r3, [r4, #40] ; 0x28 + + //* Write the Timeguard Register + AT91F_US_SetTimeguard(pUSART, timeguard); + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); + 830: e2840c01 add r0, r4, #256 ; 0x100 + 834: ebffff02 bl 444 + + //* Define the USART mode + pUSART->US_MR = mode ; + 838: e5846004 str r6, [r4, #4] + +} + 83c: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} + 840: e12fff1e bx lr + +00000844 : +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset the baud rate divisor register + pUSART->US_BRGR = 0 ; + 844: e3a03000 mov r3, #0 +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Close +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + 848: e92d4010 push {r4, lr} + //* Reset the baud rate divisor register + pUSART->US_BRGR = 0 ; + 84c: e5803020 str r3, [r0, #32] + + //* Reset the USART mode + pUSART->US_MR = 0 ; + 850: e5803004 str r3, [r0, #4] + + //* Reset the Timeguard Register + pUSART->US_TTGR = 0; + 854: e5803028 str r3, [r0, #40] ; 0x28 + + //* Disable all interrupts + pUSART->US_IDR = 0xFFFFFFFF ; + 858: e3e03000 mvn r3, #0 + 85c: e580300c str r3, [r0, #12] +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Close +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + 860: e1a04000 mov r4, r0 + + //* Disable all interrupts + pUSART->US_IDR = 0xFFFFFFFF ; + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); + 864: e2800c01 add r0, r0, #256 ; 0x100 + 868: ebffff10 bl 4b0 + + //* Disable receiver and transmitter and stop any activity immediately + pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; + 86c: e3a030ac mov r3, #172 ; 0xac + 870: e5843000 str r3, [r4] +} + 874: e8bd4010 pop {r4, lr} + 878: e12fff1e bx lr + +0000087c : + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +/* Send Data through the control endpoint */ +static void __dfufunc udp_ep0_send_data(const char *pData, u_int32_t length) +{ + 87c: e92d0033 push {r0, r1, r4, r5} + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + + do { + cpt = MIN(length, 8); + 880: e3510008 cmp r1, #8 + 884: 31a02001 movcc r2, r1 + 888: 23a02008 movcs r2, #8 + 88c: e1a0c002 mov ip, r2 + length -= cpt; + + while (cpt--) + 890: e1a04000 mov r4, r0 + 894: ea000001 b 8a0 + pUdp->UDP_FDR[0] = *pData++; + 898: e4d45001 ldrb r5, [r4], #1 + 89c: e50350af str r5, [r3, #-175] ; 0xffffff51 + + do { + cpt = MIN(length, 8); + length -= cpt; + + while (cpt--) + 8a0: e24cc001 sub ip, ip, #1 + 8a4: e37c0001 cmn ip, #1 + 8a8: e59f30a4 ldr r3, [pc, #164] ; 954 + 8ac: 1afffff9 bne 898 + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 8b0: e513c0cf ldr ip, [r3, #-207] ; 0xffffff31 + 8b4: e31c0001 tst ip, #1 + + do { + cpt = MIN(length, 8); + length -= cpt; + + while (cpt--) + 8b8: e0800002 add r0, r0, r2 + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 8bc: 0a000006 beq 8dc + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 8c0: e513c0cf ldr ip, [r3, #-207] ; 0xffffff31 + 8c4: e3ccc001 bic ip, ip, #1 + 8c8: e503c0cf str ip, [r3, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 8cc: e59f3080 ldr r3, [pc, #128] ; 954 + 8d0: e51330cf ldr r3, [r3, #-207] ; 0xffffff31 + 8d4: e3130001 tst r3, #1 + 8d8: 1afffffb bne 8cc + } + + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 8dc: e59f3070 ldr r3, [pc, #112] ; 954 + 8e0: e513c0cf ldr ip, [r3, #-207] ; 0xffffff31 + 8e4: e38cc010 orr ip, ip, #16 + 8e8: e503c0cf str ip, [r3, #-207] ; 0xffffff31 + do { + csr = pUdp->UDP_CSR[0]; + 8ec: e59f3060 ldr r3, [pc, #96] ; 954 + 8f0: e513c0cf ldr ip, [r3, #-207] ; 0xffffff31 + 8f4: e58dc004 str ip, [sp, #4] + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + 8f8: e59dc004 ldr ip, [sp, #4] + 8fc: e31c0002 tst ip, #2 + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 900: 151320cf ldrne r2, [r3, #-207] ; 0xffffff31 + 904: 13c22002 bicne r2, r2, #2 + 908: 150320cf strne r2, [r3, #-207] ; 0xffffff31 + DEBUGE("stopped by status out "); + return; + 90c: 1a00000e bne 94c + } + } while (!(csr & AT91C_UDP_TXCOMP)); + 910: e59dc004 ldr ip, [sp, #4] + 914: e31c0001 tst ip, #1 + 918: 0afffff3 beq 8ec + + } while (length); + 91c: e0511002 subs r1, r1, r2 + 920: 1affffd6 bne 880 + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 924: e51320cf ldr r2, [r3, #-207] ; 0xffffff31 + 928: e3120001 tst r2, #1 + 92c: 0a000006 beq 94c + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 930: e51320cf ldr r2, [r3, #-207] ; 0xffffff31 + 934: e3c22001 bic r2, r2, #1 + 938: e50320cf str r2, [r3, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 93c: e59f3010 ldr r3, [pc, #16] ; 954 + 940: e51330cf ldr r3, [r3, #-207] ; 0xffffff31 + 944: e3130001 tst r3, #1 + 948: 1afffffb bne 93c + } +} + 94c: e8bd003c pop {r2, r3, r4, r5} + 950: e12fff1e bx lr + 954: fffb00ff .word 0xfffb00ff + +00000958 : + +/* Send zero length packet through the control endpoint */ +static void __dfufunc udp_ep0_send_zlp(void) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 958: e59f3038 ldr r3, [pc, #56] ; 998 + 95c: e51320cf ldr r2, [r3, #-207] ; 0xffffff31 + 960: e3822010 orr r2, r2, #16 + 964: e50320cf str r2, [r3, #-207] ; 0xffffff31 + while (!(pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP)) ; + 968: e51310cf ldr r1, [r3, #-207] ; 0xffffff31 + 96c: e3110001 tst r1, #1 + 970: e59f2020 ldr r2, [pc, #32] ; 998 + 974: 0afffffb beq 968 + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 978: e51230cf ldr r3, [r2, #-207] ; 0xffffff31 + 97c: e3c33001 bic r3, r3, #1 + 980: e50230cf str r3, [r2, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 984: e59f300c ldr r3, [pc, #12] ; 998 + 988: e51330cf ldr r3, [r3, #-207] ; 0xffffff31 + 98c: e3130001 tst r3, #1 + 990: 1afffffb bne 984 +} + 994: e12fff1e bx lr + 998: fffb00ff .word 0xfffb00ff + +0000099c : + +/* Stall the control endpoint */ +static void __dfufunc udp_ep0_send_stall(void) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + pUdp->UDP_CSR[0] |= AT91C_UDP_FORCESTALL; + 99c: e59f3038 ldr r3, [pc, #56] ; 9dc + 9a0: e51320cf ldr r2, [r3, #-207] ; 0xffffff31 + 9a4: e3822020 orr r2, r2, #32 + 9a8: e50320cf str r2, [r3, #-207] ; 0xffffff31 + while (!(pUdp->UDP_CSR[0] & AT91C_UDP_ISOERROR)) ; + 9ac: e51310cf ldr r1, [r3, #-207] ; 0xffffff31 + 9b0: e3110008 tst r1, #8 + 9b4: e59f2020 ldr r2, [pc, #32] ; 9dc + 9b8: 0afffffb beq 9ac + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR); + 9bc: e51230cf ldr r3, [r2, #-207] ; 0xffffff31 + 9c0: e3c33028 bic r3, r3, #40 ; 0x28 + 9c4: e50230cf str r3, [r2, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR)) ; + 9c8: e59f300c ldr r3, [pc, #12] ; 9dc + 9cc: e51330cf ldr r3, [r3, #-207] ; 0xffffff31 + 9d0: e3130028 tst r3, #40 ; 0x28 + 9d4: 1afffffb bne 9c8 +} + 9d8: e12fff1e bx lr + 9dc: fffb00ff .word 0xfffb00ff + +000009e0 : + + udp_ep0_send_data((char *)&dstat, sizeof(dstat)); +} + +static void __dfufunc handle_getstate(void) +{ + 9e0: e92d4007 push {r0, r1, r2, lr} + u_int8_t u8 = dfu_state; + 9e4: e59f3018 ldr r3, [pc, #24] ; a04 + 9e8: e5933000 ldr r3, [r3] + 9ec: e28d0008 add r0, sp, #8 + 9f0: e5603001 strb r3, [r0, #-1]! + DEBUGE("getstate "); + + udp_ep0_send_data((char *)&u8, sizeof(u8)); + 9f4: e3a01001 mov r1, #1 + 9f8: ebffff9f bl 87c +} + 9fc: e8bd400e pop {r1, r2, r3, lr} + a00: e12fff1e bx lr + a04: 00200020 .word 0x00200020 + +00000a08 : + +#define AT91C_IFLASH_END ((u_int8_t *)AT91C_IFLASH + AT91C_IFLASH_SIZE) +static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) +{ + DEBUGE("upload "); + if (len > AT91C_IFLASH_PAGE_SIZE) { + a08: e3500c01 cmp r0, #256 ; 0x100 + + return RET_ZLP; +} + +#define AT91C_IFLASH_END ((u_int8_t *)AT91C_IFLASH + AT91C_IFLASH_SIZE) +static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) + a0c: e92d4070 push {r4, r5, r6, lr} + a10: e1a04000 mov r4, r0 +{ + DEBUGE("upload "); + if (len > AT91C_IFLASH_PAGE_SIZE) { + a14: 9a000007 bls a38 + /* Too big */ + dfu_state = DFU_STATE_dfuERROR; + a18: e59f3054 ldr r3, [pc, #84] ; a74 + a1c: e3a0200a mov r2, #10 + a20: e5832000 str r2, [r3] + dfu_status = DFU_STATUS_errADDRESS; + a24: e3a02008 mov r2, #8 + a28: e5c32004 strb r2, [r3, #4] + udp_ep0_send_stall(); + a2c: ebffffda bl 99c + return -EINVAL; + a30: e3e00015 mvn r0, #21 + a34: ea00000c b a6c + } + + if (ptr + len > AT91C_IFLASH_END) + a38: e59f6038 ldr r6, [pc, #56] ; a78 + a3c: e5965000 ldr r5, [r6] + a40: e0853000 add r3, r5, r0 + a44: e3530812 cmp r3, #1179648 ; 0x120000 + len = AT91C_IFLASH_END - (u_int8_t *)ptr; + a48: 82654000 rsbhi r4, r5, #0 + a4c: 81a04804 lslhi r4, r4, #16 + a50: 81a04824 lsrhi r4, r4, #16 + + udp_ep0_send_data((char *)ptr, len); + a54: e1a00005 mov r0, r5 + a58: e1a01004 mov r1, r4 + ptr+= len; + a5c: e0855004 add r5, r5, r4 + } + + if (ptr + len > AT91C_IFLASH_END) + len = AT91C_IFLASH_END - (u_int8_t *)ptr; + + udp_ep0_send_data((char *)ptr, len); + a60: ebffff85 bl 87c + ptr+= len; + a64: e5865000 str r5, [r6] + + return len; + a68: e1a00004 mov r0, r4 +} + a6c: e8bd4070 pop {r4, r5, r6, lr} + a70: e12fff1e bx lr + a74: 00200020 .word 0x00200020 + a78: 00201adc .word 0x00201adc + +00000a7c : +__dfudata u_int32_t dfu_state = DFU_STATE_appIDLE; +static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + +static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) +{ + volatile u_int32_t *p = (volatile u_int32_t *)ptr; + a7c: e59f3134 ldr r3, [pc, #308] ; bb8 + u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + int i; + + DEBUGE("download "); + + if (len > AT91C_IFLASH_PAGE_SIZE) { + a80: e3500c01 cmp r0, #256 ; 0x100 +static u_int8_t *ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; +static __dfudata u_int8_t dfu_status; +__dfudata u_int32_t dfu_state = DFU_STATE_appIDLE; +static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + +static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) + a84: e92d41f3 push {r0, r1, r4, r5, r6, r7, r8, lr} +{ + volatile u_int32_t *p = (volatile u_int32_t *)ptr; + a88: e5934000 ldr r4, [r3] + u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + int i; + + DEBUGE("download "); + + if (len > AT91C_IFLASH_PAGE_SIZE) { + a8c: 8a00000d bhi ac8 + DEBUGP("length exceeds flash page size "); + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + return RET_STALL; + } + if (len & 0x3) { + a90: e2103003 ands r3, r0, #3 + a94: 1a00000b bne ac8 + DEBUGP("not four-byte-aligned length "); + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + return RET_STALL; + } + if (len == 0) { + a98: e3500000 cmp r0, #0 + a9c: 1a000005 bne ab8 + DEBUGP("zero-size write -> MANIFEST_SYNC "); + flash_page(p); + aa0: e1a00004 mov r0, r4 + aa4: eb00028f bl 14e8 + dfu_state = DFU_STATE_dfuMANIFEST_SYNC; + aa8: e59f310c ldr r3, [pc, #268] ; bbc + aac: e3a02006 mov r2, #6 + ab0: e5832000 str r2, [r3] + ab4: ea00003c b bac + return RET_ZLP; + } + if (ptr + len >= (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE ) { + ab8: e59f2100 ldr r2, [pc, #256] ; bc0 + abc: e0841000 add r1, r4, r0 + ac0: e1510002 cmp r1, r2 + ac4: 9a000006 bls ae4 + DEBUGP("end of write exceeds flash end "); + dfu_state = DFU_STATE_dfuERROR; + ac8: e59f30ec ldr r3, [pc, #236] ; bbc + acc: e3a0200a mov r2, #10 + ad0: e5832000 str r2, [r3] + dfu_status = DFU_STATUS_errADDRESS; + ad4: e3a02008 mov r2, #8 + ad8: e5c32004 strb r2, [r3, #4] + return RET_STALL; + adc: e3a00002 mov r0, #2 + ae0: ea000032 b bb0 +static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + +static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) +{ + volatile u_int32_t *p = (volatile u_int32_t *)ptr; + u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + ae4: e59f10d8 ldr r1, [pc, #216] ; bc4 + + do { + /* FIXME: do we need to check whether we've been interrupted + * by a RX SETUP stage? */ + do { + csr = pUdp->UDP_CSR[0]; + ae8: e59f20d8 ldr r2, [pc, #216] ; bc8 + aec: e512c0cf ldr ip, [r2, #-207] ; 0xffffff31 + af0: e58dc004 str ip, [sp, #4] + DEBUGR("CSR=%08x ", csr); + } while (!(csr & AT91C_UDP_RX_DATA_BK0)) ; + af4: e59dc004 ldr ip, [sp, #4] + af8: e31c0002 tst ip, #2 + afc: 0afffff9 beq ae8 + + num_rcv = pUdp->UDP_CSR[0] >> 16; + b00: e51250cf ldr r5, [r2, #-207] ; 0xffffff31 + b04: e1a05825 lsr r5, r5, #16 + + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + b08: e0832005 add r2, r3, r5 + b0c: e1520000 cmp r2, r0 + num_rcv = num_rcv_total - len; + b10: 80605003 rsbhi r5, r0, r3 + b14: 81a05805 lslhi r5, r5, #16 + b18: 81a05825 lsrhi r5, r5, #16 +static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + +static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) +{ + volatile u_int32_t *p = (volatile u_int32_t *)ptr; + u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + b1c: e1a06001 mov r6, r1 + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + b20: e3a02000 mov r2, #0 + b24: ea000004 b b3c + *data++ = pUdp->UDP_FDR[0]; + b28: e51cc0af ldr ip, [ip, #-175] ; 0xffffff51 + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + b2c: e2822001 add r2, r2, #1 + b30: e1a02802 lsl r2, r2, #16 + *data++ = pUdp->UDP_FDR[0]; + b34: e4c6c001 strb ip, [r6], #1 + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + b38: e1a02822 lsr r2, r2, #16 + b3c: e1520005 cmp r2, r5 + b40: e59fc080 ldr ip, [pc, #128] ; bc8 + b44: 1afffff7 bne b28 + *data++ = pUdp->UDP_FDR[0]; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + b48: e51c50cf ldr r5, [ip, #-207] ; 0xffffff31 + + num_rcv_total += num_rcv; + + /* we need to continue to pull data until we either receive + * a packet < endpoint size or == 0 */ + } while (num_rcv == 8 && num_rcv_total < len); + b4c: e3520008 cmp r2, #8 + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + *data++ = pUdp->UDP_FDR[0]; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + b50: e3c55002 bic r5, r5, #2 + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + b54: e0811002 add r1, r1, r2 + *data++ = pUdp->UDP_FDR[0]; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + b58: e50c50cf str r5, [ip, #-207] ; 0xffffff31 + + num_rcv_total += num_rcv; + + /* we need to continue to pull data until we either receive + * a packet < endpoint size or == 0 */ + } while (num_rcv == 8 && num_rcv_total < len); + b5c: 1a000002 bne b6c + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + *data++ = pUdp->UDP_FDR[0]; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + + num_rcv_total += num_rcv; + b60: e2833008 add r3, r3, #8 + + /* we need to continue to pull data until we either receive + * a packet < endpoint size or == 0 */ + } while (num_rcv == 8 && num_rcv_total < len); + b64: e1530000 cmp r3, r0 + b68: 3affffde bcc ae8 + + /* we can only access the write buffer with correctly aligned + * 32bit writes ! */ +#ifndef DEBUG_DFU_NOFLASH + DEBUGP("copying "); + for (i = 0; i < len/4; i++) { + b6c: e1a07120 lsr r7, r0, #2 + b70: e59f8054 ldr r8, [pc, #84] ; bcc + b74: e1a05004 mov r5, r4 + b78: e3a06000 mov r6, #0 + b7c: ea000005 b b98 + *p++ = pagebuf32[i]; + b80: e5b83004 ldr r3, [r8, #4]! + b84: e4853004 str r3, [r5], #4 + /* If we have filled a page buffer, flash it */ + if (((unsigned long)p % AT91C_IFLASH_PAGE_SIZE) == 0) { + b88: e31500ff tst r5, #255 ; 0xff + DEBUGP("page_full "); + flash_page(p-1); + b8c: 02450004 subeq r0, r5, #4 + b90: 0b000254 bleq 14e8 + + /* we can only access the write buffer with correctly aligned + * 32bit writes ! */ +#ifndef DEBUG_DFU_NOFLASH + DEBUGP("copying "); + for (i = 0; i < len/4; i++) { + b94: e2866001 add r6, r6, #1 + b98: e1560007 cmp r6, r7 + b9c: bafffff7 blt b80 + if (((unsigned long)p % AT91C_IFLASH_PAGE_SIZE) == 0) { + DEBUGP("page_full "); + flash_page(p-1); + } + } + ptr = (u_int8_t *) p; + ba0: e59f3010 ldr r3, [pc, #16] ; bb8 + ba4: e0844107 add r4, r4, r7, lsl #2 + ba8: e5834000 str r4, [r3] +#endif + + return RET_ZLP; + bac: e3a00001 mov r0, #1 +} + bb0: e8bd41fc pop {r2, r3, r4, r5, r6, r7, r8, lr} + bb4: e12fff1e bx lr + bb8: 00201adc .word 0x00201adc + bbc: 00200020 .word 0x00200020 + bc0: 0011feff .word 0x0011feff + bc4: 00201ae4 .word 0x00201ae4 + bc8: fffb00ff .word 0xfffb00ff + bcc: 00201ae0 .word 0x00201ae0 + +00000bd0 : +//* \brief Return MC EFC Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_GetStatus( + AT91PS_MC pMC) // pointer to a MC controller +{ + return pMC->MC_FSR; + bd0: e3e03000 mvn r3, #0 + + return len; +} + +static __dfufunc void handle_getstatus(void) +{ + bd4: e92d4007 push {r0, r1, r2, lr} + bd8: e5132097 ldr r2, [r3, #-151] ; 0xffffff69 + struct dfu_status dstat; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + + DEBUGE("getstatus(fsr=0x%08x) ", fsr); + + switch (dfu_state) { + bdc: e59f308c ldr r3, [pc, #140] ; c70 + be0: e5931000 ldr r1, [r3] + be4: e3510003 cmp r1, #3 + be8: 3a000014 bcc c40 + bec: e3510004 cmp r1, #4 + bf0: 9a000002 bls c00 + bf4: e3510006 cmp r1, #6 + bf8: 1a000010 bne c40 + bfc: ea00000d b c38 + case DFU_STATE_dfuDNLOAD_SYNC: + case DFU_STATE_dfuDNBUSY: + if (fsr & AT91C_MC_PROGE) { + c00: e3120008 tst r2, #8 + DEBUGE("errPROG "); + dfu_status = DFU_STATUS_errPROG; + c04: 13a02006 movne r2, #6 + c08: 15c32004 strbne r2, [r3, #4] + dfu_state = DFU_STATE_dfuERROR; + c0c: 12822004 addne r2, r2, #4 + DEBUGE("getstatus(fsr=0x%08x) ", fsr); + + switch (dfu_state) { + case DFU_STATE_dfuDNLOAD_SYNC: + case DFU_STATE_dfuDNBUSY: + if (fsr & AT91C_MC_PROGE) { + c10: 1a000009 bne c3c + DEBUGE("errPROG "); + dfu_status = DFU_STATUS_errPROG; + dfu_state = DFU_STATE_dfuERROR; + } else if (fsr & AT91C_MC_LOCKE) { + c14: e3120004 tst r2, #4 + DEBUGE("errWRITE "); + dfu_status = DFU_STATUS_errWRITE; + c18: 13a02003 movne r2, #3 + c1c: 15c32004 strbne r2, [r3, #4] + dfu_state = DFU_STATE_dfuERROR; + c20: 12822007 addne r2, r2, #7 + case DFU_STATE_dfuDNBUSY: + if (fsr & AT91C_MC_PROGE) { + DEBUGE("errPROG "); + dfu_status = DFU_STATUS_errPROG; + dfu_state = DFU_STATE_dfuERROR; + } else if (fsr & AT91C_MC_LOCKE) { + c24: 1a000004 bne c3c + DEBUGE("errWRITE "); + dfu_status = DFU_STATUS_errWRITE; + dfu_state = DFU_STATE_dfuERROR; + } else if (fsr & AT91C_MC_FRDY) { + c28: e3120001 tst r2, #1 + DEBUGE("DNLOAD_IDLE "); + dfu_state = DFU_STATE_dfuDNLOAD_IDLE; + c2c: 13a02005 movne r2, #5 + } else { + DEBUGE("DNBUSY "); + dfu_state = DFU_STATE_dfuDNBUSY; + c30: 03a02004 moveq r2, #4 + c34: ea000000 b c3c + } + break; + case DFU_STATE_dfuMANIFEST_SYNC: + dfu_state = DFU_STATE_dfuMANIFEST; + c38: e3a02007 mov r2, #7 + c3c: e5832000 str r2, [r3] + break; + } + + /* send status response */ + dstat.bStatus = dfu_status; + c40: e59f3028 ldr r3, [pc, #40] ; c70 + c44: e5d32004 ldrb r2, [r3, #4] + dstat.bState = dfu_state; + c48: e5933000 ldr r3, [r3] + dstat.iString = 0; + /* FIXME: set dstat.bwPollTimeout */ + + udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + c4c: e1a0000d mov r0, sp + break; + } + + /* send status response */ + dstat.bStatus = dfu_status; + dstat.bState = dfu_state; + c50: e5cd3004 strb r3, [sp, #4] + dstat.iString = 0; + /* FIXME: set dstat.bwPollTimeout */ + + udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + c54: e3a01006 mov r1, #6 + } + + /* send status response */ + dstat.bStatus = dfu_status; + dstat.bState = dfu_state; + dstat.iString = 0; + c58: e3a03000 mov r3, #0 + dfu_state = DFU_STATE_dfuMANIFEST; + break; + } + + /* send status response */ + dstat.bStatus = dfu_status; + c5c: e5cd2000 strb r2, [sp] + dstat.bState = dfu_state; + dstat.iString = 0; + c60: e5cd3005 strb r3, [sp, #5] + /* FIXME: set dstat.bwPollTimeout */ + + udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + c64: ebffff04 bl 87c +} + c68: e8bd400e pop {r1, r2, r3, lr} + c6c: e12fff1e bx lr + c70: 00200020 .word 0x00200020 + +00000c74 : +} + +/* callback function for DFU requests */ +int __dfufunc dfu_ep0_handler(u_int8_t req_type, u_int8_t req, + u_int16_t val, u_int16_t len) +{ + c74: e92d4010 push {r4, lr} + c78: e1a04003 mov r4, r3 + int rc, ret = RET_NOTHING; + + DEBUGE("old_state = %u ", dfu_state); + + switch (dfu_state) { + c7c: e59f3204 ldr r3, [pc, #516] ; e88 + c80: e5932000 ldr r2, [r3] + c84: e352000a cmp r2, #10 + c88: 979ff102 ldrls pc, [pc, r2, lsl #2] + c8c: ea00007a b e7c + c90: 00000cbc .word 0x00000cbc + c94: 00000cdc .word 0x00000cdc + c98: 00000cf4 .word 0x00000cf4 + c9c: 00000d9c .word 0x00000d9c + ca0: 00000e2c .word 0x00000e2c + ca4: 00000d58 .word 0x00000d58 + ca8: 00000d9c .word 0x00000d9c + cac: 00000da8 .word 0x00000da8 + cb0: 00000e7c .word 0x00000e7c + cb4: 00000dc8 .word 0x00000dc8 + cb8: 00000e1c .word 0x00000e1c + case DFU_STATE_appIDLE: + switch (req) { + cbc: e3510003 cmp r1, #3 + cc0: 0a00005b beq e34 + cc4: e3510005 cmp r1, #5 + cc8: 0a00005b beq e3c + ccc: e3510000 cmp r1, #0 + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + case USB_REQ_DFU_DETACH: + dfu_state = DFU_STATE_appDETACH; + cd0: 03a02001 moveq r2, #1 + + DEBUGE("old_state = %u ", dfu_state); + + switch (dfu_state) { + case DFU_STATE_appIDLE: + switch (req) { + cd4: 0a00004e beq e14 + cd8: ea000066 b e78 + default: + ret = RET_STALL; + } + break; + case DFU_STATE_appDETACH: + switch (req) { + cdc: e3510003 cmp r1, #3 + ce0: 0a000053 beq e34 + ce4: e3510005 cmp r1, #5 + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_appIDLE; + ce8: 13a02000 movne r2, #0 + default: + ret = RET_STALL; + } + break; + case DFU_STATE_appDETACH: + switch (req) { + cec: 1a00005a bne e5c + cf0: ea000051 b e3c + break; + } + /* FIXME: implement timer to return to appIDLE */ + break; + case DFU_STATE_dfuIDLE: + switch (req) { + cf4: e2411001 sub r1, r1, #1 + cf8: e3510005 cmp r1, #5 + cfc: 979ff101 ldrls pc, [pc, r1, lsl #2] + d00: ea000054 b e58 + d04: 00000d1c .word 0x00000d1c + d08: 00000d38 .word 0x00000d38 + d0c: 00000e34 .word 0x00000e34 + d10: 00000e58 .word 0x00000e58 + d14: 00000e3c .word 0x00000e3c + d18: 00000e70 .word 0x00000e70 + case USB_REQ_DFU_DNLOAD: + if (len == 0) { + d1c: e3540000 cmp r4, #0 + d20: 0a00004c beq e58 + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + goto out; + } + dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + d24: e3a02003 mov r2, #3 + d28: e5832000 str r2, [r3] + ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + d2c: e3a02941 mov r2, #1064960 ; 0x104000 + d30: e59f3154 ldr r3, [pc, #340] ; e8c + d34: ea000012 b d84 + ret = handle_dnload(val, len); + break; + case USB_REQ_DFU_UPLOAD: + ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + d38: e59f214c ldr r2, [pc, #332] ; e8c + d3c: e3a01941 mov r1, #1064960 ; 0x104000 + d40: e5821000 str r1, [r2] + dfu_state = DFU_STATE_dfuUPLOAD_IDLE; + d44: e3a02009 mov r2, #9 + d48: e5832000 str r2, [r3] + handle_upload(val, len); + d4c: e1a00004 mov r0, r4 + d50: ebffff2c bl a08 + break; + d54: ea000048 b e7c + ret = RET_STALL; + goto out; + } + break; + case DFU_STATE_dfuDNLOAD_IDLE: + switch (req) { + d58: e2411001 sub r1, r1, #1 + d5c: e3510005 cmp r1, #5 + d60: 979ff101 ldrls pc, [pc, r1, lsl #2] + d64: ea00003b b e58 + d68: 00000d80 .word 0x00000d80 + d6c: 00000e58 .word 0x00000e58 + d70: 00000e34 .word 0x00000e34 + d74: 00000e58 .word 0x00000e58 + d78: 00000e3c .word 0x00000e3c + d7c: 00000e10 .word 0x00000e10 + case USB_REQ_DFU_DNLOAD: + dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + d80: e3a02003 mov r2, #3 + d84: e5832000 str r2, [r3] + ret = handle_dnload(val, len); + d88: e1a00004 mov r0, r4 + d8c: ebffff3a bl a7c + } + +out: + DEBUGE("new_state = %u\r\n", dfu_state); + + switch (ret) { + d90: e3500001 cmp r0, #1 + d94: 1a000032 bne e64 + d98: ea000034 b e70 + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuMANIFEST_SYNC: + switch (req) { + d9c: e3510003 cmp r1, #3 + da0: 1a000002 bne db0 + da4: ea000022 b e34 + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuMANIFEST: + switch (req) { + da8: e3510003 cmp r1, #3 + dac: 0a000002 beq dbc + db0: e3510005 cmp r1, #5 + db4: 1a000027 bne e58 + db8: ea00001f b e3c + case USB_REQ_DFU_GETSTATUS: + dfu_state = DFU_STATE_dfuIDLE; + dbc: e3a02002 mov r2, #2 + dc0: e5832000 str r2, [r3] + dc4: ea00001a b e34 + break; + case DFU_STATE_dfuMANIFEST_WAIT_RST: + /* we should never go here */ + break; + case DFU_STATE_dfuUPLOAD_IDLE: + switch (req) { + dc8: e2411002 sub r1, r1, #2 + dcc: e3510004 cmp r1, #4 + dd0: 979ff101 ldrls pc, [pc, r1, lsl #2] + dd4: ea00001f b e58 + dd8: 00000dec .word 0x00000dec + ddc: 00000e34 .word 0x00000e34 + de0: 00000e58 .word 0x00000e58 + de4: 00000e3c .word 0x00000e3c + de8: 00000e10 .word 0x00000e10 + case USB_REQ_DFU_UPLOAD: + /* state transition if less data then requested */ + rc = handle_upload(val, len); + dec: e1a00004 mov r0, r4 + df0: ebffff04 bl a08 + if (rc >= 0 && rc < len) + df4: e3500000 cmp r0, #0 + df8: ba00001f blt e7c + dfc: e1500004 cmp r0, r4 + dfu_state = DFU_STATE_dfuIDLE; + e00: b59f3080 ldrlt r3, [pc, #128] ; e88 + e04: b3a02002 movlt r2, #2 + e08: b5832000 strlt r2, [r3] + e0c: ea00001a b e7c + break; + case USB_REQ_DFU_ABORT: + dfu_state = DFU_STATE_dfuIDLE; + e10: e3a02002 mov r2, #2 + e14: e5832000 str r2, [r3] + /* no zlp? */ + ret = RET_ZLP; + break; + e18: ea000014 b e70 + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuERROR: + switch (req) { + e1c: e3510004 cmp r1, #4 + e20: 0a000007 beq e44 + e24: e3510005 cmp r1, #5 + e28: 0a000003 beq e3c + e2c: e3510003 cmp r1, #3 + e30: 1a000008 bne e58 + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + e34: ebffff65 bl bd0 + break; + e38: ea00000f b e7c + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + e3c: ebfffee7 bl 9e0 + break; + e40: ea00000d b e7c + case USB_REQ_DFU_CLRSTATUS: + dfu_state = DFU_STATE_dfuIDLE; + e44: e3a02002 mov r2, #2 + e48: e5832000 str r2, [r3] + dfu_status = DFU_STATUS_OK; + e4c: e3a02000 mov r2, #0 + e50: e5c32004 strb r2, [r3, #4] + e54: ea000005 b e70 + /* no zlp? */ + ret = RET_ZLP; + break; + default: + dfu_state = DFU_STATE_dfuERROR; + e58: e3a0200a mov r2, #10 + e5c: e5832000 str r2, [r3] + e60: ea000004 b e78 + } + +out: + DEBUGE("new_state = %u\r\n", dfu_state); + + switch (ret) { + e64: e3500002 cmp r0, #2 + e68: 1a000003 bne e7c + e6c: ea000001 b e78 + case RET_NOTHING: + break; + case RET_ZLP: + udp_ep0_send_zlp(); + e70: ebfffeb8 bl 958 + break; + e74: ea000000 b e7c + case RET_STALL: + udp_ep0_send_stall(); + e78: ebfffec7 bl 99c + break; + } + return 0; +} + e7c: e3a00000 mov r0, #0 + e80: e8bd4010 pop {r4, lr} + e84: e12fff1e bx lr + e88: 00200020 .word 0x00200020 + e8c: 00201adc .word 0x00201adc + +00000e90 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + e90: e3e03c0b mvn r3, #2816 ; 0xb00 + e94: e50300ff str r0, [r3, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + e98: e50300ef str r0, [r3, #-239] ; 0xffffff11 +} + e9c: e12fff1e bx lr + +00000ea0 : +#define led2off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) + +static void __dfufunc udp_init(void) +{ + /* Set the PLL USB Divider */ + AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + ea0: e3e03c03 mvn r3, #768 ; 0x300 + ea4: e51320d3 ldr r2, [r3, #-211] ; 0xffffff2d + ea8: e3822201 orr r2, r2, #268435456 ; 0x10000000 + +#define led2on() AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) +#define led2off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) + +static void __dfufunc udp_init(void) +{ + eac: e92d4010 push {r4, lr} + /* Set the PLL USB Divider */ + AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + eb0: e50320d3 str r2, [r3, #-211] ; 0xffffff2d + + /* Enables the 48MHz USB clock UDPCK and System Peripheral USB Clock */ + AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP; + eb4: e3a02080 mov r2, #128 ; 0x80 + eb8: e50320ff str r2, [r3, #-255] ; 0xffffff01 + AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_UDP); + ebc: e2822d1e add r2, r2, #1920 ; 0x780 + ec0: e50320ef str r2, [r3, #-239] ; 0xffffff11 + + /* Enable UDP PullUp (USB_DP_PUP) : enable & Clear of the + * corresponding PIO Set in PIO mode and Configure in Output */ +#if defined(PCD) + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + ec4: e3a00501 mov r0, #4194304 ; 0x400000 + ec8: ebfffff0 bl e90 +#endif + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + ecc: e3a00801 mov r0, #65536 ; 0x10000 +} + ed0: e8bd4010 pop {r4, lr} + /* Enable UDP PullUp (USB_DP_PUP) : enable & Clear of the + * corresponding PIO Set in PIO mode and Configure in Output */ +#if defined(PCD) + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + ed4: eaffffed b e90 + +00000ed8 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + ed8: e3e03c0b mvn r3, #2816 ; 0xb00 + edc: e50300cf str r0, [r3, #-207] ; 0xffffff31 +} + ee0: e12fff1e bx lr + +00000ee4 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + ee4: e3e03c0b mvn r3, #2816 ; 0xb00 + ee8: e50300cb str r0, [r3, #-203] ; 0xffffff35 +} + eec: e12fff1e bx lr + +00000ef0 : +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSoftReset( + AT91PS_RSTC pRSTC, + unsigned int reset) +{ + pRSTC->RSTC_RCR = (0xA5000000 | reset); + ef0: e59f2008 ldr r2, [pc, #8] ; f00 + ef4: e3e03c02 mvn r3, #512 ; 0x200 + ef8: e50320ff str r2, [r3, #-255] ; 0xffffff01 +} + efc: e12fff1e bx lr + f00: a500000d .word 0xa500000d + +00000f04 : + DEBUGE("\r\n"); +} + +/* minimal USB IRQ handler in DFU mode */ +static __dfufunc void dfu_udp_irq(void) +{ + f04: e92d4037 push {r0, r1, r2, r4, r5, lr} + AT91PS_UDP pUDP = AT91C_BASE_UDP; + AT91_REG isr = pUDP->UDP_ISR; + f08: e59f4384 ldr r4, [pc, #900] ; 1294 + f0c: e51430e3 ldr r3, [r4, #-227] ; 0xffffff1d + led1on(); + f10: e3a00402 mov r0, #33554432 ; 0x2000000 + +/* minimal USB IRQ handler in DFU mode */ +static __dfufunc void dfu_udp_irq(void) +{ + AT91PS_UDP pUDP = AT91C_BASE_UDP; + AT91_REG isr = pUDP->UDP_ISR; + f14: e58d3000 str r3, [sp] + led1on(); + f18: ebfffff1 bl ee4 + + if (isr & AT91C_UDP_ENDBUSRES) { + f1c: e59d3000 ldr r3, [sp] + f20: e3130a01 tst r3, #4096 ; 0x1000 + f24: 0a000012 beq f74 + led2on(); + f28: e3a00301 mov r0, #67108864 ; 0x4000000 + f2c: ebffffec bl ee4 + pUDP->UDP_IER = AT91C_UDP_EPINT0; + f30: e3a03001 mov r3, #1 + f34: e50430ef str r3, [r4, #-239] ; 0xffffff11 + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + f38: e3e03000 mvn r3, #0 + f3c: e50430d7 str r3, [r4, #-215] ; 0xffffff29 + pUDP->UDP_RSTEP = 0; + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + f40: e3a02c01 mov r2, #256 ; 0x100 + if (isr & AT91C_UDP_ENDBUSRES) { + led2on(); + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + f44: e2833001 add r3, r3, #1 + f48: e50430d7 str r3, [r4, #-215] ; 0xffffff29 + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + f4c: e50420f7 str r2, [r4, #-247] ; 0xffffff09 + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + f50: e2822c7f add r2, r2, #32512 ; 0x7f00 + f54: e50420cf str r2, [r4, #-207] ; 0xffffff31 + cur_config = 0; + f58: e59f2338 ldr r2, [pc, #824] ; 1298 + f5c: e5c23100 strb r3, [r2, #256] ; 0x100 + + if (dfu_state == DFU_STATE_dfuMANIFEST_WAIT_RST || + f60: e59f3334 ldr r3, [pc, #820] ; 129c + f64: e5933000 ldr r3, [r3] + f68: e2433007 sub r3, r3, #7 + f6c: e3530001 cmp r3, #1 + dfu_state == DFU_STATE_dfuMANIFEST) { + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + f70: 9bffffde blls ef0 + AT91C_RSTC_EXTRST); + } + + } + + if (isr & AT91C_UDP_EPINT0) + f74: e59d3000 ldr r3, [sp] + f78: e3130001 tst r3, #1 + f7c: 0a0000ba beq 126c +static __dfufunc void dfu_udp_ep0_handler(void) +{ + AT91PS_UDP pUDP = AT91C_BASE_UDP; + u_int8_t bmRequestType, bRequest; + u_int16_t wValue, wIndex, wLength, wStatus; + u_int32_t csr = pUDP->UDP_CSR[0]; + f80: e59f230c ldr r2, [pc, #780] ; 1294 + f84: e51230cf ldr r3, [r2, #-207] ; 0xffffff31 + + DEBUGE("CSR=0x%04x ", csr); + + if (csr & AT91C_UDP_STALLSENT) { + f88: e3130008 tst r3, #8 + DEBUGE("ACK_STALLSENT "); + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + f8c: 13e01008 mvnne r1, #8 + f90: 150210cf strne r1, [r2, #-207] ; 0xffffff31 + } + + if (csr & AT91C_UDP_RX_DATA_BK0) { + f94: e3130002 tst r3, #2 + DEBUGE("ACK_BANK0 "); + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + f98: 151210cf ldrne r1, [r2, #-207] ; 0xffffff31 + f9c: 13c11002 bicne r1, r1, #2 + fa0: 150210cf strne r1, [r2, #-207] ; 0xffffff31 + } + + if (!(csr & AT91C_UDP_RXSETUP)) { + fa4: e3130004 tst r3, #4 + fa8: 0a0000af beq 126c + DEBUGE("no setup packet\r\n"); + return; + } + + DEBUGE("len=%d ", csr >> 16); + if (csr >> 16 == 0) { + fac: e1b03823 lsrs r3, r3, #16 + fb0: 0a0000ad beq 126c + DEBUGE("empty packet\r\n"); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + fb4: e59f22d8 ldr r2, [pc, #728] ; 1294 + fb8: e51200af ldr r0, [r2, #-175] ; 0xffffff51 + bRequest = pUDP->UDP_FDR[0]; + fbc: e51210af ldr r1, [r2, #-175] ; 0xffffff51 + wValue = (pUDP->UDP_FDR[0] & 0xFF); + fc0: e51240af ldr r4, [r2, #-175] ; 0xffffff51 + wValue |= (pUDP->UDP_FDR[0] << 8); + fc4: e51230af ldr r3, [r2, #-175] ; 0xffffff51 + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + fc8: e20440ff and r4, r4, #255 ; 0xff + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + fcc: e512e0af ldr lr, [r2, #-175] ; 0xffffff51 + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + fd0: e1844403 orr r4, r4, r3, lsl #8 + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + fd4: e51230af ldr r3, [r2, #-175] ; 0xffffff51 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + fd8: e51230af ldr r3, [r2, #-175] ; 0xffffff51 + wLength |= (pUDP->UDP_FDR[0] << 8); + fdc: e512c0af ldr ip, [r2, #-175] ; 0xffffff51 + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + fe0: e20330ff and r3, r3, #255 ; 0xff + if (csr >> 16 == 0) { + DEBUGE("empty packet\r\n"); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + fe4: e20000ff and r0, r0, #255 ; 0xff + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + fe8: e183340c orr r3, r3, ip, lsl #8 + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + fec: e1a04804 lsl r4, r4, #16 + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + ff0: e1a03803 lsl r3, r3, #16 + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + ff4: e3100080 tst r0, #128 ; 0x80 + DEBUGE("empty packet\r\n"); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + ff8: e20110ff and r1, r1, #255 ; 0xff + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + ffc: e1a04824 lsr r4, r4, #16 + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + 1000: e1a03823 lsr r3, r3, #16 + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + 1004: 0a000005 beq 1020 + DEBUGE("DATA_IN=1 "); + pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 1008: e512c0cf ldr ip, [r2, #-207] ; 0xffffff31 + 100c: e38cc080 orr ip, ip, #128 ; 0x80 + 1010: e502c0cf str ip, [r2, #-207] ; 0xffffff31 + while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 1014: e512c0cf ldr ip, [r2, #-207] ; 0xffffff31 + 1018: e31c0080 tst ip, #128 ; 0x80 + 101c: 0afffffc beq 1014 + } + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + 1020: e59f226c ldr r2, [pc, #620] ; 1294 + 1024: e512c0cf ldr ip, [r2, #-207] ; 0xffffff31 + 1028: e3ccc004 bic ip, ip, #4 + 102c: e502c0cf str ip, [r2, #-207] ; 0xffffff31 + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + 1030: e512c0cf ldr ip, [r2, #-207] ; 0xffffff31 + 1034: e21cc004 ands ip, ip, #4 + 1038: e59f5254 ldr r5, [pc, #596] ; 1294 + 103c: 1afffffb bne 1030 + + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + 1040: e1802401 orr r2, r0, r1, lsl #8 + 1044: e3520c03 cmp r2, #768 ; 0x300 + 1048: 0a000086 beq 1268 + 104c: ca000010 bgt 1094 + 1050: e3520082 cmp r2, #130 ; 0x82 + 1054: 0a000065 beq 11f0 + 1058: ca000004 bgt 1070 + 105c: e3520080 cmp r2, #128 ; 0x80 + 1060: 0a00005f beq 11e4 + 1064: e3520081 cmp r2, #129 ; 0x81 + 1068: 1a000078 bne 1250 + 106c: ea00005c b 11e4 + 1070: e59fc228 ldr ip, [pc, #552] ; 12a0 + 1074: e152000c cmp r2, ip + 1078: 0a000072 beq 1248 + 107c: e28cc001 add ip, ip, #1 + 1080: e152000c cmp r2, ip + 1084: 0a000077 beq 1268 + 1088: e3520c01 cmp r2, #256 ; 0x100 + 108c: 1a00006f bne 1250 + 1090: ea000074 b 1268 + 1094: e3520d1a cmp r2, #1664 ; 0x680 + 1098: 0a00000f beq 10dc + 109c: ca000006 bgt 10bc + 10a0: e59fc1fc ldr ip, [pc, #508] ; 12a4 + 10a4: e152000c cmp r2, ip + 10a8: 0a00006e beq 1268 + 10ac: ba000065 blt 1248 + 10b0: e3520c05 cmp r2, #1280 ; 0x500 + 10b4: 1a000065 bne 1250 + 10b8: ea00002d b 1174 + 10bc: e3520c09 cmp r2, #2304 ; 0x900 + 10c0: 0a000032 beq 1190 + 10c4: e59fc1dc ldr ip, [pc, #476] ; 12a8 + 10c8: e152000c cmp r2, ip + 10cc: 0a00005d beq 1248 + 10d0: e3520d22 cmp r2, #2176 ; 0x880 + 10d4: 1a00005d bne 1250 + 10d8: ea00003e b 11d8 + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR "); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + switch (desc_type) { + 10dc: e1a02424 lsr r2, r4, #8 + 10e0: e3520002 cmp r2, #2 + 10e4: 0a00000d beq 1120 + 10e8: 8a000002 bhi 10f8 + 10ec: e3520001 cmp r2, #1 + 10f0: 1a00005c bne 1268 + 10f4: ea000004 b 110c + 10f8: e3520003 cmp r2, #3 + 10fc: 0a00000d beq 1138 + 1100: e3520021 cmp r2, #33 ; 0x21 + 1104: 1a000057 bne 1268 + 1108: ea000014 b 1160 + case USB_DT_DEVICE: + /* Return Device Descriptor */ + udp_ep0_send_data((const char *) + 110c: e59f0198 ldr r0, [pc, #408] ; 12ac + 1110: e3530012 cmp r3, #18 + 1114: 31a01003 movcc r1, r3 + 1118: 23a01012 movcs r1, #18 + 111c: ea000003 b 1130 + MIN(sizeof(dfu_dev_descriptor), + wLength)); + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ + udp_ep0_send_data((const char *) + 1120: e59f0188 ldr r0, [pc, #392] ; 12b0 + 1124: e3530024 cmp r3, #36 ; 0x24 + 1128: 31a01003 movcc r1, r3 + 112c: 23a01024 movcs r1, #36 ; 0x24 + 1130: ebfffdd1 bl 87c + 1134: ea00004c b 126c + switch ((bRequest << 8) | bmRequestType) { + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR "); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + 1138: e20440ff and r4, r4, #255 ; 0xff + MIN(sizeof(dfu_cfg_descriptor), + wLength)); + break; + case USB_DT_STRING: + /* Return String Descriptor */ + if (desc_index > ARRAY_SIZE(usb_strings)) { + 113c: e3540006 cmp r4, #6 + 1140: 8a000048 bhi 1268 + udp_ep0_send_stall(); + break; + } + DEBUGE("bLength=%u, wLength=%u ", + usb_strings[desc_index]->bLength, wLength); + udp_ep0_send_data((const char *) usb_strings[desc_index], + 1144: e59f2160 ldr r2, [pc, #352] ; 12ac + 1148: e0824104 add r4, r2, r4, lsl #2 + 114c: e5940038 ldr r0, [r4, #56] ; 0x38 + MIN(usb_strings[desc_index]->bLength, + 1150: e5d01000 ldrb r1, [r0] + udp_ep0_send_stall(); + break; + } + DEBUGE("bLength=%u, wLength=%u ", + usb_strings[desc_index]->bLength, wLength); + udp_ep0_send_data((const char *) usb_strings[desc_index], + 1154: e1530001 cmp r3, r1 + 1158: 31a01003 movcc r1, r3 + 115c: eafffff3 b 1130 + MIN(usb_strings[desc_index]->bLength, + wLength)); + break; + case USB_DT_CS_DEVICE: + /* Return Function descriptor */ + udp_ep0_send_data((const char *) &dfu_cfg_descriptor.func_dfu, + 1160: e59f014c ldr r0, [pc, #332] ; 12b4 + 1164: e3530009 cmp r3, #9 + 1168: 31a01003 movcc r1, r3 + 116c: 23a01009 movcs r1, #9 + 1170: eaffffee b 1130 + break; + } + break; + case STD_SET_ADDRESS: + DEBUGE("SET_ADDRESS "); + udp_ep0_send_zlp(); + 1174: ebfffdf7 bl 958 + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1178: e3843c01 orr r3, r4, #256 ; 0x100 + pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + 117c: e2544000 subs r4, r4, #0 + 1180: 13a04001 movne r4, #1 + } + break; + case STD_SET_ADDRESS: + DEBUGE("SET_ADDRESS "); + udp_ep0_send_zlp(); + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1184: e50530f7 str r3, [r5, #-247] ; 0xffffff09 + pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + 1188: e50540fb str r4, [r5, #-251] ; 0xffffff05 + 118c: ea000036 b 126c + break; + case STD_SET_CONFIGURATION: + DEBUGE("SET_CONFIG "); + if (wValue) + DEBUGE("VALUE!=0 "); + cur_config = wValue; + 1190: e59f3100 ldr r3, [pc, #256] ; 1298 + 1194: e5c34100 strb r4, [r3, #256] ; 0x100 + udp_ep0_send_zlp(); + 1198: ebfffdee bl 958 + pUDP->UDP_GLBSTATE = + (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + 119c: e3540000 cmp r4, #0 + 11a0: 03a03001 moveq r3, #1 + 11a4: 13a03002 movne r3, #2 + DEBUGE("SET_CONFIG "); + if (wValue) + DEBUGE("VALUE!=0 "); + cur_config = wValue; + udp_ep0_send_zlp(); + pUDP->UDP_GLBSTATE = + 11a8: e50530fb str r3, [r5, #-251] ; 0xffffff05 + (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 11ac: 01a03004 moveq r3, r4 + 11b0: 13a03c82 movne r3, #33280 ; 0x8200 + DEBUGE("VALUE!=0 "); + cur_config = wValue; + udp_ep0_send_zlp(); + pUDP->UDP_GLBSTATE = + (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = + 11b4: e50530cb str r3, [r5, #-203] ; 0xffffff35 + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 0; + pUDP->UDP_CSR[2] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + 11b8: 01a03004 moveq r3, r4 + 11bc: 13a03c86 movne r3, #34304 ; 0x8600 + pUDP->UDP_GLBSTATE = + (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 0; + pUDP->UDP_CSR[2] = + 11c0: e50530c7 str r3, [r5, #-199] ; 0xffffff39 + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + pUDP->UDP_CSR[3] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN) : 0; + 11c4: 13a04c87 movne r4, #34560 ; 0x8700 + pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + 11c8: e3a0300f mov r3, #15 + pUDP->UDP_CSR[1] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 0; + pUDP->UDP_CSR[2] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + pUDP->UDP_CSR[3] = + 11cc: e50540c3 str r4, [r5, #-195] ; 0xffffff3d + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN) : 0; + pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + 11d0: e50530ef str r3, [r5, #-239] ; 0xffffff11 + 11d4: ea000024 b 126c + AT91C_UDP_EPINT2|AT91C_UDP_EPINT3); + break; + case STD_GET_CONFIGURATION: + DEBUGE("GET_CONFIG "); + udp_ep0_send_data((char *)&(cur_config), + 11d8: e59f00d8 ldr r0, [pc, #216] ; 12b8 + 11dc: e3a01001 mov r1, #1 + 11e0: eaffffd2 b 1130 + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_INTERFACE: + DEBUGE("GET_STATUS_INTERFACE "); + wStatus = 0; + 11e4: e28d0008 add r0, sp, #8 + 11e8: e160c0b2 strh ip, [r0, #-2]! + 11ec: ea000013 b 1240 + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 11f0: e51530fb ldr r3, [r5, #-251] ; 0xffffff05 + 11f4: e3130002 tst r3, #2 + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + wStatus = 0; + 11f8: e1cdc0b6 strh ip, [sp, #6] + wIndex &= 0x0F; + 11fc: e20e200f and r2, lr, #15 + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 1200: 0a000002 beq 1210 + 1204: e3520000 cmp r2, #0 + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1208: 051530cf ldreq r3, [r5, #-207] ; 0xffffff31 + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 120c: 0a000006 beq 122c + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 1210: e59f307c ldr r3, [pc, #124] ; 1294 + 1214: e51310fb ldr r1, [r3, #-251] ; 0xffffff05 + 1218: e3110001 tst r1, #1 + 121c: 0a000011 beq 1268 + && (wIndex == 0)) { + 1220: e3520000 cmp r2, #0 + 1224: 1a00000f bne 1268 + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1228: e51330cf ldr r3, [r3, #-207] ; 0xffffff31 + 122c: e3130902 tst r3, #32768 ; 0x8000 + 1230: 13a03000 movne r3, #0 + 1234: 03a03001 moveq r3, #1 + 1238: e28d0008 add r0, sp, #8 + 123c: e16030b2 strh r3, [r0, #-2]! + udp_ep0_send_data((char *)&wStatus, + 1240: e3a01002 mov r1, #2 + 1244: eaffffb9 b 1130 + break; + case STD_SET_INTERFACE: + DEBUGE("SET INTERFACE "); + /* FIXME: store the interface number somewhere, once + * we need to support DFU flashing DFU */ + udp_ep0_send_zlp(); + 1248: ebfffdc2 bl 958 + 124c: ea000006 b 126c + break; + default: + DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + bRequest, bmRequestType); + if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + 1250: e200203f and r2, r0, #63 ; 0x3f + 1254: e3520021 cmp r2, #33 ; 0x21 + 1258: 1a000002 bne 1268 + dfu_ep0_handler(bmRequestType, bRequest, + 125c: e1a02004 mov r2, r4 + 1260: ebfffe83 bl c74 + 1264: ea000000 b 126c + wValue, wLength); + } else + udp_ep0_send_stall(); + 1268: ebfffdcb bl 99c + + if (isr & AT91C_UDP_EPINT0) + dfu_udp_ep0_handler(); + + /* clear all interrupts */ + pUDP->UDP_ICR = isr; + 126c: e59d2000 ldr r2, [sp] + 1270: e59f301c ldr r3, [pc, #28] ; 1294 + 1274: e50320df str r2, [r3, #-223] ; 0xffffff21 +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); + 1278: e3a02b02 mov r2, #2048 ; 0x800 + 127c: e2833a4f add r3, r3, #323584 ; 0x4f000 + 1280: e5832029 str r2, [r3, #41] ; 0x29 + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); + + led1off(); + 1284: e3a00402 mov r0, #33554432 ; 0x2000000 + 1288: ebffff12 bl ed8 +} + 128c: e8bd403e pop {r1, r2, r3, r4, r5, lr} + 1290: e12fff1e bx lr + 1294: fffb00ff .word 0xfffb00ff + 1298: 00201ae4 .word 0x00201ae4 + 129c: 00200020 .word 0x00200020 + 12a0: 00000101 .word 0x00000101 + 12a4: 00000302 .word 0x00000302 + 12a8: 00000b01 .word 0x00000b01 + 12ac: 000017b8 .word 0x000017b8 + 12b0: 000017ca .word 0x000017ca + 12b4: 000017e5 .word 0x000017e5 + 12b8: 00201be4 .word 0x00201be4 + +000012bc : + +/* this is only called once before DFU mode, no __dfufunc required */ +static void dfu_switch(void) +{ + 12bc: e92d4008 push {r3, lr} + AT91PS_AIC pAic = AT91C_BASE_AIC; + + DEBUGE("\r\nsam7dfu: switching to DFU mode\r\n"); + + dfu_state = DFU_STATE_appDETACH; + 12c0: e59f300c ldr r3, [pc, #12] ; 12d4 + 12c4: e3a02001 mov r2, #1 + 12c8: e5832000 str r2, [r3] + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 12cc: ebffff07 bl ef0 + 12d0: eafffffe b 12d0 + 12d4: 00200020 .word 0x00200020 + +000012d8 : + * caller since he doesn't expect us to do so */ + while (1) ; +} + +void __dfufunc dfu_main(void) +{ + 12d8: e92d4008 push {r3, lr} + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + 12dc: e3a00402 mov r0, #33554432 ; 0x2000000 + 12e0: ebfffeea bl e90 + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + 12e4: e3a00301 mov r0, #67108864 ; 0x4000000 + 12e8: ebfffee8 bl e90 + led1off(); + 12ec: e3a00402 mov r0, #33554432 ; 0x2000000 + 12f0: ebfffef8 bl ed8 + led2off(); + 12f4: e3a00301 mov r0, #67108864 ; 0x4000000 + 12f8: ebfffef6 bl ed8 + + AT91F_DBGU_Init(); + 12fc: eb00002b bl 13b0 + AT91F_DBGU_Printk("\n\r\n\rsam7dfu - AT91SAM7 USB DFU bootloader\n\r" + 1300: e59f0078 ldr r0, [pc, #120] ; 1380 + 1304: eb00004d bl 1440 + "(C) 2006-2008 by Harald Welte \n\r" + "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + AT91F_DBGU_Printk("Version " COMPILE_SVNREV + 1308: e59f0074 ldr r0, [pc, #116] ; 1384 + 130c: eb00004b bl 1440 + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + + udp_init(); + 1310: ebfffee2 bl ea0 + + dfu_state = DFU_STATE_dfuIDLE; + 1314: e59f306c ldr r3, [pc, #108] ; 1388 + 1318: e3a01002 mov r1, #2 + OPENPCD_IRQ_PRIO_UDP, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, dfu_udp_irq); + */ + AT91PS_AIC pAic = AT91C_BASE_AIC; + pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; + 131c: e59f0068 ldr r0, [pc, #104] ; 138c + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + OPENPCD_IRQ_PRIO_UDP, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, dfu_udp_irq); + */ + AT91PS_AIC pAic = AT91C_BASE_AIC; + pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + 1320: e3a02b02 mov r2, #2048 ; 0x800 + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + + udp_init(); + + dfu_state = DFU_STATE_dfuIDLE; + 1324: e5831000 str r1, [r3] + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + OPENPCD_IRQ_PRIO_UDP, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, dfu_udp_irq); + */ + AT91PS_AIC pAic = AT91C_BASE_AIC; + pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + 1328: e3e03c0f mvn r3, #3840 ; 0xf00 + 132c: e5832025 str r2, [r3, #37] ; 0x25 + pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; + 1330: e5030053 str r0, [r3, #-83] ; 0xffffffad + pAic->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | + 1334: e50310d3 str r1, [r3, #-211] ; 0xffffff2d + + /* End-of-Bus-Reset is always enabled */ + + /* Clear for set the Pull up resistor */ +#if defined(PCD) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 1338: e3a00501 mov r0, #4194304 ; 0x400000 + AT91PS_AIC pAic = AT91C_BASE_AIC; + pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; + pAic->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | + OPENPCD_IRQ_PRIO_UDP; + pAic->AIC_ICCR = 1 << AT91C_ID_UDP; + 133c: e5832029 str r2, [r3, #41] ; 0x29 +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 1340: e5832021 str r2, [r3, #33] ; 0x21 + + /* End-of-Bus-Reset is always enabled */ + + /* Clear for set the Pull up resistor */ +#if defined(PCD) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 1344: ebfffee3 bl ed8 +#endif + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 1348: e3a00801 mov r0, #65536 ; 0x10000 + 134c: ebfffee4 bl ee4 + + flash_init(); + 1350: eb00007b bl 1544 + + AT91F_DBGU_Printk("You may now start the DFU up/download process\r\n"); + 1354: e59f0034 ldr r0, [pc, #52] ; 1390 + 1358: eb000038 bl 1440 + /* do nothing, since all of DFU is interrupt driven */ + int i = 0; + 135c: e3a01000 mov r1, #0 + while (1) { + /* Occasionally reset watchdog */ + i = (i+1) % 10000; + 1360: e2810001 add r0, r1, #1 + 1364: e59f1028 ldr r1, [pc, #40] ; 1394 + 1368: eb000109 bl 1794 <__aeabi_idivmod> + if( i== 0) { + 136c: e3510000 cmp r1, #0 +//* \brief Restart Watchdog +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTRestart( + AT91PS_WDTC pWDTC) +{ + pWDTC->WDTC_WDCR = 0xA5000001; + 1370: 059f2020 ldreq r2, [pc, #32] ; 1398 + 1374: 03e03c02 mvneq r3, #512 ; 0x200 + 1378: 050320bf streq r2, [r3, #-191] ; 0xffffff41 + 137c: eafffff7 b 1360 + 1380: 0000199c .word 0x0000199c + 1384: 00001a39 .word 0x00001a39 + 1388: 00200020 .word 0x00200020 + 138c: 00000f04 .word 0x00000f04 + 1390: 00001a7c .word 0x00001a7c + 1394: 00002710 .word 0x00002710 + 1398: a5000001 .word 0xa5000001 + +0000139c : +#include + +#define USART_SYS_LEVEL 4 +void AT91F_DBGU_Ready(void) +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 139c: e3e03c0d mvn r3, #3328 ; 0xd00 + 13a0: e51330eb ldr r3, [r3, #-235] ; 0xffffff15 + 13a4: e3130c02 tst r3, #512 ; 0x200 + 13a8: 0afffffb beq 139c +} + 13ac: e12fff1e bx lr + +000013b0 : + AT91F_DBGU_Printk("\n\r"); + } +} + +void AT91F_DBGU_Init(void) +{ + 13b0: e92d4037 push {r0, r1, r2, r4, r5, lr} + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 13b4: e3e03c0b mvn r3, #2816 ; 0xb00 + 13b8: e3a02c06 mov r2, #1536 ; 0x600 + pPio->PIO_BSR = periphBEnable; + 13bc: e3a04000 mov r4, #0 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 13c0: e503208f str r2, [r3, #-143] ; 0xffffff71 + /* Open PIO for DBGU */ + AT91F_DBGU_CfgPIO(); + /* Enable Transmitter & receivier */ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 13c4: e3e05c0d mvn r5, #3328 ; 0xd00 + pPio->PIO_BSR = periphBEnable; + 13c8: e503408b str r4, [r3, #-139] ; 0xffffff75 + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 13cc: e50320fb str r2, [r3, #-251] ; 0xffffff05 + 13d0: e3a0300c mov r3, #12 + 13d4: e50530ff str r3, [r5, #-255] ; 0xffffff01 + AT91C_US_RSTTX | AT91C_US_RSTRX; + + /* Configure DBGU */ + AT91F_US_Configure(AT91C_BASE_DBGU, + 13d8: e59f004c ldr r0, [pc, #76] ; 142c + 13dc: e59f104c ldr r1, [pc, #76] ; 1430 + 13e0: e2822d0b add r2, r2, #704 ; 0x2c0 + 13e4: e59f3048 ldr r3, [pc, #72] ; 1434 + 13e8: e58d4000 str r4, [sp] + 13ec: ebfffcf4 bl 7c4 + MCK, AT91C_US_ASYNC_MODE, + AT91C_DBGU_BAUD, 0); + + /* Enable Transmitter & receivier */ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 13f0: e3a03050 mov r3, #80 ; 0x50 + 13f4: e50530ff str r3, [r5, #-255] ; 0xffffff01 + /* Enable USART IT error and AT91C_US_ENDRX */ + AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + + /* open interrupt */ + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, USART_SYS_LEVEL, + 13f8: e59f3038 ldr r3, [pc, #56] ; 1438 +static inline void AT91F_US_EnableIt ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pUSART->US_IER = flag; + 13fc: e3a01001 mov r1, #1 + 1400: e50510f7 str r1, [r5, #-247] ; 0xffffff09 + 1404: e3a02004 mov r2, #4 + 1408: e58d3000 str r3, [sp] + 140c: e59f0028 ldr r0, [pc, #40] ; 143c + 1410: e1a03004 mov r3, r4 + 1414: ebfffbd0 bl 35c +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 1418: e3a02002 mov r2, #2 + 141c: e3e03c0f mvn r3, #3840 ; 0xf00 + 1420: e5832021 str r2, [r3, #33] ; 0x21 + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + DBGU_irq_handler); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); + +} + 1424: e8bd403e pop {r1, r2, r3, r4, r5, lr} + 1428: e12fff1e bx lr + 142c: fffff200 .word 0xfffff200 + 1430: 02db4000 .word 0x02db4000 + 1434: 0001c200 .word 0x0001c200 + 1438: 00001488 .word 0x00001488 + 143c: fffff000 .word 0xfffff000 + +00001440 : + +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + 1440: ea000004 b 1458 +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 1444: e3e02c0d mvn r2, #3328 ; 0xd00 + 1448: e51210eb ldr r1, [r2, #-235] ; 0xffffff15 + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 144c: e3110002 tst r1, #2 + 1450: 0afffffb beq 1444 +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 1454: e50230e3 str r3, [r2, #-227] ; 0xffffff1d + +} + +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + 1458: e4d03001 ldrb r3, [r0], #1 + 145c: e3530000 cmp r3, #0 + 1460: 1afffff7 bne 1444 + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, *buffer++); + } +} + 1464: e12fff1e bx lr + +00001468 : +//* \brief Return 1 if a character can be read in US_RHR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_RxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_RXRDY); + 1468: e3e03c0d mvn r3, #3328 ; 0xd00 + 146c: e51320eb ldr r2, [r3, #-235] ; 0xffffff15 + +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 1470: e2122001 ands r2, r2, #1 +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_US_GetChar ( + const AT91PS_USART pUSART) +{ + return((pUSART->US_RHR) & 0x1FF); + 1474: 151330e7 ldrne r3, [r3, #-231] ; 0xffffff19 + return (0); + 1478: 01a00002 moveq r0, r2 + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 147c: 15c03000 strbne r3, [r0] + return (-1); + 1480: 13e00000 mvnne r0, #0 + } +} + 1484: e12fff1e bx lr + +00001488 : +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; +} + +static void DBGU_irq_handler(void) +{ + 1488: e92d4010 push {r4, lr} + static char value; + + AT91F_DBGU_Get(&value); + 148c: e59f4038 ldr r4, [pc, #56] ; 14cc + 1490: e1a00004 mov r0, r4 + 1494: ebfffff3 bl 1468 + switch (value) { + 1498: e5d43000 ldrb r3, [r4] + 149c: e3530039 cmp r3, #57 ; 0x39 + 14a0: 1a000006 bne 14c0 + case '9': + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 14a4: e59f0024 ldr r0, [pc, #36] ; 14d0 + 14a8: ebffffe4 bl 1440 +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSoftReset( + AT91PS_RSTC pRSTC, + unsigned int reset) +{ + pRSTC->RSTC_RCR = (0xA5000000 | reset); + 14ac: e59f2020 ldr r2, [pc, #32] ; 14d4 + 14b0: e3e03c02 mvn r3, #512 ; 0x200 + 14b4: e50320ff str r2, [r3, #-255] ; 0xffffff01 + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + AT91F_DBGU_Printk("\n\r"); + } +} + 14b8: e8bd4010 pop {r4, lr} + 14bc: e12fff1e bx lr + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + AT91F_DBGU_Printk("\n\r"); + 14c0: e59f0010 ldr r0, [pc, #16] ; 14d8 + } +} + 14c4: e8bd4010 pop {r4, lr} + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + AT91F_DBGU_Printk("\n\r"); + 14c8: eaffffdc b 1440 + 14cc: 00201be8 .word 0x00201be8 + 14d0: 00001aac .word 0x00001aac + 14d4: a500000d .word 0xa500000d + 14d8: 00001a79 .word 0x00001a79 + +000014dc : +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_EFC_PerformCmd ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int transfer_cmd) +{ + pMC->MC_FCR = transfer_cmd; + 14dc: e3e03000 mvn r3, #0 + 14e0: e503009b str r0, [r3, #-155] ; 0xffffff65 +} + 14e4: e12fff1e bx lr + +000014e8 : + +static u_int16_t page_from_ramaddr(const void *addr) +{ + u_int32_t ramaddr = (u_int32_t) addr; + ramaddr -= (u_int32_t) AT91C_IFLASH; + return ((ramaddr >> AT91C_IFLASH_PAGE_SHIFT)); + 14e8: e1a03700 lsl r3, r0, #14 +//* \brief Return MC EFC Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_GetStatus( + AT91PS_MC pMC) // pointer to a MC controller +{ + return pMC->MC_FSR; + 14ec: e3e02000 mvn r2, #0 + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 14f0: e1a03b23 lsr r3, r3, #22 + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + 14f4: e92d4070 push {r4, r5, r6, lr} + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 14f8: e1a03803 lsl r3, r3, #16 + 14fc: e5125097 ldr r5, [r2, #-151] ; 0xffffff69 + +static int is_page_locked(u_int16_t page) +{ + u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + + return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 1500: e5122097 ldr r2, [r2, #-151] ; 0xffffff69 + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 1504: e1a04823 lsr r4, r3, #16 + +static int is_page_locked(u_int16_t page) +{ + u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + + return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 1508: e1a03a23 lsr r3, r3, #20 +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + DEBUGP("flash_page(0x%x=%u) ", addr, page); + + if (is_page_locked(page)) { + 150c: e0123803 ands r3, r2, r3, lsl #16 + +static void unlock_page(u_int16_t page) +{ + page &= 0x3ff; + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); + 1510: 11a00404 lslne r0, r4, #8 +} + +static void unlock_page(u_int16_t page) +{ + page &= 0x3ff; + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + 1514: 1380045a orrne r0, r0, #1509949440 ; 0x5a000000 + 1518: 13800004 orrne r0, r0, #4 + 151c: 1bffffee blne 14dc + if (is_page_locked(page)) { + DEBUGP("unlocking "); + unlock_page(page); + } + + if (!(fsr & AT91C_MC_FRDY)) { + 1520: e3150001 tst r5, #1 + 1524: 0a000004 beq 153c + } + + DEBUGP("performing start_prog "); + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + AT91C_MC_CORRECT_KEY | (page << 8)); + 1528: e1a04404 lsl r4, r4, #8 + return; + } + + DEBUGP("performing start_prog "); + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 152c: e384045a orr r0, r4, #1509949440 ; 0x5a000000 + 1530: e3800001 orr r0, r0, #1 + AT91C_MC_CORRECT_KEY | (page << 8)); +} + 1534: e8bd4070 pop {r4, r5, r6, lr} + return; + } + + DEBUGP("performing start_prog "); + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 1538: eaffffe7 b 14dc + AT91C_MC_CORRECT_KEY | (page << 8)); +} + 153c: e8bd4070 pop {r4, r5, r6, lr} + 1540: e12fff1e bx lr + +00001544 : +static inline void AT91F_MC_EFC_CfgModeReg ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int mode) // mode register +{ + // Write to the FMR register + pMC->MC_FMR = mode; + 1544: e59f2008 ldr r2, [pc, #8] ; 1554 + 1548: e3e03000 mvn r3, #0 + 154c: e503209f str r2, [r3, #-159] ; 0xffffff61 +{ + unsigned int fmcn = AT91F_MC_EFC_ComputeFMCN(MCK); + + AT91F_MC_EFC_CfgModeReg(AT91C_BASE_MC, (fmcn&0xff) << 16 | + AT91C_MC_FWS_3FWS); +} + 1550: e12fff1e bx lr + 1554: 00310300 .word 0x00310300 + +00001558 <__aeabi_uidiv>: + 1558: e2512001 subs r2, r1, #1 + 155c: 012fff1e bxeq lr + 1560: 3a000036 bcc 1640 <__aeabi_uidiv+0xe8> + 1564: e1500001 cmp r0, r1 + 1568: 9a000022 bls 15f8 <__aeabi_uidiv+0xa0> + 156c: e1110002 tst r1, r2 + 1570: 0a000023 beq 1604 <__aeabi_uidiv+0xac> + 1574: e311020e tst r1, #-536870912 ; 0xe0000000 + 1578: 01a01181 lsleq r1, r1, #3 + 157c: 03a03008 moveq r3, #8 + 1580: 13a03001 movne r3, #1 + 1584: e3510201 cmp r1, #268435456 ; 0x10000000 + 1588: 31510000 cmpcc r1, r0 + 158c: 31a01201 lslcc r1, r1, #4 + 1590: 31a03203 lslcc r3, r3, #4 + 1594: 3afffffa bcc 1584 <__aeabi_uidiv+0x2c> + 1598: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 159c: 31510000 cmpcc r1, r0 + 15a0: 31a01081 lslcc r1, r1, #1 + 15a4: 31a03083 lslcc r3, r3, #1 + 15a8: 3afffffa bcc 1598 <__aeabi_uidiv+0x40> + 15ac: e3a02000 mov r2, #0 + 15b0: e1500001 cmp r0, r1 + 15b4: 20400001 subcs r0, r0, r1 + 15b8: 21822003 orrcs r2, r2, r3 + 15bc: e15000a1 cmp r0, r1, lsr #1 + 15c0: 204000a1 subcs r0, r0, r1, lsr #1 + 15c4: 218220a3 orrcs r2, r2, r3, lsr #1 + 15c8: e1500121 cmp r0, r1, lsr #2 + 15cc: 20400121 subcs r0, r0, r1, lsr #2 + 15d0: 21822123 orrcs r2, r2, r3, lsr #2 + 15d4: e15001a1 cmp r0, r1, lsr #3 + 15d8: 204001a1 subcs r0, r0, r1, lsr #3 + 15dc: 218221a3 orrcs r2, r2, r3, lsr #3 + 15e0: e3500000 cmp r0, #0 + 15e4: 11b03223 lsrsne r3, r3, #4 + 15e8: 11a01221 lsrne r1, r1, #4 + 15ec: 1affffef bne 15b0 <__aeabi_uidiv+0x58> + 15f0: e1a00002 mov r0, r2 + 15f4: e12fff1e bx lr + 15f8: 03a00001 moveq r0, #1 + 15fc: 13a00000 movne r0, #0 + 1600: e12fff1e bx lr + 1604: e3510801 cmp r1, #65536 ; 0x10000 + 1608: 21a01821 lsrcs r1, r1, #16 + 160c: 23a02010 movcs r2, #16 + 1610: 33a02000 movcc r2, #0 + 1614: e3510c01 cmp r1, #256 ; 0x100 + 1618: 21a01421 lsrcs r1, r1, #8 + 161c: 22822008 addcs r2, r2, #8 + 1620: e3510010 cmp r1, #16 + 1624: 21a01221 lsrcs r1, r1, #4 + 1628: 22822004 addcs r2, r2, #4 + 162c: e3510004 cmp r1, #4 + 1630: 82822003 addhi r2, r2, #3 + 1634: 908220a1 addls r2, r2, r1, lsr #1 + 1638: e1a00230 lsr r0, r0, r2 + 163c: e12fff1e bx lr + 1640: e3500000 cmp r0, #0 + 1644: 13e00000 mvnne r0, #0 + 1648: ea000059 b 17b4 <__aeabi_idiv0> + +0000164c <__aeabi_uidivmod>: + 164c: e3510000 cmp r1, #0 + 1650: 0afffffa beq 1640 <__aeabi_uidiv+0xe8> + 1654: e92d4003 push {r0, r1, lr} + 1658: ebffffbe bl 1558 <__aeabi_uidiv> + 165c: e8bd4006 pop {r1, r2, lr} + 1660: e0030092 mul r3, r2, r0 + 1664: e0411003 sub r1, r1, r3 + 1668: e12fff1e bx lr + +0000166c <__aeabi_idiv>: + 166c: e3510000 cmp r1, #0 + 1670: 0a000043 beq 1784 <.divsi3_skip_div0_test+0x110> + +00001674 <.divsi3_skip_div0_test>: + 1674: e020c001 eor ip, r0, r1 + 1678: 42611000 rsbmi r1, r1, #0 + 167c: e2512001 subs r2, r1, #1 + 1680: 0a000027 beq 1724 <.divsi3_skip_div0_test+0xb0> + 1684: e1b03000 movs r3, r0 + 1688: 42603000 rsbmi r3, r0, #0 + 168c: e1530001 cmp r3, r1 + 1690: 9a000026 bls 1730 <.divsi3_skip_div0_test+0xbc> + 1694: e1110002 tst r1, r2 + 1698: 0a000028 beq 1740 <.divsi3_skip_div0_test+0xcc> + 169c: e311020e tst r1, #-536870912 ; 0xe0000000 + 16a0: 01a01181 lsleq r1, r1, #3 + 16a4: 03a02008 moveq r2, #8 + 16a8: 13a02001 movne r2, #1 + 16ac: e3510201 cmp r1, #268435456 ; 0x10000000 + 16b0: 31510003 cmpcc r1, r3 + 16b4: 31a01201 lslcc r1, r1, #4 + 16b8: 31a02202 lslcc r2, r2, #4 + 16bc: 3afffffa bcc 16ac <.divsi3_skip_div0_test+0x38> + 16c0: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 16c4: 31510003 cmpcc r1, r3 + 16c8: 31a01081 lslcc r1, r1, #1 + 16cc: 31a02082 lslcc r2, r2, #1 + 16d0: 3afffffa bcc 16c0 <.divsi3_skip_div0_test+0x4c> + 16d4: e3a00000 mov r0, #0 + 16d8: e1530001 cmp r3, r1 + 16dc: 20433001 subcs r3, r3, r1 + 16e0: 21800002 orrcs r0, r0, r2 + 16e4: e15300a1 cmp r3, r1, lsr #1 + 16e8: 204330a1 subcs r3, r3, r1, lsr #1 + 16ec: 218000a2 orrcs r0, r0, r2, lsr #1 + 16f0: e1530121 cmp r3, r1, lsr #2 + 16f4: 20433121 subcs r3, r3, r1, lsr #2 + 16f8: 21800122 orrcs r0, r0, r2, lsr #2 + 16fc: e15301a1 cmp r3, r1, lsr #3 + 1700: 204331a1 subcs r3, r3, r1, lsr #3 + 1704: 218001a2 orrcs r0, r0, r2, lsr #3 + 1708: e3530000 cmp r3, #0 + 170c: 11b02222 lsrsne r2, r2, #4 + 1710: 11a01221 lsrne r1, r1, #4 + 1714: 1affffef bne 16d8 <.divsi3_skip_div0_test+0x64> + 1718: e35c0000 cmp ip, #0 + 171c: 42600000 rsbmi r0, r0, #0 + 1720: e12fff1e bx lr + 1724: e13c0000 teq ip, r0 + 1728: 42600000 rsbmi r0, r0, #0 + 172c: e12fff1e bx lr + 1730: 33a00000 movcc r0, #0 + 1734: 01a00fcc asreq r0, ip, #31 + 1738: 03800001 orreq r0, r0, #1 + 173c: e12fff1e bx lr + 1740: e3510801 cmp r1, #65536 ; 0x10000 + 1744: 21a01821 lsrcs r1, r1, #16 + 1748: 23a02010 movcs r2, #16 + 174c: 33a02000 movcc r2, #0 + 1750: e3510c01 cmp r1, #256 ; 0x100 + 1754: 21a01421 lsrcs r1, r1, #8 + 1758: 22822008 addcs r2, r2, #8 + 175c: e3510010 cmp r1, #16 + 1760: 21a01221 lsrcs r1, r1, #4 + 1764: 22822004 addcs r2, r2, #4 + 1768: e3510004 cmp r1, #4 + 176c: 82822003 addhi r2, r2, #3 + 1770: 908220a1 addls r2, r2, r1, lsr #1 + 1774: e35c0000 cmp ip, #0 + 1778: e1a00233 lsr r0, r3, r2 + 177c: 42600000 rsbmi r0, r0, #0 + 1780: e12fff1e bx lr + 1784: e3500000 cmp r0, #0 + 1788: c3e00102 mvngt r0, #-2147483648 ; 0x80000000 + 178c: b3a00102 movlt r0, #-2147483648 ; 0x80000000 + 1790: ea000007 b 17b4 <__aeabi_idiv0> + +00001794 <__aeabi_idivmod>: + 1794: e3510000 cmp r1, #0 + 1798: 0afffff9 beq 1784 <.divsi3_skip_div0_test+0x110> + 179c: e92d4003 push {r0, r1, lr} + 17a0: ebffffb3 bl 1674 <.divsi3_skip_div0_test> + 17a4: e8bd4006 pop {r1, r2, lr} + 17a8: e0030092 mul r3, r2, r0 + 17ac: e0411003 sub r1, r1, r3 + 17b0: e12fff1e bx lr + +000017b4 <__aeabi_idiv0>: + 17b4: e12fff1e bx lr + +000017b8 : + 17b8: 01000112 08000000 076b16c0 00000000 ..........k..... + 17c8: 02090100 .. + +000017ca : + 17ca: 00240209 80000101 00040964 01fe0000 ..$.....d....... + 17da: 04090002 fe000100 09000201 ff000321 ............!... + 17ea: 01000100 18080000 ...... + +000017f0 : + 17f0: 00001808 0000180c 00001874 000018b2 ........t....... + 1800: 000018e6 00001942 ....B... + +00001808 : + 1808: 04090304 .... + +0000180c : + 180c: 00620368 00740069 0061006d 0075006e h.b.i.t.m.a.n.u. + 181c: 00610066 0074006b 00720075 0064002e f.a.k.t.u.r...d. + 182c: 00200065 00540049 00530020 006c006f e. .I.T. .S.o.l. + 183c: 00740075 006f0069 0073006e 00610020 u.t.i.o.n.s. .a. + 184c: 0064006e 00680020 0077006d 0063002d n.d. .h.m.w.-.c. + 185c: 006e006f 00750073 0074006c 006e0069 o.n.s.u.l.t.i.n. + 186c: 002e0067 00650064 g...d.e. + +00001874 : + 1874: 004f033e 00650070 0050006e 00440043 >.O.p.e.n.P.C.D. + 1884: 00520020 00490046 00200044 00650052 .R.F.I.D. .R.e. + 1894: 00640061 00720065 002d0020 00440020 a.d.e.r. .-. .D. + 18a4: 00550046 004d0020 0064006f 03340065 F.U. .M.o.d.e. + +000018b2 : + 18b2: 004f0334 00650070 0050006e 00440043 4.O.p.e.n.P.C.D. + 18c2: 00440020 00550046 00430020 006e006f .D.F.U. .C.o.n. + 18d2: 00690066 00750067 00610072 00690074 f.i.g.u.r.a.t.i. + 18e2: 006e006f o.n. + +000018e6 : + 18e6: 004f035c 00650070 0050006e 00440043 \.O.p.e.n.P.C.D. + 18f6: 00440020 00550046 00490020 0074006e .D.F.U. .I.n.t. + 1906: 00720065 00610066 00650063 002d0020 e.r.f.a.c.e. .-. + 1916: 00410020 00700070 0069006c 00610063 .A.p.p.l.i.c.a. + 1926: 00690074 006e006f 00500020 00720061 t.i.o.n. .P.a.r. + 1936: 00690074 00690074 006e006f t.i.t.i.o.n. + +00001942 : + 1942: 004f035a 00650070 0050006e 00440043 Z.O.p.e.n.P.C.D. + 1952: 00440020 00550046 00490020 0074006e .D.F.U. .I.n.t. + 1962: 00720065 00610066 00650063 002d0020 e.r.f.a.c.e. .-. + 1972: 00420020 006f006f 006c0074 0061006f .B.o.o.t.l.o.a. + 1982: 00650064 00200072 00610050 00740072 d.e.r. .P.a.r.t. + 1992: 00740069 006f0069 0d0a006e 61730d0a i.t.i.o.n.....sa + 19a2: 6664376d 202d2075 31395441 374d4153 m7dfu - AT91SAM7 + 19b2: 42535520 55464420 6f6f6220 616f6c74 USB DFU bootloa + 19c2: 0a726564 2943280d 30303220 30322d36 der..(C) 2006-20 + 19d2: 62203830 61482079 646c6172 6c655720 08 by Harald Wel + 19e2: 3c206574 6c657768 68406574 632d776d te ..T + 1a02: 20736968 74666f73 65726177 20736920 his software is + 1a12: 45455246 464f5320 52415754 696c2045 FREE SOFTWARE li + 1a22: 736e6563 75206465 7265646e 554e4720 censed under GNU + 1a32: 4c504720 56000d0a 69737265 34206e6f GPL...Version 4 + 1a42: 752d3539 656c636e 63206e61 69706d6f 95-unclean compi + 1a52: 2064656c 31313032 30313530 3036312d led 20110510-160 + 1a62: 20373039 6e207962 407a7465 62756c42 907 by netz@Blub + 1a72: 73694662 0a0d0a68 6f59000d 616d2075 bFish.....You ma + 1a82: 6f6e2079 74732077 20747261 20656874 y now start the + 1a92: 20554644 642f7075 6c6e776f 2064616f DFU up/download + 1aa2: 636f7270 0d737365 6552000a 74746573 process...Resett + 1ab2: 20676e69 374d4153 00000d0a dc130000 ing SAM7...... + +Disassembly of section .data: + +00201ac0 <_data>: + .global _remap_call_dfu + .func _remap_call_dfu +_remap_call_dfu: + led1on + /* Remap RAM to 0x00000000 for DFU */ + ldr r1, =AT91C_BASE_AIC + 201ac0: e59f100c ldr r1, [pc, #12] ; 201ad4 <_data+0x14> + mov r2, #0x01 + 201ac4: e3a02001 mov r2, #1 + str r2, [r1, #AIC_MCR_RCR] + 201ac8: e5812f00 str r2, [r1, #3840] ; 0xf00 + + ldr r4, =dfu_main + 201acc: e59f4004 ldr r4, [pc, #4] ; 201ad8 <_data+0x18> + bx r4 + 201ad0: e12fff14 bx r4 + 201ad4: fffff000 .word 0xfffff000 + 201ad8: 000012d8 .word 0x000012d8 + +00201adc : + 201adc: 00104000 .@.. + +00201ae0 : + 201ae0: 00003039 90.. diff --git a/firmware/dfu.map b/firmware/dfu.map new file mode 100644 index 0000000..439a392 --- /dev/null +++ b/firmware/dfu.map @@ -0,0 +1,428 @@ +Archive member included because of file (symbol) + +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + lib/lib_AT91SAM7.o (__aeabi_uidiv) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + src/dfu/dfu.o (__aeabi_idivmod) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) (__aeabi_idiv0) + +Memory Configuration + +Name Origin Length Attributes +FLASH 0x00000000 0x00004000 xr +DATA 0x00200000 0x00008000 rw +STACK 0x00208000 0x00000000 rw +*default* 0x00000000 0xffffffff + +Linker script and memory map + +LOAD src/start/Cstartup.o +LOAD src/start/Cstartup_SAM7.o +LOAD lib/lib_AT91SAM7.o +LOAD src/dfu/dfu.o +LOAD src/dfu/dbgu.o +LOAD src/os/flash.o +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a +START GROUP +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a +END GROUP + 0x00000000 . = 0x0 + +.text 0x00000000 0x1ac0 + *(.reset) + .reset 0x00000000 0x0 src/start/Cstartup.o + *(.text) + .text 0x00000000 0x1f0 src/start/Cstartup.o + 0x0000004c IRQ_Handler_Entry + 0x000001a0 exit + 0x000001a4 AT91F_Default_FIQ_handler + 0x000001a8 AT91F_Default_IRQ_handler + 0x000001ac AT91F_Spurious_handler + .text 0x000001f0 0x10c src/start/Cstartup_SAM7.o + 0x000001f0 AT91F_LowLevelInit + .text 0x000002fc 0x580 lib/lib_AT91SAM7.o + 0x0000035c AT91F_AIC_ConfigureIt + 0x00000394 AT91F_AIC_SetExceptionVector + 0x000003c8 AT91F_AIC_Open + 0x00000444 AT91F_PDC_Open + 0x000004b0 AT91F_PDC_Close + 0x00000508 AT91F_PDC_SendFrame + 0x0000055c AT91F_PDC_ReceiveFrame + 0x000005b0 AT91F_PMC_GetMasterClock + 0x0000063c AT91F_RTTReadValue + 0x0000066c AT91F_SPI_Close + 0x000006ac AT91F_ADC_CfgTimings + 0x00000714 AT91F_SSC_SetBaudrate + 0x00000778 AT91F_SSC_Configure + 0x000007c4 AT91F_US_Configure + 0x00000844 AT91F_US_Close + .text 0x0000087c 0xb20 src/dfu/dfu.o + 0x00000c74 dfu_ep0_handler + 0x000012d8 dfu_main + .text 0x0000139c 0x140 src/dfu/dbgu.o + 0x0000139c AT91F_DBGU_Ready + 0x000013b0 AT91F_DBGU_Init + 0x00001440 AT91F_DBGU_Printk + 0x00001468 AT91F_DBGU_Get + .text 0x000014dc 0x7c src/os/flash.o + 0x000014e8 flash_page + 0x00001544 flash_init + .text 0x00001558 0x114 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + 0x00001558 __aeabi_uidiv + 0x00001558 __udivsi3 + 0x0000164c __aeabi_uidivmod + .text 0x0000166c 0x148 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + 0x0000166c __divsi3 + 0x0000166c __aeabi_idiv + 0x00001794 __aeabi_idivmod + .text 0x000017b4 0x4 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + 0x000017b4 __aeabi_idiv0 + 0x000017b4 __aeabi_ldiv0 + *(.rodata*) + .rodata 0x000017b8 0x1e4 src/dfu/dfu.o + 0x000017b8 dfu_dev_descriptor + 0x000017ca dfu_cfg_descriptor + .rodata.str1.1 + 0x0000199c 0x110 src/dfu/dfu.o + .rodata.str1.1 + 0x00001aac 0x11 src/dfu/dbgu.o + 0x14 (size before relaxing) + 0x00001ac0 . = ALIGN (0x4) + *fill* 0x00001abd 0x3 00 + 0x00001ac0 _etext = . + 0x00001ac0 PROVIDE (etext, .) + +.glue_7 0x00001ac0 0x0 + .glue_7 0x00000000 0x0 linker stubs + +.glue_7t 0x00001ac0 0x0 + .glue_7t 0x00000000 0x0 linker stubs + +.vfp11_veneer 0x00001ac0 0x0 + .vfp11_veneer 0x00000000 0x0 linker stubs + +.v4_bx 0x00001ac0 0x0 + .v4_bx 0x00000000 0x0 linker stubs + +.data.shared 0x00200020 0x8 load address 0x00001ac0 + 0x00200020 _data_shared = . + *(.data.shared) + .data.shared 0x00200020 0x8 src/dfu/dfu.o + 0x00200020 dfu_state + 0x00200028 . = ALIGN (0x4) + 0x00200028 _edata_shared = . + 0x00001ac8 _data_flash = (LOADADDR (.data.shared) + SIZEOF (.data.shared)) + +.data 0x00201ac0 0x24 load address 0x00001ac8 + 0x00201ac0 _data = . + *(.vectram) + .vectram 0x00201ac0 0x1c src/start/Cstartup.o + 0x00201ac0 _remap_call_dfu + *(.data) + .data 0x00201adc 0x0 src/start/Cstartup.o + .data 0x00201adc 0x0 src/start/Cstartup_SAM7.o + .data 0x00201adc 0x0 lib/lib_AT91SAM7.o + .data 0x00201adc 0x8 src/dfu/dfu.o + 0x00201ae0 foo + .data 0x00201ae4 0x0 src/dfu/dbgu.o + .data 0x00201ae4 0x0 src/os/flash.o + .data 0x00201ae4 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .data 0x00201ae4 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + .data 0x00201ae4 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + 0x00201ae4 . = ALIGN (0x4) + 0x00201ae4 _edata = . + 0x00201ae4 PROVIDE (edata, .) + +.dfu.functab 0x00003fd0 0x30 + *(.dfu.functab) + .dfu.functab 0x00003fd0 0x24 src/dfu/dfu.o + 0x00003fd0 dfu_api + 0x00004000 . = ALIGN (0x1000) + *fill* 0x00003ff4 0xc 00 + +.bss 0x00201ae4 0x105 load address 0x00001aec + 0x00201ae4 __bss_start = . + 0x00201ae4 __bss_start__ = . + *(.bss) + .bss 0x00201ae4 0x0 src/start/Cstartup.o + .bss 0x00201ae4 0x0 src/start/Cstartup_SAM7.o + .bss 0x00201ae4 0x0 lib/lib_AT91SAM7.o + .bss 0x00201ae4 0x104 src/dfu/dfu.o + .bss 0x00201be8 0x1 src/dfu/dbgu.o + .bss 0x00201be9 0x0 src/os/flash.o + .bss 0x00201be9 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .bss 0x00201be9 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + .bss 0x00201be9 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + *(COMMON) + 0x00201bec . = ALIGN (0x4) + 0x00201bec __bss_end__ = . + 0x00201bec __bss_end__ = . + 0x00201bec PROVIDE (main, .) + 0x00201bec _end = . + 0x00201bec . = ALIGN (0x4) + +.int_data 0x00208000 0x0 + *(.internal_ram_top) + .internal_ram_top + 0x00208000 0x0 src/start/Cstartup.o + 0x00208000 PROVIDE (end, .) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.ARM.attributes + 0x00000000 0x2e + .ARM.attributes + 0x00000000 0x22 src/start/Cstartup.o + .ARM.attributes + 0x00000022 0x32 src/start/Cstartup_SAM7.o + .ARM.attributes + 0x00000054 0x32 lib/lib_AT91SAM7.o + .ARM.attributes + 0x00000086 0x32 src/dfu/dfu.o + .ARM.attributes + 0x000000b8 0x32 src/dfu/dbgu.o + .ARM.attributes + 0x000000ea 0x32 src/os/flash.o + .ARM.attributes + 0x0000011c 0x1a e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .ARM.attributes + 0x00000136 0x1a e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + .ARM.attributes + 0x00000150 0x18 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + +.comment 0x00000000 0x2a + *(.comment) + .comment 0x00000000 0x2a src/start/Cstartup_SAM7.o + 0x2b (size before relaxing) + .comment 0x00000000 0x2b lib/lib_AT91SAM7.o + .comment 0x00000000 0x2b src/dfu/dfu.o + .comment 0x00000000 0x2b src/dfu/dbgu.o + .comment 0x00000000 0x2b src/os/flash.o + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0xc8 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x28 src/start/Cstartup.o + .debug_aranges + 0x00000028 0x20 src/start/Cstartup_SAM7.o + .debug_aranges + 0x00000048 0x20 lib/lib_AT91SAM7.o + .debug_aranges + 0x00000068 0x20 src/dfu/dfu.o + .debug_aranges + 0x00000088 0x20 src/dfu/dbgu.o + .debug_aranges + 0x000000a8 0x20 src/os/flash.o + +.debug_pubnames + 0x00000000 0x2b7 + *(.debug_pubnames) + .debug_pubnames + 0x00000000 0x29 src/start/Cstartup_SAM7.o + .debug_pubnames + 0x00000029 0x177 lib/lib_AT91SAM7.o + .debug_pubnames + 0x000001a0 0x83 src/dfu/dfu.o + .debug_pubnames + 0x00000223 0x64 src/dfu/dbgu.o + .debug_pubnames + 0x00000287 0x30 src/os/flash.o + +.debug_info 0x00000000 0x40e7 + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x00000000 0x6a src/start/Cstartup.o + .debug_info 0x0000006a 0x428 src/start/Cstartup_SAM7.o + .debug_info 0x00000492 0x161b lib/lib_AT91SAM7.o + .debug_info 0x00001aad 0x172c src/dfu/dfu.o + .debug_info 0x000031d9 0xb8d src/dfu/dbgu.o + .debug_info 0x00003d66 0x381 src/os/flash.o + +.debug_abbrev 0x00000000 0xbb3 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x12 src/start/Cstartup.o + .debug_abbrev 0x00000012 0xd7 src/start/Cstartup_SAM7.o + .debug_abbrev 0x000000e9 0x2c6 lib/lib_AT91SAM7.o + .debug_abbrev 0x000003af 0x403 src/dfu/dfu.o + .debug_abbrev 0x000007b2 0x226 src/dfu/dbgu.o + .debug_abbrev 0x000009d8 0x1db src/os/flash.o + +.debug_line 0x00000000 0x89e + *(.debug_line) + .debug_line 0x00000000 0xce src/start/Cstartup.o + .debug_line 0x000000ce 0x95 src/start/Cstartup_SAM7.o + .debug_line 0x00000163 0x20e lib/lib_AT91SAM7.o + .debug_line 0x00000371 0x315 src/dfu/dfu.o + .debug_line 0x00000686 0xf7 src/dfu/dbgu.o + .debug_line 0x0000077d 0x121 src/os/flash.o + +.debug_frame 0x00000000 0x540 + *(.debug_frame) + .debug_frame 0x00000000 0x24 src/start/Cstartup_SAM7.o + .debug_frame 0x00000024 0x254 lib/lib_AT91SAM7.o + .debug_frame 0x00000278 0x1b4 src/dfu/dfu.o + .debug_frame 0x0000042c 0x84 src/dfu/dbgu.o + .debug_frame 0x000004b0 0x50 src/os/flash.o + .debug_frame 0x00000500 0x20 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .debug_frame 0x00000520 0x20 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + +.debug_str 0x00000000 0x1637 + *(.debug_str) + .debug_str 0x00000000 0x226 src/start/Cstartup_SAM7.o + 0x233 (size before relaxing) + .debug_str 0x00000226 0x918 lib/lib_AT91SAM7.o + 0xb13 (size before relaxing) + .debug_str 0x00000b3e 0x843 src/dfu/dfu.o + 0xb30 (size before relaxing) + .debug_str 0x00001381 0x1f1 src/dfu/dbgu.o + 0x605 (size before relaxing) + .debug_str 0x00001572 0xc5 src/os/flash.o + 0x21e (size before relaxing) + +.debug_loc 0x00000000 0x1193 + *(.debug_loc) + .debug_loc 0x00000000 0x57 src/start/Cstartup_SAM7.o + .debug_loc 0x00000057 0x86c lib/lib_AT91SAM7.o + .debug_loc 0x000008c3 0x729 src/dfu/dfu.o + .debug_loc 0x00000fec 0xcf src/dfu/dbgu.o + .debug_loc 0x000010bb 0xd8 src/os/flash.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) +OUTPUT(dfu.elf elf32-littlearm) + +.debug_ranges 0x00000000 0x1d0 + .debug_ranges 0x00000000 0x20 src/start/Cstartup.o + .debug_ranges 0x00000020 0xa8 lib/lib_AT91SAM7.o + .debug_ranges 0x000000c8 0x60 src/dfu/dfu.o + .debug_ranges 0x00000128 0x48 src/dfu/dbgu.o + .debug_ranges 0x00000170 0x60 src/os/flash.o + +.debug_pubtypes + 0x00000000 0x485 + .debug_pubtypes + 0x00000000 0x6a src/start/Cstartup_SAM7.o + .debug_pubtypes + 0x0000006a 0x128 lib/lib_AT91SAM7.o + .debug_pubtypes + 0x00000192 0x1ec src/dfu/dfu.o + .debug_pubtypes + 0x0000037e 0xb0 src/dfu/dbgu.o + .debug_pubtypes + 0x0000042e 0x57 src/os/flash.o + +Cross Reference Table + +Symbol File +AT91F_ADC_CfgTimings lib/lib_AT91SAM7.o +AT91F_AIC_ConfigureIt lib/lib_AT91SAM7.o + src/dfu/dbgu.o +AT91F_AIC_Open lib/lib_AT91SAM7.o +AT91F_AIC_SetExceptionVector lib/lib_AT91SAM7.o +AT91F_DBGU_Get src/dfu/dbgu.o +AT91F_DBGU_Init src/dfu/dbgu.o + src/dfu/dfu.o +AT91F_DBGU_Printk src/dfu/dbgu.o + src/dfu/dfu.o +AT91F_DBGU_Ready src/dfu/dbgu.o +AT91F_Default_FIQ_handler src/start/Cstartup.o + src/start/Cstartup_SAM7.o +AT91F_Default_IRQ_handler src/start/Cstartup.o + src/start/Cstartup_SAM7.o +AT91F_LowLevelInit src/start/Cstartup_SAM7.o + src/start/Cstartup.o +AT91F_PDC_Close lib/lib_AT91SAM7.o +AT91F_PDC_Open lib/lib_AT91SAM7.o +AT91F_PDC_ReceiveFrame lib/lib_AT91SAM7.o +AT91F_PDC_SendFrame lib/lib_AT91SAM7.o +AT91F_PMC_GetMasterClock lib/lib_AT91SAM7.o +AT91F_RTTReadValue lib/lib_AT91SAM7.o +AT91F_SPI_Close lib/lib_AT91SAM7.o +AT91F_SSC_Configure lib/lib_AT91SAM7.o +AT91F_SSC_SetBaudrate lib/lib_AT91SAM7.o +AT91F_Spurious_handler src/start/Cstartup.o + src/start/Cstartup_SAM7.o +AT91F_US_Close lib/lib_AT91SAM7.o +AT91F_US_Configure lib/lib_AT91SAM7.o + src/dfu/dbgu.o +IRQ_Handler_Entry src/start/Cstartup.o +Top_Stack src/start/Cstartup.o +__aeabi_idiv e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) +__aeabi_idiv0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) +__aeabi_idivmod e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) + src/dfu/dfu.o +__aeabi_ldiv0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) +__aeabi_uidiv e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + lib/lib_AT91SAM7.o +__aeabi_uidivmod e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + lib/lib_AT91SAM7.o +__bss_end__ src/start/Cstartup.o +__bss_start__ src/start/Cstartup.o +__divsi3 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_divsi3.o) +__udivsi3 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) +_data src/start/Cstartup.o +_data_flash src/start/Cstartup.o +_data_shared src/start/Cstartup.o +_edata src/start/Cstartup.o +_edata_shared src/start/Cstartup.o +_etext src/start/Cstartup.o +_remap_call_dfu src/start/Cstartup.o +_startup src/start/Cstartup.o +dfu_api src/dfu/dfu.o +dfu_cfg_descriptor src/dfu/dfu.o +dfu_dev_descriptor src/dfu/dfu.o +dfu_ep0_handler src/dfu/dfu.o +dfu_main src/dfu/dfu.o + src/start/Cstartup.o +dfu_state src/dfu/dfu.o + src/start/Cstartup.o +exit src/start/Cstartup.o +flash_init src/os/flash.o + src/dfu/dfu.o +flash_page src/os/flash.o + src/dfu/dfu.o +foo src/dfu/dfu.o diff --git a/firmware/dfu.sym b/firmware/dfu.sym new file mode 100644 index 0000000..a8b89fb --- /dev/null +++ b/firmware/dfu.sym @@ -0,0 +1,127 @@ + U _startup +00000000 t reset +00000002 a AT91C_ID_PIOA +00000004 t undefvec +00000008 t swivec +0000000c t pabtvec +00000010 t dabtvec +00000011 a ARM_MODE_FIQ +00000012 a ARM_MODE_IRQ +00000013 a ARM_MODE_SVC +00000014 t rsvdvec +00000018 t irqvec +0000001c t fiqvec +00000020 t dfu_state_dummy +00000024 t FIQ_Handler_Entry +0000003c a PIOA_PDSR +00000040 a F_BIT +0000004c T IRQ_Handler_Entry +00000080 a I_BIT +0000009c t .RAM_TOP +000000a0 t InitReset +000000fc t dfu_magic_end +00000100 a AIC_IVR +00000104 a AIC_FVR +00000108 t LoopRelDS +00000130 a AIC_EOICR +00000144 t _reloc_dfu +00000150 t LoopRel +0000016c t LoopZI +00000188 t loop_rel_t +000001a0 T exit +000001a4 T AT91F_Default_FIQ_handler +000001a8 T AT91F_Default_IRQ_handler +000001ac T AT91F_Spurious_handler +000001f0 T AT91F_LowLevelInit +000002fc t AT91F_PDC_SetNextRx +00000308 t AT91F_PDC_SetNextTx +00000314 t AT91F_PDC_SetRx +00000320 t AT91F_PDC_SetTx +0000032c t AT91F_PDC_DisableTx +00000338 t AT91F_PDC_DisableRx +00000344 t AT91F_CKGR_GetMainClock +0000035c T AT91F_AIC_ConfigureIt +00000394 T AT91F_AIC_SetExceptionVector +000003c8 T AT91F_AIC_Open +00000400 a FIQ_Stack_Size +00000400 a IRQ_Stack_Size +00000444 T AT91F_PDC_Open +000004b0 T AT91F_PDC_Close +00000508 T AT91F_PDC_SendFrame +0000055c T AT91F_PDC_ReceiveFrame +000005b0 T AT91F_PMC_GetMasterClock +0000063c T AT91F_RTTReadValue +0000066c T AT91F_SPI_Close +000006ac T AT91F_ADC_CfgTimings +00000714 T AT91F_SSC_SetBaudrate +00000778 T AT91F_SSC_Configure +000007c4 T AT91F_US_Configure +00000844 T AT91F_US_Close +0000087c t udp_ep0_send_data +00000958 t udp_ep0_send_zlp +0000099c t udp_ep0_send_stall +000009e0 t handle_getstate +00000a08 t handle_upload.clone.0 +00000a7c t handle_dnload.clone.1 +00000bd0 t handle_getstatus +00000c74 T dfu_ep0_handler +00000e90 t AT91F_PIO_CfgOutput.clone.5 +00000ea0 t udp_init +00000ed8 t AT91F_PIO_SetOutput.clone.6 +00000ee4 t AT91F_PIO_ClearOutput.clone.7 +00000ef0 t AT91F_RSTSoftReset.clone.8 +00000f00 a AIC_MCR_RCR +00000f04 t dfu_udp_irq +000012bc t dfu_switch +000012d8 T dfu_main +0000139c T AT91F_DBGU_Ready +000013b0 T AT91F_DBGU_Init +00001440 T AT91F_DBGU_Printk +00001468 T AT91F_DBGU_Get +00001488 t DBGU_irq_handler +000014dc t AT91F_MC_EFC_PerformCmd.clone.3 +000014e8 T flash_page +00001544 T flash_init +00001558 t .udivsi3_skip_div0_test +00001558 T __aeabi_uidiv +00001558 T __udivsi3 +0000164c T __aeabi_uidivmod +0000166c T __aeabi_idiv +0000166c T __divsi3 +00001674 t .divsi3_skip_div0_test +00001794 T __aeabi_idivmod +000017b4 W __aeabi_idiv0 +000017b4 W __aeabi_ldiv0 +000017b8 T dfu_dev_descriptor +000017ca T dfu_cfg_descriptor +000017f0 t usb_strings +00001808 t string0 +0000180c t string1 +00001874 t string2 +000018b2 t string3 +000018e6 t string4 +00001942 t string5 +00001ac0 A _etext +00001ac8 A _data_flash +00003fd0 R dfu_api +00200020 D _data_shared +00200020 D dfu_state +00200024 d dfu_status +00200028 A _edata_shared +00201ac0 D _data +00201ac0 D _remap_call_dfu +00201adc d ptr +00201ae0 D foo +00201ae4 B __bss_start +00201ae4 B __bss_start__ +00201ae4 A _edata +00201ae4 b pagebuf32 +00201be4 b cur_config +00201be8 b value.6564 +00201bec A __bss_end__ +00201bec A _end +00208000 N Top_Stack +08000000 a PIO_BOOTLDR +fffff000 a AT91C_BASE_AIC +fffff400 a AT91C_BASE_PIOA +fffffc10 a AT91C_PMC_PCER diff --git a/firmware/doc/dfu.txt b/firmware/doc/dfu.txt new file mode 100644 index 0000000..78fe5a6 --- /dev/null +++ b/firmware/doc/dfu.txt @@ -0,0 +1,131 @@ +- data that is needed from both app and dfu mode +- code that is needed from both app and dfu mode + - function pointers + - copy code to RAM in case of DFU switch +- data that is only needed in DFU mode + - can be overwritten in case of reset-to-application +- data that is only needed in app mode + - can be overwritten with DFU data in case of DFU switch +- code that is only needed in DFU mode + - has to be copied to ram in case of DFU switch +- code that is only needed in app mode + - can be read from flash, no action required + + +=> abandoned that complicated idea. +now all DFU functions are __ramfunc's and thus always present. + + +interaction between app and dfu code: + +- dfu_switch(void) +- dfu_status (can be put in accessor function, if required) +- dfu_cfg_descriptor +- dfu_dev_descriptor +- dfu_ep0_handler() + + +order of events at boot; + +- start at reset vector in flash + - AT91F_LowLevelInit() +- setup stack for each mode +- relocate 'data' of bootloader, including ramfunc/vectram +- clear 'bss' of bootloader +- call remap command + - call usb initialization (irq, clock) + - if keypress, + - call dfu_main() + - wait for ep0 / busreset interrupt + - else call main() + + +memory layout: + +0: lowlevel startup code + Cstartup.o 0x00bc + Cstartup_SAM7.o 0x0100 + dfufunc 0x1dcc + dfustruct 0x0038 + + text text 0x0070 +data data 0x0000 +bss bss 0x000c + +flash = text + data (= 8k) +ram/rel = data + bss (12 bytes) + + +If we drop the DFU-can-flash-DFU requirement, we can leave all DFU related code +in flash. no need for any function to be permanently in RAM. However, not +preventing this feature in some future version, we shouldn't do that. + + +Function DFU runtime +udp_init x x RAM +udp_ep0_send_data x x RAM +udp_ep0_send_zlp x x RAM +udp_sp0_send_stall x x RAM +handle_dnload x - flash/relocated +handle_upload x - flash/relocated +handle_getstatus x - flash/relocated +handle_getstate x - flash/relocated +dfu_ep0_handler x x RAM + +dfu_dev_descriptor x - flash/relocated +dfu_cfg_descriptor x - flash/relocated +dfu_udp_ep0_handler x - flash/relocated +dfu_udp_irq x - flash/relocated +dfu_switch - x RAM +dfu_main x - flash/relocated +vectram x x flash/relocated/switched +IRQ_Handler_EntryR x x flash/relocated/switched +_remap x - flash/reloaded + +dfu_api x x flash (const anyway) +dfu_state x x RAM + + +preconditions: + - dfu code assumes to be loaded to address zero to make it work from both ram and rom + +startup: + - exception vectors (in flash) + - call lowlevel_init + - setup user/supervisor/FIQ/IRQ stack + - relocate dfu_state + - if DFU switch is pressed + - jump to dfu_main in flash + - relocate all of DFU .text/.data into ram (including exception vectors) + - initialize DFU .bss + - remap RAM to address zero + + - if DFU switch is not pressed jump to entry address of app + - Cstartup_app.S + - relocate application .data + - initialize application .bss + - jump to appliction main + - application uses dfu_api in flash, pointing to in-flash data + - application calls dfu_switch() + - disable all interupts but USB + - relocate all of DFU .text/.data into ram (including exception vectors) + - remap RAM to address zero + - check whether app has already remapped RAM before !?! + +memory map: + +load_addr run_Addr +0x00100000 0x00000000 exception vectors (DFU Cstartup) + Cstartup_SAM7 + + 0x00200000 + + +DFU constants: +_etext: +_data: 0x200000 +_edata: + +APP contants: +_data: _edata_dfu + diff --git a/firmware/doc/piccsim-todo.txt b/firmware/doc/piccsim-todo.txt new file mode 100644 index 0000000..a009b7d --- /dev/null +++ b/firmware/doc/piccsim-todo.txt @@ -0,0 +1,34 @@ +- code to control digital potentiometers via SPI [MM] + - chip select not SPI CS + +- idea: use comparator to determine voltage range, then reconfigure amplifier + - later + +- problem: capacitance of digital poti + - idea 1: + - idea 2: logarithmic amplifier using transistor + +- ADC driver + - core [MM] + - trigger function (we want to read all values ASAP) + - callback function (once new values are available) + - init function (initialize ADC) + - USB integration [HW] + - simple READ_ADC command + - one reply packet with all ADC channels + +- OS timer + - how often? + +- 'load modulation' driver + x set PA2/PA3 to binary 0..3 + +x add IO definitions for + - PLL INHIBIT low + - SPI_SS1_GAIN + - SPI_SS2_DATA_THRESHOLD + - BOOTLDR + +- sampled data continuous output into file / stdout + - trigger sampling by raising/falling edge (configurable) + - sample only one buffer diff --git a/firmware/doc/piccsim.txt b/firmware/doc/piccsim.txt new file mode 100644 index 0000000..3f149da --- /dev/null +++ b/firmware/doc/piccsim.txt @@ -0,0 +1,42 @@ +PICCSIM design + +ISO14443 anticollision: +- Configure TC + - to reset TC2 on every falling edge + - to use FORCE_FAST for TC IRQ + - to enable TC2 ETRGS +- CARRIER_DIV is switched to 212kHz / 424kHz + - this results in SSC Rx is 4x (2x?) oversampling +- Set SSC Rx start condition to 4x/2x SOF pattern +- upon reception of first falling edge, we + - end up in TC FIQ + - read out TC0 current value + - reconfigure TC0 RA/RB to be in-phase with previously-read TC0 + value (subtracting some fixed offset depending on FIQ latency) + - reconfigure TC2 + - to use external event on every rising edge + - to reset(trigger) on every external event + - to clear TIOA2 on RC compare (RC is high) + - to set TIOA2 on RA compare (RA set later) + - disable TC2 IRQ (and FIQ FAST_FORCE) +- Wait for SSC Rx Interrupt (DMA complete, or PIO) + - Read and decode single 32bit word + - determine whether it is REQA or WUPA + - abort if not, start over + - depending on last bit 0/1, configure TC2 RA (FDT) + - recconfig TC0 to produce 1.6MHz CARRIER_DIV clock for SSC Tx + - make sure this is done synchronously + - + - set up SSC Tx + - DMA with pre-encoded (and user-configured) ATQA + - start Tx at a rising edge of TF (asserted by TC2 RA) + - Send Interrupt once TX DMA is done +- Once TC2 RA compare happens, the rising edge of TIOA2 will trigger SSC +- Wait for SSC Tx DMA to finish +- Repeat similar steps for ANTICOL/SELECT command, differences: + - single-byte compare after frame Rx is not sufficient + - evaluate number of valid bits ASAP + - we might receive and transmit split frame at non-byte-boundaries + - just shift a prepared ANTICOL/Select response + - make sure parity is handled correctly! +- Once we've completed the select, we go on with normal diff --git a/firmware/include/AT91SAM7.h b/firmware/include/AT91SAM7.h new file mode 100644 index 0000000..53eb072 --- /dev/null +++ b/firmware/include/AT91SAM7.h @@ -0,0 +1,1947 @@ +// ---------------------------------------------------------------------------- +// ATMEL Microcontroller Software Support - ROUSSET - +// ---------------------------------------------------------------------------- +// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +// DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ---------------------------------------------------------------------------- +// File Name : AT91SAM7S64.h +// Object : AT91SAM7S64 definitions +// Generated : AT91 SW Application Group 08/30/2005 (15:52:59) +// +// CVS Reference : /AT91SAM7S64.pl/1.21/Tue Aug 30 11:55:03 2005// +// CVS Reference : /SYS_SAM7S.pl/1.2/Tue Feb 1 17:01:52 2005// +// CVS Reference : /MC_SAM7S.pl/1.3/Fri May 20 14:12:30 2005// +// CVS Reference : /PMC_SAM7S_USB.pl/1.4/Tue Feb 8 13:58:22 2005// +// CVS Reference : /RSTC_SAM7S.pl/1.2/Wed Jul 13 14:57:40 2005// +// CVS Reference : /UDP_SAM7S.pl/1.1/Tue May 10 11:34:52 2005// +// CVS Reference : /PWM_SAM7S.pl/1.1/Tue May 10 11:53:07 2005// +// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +// CVS Reference : /SSC_6078A.pl/1.1/Tue Jul 13 07:45:40 2004// +// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +// ---------------------------------------------------------------------------- + +#ifndef __AT91SAM7_H__ +#define __AT91SAM7_H__ + +typedef volatile unsigned int AT91_REG;// Hardware register definition + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR System Peripherals +// ***************************************************************************** +typedef struct _AT91S_SYS { + AT91_REG AIC_SMR[32]; // Source Mode Register + AT91_REG AIC_SVR[32]; // Source Vector Register + AT91_REG AIC_IVR; // IRQ Vector Register + AT91_REG AIC_FVR; // FIQ Vector Register + AT91_REG AIC_ISR; // Interrupt Status Register + AT91_REG AIC_IPR; // Interrupt Pending Register + AT91_REG AIC_IMR; // Interrupt Mask Register + AT91_REG AIC_CISR; // Core Interrupt Status Register + AT91_REG Reserved0[2]; // + AT91_REG AIC_IECR; // Interrupt Enable Command Register + AT91_REG AIC_IDCR; // Interrupt Disable Command Register + AT91_REG AIC_ICCR; // Interrupt Clear Command Register + AT91_REG AIC_ISCR; // Interrupt Set Command Register + AT91_REG AIC_EOICR; // End of Interrupt Command Register + AT91_REG AIC_SPU; // Spurious Vector Register + AT91_REG AIC_DCR; // Debug Control Register (Protect) + AT91_REG Reserved1[1]; // + AT91_REG AIC_FFER; // Fast Forcing Enable Register + AT91_REG AIC_FFDR; // Fast Forcing Disable Register + AT91_REG AIC_FFSR; // Fast Forcing Status Register + AT91_REG Reserved2[45]; // + AT91_REG DBGU_CR; // Control Register + AT91_REG DBGU_MR; // Mode Register + AT91_REG DBGU_IER; // Interrupt Enable Register + AT91_REG DBGU_IDR; // Interrupt Disable Register + AT91_REG DBGU_IMR; // Interrupt Mask Register + AT91_REG DBGU_CSR; // Channel Status Register + AT91_REG DBGU_RHR; // Receiver Holding Register + AT91_REG DBGU_THR; // Transmitter Holding Register + AT91_REG DBGU_BRGR; // Baud Rate Generator Register + AT91_REG Reserved3[7]; // + AT91_REG DBGU_CIDR; // Chip ID Register + AT91_REG DBGU_EXID; // Chip ID Extension Register + AT91_REG DBGU_FNTR; // Force NTRST Register + AT91_REG Reserved4[45]; // + AT91_REG DBGU_RPR; // Receive Pointer Register + AT91_REG DBGU_RCR; // Receive Counter Register + AT91_REG DBGU_TPR; // Transmit Pointer Register + AT91_REG DBGU_TCR; // Transmit Counter Register + AT91_REG DBGU_RNPR; // Receive Next Pointer Register + AT91_REG DBGU_RNCR; // Receive Next Counter Register + AT91_REG DBGU_TNPR; // Transmit Next Pointer Register + AT91_REG DBGU_TNCR; // Transmit Next Counter Register + AT91_REG DBGU_PTCR; // PDC Transfer Control Register + AT91_REG DBGU_PTSR; // PDC Transfer Status Register + AT91_REG Reserved5[54]; // + AT91_REG PIOA_PER; // PIO Enable Register + AT91_REG PIOA_PDR; // PIO Disable Register + AT91_REG PIOA_PSR; // PIO Status Register + AT91_REG Reserved6[1]; // + AT91_REG PIOA_OER; // Output Enable Register + AT91_REG PIOA_ODR; // Output Disable Registerr + AT91_REG PIOA_OSR; // Output Status Register + AT91_REG Reserved7[1]; // + AT91_REG PIOA_IFER; // Input Filter Enable Register + AT91_REG PIOA_IFDR; // Input Filter Disable Register + AT91_REG PIOA_IFSR; // Input Filter Status Register + AT91_REG Reserved8[1]; // + AT91_REG PIOA_SODR; // Set Output Data Register + AT91_REG PIOA_CODR; // Clear Output Data Register + AT91_REG PIOA_ODSR; // Output Data Status Register + AT91_REG PIOA_PDSR; // Pin Data Status Register + AT91_REG PIOA_IER; // Interrupt Enable Register + AT91_REG PIOA_IDR; // Interrupt Disable Register + AT91_REG PIOA_IMR; // Interrupt Mask Register + AT91_REG PIOA_ISR; // Interrupt Status Register + AT91_REG PIOA_MDER; // Multi-driver Enable Register + AT91_REG PIOA_MDDR; // Multi-driver Disable Register + AT91_REG PIOA_MDSR; // Multi-driver Status Register + AT91_REG Reserved9[1]; // + AT91_REG PIOA_PPUDR; // Pull-up Disable Register + AT91_REG PIOA_PPUER; // Pull-up Enable Register + AT91_REG PIOA_PPUSR; // Pull-up Status Register + AT91_REG Reserved10[1]; // + AT91_REG PIOA_ASR; // Select A Register + AT91_REG PIOA_BSR; // Select B Register + AT91_REG PIOA_ABSR; // AB Select Status Register + AT91_REG Reserved11[9]; // + AT91_REG PIOA_OWER; // Output Write Enable Register + AT91_REG PIOA_OWDR; // Output Write Disable Register + AT91_REG PIOA_OWSR; // Output Write Status Register + AT91_REG Reserved12[469]; // + AT91_REG PMC_SCER; // System Clock Enable Register + AT91_REG PMC_SCDR; // System Clock Disable Register + AT91_REG PMC_SCSR; // System Clock Status Register + AT91_REG Reserved13[1]; // + AT91_REG PMC_PCER; // Peripheral Clock Enable Register + AT91_REG PMC_PCDR; // Peripheral Clock Disable Register + AT91_REG PMC_PCSR; // Peripheral Clock Status Register + AT91_REG Reserved14[1]; // + AT91_REG PMC_MOR; // Main Oscillator Register + AT91_REG PMC_MCFR; // Main Clock Frequency Register + AT91_REG Reserved15[1]; // + AT91_REG PMC_PLLR; // PLL Register + AT91_REG PMC_MCKR; // Master Clock Register + AT91_REG Reserved16[3]; // + AT91_REG PMC_PCKR[3]; // Programmable Clock Register + AT91_REG Reserved17[5]; // + AT91_REG PMC_IER; // Interrupt Enable Register + AT91_REG PMC_IDR; // Interrupt Disable Register + AT91_REG PMC_SR; // Status Register + AT91_REG PMC_IMR; // Interrupt Mask Register + AT91_REG Reserved18[36]; // + AT91_REG RSTC_RCR; // Reset Control Register + AT91_REG RSTC_RSR; // Reset Status Register + AT91_REG RSTC_RMR; // Reset Mode Register + AT91_REG Reserved19[5]; // + AT91_REG RTTC_RTMR; // Real-time Mode Register + AT91_REG RTTC_RTAR; // Real-time Alarm Register + AT91_REG RTTC_RTVR; // Real-time Value Register + AT91_REG RTTC_RTSR; // Real-time Status Register + AT91_REG PITC_PIMR; // Period Interval Mode Register + AT91_REG PITC_PISR; // Period Interval Status Register + AT91_REG PITC_PIVR; // Period Interval Value Register + AT91_REG PITC_PIIR; // Period Interval Image Register + AT91_REG WDTC_WDCR; // Watchdog Control Register + AT91_REG WDTC_WDMR; // Watchdog Mode Register + AT91_REG WDTC_WDSR; // Watchdog Status Register + AT91_REG Reserved20[5]; // + AT91_REG VREG_MR; // Voltage Regulator Mode Register +} AT91S_SYS, *AT91PS_SYS; + + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +// ***************************************************************************** +typedef struct _AT91S_AIC { + AT91_REG AIC_SMR[32]; // Source Mode Register + AT91_REG AIC_SVR[32]; // Source Vector Register + AT91_REG AIC_IVR; // IRQ Vector Register + AT91_REG AIC_FVR; // FIQ Vector Register + AT91_REG AIC_ISR; // Interrupt Status Register + AT91_REG AIC_IPR; // Interrupt Pending Register + AT91_REG AIC_IMR; // Interrupt Mask Register + AT91_REG AIC_CISR; // Core Interrupt Status Register + AT91_REG Reserved0[2]; // + AT91_REG AIC_IECR; // Interrupt Enable Command Register + AT91_REG AIC_IDCR; // Interrupt Disable Command Register + AT91_REG AIC_ICCR; // Interrupt Clear Command Register + AT91_REG AIC_ISCR; // Interrupt Set Command Register + AT91_REG AIC_EOICR; // End of Interrupt Command Register + AT91_REG AIC_SPU; // Spurious Vector Register + AT91_REG AIC_DCR; // Debug Control Register (Protect) + AT91_REG Reserved1[1]; // + AT91_REG AIC_FFER; // Fast Forcing Enable Register + AT91_REG AIC_FFDR; // Fast Forcing Disable Register + AT91_REG AIC_FFSR; // Fast Forcing Status Register +} AT91S_AIC, *AT91PS_AIC; + +// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +#define AT91C_AIC_PRIOR ((unsigned int) 0x7 << 0) // (AIC) Priority Level +#define AT91C_AIC_PRIOR_LOWEST ((unsigned int) 0x0) // (AIC) Lowest priority level +#define AT91C_AIC_PRIOR_HIGHEST ((unsigned int) 0x7) // (AIC) Highest priority level +#define AT91C_AIC_SRCTYPE ((unsigned int) 0x3 << 5) // (AIC) Interrupt Source Type +#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL ((unsigned int) 0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive +#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL ((unsigned int) 0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive +#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered +#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered +#define AT91C_AIC_SRCTYPE_HIGH_LEVEL ((unsigned int) 0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive +#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE ((unsigned int) 0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered +// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +#define AT91C_AIC_NFIQ ((unsigned int) 0x1 << 0) // (AIC) NFIQ Status +#define AT91C_AIC_NIRQ ((unsigned int) 0x1 << 1) // (AIC) NIRQ Status +// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +#define AT91C_AIC_DCR_PROT ((unsigned int) 0x1 << 0) // (AIC) Protection Mode +#define AT91C_AIC_DCR_GMSK ((unsigned int) 0x1 << 1) // (AIC) General Mask + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Peripheral DMA Controller +// ***************************************************************************** +typedef struct _AT91S_PDC { + AT91_REG PDC_RPR; // Receive Pointer Register + AT91_REG PDC_RCR; // Receive Counter Register + AT91_REG PDC_TPR; // Transmit Pointer Register + AT91_REG PDC_TCR; // Transmit Counter Register + AT91_REG PDC_RNPR; // Receive Next Pointer Register + AT91_REG PDC_RNCR; // Receive Next Counter Register + AT91_REG PDC_TNPR; // Transmit Next Pointer Register + AT91_REG PDC_TNCR; // Transmit Next Counter Register + AT91_REG PDC_PTCR; // PDC Transfer Control Register + AT91_REG PDC_PTSR; // PDC Transfer Status Register +} AT91S_PDC, *AT91PS_PDC; + +// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +#define AT91C_PDC_RXTEN ((unsigned int) 0x1 << 0) // (PDC) Receiver Transfer Enable +#define AT91C_PDC_RXTDIS ((unsigned int) 0x1 << 1) // (PDC) Receiver Transfer Disable +#define AT91C_PDC_TXTEN ((unsigned int) 0x1 << 8) // (PDC) Transmitter Transfer Enable +#define AT91C_PDC_TXTDIS ((unsigned int) 0x1 << 9) // (PDC) Transmitter Transfer Disable +// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Debug Unit +// ***************************************************************************** +typedef struct _AT91S_DBGU { + AT91_REG DBGU_CR; // Control Register + AT91_REG DBGU_MR; // Mode Register + AT91_REG DBGU_IER; // Interrupt Enable Register + AT91_REG DBGU_IDR; // Interrupt Disable Register + AT91_REG DBGU_IMR; // Interrupt Mask Register + AT91_REG DBGU_CSR; // Channel Status Register + AT91_REG DBGU_RHR; // Receiver Holding Register + AT91_REG DBGU_THR; // Transmitter Holding Register + AT91_REG DBGU_BRGR; // Baud Rate Generator Register + AT91_REG Reserved0[7]; // + AT91_REG DBGU_CIDR; // Chip ID Register + AT91_REG DBGU_EXID; // Chip ID Extension Register + AT91_REG DBGU_FNTR; // Force NTRST Register + AT91_REG Reserved1[45]; // + AT91_REG DBGU_RPR; // Receive Pointer Register + AT91_REG DBGU_RCR; // Receive Counter Register + AT91_REG DBGU_TPR; // Transmit Pointer Register + AT91_REG DBGU_TCR; // Transmit Counter Register + AT91_REG DBGU_RNPR; // Receive Next Pointer Register + AT91_REG DBGU_RNCR; // Receive Next Counter Register + AT91_REG DBGU_TNPR; // Transmit Next Pointer Register + AT91_REG DBGU_TNCR; // Transmit Next Counter Register + AT91_REG DBGU_PTCR; // PDC Transfer Control Register + AT91_REG DBGU_PTSR; // PDC Transfer Status Register +} AT91S_DBGU, *AT91PS_DBGU; + +// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) // (DBGU) Reset Receiver +#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) // (DBGU) Reset Transmitter +#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) // (DBGU) Receiver Enable +#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) // (DBGU) Receiver Disable +#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) // (DBGU) Transmitter Enable +#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) // (DBGU) Transmitter Disable +#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) // (DBGU) Reset Status Bits +// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +#define AT91C_US_PAR ((unsigned int) 0x7 << 9) // (DBGU) Parity type +#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) // (DBGU) Even Parity +#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) // (DBGU) Odd Parity +#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) // (DBGU) Parity forced to 0 (Space) +#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) // (DBGU) Parity forced to 1 (Mark) +#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) // (DBGU) No Parity +#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) // (DBGU) Multi-drop mode +#define AT91C_US_CHMODE ((unsigned int) 0x3 << 14) // (DBGU) Channel Mode +#define AT91C_US_CHMODE_NORMAL ((unsigned int) 0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +#define AT91C_US_CHMODE_AUTO ((unsigned int) 0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +#define AT91C_US_CHMODE_LOCAL ((unsigned int) 0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +#define AT91C_US_CHMODE_REMOTE ((unsigned int) 0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) // (DBGU) RXRDY Interrupt +#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) // (DBGU) TXRDY Interrupt +#define AT91C_US_ENDRX ((unsigned int) 0x1 << 3) // (DBGU) End of Receive Transfer Interrupt +#define AT91C_US_ENDTX ((unsigned int) 0x1 << 4) // (DBGU) End of Transmit Interrupt +#define AT91C_US_OVRE ((unsigned int) 0x1 << 5) // (DBGU) Overrun Interrupt +#define AT91C_US_FRAME ((unsigned int) 0x1 << 6) // (DBGU) Framing Error Interrupt +#define AT91C_US_PARE ((unsigned int) 0x1 << 7) // (DBGU) Parity Error Interrupt +#define AT91C_US_TXEMPTY ((unsigned int) 0x1 << 9) // (DBGU) TXEMPTY Interrupt +#define AT91C_US_TXBUFE ((unsigned int) 0x1 << 11) // (DBGU) TXBUFE Interrupt +#define AT91C_US_RXBUFF ((unsigned int) 0x1 << 12) // (DBGU) RXBUFF Interrupt +#define AT91C_US_COMM_TX ((unsigned int) 0x1 << 30) // (DBGU) COMM_TX Interrupt +#define AT91C_US_COMM_RX ((unsigned int) 0x1 << 31) // (DBGU) COMM_RX Interrupt +// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +#define AT91C_US_FORCE_NTRST ((unsigned int) 0x1 << 0) // (DBGU) Force NTRST in JTAG + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +// ***************************************************************************** +typedef struct _AT91S_PIO { + AT91_REG PIO_PER; // PIO Enable Register + AT91_REG PIO_PDR; // PIO Disable Register + AT91_REG PIO_PSR; // PIO Status Register + AT91_REG Reserved0[1]; // + AT91_REG PIO_OER; // Output Enable Register + AT91_REG PIO_ODR; // Output Disable Registerr + AT91_REG PIO_OSR; // Output Status Register + AT91_REG Reserved1[1]; // + AT91_REG PIO_IFER; // Input Filter Enable Register + AT91_REG PIO_IFDR; // Input Filter Disable Register + AT91_REG PIO_IFSR; // Input Filter Status Register + AT91_REG Reserved2[1]; // + AT91_REG PIO_SODR; // Set Output Data Register + AT91_REG PIO_CODR; // Clear Output Data Register + AT91_REG PIO_ODSR; // Output Data Status Register + AT91_REG PIO_PDSR; // Pin Data Status Register + AT91_REG PIO_IER; // Interrupt Enable Register + AT91_REG PIO_IDR; // Interrupt Disable Register + AT91_REG PIO_IMR; // Interrupt Mask Register + AT91_REG PIO_ISR; // Interrupt Status Register + AT91_REG PIO_MDER; // Multi-driver Enable Register + AT91_REG PIO_MDDR; // Multi-driver Disable Register + AT91_REG PIO_MDSR; // Multi-driver Status Register + AT91_REG Reserved3[1]; // + AT91_REG PIO_PPUDR; // Pull-up Disable Register + AT91_REG PIO_PPUER; // Pull-up Enable Register + AT91_REG PIO_PPUSR; // Pull-up Status Register + AT91_REG Reserved4[1]; // + AT91_REG PIO_ASR; // Select A Register + AT91_REG PIO_BSR; // Select B Register + AT91_REG PIO_ABSR; // AB Select Status Register + AT91_REG Reserved5[9]; // + AT91_REG PIO_OWER; // Output Write Enable Register + AT91_REG PIO_OWDR; // Output Write Disable Register + AT91_REG PIO_OWSR; // Output Write Status Register +} AT91S_PIO, *AT91PS_PIO; + + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Clock Generator Controler +// ***************************************************************************** +typedef struct _AT91S_CKGR { + AT91_REG CKGR_MOR; // Main Oscillator Register + AT91_REG CKGR_MCFR; // Main Clock Frequency Register + AT91_REG Reserved0[1]; // + AT91_REG CKGR_PLLR; // PLL Register +} AT91S_CKGR, *AT91PS_CKGR; + +// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +#define AT91C_CKGR_MOSCEN ((unsigned int) 0x1 << 0) // (CKGR) Main Oscillator Enable +#define AT91C_CKGR_OSCBYPASS ((unsigned int) 0x1 << 1) // (CKGR) Main Oscillator Bypass +#define AT91C_CKGR_OSCOUNT ((unsigned int) 0xFF << 8) // (CKGR) Main Oscillator Start-up Time +// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +#define AT91C_CKGR_MAINF ((unsigned int) 0xFFFF << 0) // (CKGR) Main Clock Frequency +#define AT91C_CKGR_MAINRDY ((unsigned int) 0x1 << 16) // (CKGR) Main Clock Ready +// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +#define AT91C_CKGR_DIV ((unsigned int) 0xFF << 0) // (CKGR) Divider Selected +#define AT91C_CKGR_DIV_0 ((unsigned int) 0x0) // (CKGR) Divider output is 0 +#define AT91C_CKGR_DIV_BYPASS ((unsigned int) 0x1) // (CKGR) Divider is bypassed +#define AT91C_CKGR_PLLCOUNT ((unsigned int) 0x3F << 8) // (CKGR) PLL Counter +#define AT91C_CKGR_OUT ((unsigned int) 0x3 << 14) // (CKGR) PLL Output Frequency Range +#define AT91C_CKGR_OUT_0 ((unsigned int) 0x0 << 14) // (CKGR) Please refer to the PLL datasheet +#define AT91C_CKGR_OUT_1 ((unsigned int) 0x1 << 14) // (CKGR) Please refer to the PLL datasheet +#define AT91C_CKGR_OUT_2 ((unsigned int) 0x2 << 14) // (CKGR) Please refer to the PLL datasheet +#define AT91C_CKGR_OUT_3 ((unsigned int) 0x3 << 14) // (CKGR) Please refer to the PLL datasheet +#define AT91C_CKGR_MUL ((unsigned int) 0x7FF << 16) // (CKGR) PLL Multiplier +#define AT91C_CKGR_USBDIV ((unsigned int) 0x3 << 28) // (CKGR) Divider for USB Clocks +#define AT91C_CKGR_USBDIV_0 ((unsigned int) 0x0 << 28) // (CKGR) Divider output is PLL clock output +#define AT91C_CKGR_USBDIV_1 ((unsigned int) 0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 +#define AT91C_CKGR_USBDIV_2 ((unsigned int) 0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Power Management Controler +// ***************************************************************************** +typedef struct _AT91S_PMC { + AT91_REG PMC_SCER; // System Clock Enable Register + AT91_REG PMC_SCDR; // System Clock Disable Register + AT91_REG PMC_SCSR; // System Clock Status Register + AT91_REG Reserved0[1]; // + AT91_REG PMC_PCER; // Peripheral Clock Enable Register + AT91_REG PMC_PCDR; // Peripheral Clock Disable Register + AT91_REG PMC_PCSR; // Peripheral Clock Status Register + AT91_REG Reserved1[1]; // + AT91_REG PMC_MOR; // Main Oscillator Register + AT91_REG PMC_MCFR; // Main Clock Frequency Register + AT91_REG Reserved2[1]; // + AT91_REG PMC_PLLR; // PLL Register + AT91_REG PMC_MCKR; // Master Clock Register + AT91_REG Reserved3[3]; // + AT91_REG PMC_PCKR[3]; // Programmable Clock Register + AT91_REG Reserved4[5]; // + AT91_REG PMC_IER; // Interrupt Enable Register + AT91_REG PMC_IDR; // Interrupt Disable Register + AT91_REG PMC_SR; // Status Register + AT91_REG PMC_IMR; // Interrupt Mask Register +} AT91S_PMC, *AT91PS_PMC; + +// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +#define AT91C_PMC_PCK ((unsigned int) 0x1 << 0) // (PMC) Processor Clock +#define AT91C_PMC_UDP ((unsigned int) 0x1 << 7) // (PMC) USB Device Port Clock +#define AT91C_PMC_PCK0 ((unsigned int) 0x1 << 8) // (PMC) Programmable Clock Output +#define AT91C_PMC_PCK1 ((unsigned int) 0x1 << 9) // (PMC) Programmable Clock Output +#define AT91C_PMC_PCK2 ((unsigned int) 0x1 << 10) // (PMC) Programmable Clock Output +// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +#define AT91C_PMC_CSS ((unsigned int) 0x3 << 0) // (PMC) Programmable Clock Selection +#define AT91C_PMC_CSS_SLOW_CLK ((unsigned int) 0x0) // (PMC) Slow Clock is selected +#define AT91C_PMC_CSS_MAIN_CLK ((unsigned int) 0x1) // (PMC) Main Clock is selected +#define AT91C_PMC_CSS_PLL_CLK ((unsigned int) 0x3) // (PMC) Clock from PLL is selected +#define AT91C_PMC_PRES ((unsigned int) 0x7 << 2) // (PMC) Programmable Clock Prescaler +#define AT91C_PMC_PRES_CLK ((unsigned int) 0x0 << 2) // (PMC) Selected clock +#define AT91C_PMC_PRES_CLK_2 ((unsigned int) 0x1 << 2) // (PMC) Selected clock divided by 2 +#define AT91C_PMC_PRES_CLK_4 ((unsigned int) 0x2 << 2) // (PMC) Selected clock divided by 4 +#define AT91C_PMC_PRES_CLK_8 ((unsigned int) 0x3 << 2) // (PMC) Selected clock divided by 8 +#define AT91C_PMC_PRES_CLK_16 ((unsigned int) 0x4 << 2) // (PMC) Selected clock divided by 16 +#define AT91C_PMC_PRES_CLK_32 ((unsigned int) 0x5 << 2) // (PMC) Selected clock divided by 32 +#define AT91C_PMC_PRES_CLK_64 ((unsigned int) 0x6 << 2) // (PMC) Selected clock divided by 64 +// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +#define AT91C_PMC_MOSCS ((unsigned int) 0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask +#define AT91C_PMC_LOCK ((unsigned int) 0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask +#define AT91C_PMC_MCKRDY ((unsigned int) 0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask +#define AT91C_PMC_PCK0RDY ((unsigned int) 0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask +#define AT91C_PMC_PCK1RDY ((unsigned int) 0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask +#define AT91C_PMC_PCK2RDY ((unsigned int) 0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask +// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Reset Controller Interface +// ***************************************************************************** +typedef struct _AT91S_RSTC { + AT91_REG RSTC_RCR; // Reset Control Register + AT91_REG RSTC_RSR; // Reset Status Register + AT91_REG RSTC_RMR; // Reset Mode Register +} AT91S_RSTC, *AT91PS_RSTC; + +// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) // (RSTC) Processor Reset +#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) // (RSTC) Peripheral Reset +#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) // (RSTC) External Reset +#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) // (RSTC) Password +// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) // (RSTC) User Reset Status +#define AT91C_RSTC_BODSTS ((unsigned int) 0x1 << 1) // (RSTC) Brownout Detection Status +#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) // (RSTC) Reset Type +#define AT91C_RSTC_RSTTYP_POWERUP ((unsigned int) 0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. +#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. +#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. +#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. +#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) // (RSTC) User Reset. NRST pin detected low. +#define AT91C_RSTC_RSTTYP_BROWNOUT ((unsigned int) 0x5 << 8) // (RSTC) Brownout Reset occured. +#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) // (RSTC) NRST pin level +#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) // (RSTC) Software Reset Command in Progress. +// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) // (RSTC) User Reset Enable +#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) // (RSTC) User Reset Interrupt Enable +#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) // (RSTC) User Reset Length +#define AT91C_RSTC_BODIEN ((unsigned int) 0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +// ***************************************************************************** +typedef struct _AT91S_RTTC { + AT91_REG RTTC_RTMR; // Real-time Mode Register + AT91_REG RTTC_RTAR; // Real-time Alarm Register + AT91_REG RTTC_RTVR; // Real-time Value Register + AT91_REG RTTC_RTSR; // Real-time Status Register +} AT91S_RTTC, *AT91PS_RTTC; + +// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +#define AT91C_RTTC_RTPRES ((unsigned int) 0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value +#define AT91C_RTTC_ALMIEN ((unsigned int) 0x1 << 16) // (RTTC) Alarm Interrupt Enable +#define AT91C_RTTC_RTTINCIEN ((unsigned int) 0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable +#define AT91C_RTTC_RTTRST ((unsigned int) 0x1 << 18) // (RTTC) Real Time Timer Restart +// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +#define AT91C_RTTC_ALMV ((unsigned int) 0x0 << 0) // (RTTC) Alarm Value +// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +#define AT91C_RTTC_CRTV ((unsigned int) 0x0 << 0) // (RTTC) Current Real-time Value +// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +#define AT91C_RTTC_ALMS ((unsigned int) 0x1 << 0) // (RTTC) Real-time Alarm Status +#define AT91C_RTTC_RTTINC ((unsigned int) 0x1 << 1) // (RTTC) Real-time Timer Increment + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +// ***************************************************************************** +typedef struct _AT91S_PITC { + AT91_REG PITC_PIMR; // Period Interval Mode Register + AT91_REG PITC_PISR; // Period Interval Status Register + AT91_REG PITC_PIVR; // Period Interval Value Register + AT91_REG PITC_PIIR; // Period Interval Image Register +} AT91S_PITC, *AT91PS_PITC; + +// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) // (PITC) Periodic Interval Value +#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) // (PITC) Periodic Interval Timer Enabled +#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable +// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) // (PITC) Periodic Interval Timer Status +// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) // (PITC) Current Periodic Interval Value +#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) // (PITC) Periodic Interval Counter +// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +// ***************************************************************************** +typedef struct _AT91S_WDTC { + AT91_REG WDTC_WDCR; // Watchdog Control Register + AT91_REG WDTC_WDMR; // Watchdog Mode Register + AT91_REG WDTC_WDSR; // Watchdog Status Register +} AT91S_WDTC, *AT91PS_WDTC; + +// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +#define AT91C_WDTC_WDRSTT ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Restart +#define AT91C_WDTC_KEY ((unsigned int) 0xFF << 24) // (WDTC) Watchdog KEY Password +// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +#define AT91C_WDTC_WDV ((unsigned int) 0xFFF << 0) // (WDTC) Watchdog Timer Restart +#define AT91C_WDTC_WDFIEN ((unsigned int) 0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable +#define AT91C_WDTC_WDRSTEN ((unsigned int) 0x1 << 13) // (WDTC) Watchdog Reset Enable +#define AT91C_WDTC_WDRPROC ((unsigned int) 0x1 << 14) // (WDTC) Watchdog Timer Restart +#define AT91C_WDTC_WDDIS ((unsigned int) 0x1 << 15) // (WDTC) Watchdog Disable +#define AT91C_WDTC_WDD ((unsigned int) 0xFFF << 16) // (WDTC) Watchdog Delta Value +#define AT91C_WDTC_WDDBGHLT ((unsigned int) 0x1 << 28) // (WDTC) Watchdog Debug Halt +#define AT91C_WDTC_WDIDLEHLT ((unsigned int) 0x1 << 29) // (WDTC) Watchdog Idle Halt +// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +#define AT91C_WDTC_WDUNF ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Underflow +#define AT91C_WDTC_WDERR ((unsigned int) 0x1 << 1) // (WDTC) Watchdog Error + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +// ***************************************************************************** +typedef struct _AT91S_VREG { + AT91_REG VREG_MR; // Voltage Regulator Mode Register +} AT91S_VREG, *AT91PS_VREG; + +// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +#define AT91C_VREG_PSTDBY ((unsigned int) 0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Memory Controller Interface +// ***************************************************************************** +typedef struct _AT91S_MC { + AT91_REG MC_RCR; // MC Remap Control Register + AT91_REG MC_ASR; // MC Abort Status Register + AT91_REG MC_AASR; // MC Abort Address Status Register + AT91_REG Reserved0[21]; // + AT91_REG MC_FMR; // MC Flash Mode Register + AT91_REG MC_FCR; // MC Flash Command Register + AT91_REG MC_FSR; // MC Flash Status Register +} AT91S_MC, *AT91PS_MC; + +// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +#define AT91C_MC_RCB ((unsigned int) 0x1 << 0) // (MC) Remap Command Bit +// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +#define AT91C_MC_UNDADD ((unsigned int) 0x1 << 0) // (MC) Undefined Addess Abort Status +#define AT91C_MC_MISADD ((unsigned int) 0x1 << 1) // (MC) Misaligned Addess Abort Status +#define AT91C_MC_ABTSZ ((unsigned int) 0x3 << 8) // (MC) Abort Size Status +#define AT91C_MC_ABTSZ_BYTE ((unsigned int) 0x0 << 8) // (MC) Byte +#define AT91C_MC_ABTSZ_HWORD ((unsigned int) 0x1 << 8) // (MC) Half-word +#define AT91C_MC_ABTSZ_WORD ((unsigned int) 0x2 << 8) // (MC) Word +#define AT91C_MC_ABTTYP ((unsigned int) 0x3 << 10) // (MC) Abort Type Status +#define AT91C_MC_ABTTYP_DATAR ((unsigned int) 0x0 << 10) // (MC) Data Read +#define AT91C_MC_ABTTYP_DATAW ((unsigned int) 0x1 << 10) // (MC) Data Write +#define AT91C_MC_ABTTYP_FETCH ((unsigned int) 0x2 << 10) // (MC) Code Fetch +#define AT91C_MC_MST0 ((unsigned int) 0x1 << 16) // (MC) Master 0 Abort Source +#define AT91C_MC_MST1 ((unsigned int) 0x1 << 17) // (MC) Master 1 Abort Source +#define AT91C_MC_SVMST0 ((unsigned int) 0x1 << 24) // (MC) Saved Master 0 Abort Source +#define AT91C_MC_SVMST1 ((unsigned int) 0x1 << 25) // (MC) Saved Master 1 Abort Source +// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +#define AT91C_MC_FRDY ((unsigned int) 0x1 << 0) // (MC) Flash Ready +#define AT91C_MC_LOCKE ((unsigned int) 0x1 << 2) // (MC) Lock Error +#define AT91C_MC_PROGE ((unsigned int) 0x1 << 3) // (MC) Programming Error +#define AT91C_MC_NEBP ((unsigned int) 0x1 << 7) // (MC) No Erase Before Programming +#define AT91C_MC_FWS ((unsigned int) 0x3 << 8) // (MC) Flash Wait State +#define AT91C_MC_FWS_0FWS ((unsigned int) 0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations +#define AT91C_MC_FWS_1FWS ((unsigned int) 0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations +#define AT91C_MC_FWS_2FWS ((unsigned int) 0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations +#define AT91C_MC_FWS_3FWS ((unsigned int) 0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations +#define AT91C_MC_FMCN ((unsigned int) 0xFF << 16) // (MC) Flash Microsecond Cycle Number +// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +#define AT91C_MC_FCMD ((unsigned int) 0xF << 0) // (MC) Flash Command +#define AT91C_MC_FCMD_START_PROG ((unsigned int) 0x1) // (MC) Starts the programming of th epage specified by PAGEN. +#define AT91C_MC_FCMD_LOCK ((unsigned int) 0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +#define AT91C_MC_FCMD_PROG_AND_LOCK ((unsigned int) 0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. +#define AT91C_MC_FCMD_UNLOCK ((unsigned int) 0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +#define AT91C_MC_FCMD_ERASE_ALL ((unsigned int) 0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +#define AT91C_MC_FCMD_SET_GP_NVM ((unsigned int) 0xB) // (MC) Set General Purpose NVM bits. +#define AT91C_MC_FCMD_CLR_GP_NVM ((unsigned int) 0xD) // (MC) Clear General Purpose NVM bits. +#define AT91C_MC_FCMD_SET_SECURITY ((unsigned int) 0xF) // (MC) Set Security Bit. +#define AT91C_MC_PAGEN ((unsigned int) 0x3FF << 8) // (MC) Page Number +#define AT91C_MC_KEY ((unsigned int) 0xFF << 24) // (MC) Writing Protect Key +// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +#define AT91C_MC_SECURITY ((unsigned int) 0x1 << 4) // (MC) Security Bit Status +#define AT91C_MC_GPNVM0 ((unsigned int) 0x1 << 8) // (MC) Sector 0 Lock Status +#define AT91C_MC_GPNVM1 ((unsigned int) 0x1 << 9) // (MC) Sector 1 Lock Status +#define AT91C_MC_GPNVM2 ((unsigned int) 0x1 << 10) // (MC) Sector 2 Lock Status +#define AT91C_MC_GPNVM3 ((unsigned int) 0x1 << 11) // (MC) Sector 3 Lock Status +#define AT91C_MC_GPNVM4 ((unsigned int) 0x1 << 12) // (MC) Sector 4 Lock Status +#define AT91C_MC_GPNVM5 ((unsigned int) 0x1 << 13) // (MC) Sector 5 Lock Status +#define AT91C_MC_GPNVM6 ((unsigned int) 0x1 << 14) // (MC) Sector 6 Lock Status +#define AT91C_MC_GPNVM7 ((unsigned int) 0x1 << 15) // (MC) Sector 7 Lock Status +#define AT91C_MC_LOCKS0 ((unsigned int) 0x1 << 16) // (MC) Sector 0 Lock Status +#define AT91C_MC_LOCKS1 ((unsigned int) 0x1 << 17) // (MC) Sector 1 Lock Status +#define AT91C_MC_LOCKS2 ((unsigned int) 0x1 << 18) // (MC) Sector 2 Lock Status +#define AT91C_MC_LOCKS3 ((unsigned int) 0x1 << 19) // (MC) Sector 3 Lock Status +#define AT91C_MC_LOCKS4 ((unsigned int) 0x1 << 20) // (MC) Sector 4 Lock Status +#define AT91C_MC_LOCKS5 ((unsigned int) 0x1 << 21) // (MC) Sector 5 Lock Status +#define AT91C_MC_LOCKS6 ((unsigned int) 0x1 << 22) // (MC) Sector 6 Lock Status +#define AT91C_MC_LOCKS7 ((unsigned int) 0x1 << 23) // (MC) Sector 7 Lock Status +#define AT91C_MC_LOCKS8 ((unsigned int) 0x1 << 24) // (MC) Sector 8 Lock Status +#define AT91C_MC_LOCKS9 ((unsigned int) 0x1 << 25) // (MC) Sector 9 Lock Status +#define AT91C_MC_LOCKS10 ((unsigned int) 0x1 << 26) // (MC) Sector 10 Lock Status +#define AT91C_MC_LOCKS11 ((unsigned int) 0x1 << 27) // (MC) Sector 11 Lock Status +#define AT91C_MC_LOCKS12 ((unsigned int) 0x1 << 28) // (MC) Sector 12 Lock Status +#define AT91C_MC_LOCKS13 ((unsigned int) 0x1 << 29) // (MC) Sector 13 Lock Status +#define AT91C_MC_LOCKS14 ((unsigned int) 0x1 << 30) // (MC) Sector 14 Lock Status +#define AT91C_MC_LOCKS15 ((unsigned int) 0x1 << 31) // (MC) Sector 15 Lock Status + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Serial Parallel Interface +// ***************************************************************************** +typedef struct _AT91S_SPI { + AT91_REG SPI_CR; // Control Register + AT91_REG SPI_MR; // Mode Register + AT91_REG SPI_RDR; // Receive Data Register + AT91_REG SPI_TDR; // Transmit Data Register + AT91_REG SPI_SR; // Status Register + AT91_REG SPI_IER; // Interrupt Enable Register + AT91_REG SPI_IDR; // Interrupt Disable Register + AT91_REG SPI_IMR; // Interrupt Mask Register + AT91_REG Reserved0[4]; // + AT91_REG SPI_CSR[4]; // Chip Select Register + AT91_REG Reserved1[48]; // + AT91_REG SPI_RPR; // Receive Pointer Register + AT91_REG SPI_RCR; // Receive Counter Register + AT91_REG SPI_TPR; // Transmit Pointer Register + AT91_REG SPI_TCR; // Transmit Counter Register + AT91_REG SPI_RNPR; // Receive Next Pointer Register + AT91_REG SPI_RNCR; // Receive Next Counter Register + AT91_REG SPI_TNPR; // Transmit Next Pointer Register + AT91_REG SPI_TNCR; // Transmit Next Counter Register + AT91_REG SPI_PTCR; // PDC Transfer Control Register + AT91_REG SPI_PTSR; // PDC Transfer Status Register +} AT91S_SPI, *AT91PS_SPI; + +// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) // (SPI) SPI Enable +#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) // (SPI) SPI Disable +#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) // (SPI) SPI Software reset +#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) // (SPI) SPI Last Transfer +// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) // (SPI) Master/Slave Mode +#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) // (SPI) Peripheral Select +#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) // (SPI) Fixed Peripheral Select +#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) // (SPI) Variable Peripheral Select +#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) // (SPI) Chip Select Decode +#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) // (SPI) Clock Selection +#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) // (SPI) Mode Fault Detection +#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) // (SPI) Clock Selection +#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select +#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) // (SPI) Delay Between Chip Selects +// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) // (SPI) Receive Data +#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) // (SPI) Transmit Data +#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) // (SPI) Receive Data Register Full +#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) // (SPI) Transmit Data Register Empty +#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) // (SPI) Mode Fault Error +#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) // (SPI) Overrun Error Status +#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) // (SPI) End of Receiver Transfer +#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) // (SPI) End of Receiver Transfer +#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) // (SPI) RXBUFF Interrupt +#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) // (SPI) TXBUFE Interrupt +#define AT91C_SPI_NSSR ((unsigned int) 0x1 << 8) // (SPI) NSSR Interrupt +#define AT91C_SPI_TXEMPTY ((unsigned int) 0x1 << 9) // (SPI) TXEMPTY Interrupt +#define AT91C_SPI_SPIENS ((unsigned int) 0x1 << 16) // (SPI) Enable Status +// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +#define AT91C_SPI_CPOL ((unsigned int) 0x1 << 0) // (SPI) Clock Polarity +#define AT91C_SPI_NCPHA ((unsigned int) 0x1 << 1) // (SPI) Clock Phase +#define AT91C_SPI_CSAAT ((unsigned int) 0x1 << 3) // (SPI) Chip Select Active After Transfer +#define AT91C_SPI_BITS ((unsigned int) 0xF << 4) // (SPI) Bits Per Transfer +#define AT91C_SPI_BITS_8 ((unsigned int) 0x0 << 4) // (SPI) 8 Bits Per transfer +#define AT91C_SPI_BITS_9 ((unsigned int) 0x1 << 4) // (SPI) 9 Bits Per transfer +#define AT91C_SPI_BITS_10 ((unsigned int) 0x2 << 4) // (SPI) 10 Bits Per transfer +#define AT91C_SPI_BITS_11 ((unsigned int) 0x3 << 4) // (SPI) 11 Bits Per transfer +#define AT91C_SPI_BITS_12 ((unsigned int) 0x4 << 4) // (SPI) 12 Bits Per transfer +#define AT91C_SPI_BITS_13 ((unsigned int) 0x5 << 4) // (SPI) 13 Bits Per transfer +#define AT91C_SPI_BITS_14 ((unsigned int) 0x6 << 4) // (SPI) 14 Bits Per transfer +#define AT91C_SPI_BITS_15 ((unsigned int) 0x7 << 4) // (SPI) 15 Bits Per transfer +#define AT91C_SPI_BITS_16 ((unsigned int) 0x8 << 4) // (SPI) 16 Bits Per transfer +#define AT91C_SPI_SCBR ((unsigned int) 0xFF << 8) // (SPI) Serial Clock Baud Rate +#define AT91C_SPI_DLYBS ((unsigned int) 0xFF << 16) // (SPI) Delay Before SPCK +#define AT91C_SPI_DLYBCT ((unsigned int) 0xFF << 24) // (SPI) Delay Between Consecutive Transfers + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Analog to Digital Convertor +// ***************************************************************************** +typedef struct _AT91S_ADC { + AT91_REG ADC_CR; // ADC Control Register + AT91_REG ADC_MR; // ADC Mode Register + AT91_REG Reserved0[2]; // + AT91_REG ADC_CHER; // ADC Channel Enable Register + AT91_REG ADC_CHDR; // ADC Channel Disable Register + AT91_REG ADC_CHSR; // ADC Channel Status Register + AT91_REG ADC_SR; // ADC Status Register + AT91_REG ADC_LCDR; // ADC Last Converted Data Register + AT91_REG ADC_IER; // ADC Interrupt Enable Register + AT91_REG ADC_IDR; // ADC Interrupt Disable Register + AT91_REG ADC_IMR; // ADC Interrupt Mask Register + AT91_REG ADC_CDR0; // ADC Channel Data Register 0 + AT91_REG ADC_CDR1; // ADC Channel Data Register 1 + AT91_REG ADC_CDR2; // ADC Channel Data Register 2 + AT91_REG ADC_CDR3; // ADC Channel Data Register 3 + AT91_REG ADC_CDR4; // ADC Channel Data Register 4 + AT91_REG ADC_CDR5; // ADC Channel Data Register 5 + AT91_REG ADC_CDR6; // ADC Channel Data Register 6 + AT91_REG ADC_CDR7; // ADC Channel Data Register 7 + AT91_REG Reserved1[44]; // + AT91_REG ADC_RPR; // Receive Pointer Register + AT91_REG ADC_RCR; // Receive Counter Register + AT91_REG ADC_TPR; // Transmit Pointer Register + AT91_REG ADC_TCR; // Transmit Counter Register + AT91_REG ADC_RNPR; // Receive Next Pointer Register + AT91_REG ADC_RNCR; // Receive Next Counter Register + AT91_REG ADC_TNPR; // Transmit Next Pointer Register + AT91_REG ADC_TNCR; // Transmit Next Counter Register + AT91_REG ADC_PTCR; // PDC Transfer Control Register + AT91_REG ADC_PTSR; // PDC Transfer Status Register +} AT91S_ADC, *AT91PS_ADC; + +// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +#define AT91C_ADC_SWRST ((unsigned int) 0x1 << 0) // (ADC) Software Reset +#define AT91C_ADC_START ((unsigned int) 0x1 << 1) // (ADC) Start Conversion +// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +#define AT91C_ADC_TRGEN ((unsigned int) 0x1 << 0) // (ADC) Trigger Enable +#define AT91C_ADC_TRGEN_DIS ((unsigned int) 0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +#define AT91C_ADC_TRGEN_EN ((unsigned int) 0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. +#define AT91C_ADC_TRGSEL ((unsigned int) 0x7 << 1) // (ADC) Trigger Selection +#define AT91C_ADC_TRGSEL_TIOA0 ((unsigned int) 0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 +#define AT91C_ADC_TRGSEL_TIOA1 ((unsigned int) 0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 +#define AT91C_ADC_TRGSEL_TIOA2 ((unsigned int) 0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 +#define AT91C_ADC_TRGSEL_TIOA3 ((unsigned int) 0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 +#define AT91C_ADC_TRGSEL_TIOA4 ((unsigned int) 0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 +#define AT91C_ADC_TRGSEL_TIOA5 ((unsigned int) 0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 +#define AT91C_ADC_TRGSEL_EXT ((unsigned int) 0x6 << 1) // (ADC) Selected TRGSEL = External Trigger +#define AT91C_ADC_LOWRES ((unsigned int) 0x1 << 4) // (ADC) Resolution. +#define AT91C_ADC_LOWRES_10_BIT ((unsigned int) 0x0 << 4) // (ADC) 10-bit resolution +#define AT91C_ADC_LOWRES_8_BIT ((unsigned int) 0x1 << 4) // (ADC) 8-bit resolution +#define AT91C_ADC_SLEEP ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +#define AT91C_ADC_SLEEP_NORMAL_MODE ((unsigned int) 0x0 << 5) // (ADC) Normal Mode +#define AT91C_ADC_SLEEP_MODE ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +#define AT91C_ADC_PRESCAL ((unsigned int) 0x3F << 8) // (ADC) Prescaler rate selection +#define AT91C_ADC_STARTUP ((unsigned int) 0x1F << 16) // (ADC) Startup Time +#define AT91C_ADC_SHTIM ((unsigned int) 0xF << 24) // (ADC) Sample & Hold Time +// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +#define AT91C_ADC_CH0 ((unsigned int) 0x1 << 0) // (ADC) Channel 0 +#define AT91C_ADC_CH1 ((unsigned int) 0x1 << 1) // (ADC) Channel 1 +#define AT91C_ADC_CH2 ((unsigned int) 0x1 << 2) // (ADC) Channel 2 +#define AT91C_ADC_CH3 ((unsigned int) 0x1 << 3) // (ADC) Channel 3 +#define AT91C_ADC_CH4 ((unsigned int) 0x1 << 4) // (ADC) Channel 4 +#define AT91C_ADC_CH5 ((unsigned int) 0x1 << 5) // (ADC) Channel 5 +#define AT91C_ADC_CH6 ((unsigned int) 0x1 << 6) // (ADC) Channel 6 +#define AT91C_ADC_CH7 ((unsigned int) 0x1 << 7) // (ADC) Channel 7 +// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +#define AT91C_ADC_EOC0 ((unsigned int) 0x1 << 0) // (ADC) End of Conversion +#define AT91C_ADC_EOC1 ((unsigned int) 0x1 << 1) // (ADC) End of Conversion +#define AT91C_ADC_EOC2 ((unsigned int) 0x1 << 2) // (ADC) End of Conversion +#define AT91C_ADC_EOC3 ((unsigned int) 0x1 << 3) // (ADC) End of Conversion +#define AT91C_ADC_EOC4 ((unsigned int) 0x1 << 4) // (ADC) End of Conversion +#define AT91C_ADC_EOC5 ((unsigned int) 0x1 << 5) // (ADC) End of Conversion +#define AT91C_ADC_EOC6 ((unsigned int) 0x1 << 6) // (ADC) End of Conversion +#define AT91C_ADC_EOC7 ((unsigned int) 0x1 << 7) // (ADC) End of Conversion +#define AT91C_ADC_OVRE0 ((unsigned int) 0x1 << 8) // (ADC) Overrun Error +#define AT91C_ADC_OVRE1 ((unsigned int) 0x1 << 9) // (ADC) Overrun Error +#define AT91C_ADC_OVRE2 ((unsigned int) 0x1 << 10) // (ADC) Overrun Error +#define AT91C_ADC_OVRE3 ((unsigned int) 0x1 << 11) // (ADC) Overrun Error +#define AT91C_ADC_OVRE4 ((unsigned int) 0x1 << 12) // (ADC) Overrun Error +#define AT91C_ADC_OVRE5 ((unsigned int) 0x1 << 13) // (ADC) Overrun Error +#define AT91C_ADC_OVRE6 ((unsigned int) 0x1 << 14) // (ADC) Overrun Error +#define AT91C_ADC_OVRE7 ((unsigned int) 0x1 << 15) // (ADC) Overrun Error +#define AT91C_ADC_DRDY ((unsigned int) 0x1 << 16) // (ADC) Data Ready +#define AT91C_ADC_GOVRE ((unsigned int) 0x1 << 17) // (ADC) General Overrun +#define AT91C_ADC_ENDRX ((unsigned int) 0x1 << 18) // (ADC) End of Receiver Transfer +#define AT91C_ADC_RXBUFF ((unsigned int) 0x1 << 19) // (ADC) RXBUFF Interrupt +// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +#define AT91C_ADC_LDATA ((unsigned int) 0x3FF << 0) // (ADC) Last Data Converted +// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +#define AT91C_ADC_DATA ((unsigned int) 0x3FF << 0) // (ADC) Converted Data +// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +// ***************************************************************************** +typedef struct _AT91S_SSC { + AT91_REG SSC_CR; // Control Register + AT91_REG SSC_CMR; // Clock Mode Register + AT91_REG Reserved0[2]; // + AT91_REG SSC_RCMR; // Receive Clock ModeRegister + AT91_REG SSC_RFMR; // Receive Frame Mode Register + AT91_REG SSC_TCMR; // Transmit Clock Mode Register + AT91_REG SSC_TFMR; // Transmit Frame Mode Register + AT91_REG SSC_RHR; // Receive Holding Register + AT91_REG SSC_THR; // Transmit Holding Register + AT91_REG Reserved1[2]; // + AT91_REG SSC_RSHR; // Receive Sync Holding Register + AT91_REG SSC_TSHR; // Transmit Sync Holding Register + AT91_REG SSC_RC0R; // Receive Compare 0 Register + AT91_REG SSC_RC1R; // Receive Compare 1 Register + AT91_REG SSC_SR; // Status Register + AT91_REG SSC_IER; // Interrupt Enable Register + AT91_REG SSC_IDR; // Interrupt Disable Register + AT91_REG SSC_IMR; // Interrupt Mask Register + AT91_REG Reserved3[44]; // + AT91_REG SSC_RPR; // Receive Pointer Register + AT91_REG SSC_RCR; // Receive Counter Register + AT91_REG SSC_TPR; // Transmit Pointer Register + AT91_REG SSC_TCR; // Transmit Counter Register + AT91_REG SSC_RNPR; // Receive Next Pointer Register + AT91_REG SSC_RNCR; // Receive Next Counter Register + AT91_REG SSC_TNPR; // Transmit Next Pointer Register + AT91_REG SSC_TNCR; // Transmit Next Counter Register + AT91_REG SSC_PTCR; // PDC Transfer Control Register + AT91_REG SSC_PTSR; // PDC Transfer Status Register +} AT91S_SSC, *AT91PS_SSC; + +// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +#define AT91C_SSC_RXEN ((unsigned int) 0x1 << 0) // (SSC) Receive Enable +#define AT91C_SSC_RXDIS ((unsigned int) 0x1 << 1) // (SSC) Receive Disable +#define AT91C_SSC_TXEN ((unsigned int) 0x1 << 8) // (SSC) Transmit Enable +#define AT91C_SSC_TXDIS ((unsigned int) 0x1 << 9) // (SSC) Transmit Disable +#define AT91C_SSC_SWRST ((unsigned int) 0x1 << 15) // (SSC) Software Reset +// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +#define AT91C_SSC_CKS ((unsigned int) 0x3 << 0) // (SSC) Receive/Transmit Clock Selection +#define AT91C_SSC_CKS_DIV ((unsigned int) 0x0) // (SSC) Divided Clock +#define AT91C_SSC_CKS_TK ((unsigned int) 0x1) // (SSC) TK Clock signal +#define AT91C_SSC_CKS_RK ((unsigned int) 0x2) // (SSC) RK pin +#define AT91C_SSC_CKO ((unsigned int) 0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection +#define AT91C_SSC_CKO_NONE ((unsigned int) 0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +#define AT91C_SSC_CKO_CONTINOUS ((unsigned int) 0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output +#define AT91C_SSC_CKO_DATA_TX ((unsigned int) 0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +#define AT91C_SSC_CKI ((unsigned int) 0x1 << 5) // (SSC) Receive/Transmit Clock Inversion +#define AT91C_SSC_START ((unsigned int) 0xF << 8) // (SSC) Receive/Transmit Start Selection +#define AT91C_SSC_START_CONTINOUS ((unsigned int) 0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +#define AT91C_SSC_START_TX ((unsigned int) 0x1 << 8) // (SSC) Transmit/Receive start +#define AT91C_SSC_START_LOW_RF ((unsigned int) 0x2 << 8) // (SSC) Detection of a low level on RF input +#define AT91C_SSC_START_HIGH_RF ((unsigned int) 0x3 << 8) // (SSC) Detection of a high level on RF input +#define AT91C_SSC_START_FALL_RF ((unsigned int) 0x4 << 8) // (SSC) Detection of a falling edge on RF input +#define AT91C_SSC_START_RISE_RF ((unsigned int) 0x5 << 8) // (SSC) Detection of a rising edge on RF input +#define AT91C_SSC_START_LEVEL_RF ((unsigned int) 0x6 << 8) // (SSC) Detection of any level change on RF input +#define AT91C_SSC_START_EDGE_RF ((unsigned int) 0x7 << 8) // (SSC) Detection of any edge on RF input +#define AT91C_SSC_START_0 ((unsigned int) 0x8 << 8) // (SSC) Compare 0 +#define AT91C_SSC_STTDLY ((unsigned int) 0xFF << 16) // (SSC) Receive/Transmit Start Delay +#define AT91C_SSC_PERIOD ((unsigned int) 0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection +// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +#define AT91C_SSC_DATLEN ((unsigned int) 0x1F << 0) // (SSC) Data Length +#define AT91C_SSC_LOOP ((unsigned int) 0x1 << 5) // (SSC) Loop Mode +#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) Most Significant Bit First +#define AT91C_SSC_DATNB ((unsigned int) 0xF << 8) // (SSC) Data Number per Frame +#define AT91C_SSC_FSLEN ((unsigned int) 0xF << 16) // (SSC) Receive/Transmit Frame Sync length +#define AT91C_SSC_FSOS ((unsigned int) 0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection +#define AT91C_SSC_FSOS_NONE ((unsigned int) 0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +#define AT91C_SSC_FSOS_NEGATIVE ((unsigned int) 0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +#define AT91C_SSC_FSOS_POSITIVE ((unsigned int) 0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +#define AT91C_SSC_FSOS_LOW ((unsigned int) 0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +#define AT91C_SSC_FSOS_HIGH ((unsigned int) 0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +#define AT91C_SSC_FSOS_TOGGLE ((unsigned int) 0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +#define AT91C_SSC_FSEDGE ((unsigned int) 0x1 << 24) // (SSC) Frame Sync Edge Detection +// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +#define AT91C_SSC_DATDEF ((unsigned int) 0x1 << 5) // (SSC) Data Default Value +#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) MSB First +#define AT91C_SSC_FSDEN ((unsigned int) 0x1 << 23) // (SSC) Frame Sync Data Enable +// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +#define AT91C_SSC_TXRDY ((unsigned int) 0x1 << 0) // (SSC) Transmit Ready +#define AT91C_SSC_TXEMPTY ((unsigned int) 0x1 << 1) // (SSC) Transmit Empty +#define AT91C_SSC_ENDTX ((unsigned int) 0x1 << 2) // (SSC) End Of Transmission +#define AT91C_SSC_TXBUFE ((unsigned int) 0x1 << 3) // (SSC) Transmit Buffer Empty +#define AT91C_SSC_RXRDY ((unsigned int) 0x1 << 4) // (SSC) Receive Ready +#define AT91C_SSC_OVRUN ((unsigned int) 0x1 << 5) // (SSC) Receive Overrun +#define AT91C_SSC_ENDRX ((unsigned int) 0x1 << 6) // (SSC) End of Reception +#define AT91C_SSC_RXBUFF ((unsigned int) 0x1 << 7) // (SSC) Receive Buffer Full +#define AT91C_SSC_CP0 ((unsigned int) 0x1 << 8) // (SSC) Compare 0 +#define AT91C_SSC_CP1 ((unsigned int) 0x1 << 9) // (SSC) Compare 1 +#define AT91C_SSC_TXSYN ((unsigned int) 0x1 << 10) // (SSC) Transmit Sync +#define AT91C_SSC_RXSYN ((unsigned int) 0x1 << 11) // (SSC) Receive Sync +#define AT91C_SSC_TXENA ((unsigned int) 0x1 << 16) // (SSC) Transmit Enable +#define AT91C_SSC_RXENA ((unsigned int) 0x1 << 17) // (SSC) Receive Enable +// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Usart +// ***************************************************************************** +typedef struct _AT91S_USART { + AT91_REG US_CR; // Control Register + AT91_REG US_MR; // Mode Register + AT91_REG US_IER; // Interrupt Enable Register + AT91_REG US_IDR; // Interrupt Disable Register + AT91_REG US_IMR; // Interrupt Mask Register + AT91_REG US_CSR; // Channel Status Register + AT91_REG US_RHR; // Receiver Holding Register + AT91_REG US_THR; // Transmitter Holding Register + AT91_REG US_BRGR; // Baud Rate Generator Register + AT91_REG US_RTOR; // Receiver Time-out Register + AT91_REG US_TTGR; // Transmitter Time-guard Register + AT91_REG Reserved0[5]; // + AT91_REG US_FIDI; // FI_DI_Ratio Register + AT91_REG US_NER; // Nb Errors Register + AT91_REG Reserved1[1]; // + AT91_REG US_IF; // IRDA_FILTER Register + AT91_REG Reserved2[44]; // + AT91_REG US_RPR; // Receive Pointer Register + AT91_REG US_RCR; // Receive Counter Register + AT91_REG US_TPR; // Transmit Pointer Register + AT91_REG US_TCR; // Transmit Counter Register + AT91_REG US_RNPR; // Receive Next Pointer Register + AT91_REG US_RNCR; // Receive Next Counter Register + AT91_REG US_TNPR; // Transmit Next Pointer Register + AT91_REG US_TNCR; // Transmit Next Counter Register + AT91_REG US_PTCR; // PDC Transfer Control Register + AT91_REG US_PTSR; // PDC Transfer Status Register +} AT91S_USART, *AT91PS_USART; + +// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) // (USART) Start Break +#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) // (USART) Stop Break +#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) // (USART) Start Time-out +#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) // (USART) Send Address +#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) // (USART) Reset Iterations +#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) // (USART) Reset Non Acknowledge +#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) // (USART) Rearm Time-out +#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) // (USART) Data Terminal ready Enable +#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) // (USART) Data Terminal ready Disable +#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) // (USART) Request to Send enable +#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) // (USART) Request to Send Disable +// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +#define AT91C_US_USMODE ((unsigned int) 0xF << 0) // (USART) Usart mode +#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) // (USART) Normal +#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) // (USART) RS485 +#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) // (USART) Hardware Handshaking +#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) // (USART) Modem +#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) // (USART) ISO7816 protocol: T = 0 +#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) // (USART) ISO7816 protocol: T = 1 +#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) // (USART) IrDA +#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) // (USART) Software Handshaking +#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock +#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) // (USART) Clock +#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) // (USART) fdiv1 +#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) // (USART) slow_clock (ARM) +#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) // (USART) External (SCK) +#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock +#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) // (USART) Character Length: 5 bits +#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) // (USART) Character Length: 6 bits +#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) // (USART) Character Length: 7 bits +#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) // (USART) Character Length: 8 bits +#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) // (USART) Synchronous Mode Select +#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) // (USART) Number of Stop bits +#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) // (USART) 1 stop bit +#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) // (USART) 2 stop bits +#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) // (USART) Bit Order +#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) // (USART) 9-bit Character length +#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) // (USART) Clock Output Select +#define AT91C_US_OVER ((unsigned int) 0x1 << 19) // (USART) Over Sampling Mode +#define AT91C_US_INACK ((unsigned int) 0x1 << 20) // (USART) Inhibit Non Acknowledge +#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) // (USART) Disable Successive NACK +#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) // (USART) Number of Repetitions +#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) // (USART) Receive Line Filter +// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) // (USART) Break Received/End of Break +#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) // (USART) Receiver Time-out +#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) // (USART) Max number of Repetitions Reached +#define AT91C_US_NACK ((unsigned int) 0x1 << 13) // (USART) Non Acknowledge +#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) // (USART) Ring INdicator Input Change Flag +#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) // (USART) Data Set Ready Input Change Flag +#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) // (USART) Data Carrier Flag +#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) // (USART) Clear To Send Input Change Flag +// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +#define AT91C_US_RI ((unsigned int) 0x1 << 20) // (USART) Image of RI Input +#define AT91C_US_DSR ((unsigned int) 0x1 << 21) // (USART) Image of DSR Input +#define AT91C_US_DCD ((unsigned int) 0x1 << 22) // (USART) Image of DCD Input +#define AT91C_US_CTS ((unsigned int) 0x1 << 23) // (USART) Image of CTS Input + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Two-wire Interface +// ***************************************************************************** +typedef struct _AT91S_TWI { + AT91_REG TWI_CR; // Control Register + AT91_REG TWI_MMR; // Master Mode Register + AT91_REG Reserved0[1]; // + AT91_REG TWI_IADR; // Internal Address Register + AT91_REG TWI_CWGR; // Clock Waveform Generator Register + AT91_REG Reserved1[3]; // + AT91_REG TWI_SR; // Status Register + AT91_REG TWI_IER; // Interrupt Enable Register + AT91_REG TWI_IDR; // Interrupt Disable Register + AT91_REG TWI_IMR; // Interrupt Mask Register + AT91_REG TWI_RHR; // Receive Holding Register + AT91_REG TWI_THR; // Transmit Holding Register +} AT91S_TWI, *AT91PS_TWI; + +// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +#define AT91C_TWI_START ((unsigned int) 0x1 << 0) // (TWI) Send a START Condition +#define AT91C_TWI_STOP ((unsigned int) 0x1 << 1) // (TWI) Send a STOP Condition +#define AT91C_TWI_MSEN ((unsigned int) 0x1 << 2) // (TWI) TWI Master Transfer Enabled +#define AT91C_TWI_MSDIS ((unsigned int) 0x1 << 3) // (TWI) TWI Master Transfer Disabled +#define AT91C_TWI_SWRST ((unsigned int) 0x1 << 7) // (TWI) Software Reset +// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +#define AT91C_TWI_IADRSZ ((unsigned int) 0x3 << 8) // (TWI) Internal Device Address Size +#define AT91C_TWI_IADRSZ_NO ((unsigned int) 0x0 << 8) // (TWI) No internal device address +#define AT91C_TWI_IADRSZ_1_BYTE ((unsigned int) 0x1 << 8) // (TWI) One-byte internal device address +#define AT91C_TWI_IADRSZ_2_BYTE ((unsigned int) 0x2 << 8) // (TWI) Two-byte internal device address +#define AT91C_TWI_IADRSZ_3_BYTE ((unsigned int) 0x3 << 8) // (TWI) Three-byte internal device address +#define AT91C_TWI_MREAD ((unsigned int) 0x1 << 12) // (TWI) Master Read Direction +#define AT91C_TWI_DADR ((unsigned int) 0x7F << 16) // (TWI) Device Address +// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +#define AT91C_TWI_CLDIV ((unsigned int) 0xFF << 0) // (TWI) Clock Low Divider +#define AT91C_TWI_CHDIV ((unsigned int) 0xFF << 8) // (TWI) Clock High Divider +#define AT91C_TWI_CKDIV ((unsigned int) 0x7 << 16) // (TWI) Clock Divider +// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +#define AT91C_TWI_TXCOMP ((unsigned int) 0x1 << 0) // (TWI) Transmission Completed +#define AT91C_TWI_RXRDY ((unsigned int) 0x1 << 1) // (TWI) Receive holding register ReaDY +#define AT91C_TWI_TXRDY ((unsigned int) 0x1 << 2) // (TWI) Transmit holding register ReaDY +#define AT91C_TWI_OVRE ((unsigned int) 0x1 << 6) // (TWI) Overrun Error +#define AT91C_TWI_UNRE ((unsigned int) 0x1 << 7) // (TWI) Underrun Error +#define AT91C_TWI_NACK ((unsigned int) 0x1 << 8) // (TWI) Not Acknowledged +// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +// ***************************************************************************** +typedef struct _AT91S_TC { + AT91_REG TC_CCR; // Channel Control Register + AT91_REG TC_CMR; // Channel Mode Register (Capture Mode / Waveform Mode) + AT91_REG Reserved0[2]; // + AT91_REG TC_CV; // Counter Value + AT91_REG TC_RA; // Register A + AT91_REG TC_RB; // Register B + AT91_REG TC_RC; // Register C + AT91_REG TC_SR; // Status Register + AT91_REG TC_IER; // Interrupt Enable Register + AT91_REG TC_IDR; // Interrupt Disable Register + AT91_REG TC_IMR; // Interrupt Mask Register +} AT91S_TC, *AT91PS_TC; + +// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +#define AT91C_TC_CLKEN ((unsigned int) 0x1 << 0) // (TC) Counter Clock Enable Command +#define AT91C_TC_CLKDIS ((unsigned int) 0x1 << 1) // (TC) Counter Clock Disable Command +#define AT91C_TC_SWTRG ((unsigned int) 0x1 << 2) // (TC) Software Trigger Command +// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +#define AT91C_TC_CLKS ((unsigned int) 0x7 << 0) // (TC) Clock Selection +#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK ((unsigned int) 0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK +#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK ((unsigned int) 0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK +#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK ((unsigned int) 0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK +#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK ((unsigned int) 0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK +#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK ((unsigned int) 0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK +#define AT91C_TC_CLKS_XC0 ((unsigned int) 0x5) // (TC) Clock selected: XC0 +#define AT91C_TC_CLKS_XC1 ((unsigned int) 0x6) // (TC) Clock selected: XC1 +#define AT91C_TC_CLKS_XC2 ((unsigned int) 0x7) // (TC) Clock selected: XC2 +#define AT91C_TC_CLKI ((unsigned int) 0x1 << 3) // (TC) Clock Invert +#define AT91C_TC_BURST ((unsigned int) 0x3 << 4) // (TC) Burst Signal Selection +#define AT91C_TC_BURST_NONE ((unsigned int) 0x0 << 4) // (TC) The clock is not gated by an external signal +#define AT91C_TC_BURST_XC0 ((unsigned int) 0x1 << 4) // (TC) XC0 is ANDed with the selected clock +#define AT91C_TC_BURST_XC1 ((unsigned int) 0x2 << 4) // (TC) XC1 is ANDed with the selected clock +#define AT91C_TC_BURST_XC2 ((unsigned int) 0x3 << 4) // (TC) XC2 is ANDed with the selected clock +#define AT91C_TC_CPCSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RC Compare +#define AT91C_TC_LDBSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RB Loading +#define AT91C_TC_CPCDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disable with RC Compare +#define AT91C_TC_LDBDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disabled with RB Loading +#define AT91C_TC_ETRGEDG ((unsigned int) 0x3 << 8) // (TC) External Trigger Edge Selection +#define AT91C_TC_ETRGEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +#define AT91C_TC_ETRGEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +#define AT91C_TC_ETRGEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +#define AT91C_TC_ETRGEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +#define AT91C_TC_EEVTEDG ((unsigned int) 0x3 << 8) // (TC) External Event Edge Selection +#define AT91C_TC_EEVTEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +#define AT91C_TC_EEVTEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +#define AT91C_TC_EEVTEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +#define AT91C_TC_EEVTEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +#define AT91C_TC_EEVT ((unsigned int) 0x3 << 10) // (TC) External Event Selection +#define AT91C_TC_EEVT_TIOB ((unsigned int) 0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input +#define AT91C_TC_EEVT_XC0 ((unsigned int) 0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output +#define AT91C_TC_EEVT_XC1 ((unsigned int) 0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output +#define AT91C_TC_EEVT_XC2 ((unsigned int) 0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output +#define AT91C_TC_ABETRG ((unsigned int) 0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection +#define AT91C_TC_ENETRG ((unsigned int) 0x1 << 12) // (TC) External Event Trigger enable +#define AT91C_TC_WAVESEL ((unsigned int) 0x3 << 13) // (TC) Waveform Selection +#define AT91C_TC_WAVESEL_UP ((unsigned int) 0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare +#define AT91C_TC_WAVESEL_UPDOWN ((unsigned int) 0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare +#define AT91C_TC_WAVESEL_UP_AUTO ((unsigned int) 0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare +#define AT91C_TC_WAVESEL_UPDOWN_AUTO ((unsigned int) 0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare +#define AT91C_TC_CPCTRG ((unsigned int) 0x1 << 14) // (TC) RC Compare Trigger Enable +#define AT91C_TC_WAVE ((unsigned int) 0x1 << 15) // (TC) +#define AT91C_TC_ACPA ((unsigned int) 0x3 << 16) // (TC) RA Compare Effect on TIOA +#define AT91C_TC_ACPA_NONE ((unsigned int) 0x0 << 16) // (TC) Effect: none +#define AT91C_TC_ACPA_SET ((unsigned int) 0x1 << 16) // (TC) Effect: set +#define AT91C_TC_ACPA_CLEAR ((unsigned int) 0x2 << 16) // (TC) Effect: clear +#define AT91C_TC_ACPA_TOGGLE ((unsigned int) 0x3 << 16) // (TC) Effect: toggle +#define AT91C_TC_LDRA ((unsigned int) 0x3 << 16) // (TC) RA Loading Selection +#define AT91C_TC_LDRA_NONE ((unsigned int) 0x0 << 16) // (TC) Edge: None +#define AT91C_TC_LDRA_RISING ((unsigned int) 0x1 << 16) // (TC) Edge: rising edge of TIOA +#define AT91C_TC_LDRA_FALLING ((unsigned int) 0x2 << 16) // (TC) Edge: falling edge of TIOA +#define AT91C_TC_LDRA_BOTH ((unsigned int) 0x3 << 16) // (TC) Edge: each edge of TIOA +#define AT91C_TC_ACPC ((unsigned int) 0x3 << 18) // (TC) RC Compare Effect on TIOA +#define AT91C_TC_ACPC_NONE ((unsigned int) 0x0 << 18) // (TC) Effect: none +#define AT91C_TC_ACPC_SET ((unsigned int) 0x1 << 18) // (TC) Effect: set +#define AT91C_TC_ACPC_CLEAR ((unsigned int) 0x2 << 18) // (TC) Effect: clear +#define AT91C_TC_ACPC_TOGGLE ((unsigned int) 0x3 << 18) // (TC) Effect: toggle +#define AT91C_TC_LDRB ((unsigned int) 0x3 << 18) // (TC) RB Loading Selection +#define AT91C_TC_LDRB_NONE ((unsigned int) 0x0 << 18) // (TC) Edge: None +#define AT91C_TC_LDRB_RISING ((unsigned int) 0x1 << 18) // (TC) Edge: rising edge of TIOA +#define AT91C_TC_LDRB_FALLING ((unsigned int) 0x2 << 18) // (TC) Edge: falling edge of TIOA +#define AT91C_TC_LDRB_BOTH ((unsigned int) 0x3 << 18) // (TC) Edge: each edge of TIOA +#define AT91C_TC_AEEVT ((unsigned int) 0x3 << 20) // (TC) External Event Effect on TIOA +#define AT91C_TC_AEEVT_NONE ((unsigned int) 0x0 << 20) // (TC) Effect: none +#define AT91C_TC_AEEVT_SET ((unsigned int) 0x1 << 20) // (TC) Effect: set +#define AT91C_TC_AEEVT_CLEAR ((unsigned int) 0x2 << 20) // (TC) Effect: clear +#define AT91C_TC_AEEVT_TOGGLE ((unsigned int) 0x3 << 20) // (TC) Effect: toggle +#define AT91C_TC_ASWTRG ((unsigned int) 0x3 << 22) // (TC) Software Trigger Effect on TIOA +#define AT91C_TC_ASWTRG_NONE ((unsigned int) 0x0 << 22) // (TC) Effect: none +#define AT91C_TC_ASWTRG_SET ((unsigned int) 0x1 << 22) // (TC) Effect: set +#define AT91C_TC_ASWTRG_CLEAR ((unsigned int) 0x2 << 22) // (TC) Effect: clear +#define AT91C_TC_ASWTRG_TOGGLE ((unsigned int) 0x3 << 22) // (TC) Effect: toggle +#define AT91C_TC_BCPB ((unsigned int) 0x3 << 24) // (TC) RB Compare Effect on TIOB +#define AT91C_TC_BCPB_NONE ((unsigned int) 0x0 << 24) // (TC) Effect: none +#define AT91C_TC_BCPB_SET ((unsigned int) 0x1 << 24) // (TC) Effect: set +#define AT91C_TC_BCPB_CLEAR ((unsigned int) 0x2 << 24) // (TC) Effect: clear +#define AT91C_TC_BCPB_TOGGLE ((unsigned int) 0x3 << 24) // (TC) Effect: toggle +#define AT91C_TC_BCPC ((unsigned int) 0x3 << 26) // (TC) RC Compare Effect on TIOB +#define AT91C_TC_BCPC_NONE ((unsigned int) 0x0 << 26) // (TC) Effect: none +#define AT91C_TC_BCPC_SET ((unsigned int) 0x1 << 26) // (TC) Effect: set +#define AT91C_TC_BCPC_CLEAR ((unsigned int) 0x2 << 26) // (TC) Effect: clear +#define AT91C_TC_BCPC_TOGGLE ((unsigned int) 0x3 << 26) // (TC) Effect: toggle +#define AT91C_TC_BEEVT ((unsigned int) 0x3 << 28) // (TC) External Event Effect on TIOB +#define AT91C_TC_BEEVT_NONE ((unsigned int) 0x0 << 28) // (TC) Effect: none +#define AT91C_TC_BEEVT_SET ((unsigned int) 0x1 << 28) // (TC) Effect: set +#define AT91C_TC_BEEVT_CLEAR ((unsigned int) 0x2 << 28) // (TC) Effect: clear +#define AT91C_TC_BEEVT_TOGGLE ((unsigned int) 0x3 << 28) // (TC) Effect: toggle +#define AT91C_TC_BSWTRG ((unsigned int) 0x3 << 30) // (TC) Software Trigger Effect on TIOB +#define AT91C_TC_BSWTRG_NONE ((unsigned int) 0x0 << 30) // (TC) Effect: none +#define AT91C_TC_BSWTRG_SET ((unsigned int) 0x1 << 30) // (TC) Effect: set +#define AT91C_TC_BSWTRG_CLEAR ((unsigned int) 0x2 << 30) // (TC) Effect: clear +#define AT91C_TC_BSWTRG_TOGGLE ((unsigned int) 0x3 << 30) // (TC) Effect: toggle +// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +#define AT91C_TC_COVFS ((unsigned int) 0x1 << 0) // (TC) Counter Overflow +#define AT91C_TC_LOVRS ((unsigned int) 0x1 << 1) // (TC) Load Overrun +#define AT91C_TC_CPAS ((unsigned int) 0x1 << 2) // (TC) RA Compare +#define AT91C_TC_CPBS ((unsigned int) 0x1 << 3) // (TC) RB Compare +#define AT91C_TC_CPCS ((unsigned int) 0x1 << 4) // (TC) RC Compare +#define AT91C_TC_LDRAS ((unsigned int) 0x1 << 5) // (TC) RA Loading +#define AT91C_TC_LDRBS ((unsigned int) 0x1 << 6) // (TC) RB Loading +#define AT91C_TC_ETRGS ((unsigned int) 0x1 << 7) // (TC) External Trigger +#define AT91C_TC_CLKSTA ((unsigned int) 0x1 << 16) // (TC) Clock Enabling +#define AT91C_TC_MTIOA ((unsigned int) 0x1 << 17) // (TC) TIOA Mirror +#define AT91C_TC_MTIOB ((unsigned int) 0x1 << 18) // (TC) TIOA Mirror +// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Timer Counter Interface +// ***************************************************************************** +typedef struct _AT91S_TCB { + AT91S_TC TCB_TC0; // TC Channel 0 + AT91_REG Reserved0[4]; // + AT91S_TC TCB_TC1; // TC Channel 1 + AT91_REG Reserved1[4]; // + AT91S_TC TCB_TC2; // TC Channel 2 + AT91_REG Reserved2[4]; // + AT91_REG TCB_BCR; // TC Block Control Register + AT91_REG TCB_BMR; // TC Block Mode Register +} AT91S_TCB, *AT91PS_TCB; + +// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +#define AT91C_TCB_SYNC ((unsigned int) 0x1 << 0) // (TCB) Synchro Command +// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +#define AT91C_TCB_TC0XC0S ((unsigned int) 0x3 << 0) // (TCB) External Clock Signal 0 Selection +#define AT91C_TCB_TC0XC0S_TCLK0 ((unsigned int) 0x0) // (TCB) TCLK0 connected to XC0 +#define AT91C_TCB_TC0XC0S_NONE ((unsigned int) 0x1) // (TCB) None signal connected to XC0 +#define AT91C_TCB_TC0XC0S_TIOA1 ((unsigned int) 0x2) // (TCB) TIOA1 connected to XC0 +#define AT91C_TCB_TC0XC0S_TIOA2 ((unsigned int) 0x3) // (TCB) TIOA2 connected to XC0 +#define AT91C_TCB_TC1XC1S ((unsigned int) 0x3 << 2) // (TCB) External Clock Signal 1 Selection +#define AT91C_TCB_TC1XC1S_TCLK1 ((unsigned int) 0x0 << 2) // (TCB) TCLK1 connected to XC1 +#define AT91C_TCB_TC1XC1S_NONE ((unsigned int) 0x1 << 2) // (TCB) None signal connected to XC1 +#define AT91C_TCB_TC1XC1S_TIOA0 ((unsigned int) 0x2 << 2) // (TCB) TIOA0 connected to XC1 +#define AT91C_TCB_TC1XC1S_TIOA2 ((unsigned int) 0x3 << 2) // (TCB) TIOA2 connected to XC1 +#define AT91C_TCB_TC2XC2S ((unsigned int) 0x3 << 4) // (TCB) External Clock Signal 2 Selection +#define AT91C_TCB_TC2XC2S_TCLK2 ((unsigned int) 0x0 << 4) // (TCB) TCLK2 connected to XC2 +#define AT91C_TCB_TC2XC2S_NONE ((unsigned int) 0x1 << 4) // (TCB) None signal connected to XC2 +#define AT91C_TCB_TC2XC2S_TIOA0 ((unsigned int) 0x2 << 4) // (TCB) TIOA0 connected to XC2 +#define AT91C_TCB_TC2XC2S_TIOA1 ((unsigned int) 0x3 << 4) // (TCB) TIOA2 connected to XC2 + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR PWMC Channel Interface +// ***************************************************************************** +typedef struct _AT91S_PWMC_CH { + AT91_REG PWMC_CMR; // Channel Mode Register + AT91_REG PWMC_CDTYR; // Channel Duty Cycle Register + AT91_REG PWMC_CPRDR; // Channel Period Register + AT91_REG PWMC_CCNTR; // Channel Counter Register + AT91_REG PWMC_CUPDR; // Channel Update Register + AT91_REG PWMC_Reserved[3]; // Reserved +} AT91S_PWMC_CH, *AT91PS_PWMC_CH; + +// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +#define AT91C_PWMC_CPRE ((unsigned int) 0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +#define AT91C_PWMC_CPRE_MCK ((unsigned int) 0x0) // (PWMC_CH) +#define AT91C_PWMC_CPRE_MCKA ((unsigned int) 0xB) // (PWMC_CH) +#define AT91C_PWMC_CPRE_MCKB ((unsigned int) 0xC) // (PWMC_CH) +#define AT91C_PWMC_CALG ((unsigned int) 0x1 << 8) // (PWMC_CH) Channel Alignment +#define AT91C_PWMC_CPOL ((unsigned int) 0x1 << 9) // (PWMC_CH) Channel Polarity +#define AT91C_PWMC_CPD ((unsigned int) 0x1 << 10) // (PWMC_CH) Channel Update Period +// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +#define AT91C_PWMC_CDTY ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Duty Cycle +// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +#define AT91C_PWMC_CPRD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Period +// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +#define AT91C_PWMC_CCNT ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Counter +// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +#define AT91C_PWMC_CUPD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Update + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +// ***************************************************************************** +typedef struct _AT91S_PWMC { + AT91_REG PWMC_MR; // PWMC Mode Register + AT91_REG PWMC_ENA; // PWMC Enable Register + AT91_REG PWMC_DIS; // PWMC Disable Register + AT91_REG PWMC_SR; // PWMC Status Register + AT91_REG PWMC_IER; // PWMC Interrupt Enable Register + AT91_REG PWMC_IDR; // PWMC Interrupt Disable Register + AT91_REG PWMC_IMR; // PWMC Interrupt Mask Register + AT91_REG PWMC_ISR; // PWMC Interrupt Status Register + AT91_REG Reserved0[55]; // + AT91_REG PWMC_VR; // PWMC Version Register + AT91_REG Reserved1[64]; // + AT91S_PWMC_CH PWMC_CH[4]; // PWMC Channel +} AT91S_PWMC, *AT91PS_PWMC; + +// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +#define AT91C_PWMC_DIVA ((unsigned int) 0xFF << 0) // (PWMC) CLKA divide factor. +#define AT91C_PWMC_PREA ((unsigned int) 0xF << 8) // (PWMC) Divider Input Clock Prescaler A +#define AT91C_PWMC_PREA_MCK ((unsigned int) 0x0 << 8) // (PWMC) +#define AT91C_PWMC_DIVB ((unsigned int) 0xFF << 16) // (PWMC) CLKB divide factor. +#define AT91C_PWMC_PREB ((unsigned int) 0xF << 24) // (PWMC) Divider Input Clock Prescaler B +#define AT91C_PWMC_PREB_MCK ((unsigned int) 0x0 << 24) // (PWMC) +// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +#define AT91C_PWMC_CHID0 ((unsigned int) 0x1 << 0) // (PWMC) Channel ID 0 +#define AT91C_PWMC_CHID1 ((unsigned int) 0x1 << 1) // (PWMC) Channel ID 1 +#define AT91C_PWMC_CHID2 ((unsigned int) 0x1 << 2) // (PWMC) Channel ID 2 +#define AT91C_PWMC_CHID3 ((unsigned int) 0x1 << 3) // (PWMC) Channel ID 3 +// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- + +// ***************************************************************************** +// SOFTWARE API DEFINITION FOR USB Device Interface +// ***************************************************************************** +typedef struct _AT91S_UDP { + AT91_REG UDP_NUM; // Frame Number Register + AT91_REG UDP_GLBSTATE; // Global State Register + AT91_REG UDP_FADDR; // Function Address Register + AT91_REG Reserved0[1]; // + AT91_REG UDP_IER; // Interrupt Enable Register + AT91_REG UDP_IDR; // Interrupt Disable Register + AT91_REG UDP_IMR; // Interrupt Mask Register + AT91_REG UDP_ISR; // Interrupt Status Register + AT91_REG UDP_ICR; // Interrupt Clear Register + AT91_REG Reserved1[1]; // + AT91_REG UDP_RSTEP; // Reset Endpoint Register + AT91_REG Reserved2[1]; // + AT91_REG UDP_CSR[4]; // Endpoint Control and Status Register + AT91_REG Reserved3[4]; // + AT91_REG UDP_FDR[4]; // Endpoint FIFO Data Register + AT91_REG Reserved4[5]; // + AT91_REG UDP_TXVC; // Transceiver Control Register +} AT91S_UDP, *AT91PS_UDP; + +// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +#define AT91C_UDP_FRM_NUM ((unsigned int) 0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats +#define AT91C_UDP_FRM_ERR ((unsigned int) 0x1 << 16) // (UDP) Frame Error +#define AT91C_UDP_FRM_OK ((unsigned int) 0x1 << 17) // (UDP) Frame OK +// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +#define AT91C_UDP_FADDEN ((unsigned int) 0x1 << 0) // (UDP) Function Address Enable +#define AT91C_UDP_CONFG ((unsigned int) 0x1 << 1) // (UDP) Configured +#define AT91C_UDP_ESR ((unsigned int) 0x1 << 2) // (UDP) Enable Send Resume +#define AT91C_UDP_RSMINPR ((unsigned int) 0x1 << 3) // (UDP) A Resume Has Been Sent to the Host +#define AT91C_UDP_RMWUPE ((unsigned int) 0x1 << 4) // (UDP) Remote Wake Up Enable +// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +#define AT91C_UDP_FADD ((unsigned int) 0xFF << 0) // (UDP) Function Address Value +#define AT91C_UDP_FEN ((unsigned int) 0x1 << 8) // (UDP) Function Enable +// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +#define AT91C_UDP_EPINT0 ((unsigned int) 0x1 << 0) // (UDP) Endpoint 0 Interrupt +#define AT91C_UDP_EPINT1 ((unsigned int) 0x1 << 1) // (UDP) Endpoint 1 Interrupt +#define AT91C_UDP_EPINT2 ((unsigned int) 0x1 << 2) // (UDP) Endpoint 2 Interrupt +#define AT91C_UDP_EPINT3 ((unsigned int) 0x1 << 3) // (UDP) Endpoint 3 Interrupt +#define AT91C_UDP_RXSUSP ((unsigned int) 0x1 << 8) // (UDP) USB Suspend Interrupt +#define AT91C_UDP_RXRSM ((unsigned int) 0x1 << 9) // (UDP) USB Resume Interrupt +#define AT91C_UDP_EXTRSM ((unsigned int) 0x1 << 10) // (UDP) USB External Resume Interrupt +#define AT91C_UDP_SOFINT ((unsigned int) 0x1 << 11) // (UDP) USB Start Of frame Interrupt +#define AT91C_UDP_WAKEUP ((unsigned int) 0x1 << 13) // (UDP) USB Resume Interrupt +// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +#define AT91C_UDP_ENDBUSRES ((unsigned int) 0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt +// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +#define AT91C_UDP_EP0 ((unsigned int) 0x1 << 0) // (UDP) Reset Endpoint 0 +#define AT91C_UDP_EP1 ((unsigned int) 0x1 << 1) // (UDP) Reset Endpoint 1 +#define AT91C_UDP_EP2 ((unsigned int) 0x1 << 2) // (UDP) Reset Endpoint 2 +#define AT91C_UDP_EP3 ((unsigned int) 0x1 << 3) // (UDP) Reset Endpoint 3 +// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +#define AT91C_UDP_TXCOMP ((unsigned int) 0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR +#define AT91C_UDP_RX_DATA_BK0 ((unsigned int) 0x1 << 1) // (UDP) Receive Data Bank 0 +#define AT91C_UDP_RXSETUP ((unsigned int) 0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) +#define AT91C_UDP_ISOERROR ((unsigned int) 0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) +#define AT91C_UDP_STALLSENT ((unsigned int) 0x1 << 3) // (UDP) Stall Sent (Control endpoints) +#define AT91C_UDP_TXPKTRDY ((unsigned int) 0x1 << 4) // (UDP) Transmit Packet Ready +#define AT91C_UDP_FORCESTALL ((unsigned int) 0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +#define AT91C_UDP_RX_DATA_BK1 ((unsigned int) 0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +#define AT91C_UDP_DIR ((unsigned int) 0x1 << 7) // (UDP) Transfer Direction +#define AT91C_UDP_EPTYPE ((unsigned int) 0x7 << 8) // (UDP) Endpoint type +#define AT91C_UDP_EPTYPE_CTRL ((unsigned int) 0x0 << 8) // (UDP) Control +#define AT91C_UDP_EPTYPE_ISO_OUT ((unsigned int) 0x1 << 8) // (UDP) Isochronous OUT +#define AT91C_UDP_EPTYPE_BULK_OUT ((unsigned int) 0x2 << 8) // (UDP) Bulk OUT +#define AT91C_UDP_EPTYPE_INT_OUT ((unsigned int) 0x3 << 8) // (UDP) Interrupt OUT +#define AT91C_UDP_EPTYPE_ISO_IN ((unsigned int) 0x5 << 8) // (UDP) Isochronous IN +#define AT91C_UDP_EPTYPE_BULK_IN ((unsigned int) 0x6 << 8) // (UDP) Bulk IN +#define AT91C_UDP_EPTYPE_INT_IN ((unsigned int) 0x7 << 8) // (UDP) Interrupt IN +#define AT91C_UDP_DTGLE ((unsigned int) 0x1 << 11) // (UDP) Data Toggle +#define AT91C_UDP_EPEDS ((unsigned int) 0x1 << 15) // (UDP) Endpoint Enable Disable +#define AT91C_UDP_RXBYTECNT ((unsigned int) 0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO +// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +#define AT91C_UDP_TXVDIS ((unsigned int) 0x1 << 8) // (UDP) + +// ***************************************************************************** +// REGISTER ADDRESS DEFINITION FOR AT91SAM7S64 +// ***************************************************************************** +// ========== Register definition for SYS peripheral ========== +// ========== Register definition for AIC peripheral ========== +#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register +#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register +#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register +#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) +#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register +#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register +#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register +#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register +#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register +#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register +#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register +#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register +#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register +#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register +#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register +#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register +#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register +#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register +// ========== Register definition for PDC_DBGU peripheral ========== +#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register +#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register +#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register +#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register +#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register +#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register +#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register +#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register +#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register +#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register +// ========== Register definition for DBGU peripheral ========== +#define AT91C_DBGU_EXID ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID Extension Register +#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register +#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register +#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register +#define AT91C_DBGU_CIDR ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID Register +#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register +#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register +#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register +#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register +#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register +#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register +#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register +// ========== Register definition for PIOA peripheral ========== +#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr +#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register +#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register +#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register +#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register +#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register +#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register +#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register +#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register +#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register +#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register +#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register +#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register +#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pull-up Status Register +#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register +#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register +#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register +#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register +#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register +#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register +#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register +#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register +#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register +#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register +#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register +#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register +#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register +#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register +#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register +// ========== Register definition for CKGR peripheral ========== +#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register +#define AT91C_CKGR_PLLR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL Register +#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register +// ========== Register definition for PMC peripheral ========== +#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register +#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register +#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register +#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register +#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register +#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register +#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register +#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register +#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register +#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register +#define AT91C_PMC_MCFR ((AT91_REG *) 0xFFFFFC24) // (PMC) Main Clock Frequency Register +#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register +#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register +#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register +#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register +// ========== Register definition for RSTC peripheral ========== +#define AT91C_RSTC_RCR ((AT91_REG *) 0xFFFFFD00) // (RSTC) Reset Control Register +#define AT91C_RSTC_RMR ((AT91_REG *) 0xFFFFFD08) // (RSTC) Reset Mode Register +#define AT91C_RSTC_RSR ((AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register +// ========== Register definition for RTTC peripheral ========== +#define AT91C_RTTC_RTSR ((AT91_REG *) 0xFFFFFD2C) // (RTTC) Real-time Status Register +#define AT91C_RTTC_RTMR ((AT91_REG *) 0xFFFFFD20) // (RTTC) Real-time Mode Register +#define AT91C_RTTC_RTVR ((AT91_REG *) 0xFFFFFD28) // (RTTC) Real-time Value Register +#define AT91C_RTTC_RTAR ((AT91_REG *) 0xFFFFFD24) // (RTTC) Real-time Alarm Register +// ========== Register definition for PITC peripheral ========== +#define AT91C_PITC_PIVR ((AT91_REG *) 0xFFFFFD38) // (PITC) Period Interval Value Register +#define AT91C_PITC_PISR ((AT91_REG *) 0xFFFFFD34) // (PITC) Period Interval Status Register +#define AT91C_PITC_PIIR ((AT91_REG *) 0xFFFFFD3C) // (PITC) Period Interval Image Register +#define AT91C_PITC_PIMR ((AT91_REG *) 0xFFFFFD30) // (PITC) Period Interval Mode Register +// ========== Register definition for WDTC peripheral ========== +#define AT91C_WDTC_WDCR ((AT91_REG *) 0xFFFFFD40) // (WDTC) Watchdog Control Register +#define AT91C_WDTC_WDSR ((AT91_REG *) 0xFFFFFD48) // (WDTC) Watchdog Status Register +#define AT91C_WDTC_WDMR ((AT91_REG *) 0xFFFFFD44) // (WDTC) Watchdog Mode Register +// ========== Register definition for VREG peripheral ========== +#define AT91C_VREG_MR ((AT91_REG *) 0xFFFFFD60) // (VREG) Voltage Regulator Mode Register +// ========== Register definition for MC peripheral ========== +#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register +#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register +#define AT91C_MC_FCR ((AT91_REG *) 0xFFFFFF64) // (MC) MC Flash Command Register +#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register +#define AT91C_MC_FSR ((AT91_REG *) 0xFFFFFF68) // (MC) MC Flash Status Register +#define AT91C_MC_FMR ((AT91_REG *) 0xFFFFFF60) // (MC) MC Flash Mode Register +// ========== Register definition for PDC_SPI peripheral ========== +#define AT91C_SPI_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI) PDC Transfer Control Register +#define AT91C_SPI_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI) Transmit Pointer Register +#define AT91C_SPI_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI) Transmit Counter Register +#define AT91C_SPI_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI) Receive Counter Register +#define AT91C_SPI_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI) PDC Transfer Status Register +#define AT91C_SPI_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI) Receive Next Pointer Register +#define AT91C_SPI_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI) Receive Pointer Register +#define AT91C_SPI_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI) Transmit Next Counter Register +#define AT91C_SPI_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI) Receive Next Counter Register +#define AT91C_SPI_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI) Transmit Next Pointer Register +// ========== Register definition for SPI peripheral ========== +#define AT91C_SPI_IER ((AT91_REG *) 0xFFFE0014) // (SPI) Interrupt Enable Register +#define AT91C_SPI_SR ((AT91_REG *) 0xFFFE0010) // (SPI) Status Register +#define AT91C_SPI_IDR ((AT91_REG *) 0xFFFE0018) // (SPI) Interrupt Disable Register +#define AT91C_SPI_CR ((AT91_REG *) 0xFFFE0000) // (SPI) Control Register +#define AT91C_SPI_MR ((AT91_REG *) 0xFFFE0004) // (SPI) Mode Register +#define AT91C_SPI_IMR ((AT91_REG *) 0xFFFE001C) // (SPI) Interrupt Mask Register +#define AT91C_SPI_TDR ((AT91_REG *) 0xFFFE000C) // (SPI) Transmit Data Register +#define AT91C_SPI_RDR ((AT91_REG *) 0xFFFE0008) // (SPI) Receive Data Register +#define AT91C_SPI_CSR ((AT91_REG *) 0xFFFE0030) // (SPI) Chip Select Register +// ========== Register definition for PDC_ADC peripheral ========== +#define AT91C_ADC_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register +#define AT91C_ADC_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register +#define AT91C_ADC_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register +#define AT91C_ADC_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register +#define AT91C_ADC_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register +#define AT91C_ADC_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_ADC) Receive Next Counter Register +#define AT91C_ADC_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_ADC) Receive Pointer Register +#define AT91C_ADC_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_ADC) Transmit Counter Register +#define AT91C_ADC_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_ADC) Transmit Pointer Register +#define AT91C_ADC_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_ADC) Receive Counter Register +// ========== Register definition for ADC peripheral ========== +#define AT91C_ADC_CDR2 ((AT91_REG *) 0xFFFD8038) // (ADC) ADC Channel Data Register 2 +#define AT91C_ADC_CDR3 ((AT91_REG *) 0xFFFD803C) // (ADC) ADC Channel Data Register 3 +#define AT91C_ADC_CDR0 ((AT91_REG *) 0xFFFD8030) // (ADC) ADC Channel Data Register 0 +#define AT91C_ADC_CDR5 ((AT91_REG *) 0xFFFD8044) // (ADC) ADC Channel Data Register 5 +#define AT91C_ADC_CHDR ((AT91_REG *) 0xFFFD8014) // (ADC) ADC Channel Disable Register +#define AT91C_ADC_SR ((AT91_REG *) 0xFFFD801C) // (ADC) ADC Status Register +#define AT91C_ADC_CDR4 ((AT91_REG *) 0xFFFD8040) // (ADC) ADC Channel Data Register 4 +#define AT91C_ADC_CDR1 ((AT91_REG *) 0xFFFD8034) // (ADC) ADC Channel Data Register 1 +#define AT91C_ADC_LCDR ((AT91_REG *) 0xFFFD8020) // (ADC) ADC Last Converted Data Register +#define AT91C_ADC_IDR ((AT91_REG *) 0xFFFD8028) // (ADC) ADC Interrupt Disable Register +#define AT91C_ADC_CR ((AT91_REG *) 0xFFFD8000) // (ADC) ADC Control Register +#define AT91C_ADC_CDR7 ((AT91_REG *) 0xFFFD804C) // (ADC) ADC Channel Data Register 7 +#define AT91C_ADC_CDR6 ((AT91_REG *) 0xFFFD8048) // (ADC) ADC Channel Data Register 6 +#define AT91C_ADC_IER ((AT91_REG *) 0xFFFD8024) // (ADC) ADC Interrupt Enable Register +#define AT91C_ADC_CHER ((AT91_REG *) 0xFFFD8010) // (ADC) ADC Channel Enable Register +#define AT91C_ADC_CHSR ((AT91_REG *) 0xFFFD8018) // (ADC) ADC Channel Status Register +#define AT91C_ADC_MR ((AT91_REG *) 0xFFFD8004) // (ADC) ADC Mode Register +#define AT91C_ADC_IMR ((AT91_REG *) 0xFFFD802C) // (ADC) ADC Interrupt Mask Register +// ========== Register definition for PDC_SSC peripheral ========== +#define AT91C_SSC_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register +#define AT91C_SSC_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC) Receive Pointer Register +#define AT91C_SSC_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC) Receive Next Counter Register +#define AT91C_SSC_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC) Transmit Pointer Register +#define AT91C_SSC_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register +#define AT91C_SSC_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC) Transmit Counter Register +#define AT91C_SSC_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC) Receive Counter Register +#define AT91C_SSC_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register +#define AT91C_SSC_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register +#define AT91C_SSC_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register +// ========== Register definition for SSC peripheral ========== +#define AT91C_SSC_RHR ((AT91_REG *) 0xFFFD4020) // (SSC) Receive Holding Register +#define AT91C_SSC_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC) Receive Sync Holding Register +#define AT91C_SSC_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC) Transmit Frame Mode Register +#define AT91C_SSC_IDR ((AT91_REG *) 0xFFFD4048) // (SSC) Interrupt Disable Register +#define AT91C_SSC_THR ((AT91_REG *) 0xFFFD4024) // (SSC) Transmit Holding Register +#define AT91C_SSC_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC) Receive Clock ModeRegister +#define AT91C_SSC_IER ((AT91_REG *) 0xFFFD4044) // (SSC) Interrupt Enable Register +#define AT91C_SSC_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC) Transmit Sync Holding Register +#define AT91C_SSC_SR ((AT91_REG *) 0xFFFD4040) // (SSC) Status Register +#define AT91C_SSC_CMR ((AT91_REG *) 0xFFFD4004) // (SSC) Clock Mode Register +#define AT91C_SSC_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC) Transmit Clock Mode Register +#define AT91C_SSC_CR ((AT91_REG *) 0xFFFD4000) // (SSC) Control Register +#define AT91C_SSC_IMR ((AT91_REG *) 0xFFFD404C) // (SSC) Interrupt Mask Register +#define AT91C_SSC_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC) Receive Frame Mode Register +// ========== Register definition for PDC_US1 peripheral ========== +#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register +#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register +#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register +#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register +#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register +#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register +#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register +#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register +#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register +#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register +// ========== Register definition for US1 peripheral ========== +#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register +#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register +#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register +#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register +#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register +#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register +#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register +#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register +#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register +#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register +#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register +#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register +#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register +#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register +// ========== Register definition for PDC_US0 peripheral ========== +#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register +#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register +#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register +#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register +#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register +#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register +#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register +#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register +#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register +#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register +// ========== Register definition for US0 peripheral ========== +#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register +#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register +#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register +#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register +#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register +#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register +#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register +#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register +#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register +#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register +#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register +#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register +#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register +#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register +// ========== Register definition for TWI peripheral ========== +#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register +#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register +#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register +#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register +#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register +#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register +#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register +#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register +#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register +#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register +// ========== Register definition for TC0 peripheral ========== +#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register +#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C +#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B +#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register +#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register +#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A +#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register +#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value +#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register +// ========== Register definition for TC1 peripheral ========== +#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B +#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register +#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register +#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register +#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register +#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A +#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C +#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register +#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value +// ========== Register definition for TC2 peripheral ========== +#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register +#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value +#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A +#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B +#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register +#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register +#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C +#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register +#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register +// ========== Register definition for TCB peripheral ========== +#define AT91C_TCB_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB) TC Block Mode Register +#define AT91C_TCB_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB) TC Block Control Register +// ========== Register definition for PWMC_CH3 peripheral ========== +#define AT91C_PWMC_CH3_CUPDR ((AT91_REG *) 0xFFFCC270) // (PWMC_CH3) Channel Update Register +#define AT91C_PWMC_CH3_Reserved ((AT91_REG *) 0xFFFCC274) // (PWMC_CH3) Reserved +#define AT91C_PWMC_CH3_CPRDR ((AT91_REG *) 0xFFFCC268) // (PWMC_CH3) Channel Period Register +#define AT91C_PWMC_CH3_CDTYR ((AT91_REG *) 0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register +#define AT91C_PWMC_CH3_CCNTR ((AT91_REG *) 0xFFFCC26C) // (PWMC_CH3) Channel Counter Register +#define AT91C_PWMC_CH3_CMR ((AT91_REG *) 0xFFFCC260) // (PWMC_CH3) Channel Mode Register +// ========== Register definition for PWMC_CH2 peripheral ========== +#define AT91C_PWMC_CH2_Reserved ((AT91_REG *) 0xFFFCC254) // (PWMC_CH2) Reserved +#define AT91C_PWMC_CH2_CMR ((AT91_REG *) 0xFFFCC240) // (PWMC_CH2) Channel Mode Register +#define AT91C_PWMC_CH2_CCNTR ((AT91_REG *) 0xFFFCC24C) // (PWMC_CH2) Channel Counter Register +#define AT91C_PWMC_CH2_CPRDR ((AT91_REG *) 0xFFFCC248) // (PWMC_CH2) Channel Period Register +#define AT91C_PWMC_CH2_CUPDR ((AT91_REG *) 0xFFFCC250) // (PWMC_CH2) Channel Update Register +#define AT91C_PWMC_CH2_CDTYR ((AT91_REG *) 0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register +// ========== Register definition for PWMC_CH1 peripheral ========== +#define AT91C_PWMC_CH1_Reserved ((AT91_REG *) 0xFFFCC234) // (PWMC_CH1) Reserved +#define AT91C_PWMC_CH1_CUPDR ((AT91_REG *) 0xFFFCC230) // (PWMC_CH1) Channel Update Register +#define AT91C_PWMC_CH1_CPRDR ((AT91_REG *) 0xFFFCC228) // (PWMC_CH1) Channel Period Register +#define AT91C_PWMC_CH1_CCNTR ((AT91_REG *) 0xFFFCC22C) // (PWMC_CH1) Channel Counter Register +#define AT91C_PWMC_CH1_CDTYR ((AT91_REG *) 0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register +#define AT91C_PWMC_CH1_CMR ((AT91_REG *) 0xFFFCC220) // (PWMC_CH1) Channel Mode Register +// ========== Register definition for PWMC_CH0 peripheral ========== +#define AT91C_PWMC_CH0_Reserved ((AT91_REG *) 0xFFFCC214) // (PWMC_CH0) Reserved +#define AT91C_PWMC_CH0_CPRDR ((AT91_REG *) 0xFFFCC208) // (PWMC_CH0) Channel Period Register +#define AT91C_PWMC_CH0_CDTYR ((AT91_REG *) 0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register +#define AT91C_PWMC_CH0_CMR ((AT91_REG *) 0xFFFCC200) // (PWMC_CH0) Channel Mode Register +#define AT91C_PWMC_CH0_CUPDR ((AT91_REG *) 0xFFFCC210) // (PWMC_CH0) Channel Update Register +#define AT91C_PWMC_CH0_CCNTR ((AT91_REG *) 0xFFFCC20C) // (PWMC_CH0) Channel Counter Register +// ========== Register definition for PWMC peripheral ========== +#define AT91C_PWMC_IDR ((AT91_REG *) 0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register +#define AT91C_PWMC_DIS ((AT91_REG *) 0xFFFCC008) // (PWMC) PWMC Disable Register +#define AT91C_PWMC_IER ((AT91_REG *) 0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register +#define AT91C_PWMC_VR ((AT91_REG *) 0xFFFCC0FC) // (PWMC) PWMC Version Register +#define AT91C_PWMC_ISR ((AT91_REG *) 0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register +#define AT91C_PWMC_SR ((AT91_REG *) 0xFFFCC00C) // (PWMC) PWMC Status Register +#define AT91C_PWMC_IMR ((AT91_REG *) 0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register +#define AT91C_PWMC_MR ((AT91_REG *) 0xFFFCC000) // (PWMC) PWMC Mode Register +#define AT91C_PWMC_ENA ((AT91_REG *) 0xFFFCC004) // (PWMC) PWMC Enable Register +// ========== Register definition for UDP peripheral ========== +#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register +#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register +#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register +#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register +#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register +#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register +#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register +#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register +#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register +#define AT91C_UDP_TXVC ((AT91_REG *) 0xFFFB0074) // (UDP) Transceiver Control Register +#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register +#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register + +// ***************************************************************************** +// PIO DEFINITIONS FOR AT91SAM7S64 +// ***************************************************************************** +#define AT91C_PIO_PA0 ((unsigned int) 1 << 0) // Pin Controlled by PA0 +#define AT91C_PA0_PWM0 ((unsigned int) AT91C_PIO_PA0) // PWM Channel 0 +#define AT91C_PA0_TIOA0 ((unsigned int) AT91C_PIO_PA0) // Timer Counter 0 Multipurpose Timer I/O Pin A +#define AT91C_PIO_PA1 ((unsigned int) 1 << 1) // Pin Controlled by PA1 +#define AT91C_PA1_PWM1 ((unsigned int) AT91C_PIO_PA1) // PWM Channel 1 +#define AT91C_PA1_TIOB0 ((unsigned int) AT91C_PIO_PA1) // Timer Counter 0 Multipurpose Timer I/O Pin B +#define AT91C_PIO_PA10 ((unsigned int) 1 << 10) // Pin Controlled by PA10 +#define AT91C_PA10_DTXD ((unsigned int) AT91C_PIO_PA10) // DBGU Debug Transmit Data +#define AT91C_PA10_NPCS2 ((unsigned int) AT91C_PIO_PA10) // SPI Peripheral Chip Select 2 +#define AT91C_PIO_PA11 ((unsigned int) 1 << 11) // Pin Controlled by PA11 +#define AT91C_PA11_NPCS0 ((unsigned int) AT91C_PIO_PA11) // SPI Peripheral Chip Select 0 +#define AT91C_PA11_PWM0 ((unsigned int) AT91C_PIO_PA11) // PWM Channel 0 +#define AT91C_PIO_PA12 ((unsigned int) 1 << 12) // Pin Controlled by PA12 +#define AT91C_PA12_MISO ((unsigned int) AT91C_PIO_PA12) // SPI Master In Slave +#define AT91C_PA12_PWM1 ((unsigned int) AT91C_PIO_PA12) // PWM Channel 1 +#define AT91C_PIO_PA13 ((unsigned int) 1 << 13) // Pin Controlled by PA13 +#define AT91C_PA13_MOSI ((unsigned int) AT91C_PIO_PA13) // SPI Master Out Slave +#define AT91C_PA13_PWM2 ((unsigned int) AT91C_PIO_PA13) // PWM Channel 2 +#define AT91C_PIO_PA14 ((unsigned int) 1 << 14) // Pin Controlled by PA14 +#define AT91C_PA14_SPCK ((unsigned int) AT91C_PIO_PA14) // SPI Serial Clock +#define AT91C_PA14_PWM3 ((unsigned int) AT91C_PIO_PA14) // PWM Channel 3 +#define AT91C_PIO_PA15 ((unsigned int) 1 << 15) // Pin Controlled by PA15 +#define AT91C_PA15_TF ((unsigned int) AT91C_PIO_PA15) // SSC Transmit Frame Sync +#define AT91C_PA15_TIOA1 ((unsigned int) AT91C_PIO_PA15) // Timer Counter 1 Multipurpose Timer I/O Pin A +#define AT91C_PIO_PA16 ((unsigned int) 1 << 16) // Pin Controlled by PA16 +#define AT91C_PA16_TK ((unsigned int) AT91C_PIO_PA16) // SSC Transmit Clock +#define AT91C_PA16_TIOB1 ((unsigned int) AT91C_PIO_PA16) // Timer Counter 1 Multipurpose Timer I/O Pin B +#define AT91C_PIO_PA17 ((unsigned int) 1 << 17) // Pin Controlled by PA17 +#define AT91C_PA17_TD ((unsigned int) AT91C_PIO_PA17) // SSC Transmit data +#define AT91C_PA17_PCK1 ((unsigned int) AT91C_PIO_PA17) // PMC Programmable Clock Output 1 +#define AT91C_PIO_PA18 ((unsigned int) 1 << 18) // Pin Controlled by PA18 +#define AT91C_PA18_RD ((unsigned int) AT91C_PIO_PA18) // SSC Receive Data +#define AT91C_PA18_PCK2 ((unsigned int) AT91C_PIO_PA18) // PMC Programmable Clock Output 2 +#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) // Pin Controlled by PA19 +#define AT91C_PA19_RK ((unsigned int) AT91C_PIO_PA19) // SSC Receive Clock +#define AT91C_PA19_FIQ ((unsigned int) AT91C_PIO_PA19) // AIC Fast Interrupt Input +#define AT91C_PIO_PA2 ((unsigned int) 1 << 2) // Pin Controlled by PA2 +#define AT91C_PA2_PWM2 ((unsigned int) AT91C_PIO_PA2) // PWM Channel 2 +#define AT91C_PA2_SCK0 ((unsigned int) AT91C_PIO_PA2) // USART 0 Serial Clock +#define AT91C_PIO_PA20 ((unsigned int) 1 << 20) // Pin Controlled by PA20 +#define AT91C_PA20_RF ((unsigned int) AT91C_PIO_PA20) // SSC Receive Frame Sync +#define AT91C_PA20_IRQ0 ((unsigned int) AT91C_PIO_PA20) // External Interrupt 0 +#define AT91C_PIO_PA21 ((unsigned int) 1 << 21) // Pin Controlled by PA21 +#define AT91C_PA21_RXD1 ((unsigned int) AT91C_PIO_PA21) // USART 1 Receive Data +#define AT91C_PA21_PCK1 ((unsigned int) AT91C_PIO_PA21) // PMC Programmable Clock Output 1 +#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) // Pin Controlled by PA22 +#define AT91C_PA22_TXD1 ((unsigned int) AT91C_PIO_PA22) // USART 1 Transmit Data +#define AT91C_PA22_NPCS3 ((unsigned int) AT91C_PIO_PA22) // SPI Peripheral Chip Select 3 +#define AT91C_PIO_PA23 ((unsigned int) 1 << 23) // Pin Controlled by PA23 +#define AT91C_PA23_SCK1 ((unsigned int) AT91C_PIO_PA23) // USART 1 Serial Clock +#define AT91C_PA23_PWM0 ((unsigned int) AT91C_PIO_PA23) // PWM Channel 0 +#define AT91C_PIO_PA24 ((unsigned int) 1 << 24) // Pin Controlled by PA24 +#define AT91C_PA24_RTS1 ((unsigned int) AT91C_PIO_PA24) // USART 1 Ready To Send +#define AT91C_PA24_PWM1 ((unsigned int) AT91C_PIO_PA24) // PWM Channel 1 +#define AT91C_PIO_PA25 ((unsigned int) 1 << 25) // Pin Controlled by PA25 +#define AT91C_PA25_CTS1 ((unsigned int) AT91C_PIO_PA25) // USART 1 Clear To Send +#define AT91C_PA25_PWM2 ((unsigned int) AT91C_PIO_PA25) // PWM Channel 2 +#define AT91C_PIO_PA26 ((unsigned int) 1 << 26) // Pin Controlled by PA26 +#define AT91C_PA26_DCD1 ((unsigned int) AT91C_PIO_PA26) // USART 1 Data Carrier Detect +#define AT91C_PA26_TIOA2 ((unsigned int) AT91C_PIO_PA26) // Timer Counter 2 Multipurpose Timer I/O Pin A +#define AT91C_PIO_PA27 ((unsigned int) 1 << 27) // Pin Controlled by PA27 +#define AT91C_PA27_DTR1 ((unsigned int) AT91C_PIO_PA27) // USART 1 Data Terminal ready +#define AT91C_PA27_TIOB2 ((unsigned int) AT91C_PIO_PA27) // Timer Counter 2 Multipurpose Timer I/O Pin B +#define AT91C_PIO_PA28 ((unsigned int) 1 << 28) // Pin Controlled by PA28 +#define AT91C_PA28_DSR1 ((unsigned int) AT91C_PIO_PA28) // USART 1 Data Set ready +#define AT91C_PA28_TCLK1 ((unsigned int) AT91C_PIO_PA28) // Timer Counter 1 external clock input +#define AT91C_PIO_PA29 ((unsigned int) 1 << 29) // Pin Controlled by PA29 +#define AT91C_PA29_RI1 ((unsigned int) AT91C_PIO_PA29) // USART 1 Ring Indicator +#define AT91C_PA29_TCLK2 ((unsigned int) AT91C_PIO_PA29) // Timer Counter 2 external clock input +#define AT91C_PIO_PA3 ((unsigned int) 1 << 3) // Pin Controlled by PA3 +#define AT91C_PA3_TWD ((unsigned int) AT91C_PIO_PA3) // TWI Two-wire Serial Data +#define AT91C_PA3_NPCS3 ((unsigned int) AT91C_PIO_PA3) // SPI Peripheral Chip Select 3 +#define AT91C_PIO_PA30 ((unsigned int) 1 << 30) // Pin Controlled by PA30 +#define AT91C_PA30_IRQ1 ((unsigned int) AT91C_PIO_PA30) // External Interrupt 1 +#define AT91C_PA30_NPCS2 ((unsigned int) AT91C_PIO_PA30) // SPI Peripheral Chip Select 2 +#define AT91C_PIO_PA31 ((unsigned int) 1 << 31) // Pin Controlled by PA31 +#define AT91C_PA31_NPCS1 ((unsigned int) AT91C_PIO_PA31) // SPI Peripheral Chip Select 1 +#define AT91C_PA31_PCK2 ((unsigned int) AT91C_PIO_PA31) // PMC Programmable Clock Output 2 +#define AT91C_PIO_PA4 ((unsigned int) 1 << 4) // Pin Controlled by PA4 +#define AT91C_PA4_TWCK ((unsigned int) AT91C_PIO_PA4) // TWI Two-wire Serial Clock +#define AT91C_PA4_TCLK0 ((unsigned int) AT91C_PIO_PA4) // Timer Counter 0 external clock input +#define AT91C_PIO_PA5 ((unsigned int) 1 << 5) // Pin Controlled by PA5 +#define AT91C_PA5_RXD0 ((unsigned int) AT91C_PIO_PA5) // USART 0 Receive Data +#define AT91C_PA5_NPCS3 ((unsigned int) AT91C_PIO_PA5) // SPI Peripheral Chip Select 3 +#define AT91C_PIO_PA6 ((unsigned int) 1 << 6) // Pin Controlled by PA6 +#define AT91C_PA6_TXD0 ((unsigned int) AT91C_PIO_PA6) // USART 0 Transmit Data +#define AT91C_PA6_PCK0 ((unsigned int) AT91C_PIO_PA6) // PMC Programmable Clock Output 0 +#define AT91C_PIO_PA7 ((unsigned int) 1 << 7) // Pin Controlled by PA7 +#define AT91C_PA7_RTS0 ((unsigned int) AT91C_PIO_PA7) // USART 0 Ready To Send +#define AT91C_PA7_PWM3 ((unsigned int) AT91C_PIO_PA7) // PWM Channel 3 +#define AT91C_PIO_PA8 ((unsigned int) 1 << 8) // Pin Controlled by PA8 +#define AT91C_PA8_CTS0 ((unsigned int) AT91C_PIO_PA8) // USART 0 Clear To Send +#define AT91C_PA8_ADTRG ((unsigned int) AT91C_PIO_PA8) // ADC External Trigger +#define AT91C_PIO_PA9 ((unsigned int) 1 << 9) // Pin Controlled by PA9 +#define AT91C_PA9_DRXD ((unsigned int) AT91C_PIO_PA9) // DBGU Debug Receive Data +#define AT91C_PA9_NPCS1 ((unsigned int) AT91C_PIO_PA9) // SPI Peripheral Chip Select 1 + +// ***************************************************************************** +// PERIPHERAL ID DEFINITIONS FOR AT91SAM7S64 +// ***************************************************************************** +#define AT91C_ID_FIQ ((unsigned int) 0) // Advanced Interrupt Controller (FIQ) +#define AT91C_ID_SYS ((unsigned int) 1) // System Peripheral +#define AT91C_ID_PIOA ((unsigned int) 2) // Parallel IO Controller +#define AT91C_ID_3_Reserved ((unsigned int) 3) // Reserved +#define AT91C_ID_ADC ((unsigned int) 4) // Analog-to-Digital Converter +#define AT91C_ID_SPI ((unsigned int) 5) // Serial Peripheral Interface +#define AT91C_ID_US0 ((unsigned int) 6) // USART 0 +#define AT91C_ID_US1 ((unsigned int) 7) // USART 1 +#define AT91C_ID_SSC ((unsigned int) 8) // Serial Synchronous Controller +#define AT91C_ID_TWI ((unsigned int) 9) // Two-Wire Interface +#define AT91C_ID_PWMC ((unsigned int) 10) // PWM Controller +#define AT91C_ID_UDP ((unsigned int) 11) // USB Device Port +#define AT91C_ID_TC0 ((unsigned int) 12) // Timer Counter 0 +#define AT91C_ID_TC1 ((unsigned int) 13) // Timer Counter 1 +#define AT91C_ID_TC2 ((unsigned int) 14) // Timer Counter 2 +#define AT91C_ID_15_Reserved ((unsigned int) 15) // Reserved +#define AT91C_ID_16_Reserved ((unsigned int) 16) // Reserved +#define AT91C_ID_17_Reserved ((unsigned int) 17) // Reserved +#define AT91C_ID_18_Reserved ((unsigned int) 18) // Reserved +#define AT91C_ID_19_Reserved ((unsigned int) 19) // Reserved +#define AT91C_ID_20_Reserved ((unsigned int) 20) // Reserved +#define AT91C_ID_21_Reserved ((unsigned int) 21) // Reserved +#define AT91C_ID_22_Reserved ((unsigned int) 22) // Reserved +#define AT91C_ID_23_Reserved ((unsigned int) 23) // Reserved +#define AT91C_ID_24_Reserved ((unsigned int) 24) // Reserved +#define AT91C_ID_25_Reserved ((unsigned int) 25) // Reserved +#define AT91C_ID_26_Reserved ((unsigned int) 26) // Reserved +#define AT91C_ID_27_Reserved ((unsigned int) 27) // Reserved +#define AT91C_ID_28_Reserved ((unsigned int) 28) // Reserved +#define AT91C_ID_29_Reserved ((unsigned int) 29) // Reserved +#define AT91C_ID_IRQ0 ((unsigned int) 30) // Advanced Interrupt Controller (IRQ0) +#define AT91C_ID_IRQ1 ((unsigned int) 31) // Advanced Interrupt Controller (IRQ1) +#define AT91C_ALL_INT ((unsigned int) 0xC0007FF7) // ALL VALID INTERRUPTS + +// ***************************************************************************** +// BASE ADDRESS DEFINITIONS FOR AT91SAM7S64 +// ***************************************************************************** +#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address +#define AT91C_BASE_AIC ((AT91PS_AIC) 0xFFFFF000) // (AIC) Base Address +#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address +#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address +#define AT91C_BASE_PIOA ((AT91PS_PIO) 0xFFFFF400) // (PIOA) Base Address +#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address +#define AT91C_BASE_PMC ((AT91PS_PMC) 0xFFFFFC00) // (PMC) Base Address +#define AT91C_BASE_RSTC ((AT91PS_RSTC) 0xFFFFFD00) // (RSTC) Base Address +#define AT91C_BASE_RTTC ((AT91PS_RTTC) 0xFFFFFD20) // (RTTC) Base Address +#define AT91C_BASE_PITC ((AT91PS_PITC) 0xFFFFFD30) // (PITC) Base Address +#define AT91C_BASE_WDTC ((AT91PS_WDTC) 0xFFFFFD40) // (WDTC) Base Address +#define AT91C_BASE_VREG ((AT91PS_VREG) 0xFFFFFD60) // (VREG) Base Address +#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address +#define AT91C_BASE_PDC_SPI ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI) Base Address +#define AT91C_BASE_SPI ((AT91PS_SPI) 0xFFFE0000) // (SPI) Base Address +#define AT91C_BASE_PDC_ADC ((AT91PS_PDC) 0xFFFD8100) // (PDC_ADC) Base Address +#define AT91C_BASE_ADC ((AT91PS_ADC) 0xFFFD8000) // (ADC) Base Address +#define AT91C_BASE_PDC_SSC ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC) Base Address +#define AT91C_BASE_SSC ((AT91PS_SSC) 0xFFFD4000) // (SSC) Base Address +#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address +#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address +#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address +#define AT91C_BASE_US0 ((AT91PS_USART) 0xFFFC0000) // (US0) Base Address +#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address +#define AT91C_BASE_TC0 ((AT91PS_TC) 0xFFFA0000) // (TC0) Base Address +#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address +#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address +#define AT91C_BASE_TCB ((AT91PS_TCB) 0xFFFA0000) // (TCB) Base Address +#define AT91C_BASE_PWMC_CH3 ((AT91PS_PWMC_CH) 0xFFFCC260) // (PWMC_CH3) Base Address +#define AT91C_BASE_PWMC_CH2 ((AT91PS_PWMC_CH) 0xFFFCC240) // (PWMC_CH2) Base Address +#define AT91C_BASE_PWMC_CH1 ((AT91PS_PWMC_CH) 0xFFFCC220) // (PWMC_CH1) Base Address +#define AT91C_BASE_PWMC_CH0 ((AT91PS_PWMC_CH) 0xFFFCC200) // (PWMC_CH0) Base Address +#define AT91C_BASE_PWMC ((AT91PS_PWMC) 0xFFFCC000) // (PWMC) Base Address +#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address + +// ***************************************************************************** +// MEMORY MAPPING DEFINITIONS FOR AT91SAM7S64 +// ***************************************************************************** +// ISRAM +#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address +// IFLASH +#define AT91C_IFLASH ((char *) 0x00100000) // Internal FLASH base address + +#if defined(__AT91SAM7S32__) +#define AT91C_ISRAM_SIZE ((unsigned int) 0x00002000) // Internal SRAM size in byte (8 Kbytes) +#define AT91C_IFLASH_SIZE ((unsigned int) 0x00008000) // Internal FLASH size in byte (32 Kbytes) +#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 128) // Internal FLASH Page Size: 128 bytes +#define AT91C_IFLASH_PAGE_SHIFT 7 +#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 8) // Internal FLASH Number of Lock Bits: 8 +#elif defined(__AT91SAM7S64__) +#define AT91C_ISRAM_SIZE ((unsigned int) 0x00004000) // Internal SRAM size in byte (16 Kbytes) +#define AT91C_IFLASH_SIZE ((unsigned int) 0x00010000) // Internal FLASH size in byte (64 Kbytes) +#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 128) // Internal FLASH Page Size: 128 bytes +#define AT91C_IFLASH_PAGE_SHIFT 7 +#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 +#elif defined(__AT91SAM7S128__) +#define AT91C_ISRAM_SIZE ((unsigned int) 0x00008000) // Internal SRAM size in byte (32 Kbytes) +#define AT91C_IFLASH_SIZE ((unsigned int) 0x00020000) // Internal FLASH size in byte (128 Kbytes) +#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes +#define AT91C_IFLASH_PAGE_SHIFT 8 +#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 8) // Internal FLASH Number of Lock Bits: 8 +#elif defined(__AT91SAM7S256__) +#define AT91C_ISRAM_SIZE ((unsigned int) 0x00010000) // Internal SRAM size in byte (64 Kbytes) +#define AT91C_IFLASH_SIZE ((unsigned int) 0x00040000) // Internal FLASH size in byte (256 Kbytes) +#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes +#define AT91C_IFLASH_PAGE_SHIFT 8 +#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 +#else +#error Have to define which __AT91SAM7Sxxx__ type +#endif + +#define AT91C_IFLASH_NB_OF_PAGES (AT91C_ISRAM_SIZE>>AT91C_IFLASH_PAGE_SHIFT) +#define AT91C_IFLASH_LOCK_REGION_SIZE (AT91C_ISRAM_SIZE/AT91C_IFLASH_NB_OF_LOCK_BITS) + +#endif/*__AT91SAM7_H__*/ diff --git a/firmware/include/asm/assembler.h b/firmware/include/asm/assembler.h new file mode 100644 index 0000000..b43f9d1 --- /dev/null +++ b/firmware/include/asm/assembler.h @@ -0,0 +1,97 @@ +/* + * linux/include/asm-arm/assembler.h + * + * Copyright (C) 1996-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This file contains arm architecture specific defines + * for the different processors. + * + * Do not include any C declarations in this file - it is included by + * assembler source. + */ +#ifndef __ASSEMBLY__ +#error "Only include this from assembly code" +#endif + +#include + +#define pull lsl +#define push lsr +#define get_byte_0 lsr #24 +#define get_byte_1 lsr #16 +#define get_byte_2 lsr #8 +#define get_byte_3 lsl #0 +#define put_byte_0 lsl #24 +#define put_byte_1 lsl #16 +#define put_byte_2 lsl #8 +#define put_byte_3 lsl #0 + +#define PLD(code...) + +#define MODE_USR USR_MODE +#define MODE_FIQ FIQ_MODE +#define MODE_IRQ IRQ_MODE +#define MODE_SVC SVC_MODE + +#define DEFAULT_FIQ MODE_FIQ + +/* + * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + */ +#ifdef __STDC__ +#define LOADREGS(cond, base, reglist...)\ + ldm##cond base,reglist +#else +#define LOADREGS(cond, base, reglist...)\ + ldm/**/cond base,reglist +#endif + +/* + * Build a return instruction for this processor type. + */ +#define RETINSTR(instr, regs...)\ + instr regs + +/* + * Enable and disable interrupts + */ + .macro disable_irq + msr cpsr_c, #PSR_I_BIT | SVC_MODE + .endm + + .macro enable_irq + msr cpsr_c, #SVC_MODE + .endm + +/* + * Save the current IRQ state and disable IRQs. Note that this macro + * assumes FIQs are enabled, and that the processor is in SVC mode. + */ + .macro save_and_disable_irqs, oldcpsr + mrs \oldcpsr, cpsr + disable_irq + .endm + +/* + * Restore interrupt state previously stored in a register. We don't + * guarantee that this will preserve the flags. + */ + .macro restore_irqs, oldcpsr + msr cpsr_c, \oldcpsr + .endm + +/* + * These two are used to save LR/restore PC over a user-based access. + * The old 26-bit architecture requires that we do. On 32-bit + * architecture, we can safely ignore this requirement. + */ + .macro save_lr + .endm + + .macro restore_pc + mov pc, lr + .endm diff --git a/firmware/include/asm/atomic.h b/firmware/include/asm/atomic.h new file mode 100644 index 0000000..19e8ce6 --- /dev/null +++ b/firmware/include/asm/atomic.h @@ -0,0 +1,106 @@ +/* + * linux/include/asm-arm/atomic.h + * + * Copyright (C) 1996 Russell King. + * Copyright (C) 2002 Deep Blue Solutions Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_ATOMIC_H +#define __ASM_ARM_ATOMIC_H + +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +#define atomic_read(v) ((v)->counter) + +#include +#include + +#define atomic_set(v,i) (((v)->counter) = (i)) + +static inline int atomic_add_return(int i, atomic_t *v) +{ + unsigned long flags; + int val; + + local_irq_save(flags); + val = v->counter; + v->counter = val += i; + local_irq_restore(flags); + + return val; +} + +static inline int atomic_sub_return(int i, atomic_t *v) +{ + unsigned long flags; + int val; + + local_irq_save(flags); + val = v->counter; + v->counter = val -= i; + local_irq_restore(flags); + + return val; +} + +static inline int atomic_cmpxchg(atomic_t *v, int old, int new) +{ + int ret; + unsigned long flags; + + local_irq_save(flags); + ret = v->counter; + if (likely(ret == old)) + v->counter = new; + local_irq_restore(flags); + + return ret; +} + +static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) +{ + unsigned long flags; + + local_irq_save(flags); + *addr &= ~mask; + local_irq_restore(flags); +} + +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) + +static inline int atomic_add_unless(atomic_t *v, int a, int u) +{ + int c, old; + + c = atomic_read(v); + while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c) + c = old; + return c != u; +} +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) + +#define atomic_add(i, v) (void) atomic_add_return(i, v) +#define atomic_inc(v) (void) atomic_add_return(1, v) +#define atomic_sub(i, v) (void) atomic_sub_return(i, v) +#define atomic_dec(v) (void) atomic_sub_return(1, v) + +#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) +#define atomic_inc_return(v) (atomic_add_return(1, v)) +#define atomic_dec_return(v) (atomic_sub_return(1, v)) +#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) + +#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0) + +/* Atomic operations are already serializing on ARM */ +#define smp_mb__before_atomic_dec() barrier() +#define smp_mb__after_atomic_dec() barrier() +#define smp_mb__before_atomic_inc() barrier() +#define smp_mb__after_atomic_inc() barrier() + +#endif diff --git a/firmware/include/asm/bitops.h b/firmware/include/asm/bitops.h new file mode 100644 index 0000000..337d800 --- /dev/null +++ b/firmware/include/asm/bitops.h @@ -0,0 +1,225 @@ +/* + * Copyright 1995, Russell King. + * Various bits and pieces copyrights include: + * Linus Torvalds (test_bit). + * Big endian support: Copyright 2001, Nicolas Pitre + * reworked by rmk. + * + * bit 0 is the LSB of an "unsigned long" quantity. + * + * Please note that the code in this file should never be included + * from user space. Many of these are not implemented in assembler + * since they would be too costly. Also, they require privileged + * instructions (which are not available from user mode) to ensure + * that they are atomic. + */ + +#ifndef __ASM_ARM_BITOPS_H +#define __ASM_ARM_BITOPS_H + +#include + +#define smp_mb__before_clear_bit() mb() +#define smp_mb__after_clear_bit() mb() + +/* + * These functions are the basis of our bit ops. + * + * First, the atomic bitops. These use native endian. + */ +static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + *p |= mask; + local_irq_restore(flags); +} + +static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + *p &= ~mask; + local_irq_restore(flags); +} + +static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + *p ^= mask; + local_irq_restore(flags); +} + +static inline int +____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned int res; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + res = *p; + *p = res | mask; + local_irq_restore(flags); + + return res & mask; +} + +static inline int +____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned int res; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + res = *p; + *p = res & ~mask; + local_irq_restore(flags); + + return res & mask; +} + +static inline int +____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p) +{ + unsigned long flags; + unsigned int res; + unsigned long mask = 1UL << (bit & 31); + + p += bit >> 5; + + local_irq_save(flags); + res = *p; + *p = res ^ mask; + local_irq_restore(flags); + + return res & mask; +} + +//#include + +/* + * A note about Endian-ness. + * ------------------------- + * + * When the ARM is put into big endian mode via CR15, the processor + * merely swaps the order of bytes within words, thus: + * + * ------------ physical data bus bits ----------- + * D31 ... D24 D23 ... D16 D15 ... D8 D7 ... D0 + * little byte 3 byte 2 byte 1 byte 0 + * big byte 0 byte 1 byte 2 byte 3 + * + * This means that reading a 32-bit word at address 0 returns the same + * value irrespective of the endian mode bit. + * + * Peripheral devices should be connected with the data bus reversed in + * "Big Endian" mode. ARM Application Note 61 is applicable, and is + * available from http://www.arm.com/. + * + * The following assumes that the data bus connectivity for big endian + * mode has been followed. + * + * Note that bit 0 is defined to be 32-bit word bit 0, not byte 0 bit 0. + */ + +/* + * Little endian assembly bitops. nr = 0 -> byte 0 bit 0. + */ +extern void _set_bit_le(int nr, volatile unsigned long * p); +extern void _clear_bit_le(int nr, volatile unsigned long * p); +extern void _change_bit_le(int nr, volatile unsigned long * p); +extern int _test_and_set_bit_le(int nr, volatile unsigned long * p); +extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p); +extern int _test_and_change_bit_le(int nr, volatile unsigned long * p); +extern int _find_first_zero_bit_le(const void * p, unsigned size); +extern int _find_next_zero_bit_le(const void * p, int size, int offset); +extern int _find_first_bit_le(const unsigned long *p, unsigned size); +extern int _find_next_bit_le(const unsigned long *p, int size, int offset); + +/* + * Big endian assembly bitops. nr = 0 -> byte 3 bit 0. + */ +extern void _set_bit_be(int nr, volatile unsigned long * p); +extern void _clear_bit_be(int nr, volatile unsigned long * p); +extern void _change_bit_be(int nr, volatile unsigned long * p); +extern int _test_and_set_bit_be(int nr, volatile unsigned long * p); +extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p); +extern int _test_and_change_bit_be(int nr, volatile unsigned long * p); +extern int _find_first_zero_bit_be(const void * p, unsigned size); +extern int _find_next_zero_bit_be(const void * p, int size, int offset); +extern int _find_first_bit_be(const unsigned long *p, unsigned size); +extern int _find_next_bit_be(const unsigned long *p, int size, int offset); + +/* + * The __* form of bitops are non-atomic and may be reordered. + */ +#define ATOMIC_BITOP_LE(name,nr,p) \ + (__builtin_constant_p(nr) ? \ + ____atomic_##name(nr, p) : \ + _##name##_le(nr,p)) + +#define ATOMIC_BITOP_BE(name,nr,p) \ + (__builtin_constant_p(nr) ? \ + ____atomic_##name(nr, p) : \ + _##name##_be(nr,p)) + +#define NONATOMIC_BITOP(name,nr,p) \ + (____nonatomic_##name(nr, p)) + +/* + * These are the little endian, atomic definitions. + */ +#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p) +#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p) +#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p) +#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p) +#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p) +#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p) +#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz) +#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off) +#define find_first_bit(p,sz) _find_first_bit_le(p,sz) +#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off) + +#define WORD_BITOFF_TO_LE(x) ((x)) + +#if 0 +#include +#include +#include +#include + +#include + +#include +#include +#endif + +#define BITS_PER_LONG 32 +#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) + +static inline int test_bit(int nr, const volatile unsigned long *addr) +{ + return 1UL & (addr[BITOP_WORD(nr)] >> (nr & (BITS_PER_LONG-1))); +} + +#endif /* _ARM_BITOPS_H */ diff --git a/firmware/include/asm/compiler.h b/firmware/include/asm/compiler.h new file mode 100644 index 0000000..de4dfaa --- /dev/null +++ b/firmware/include/asm/compiler.h @@ -0,0 +1,7 @@ +#ifndef _ASM_COMPILER_H +#define _ASM_COMPILER_H + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +#endif diff --git a/firmware/include/asm/ctype.h b/firmware/include/asm/ctype.h new file mode 100644 index 0000000..afa3639 --- /dev/null +++ b/firmware/include/asm/ctype.h @@ -0,0 +1,54 @@ +#ifndef _LINUX_CTYPE_H +#define _LINUX_CTYPE_H + +/* + * NOTE! This ctype does not handle EOF like the standard C + * library is required to. + */ + +#define _U 0x01 /* upper */ +#define _L 0x02 /* lower */ +#define _D 0x04 /* digit */ +#define _C 0x08 /* cntrl */ +#define _P 0x10 /* punct */ +#define _S 0x20 /* white space (space/lf/tab) */ +#define _X 0x40 /* hex digit */ +#define _SP 0x80 /* hard space (0x20) */ + +extern unsigned char _ctype[]; + +#define __ismask(x) (_ctype[(int)(unsigned char)(x)]) + +#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0) +#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0) +#define iscntrl(c) ((__ismask(c)&(_C)) != 0) +#define isdigit(c) ((__ismask(c)&(_D)) != 0) +#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0) +#define islower(c) ((__ismask(c)&(_L)) != 0) +#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) +#define ispunct(c) ((__ismask(c)&(_P)) != 0) +#define isspace(c) ((__ismask(c)&(_S)) != 0) +#define isupper(c) ((__ismask(c)&(_U)) != 0) +#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) + +#define isascii(c) (((unsigned char)(c))<=0x7f) +#define toascii(c) (((unsigned char)(c))&0x7f) + +static inline unsigned char __tolower(unsigned char c) +{ + if (isupper(c)) + c -= 'A'-'a'; + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + c -= 'a'-'A'; + return c; +} + +#define tolower(c) __tolower(c) +#define toupper(c) __toupper(c) + +#endif diff --git a/firmware/include/asm/div64.h b/firmware/include/asm/div64.h new file mode 100644 index 0000000..3682616 --- /dev/null +++ b/firmware/include/asm/div64.h @@ -0,0 +1,48 @@ +#ifndef __ASM_ARM_DIV64 +#define __ASM_ARM_DIV64 + +#include + +/* + * The semantics of do_div() are: + * + * uint32_t do_div(uint64_t *n, uint32_t base) + * { + * uint32_t remainder = *n % base; + * *n = *n / base; + * return remainder; + * } + * + * In other words, a 64-bit dividend with a 32-bit divisor producing + * a 64-bit result and a 32-bit remainder. To accomplish this optimally + * we call a special __do_div64 helper with completely non standard + * calling convention for arguments and results (beware). + */ + +#ifdef __ARMEB__ +#define __xh "r0" +#define __xl "r1" +#else +#define __xl "r0" +#define __xh "r1" +#endif + +#define do_div(n,base) \ +({ \ + register unsigned int __base asm("r4") = base; \ + register unsigned long long __n asm("r0") = n; \ + register unsigned long long __res asm("r2"); \ + register unsigned int __rem asm(__xh); \ + asm( __asmeq("%0", __xh) \ + __asmeq("%1", "r2") \ + __asmeq("%2", "r0") \ + __asmeq("%3", "r4") \ + "bl __do_div64" \ + : "=r" (__rem), "=r" (__res) \ + : "r" (__n), "r" (__base) \ + : "ip", "lr", "cc"); \ + n = __res; \ + __rem; \ +}) + +#endif diff --git a/firmware/include/asm/linkage.h b/firmware/include/asm/linkage.h new file mode 100644 index 0000000..ac1c900 --- /dev/null +++ b/firmware/include/asm/linkage.h @@ -0,0 +1,18 @@ +#ifndef __ASM_LINKAGE_H +#define __ASM_LINKAGE_H + +/* asm-arm/linkage.h */ + +#define __ALIGN .align 0 +#define __ALIGN_STR ".align 0" + +/* linux/linkage.h */ + +#define ALIGN __ALIGN + +#define ENTRY(name) \ + .globl name; \ + ALIGN; \ + name: + +#endif diff --git a/firmware/include/asm/ptrace.h b/firmware/include/asm/ptrace.h new file mode 100644 index 0000000..f3a654e --- /dev/null +++ b/firmware/include/asm/ptrace.h @@ -0,0 +1,128 @@ +/* + * linux/include/asm-arm/ptrace.h + * + * Copyright (C) 1996-2003 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ASM_ARM_PTRACE_H +#define __ASM_ARM_PTRACE_H + +/* + * PSR bits + */ +#define USR26_MODE 0x00000000 +#define FIQ26_MODE 0x00000001 +#define IRQ26_MODE 0x00000002 +#define SVC26_MODE 0x00000003 +#define USR_MODE 0x00000010 +#define FIQ_MODE 0x00000011 +#define IRQ_MODE 0x00000012 +#define SVC_MODE 0x00000013 +#define ABT_MODE 0x00000017 +#define UND_MODE 0x0000001b +#define SYSTEM_MODE 0x0000001f +#define MODE32_BIT 0x00000010 +#define MODE_MASK 0x0000001f +#define PSR_T_BIT 0x00000020 +#define PSR_F_BIT 0x00000040 +#define PSR_I_BIT 0x00000080 +#define PSR_J_BIT 0x01000000 +#define PSR_Q_BIT 0x08000000 +#define PSR_V_BIT 0x10000000 +#define PSR_C_BIT 0x20000000 +#define PSR_Z_BIT 0x40000000 +#define PSR_N_BIT 0x80000000 +#define PCMASK 0 + +/* + * Groups of PSR bits + */ +#define PSR_f 0xff000000 /* Flags */ +#define PSR_s 0x00ff0000 /* Status */ +#define PSR_x 0x0000ff00 /* Extension */ +#define PSR_c 0x000000ff /* Control */ + +#ifndef __ASSEMBLY__ + +/* + * This struct defines the way the registers are stored on the + * stack during a system call. Note that sizeof(struct pt_regs) + * has to be a multiple of 8. + */ +struct pt_regs { + long uregs[18]; +}; + +#define ARM_cpsr uregs[16] +#define ARM_pc uregs[15] +#define ARM_lr uregs[14] +#define ARM_sp uregs[13] +#define ARM_ip uregs[12] +#define ARM_fp uregs[11] +#define ARM_r10 uregs[10] +#define ARM_r9 uregs[9] +#define ARM_r8 uregs[8] +#define ARM_r7 uregs[7] +#define ARM_r6 uregs[6] +#define ARM_r5 uregs[5] +#define ARM_r4 uregs[4] +#define ARM_r3 uregs[3] +#define ARM_r2 uregs[2] +#define ARM_r1 uregs[1] +#define ARM_r0 uregs[0] +#define ARM_ORIG_r0 uregs[17] + +#define user_mode(regs) \ + (((regs)->ARM_cpsr & 0xf) == 0) + +#ifdef CONFIG_ARM_THUMB +#define thumb_mode(regs) \ + (((regs)->ARM_cpsr & PSR_T_BIT)) +#else +#define thumb_mode(regs) (0) +#endif + +#define processor_mode(regs) \ + ((regs)->ARM_cpsr & MODE_MASK) + +#define interrupts_enabled(regs) \ + (!((regs)->ARM_cpsr & PSR_I_BIT)) + +#define fast_interrupts_enabled(regs) \ + (!((regs)->ARM_cpsr & PSR_F_BIT)) + +#define condition_codes(regs) \ + ((regs)->ARM_cpsr & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT)) + +/* Are the current registers suitable for user mode? + * (used to maintain security in signal handlers) + */ +static inline int valid_user_regs(struct pt_regs *regs) +{ + if (user_mode(regs) && + (regs->ARM_cpsr & (PSR_F_BIT|PSR_I_BIT)) == 0) + return 1; + + /* + * Force CPSR to something logical... + */ + regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT; + + return 0; +} + +#define pc_pointer(v) \ + ((v) & ~PCMASK) + +#define instruction_pointer(regs) \ + (pc_pointer((regs)->ARM_pc)) + +#define profile_pc(regs) instruction_pointer(regs) + +#endif /* __ASSEMBLY__ */ + +#endif + diff --git a/firmware/include/asm/system.h b/firmware/include/asm/system.h new file mode 100644 index 0000000..2bf0cc5 --- /dev/null +++ b/firmware/include/asm/system.h @@ -0,0 +1,109 @@ +#ifndef __ASM_ARM_SYSTEM_H +#define __ASM_ARM_SYSTEM_H + +/* Generic ARM7TDMI (ARMv4T) synchronisation primitives, mostly + * taken from Linux kernel source, licensed under GPL */ + +#define local_irq_save(x) \ + ({ \ + unsigned long temp; \ + (void) (&temp == &x); \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ local_irq_save\n" \ +" orr %1, %0, #128\n" \ +" msr cpsr_c, %1" \ + : "=r" (x), "=r" (temp) \ + : \ + : "memory", "cc"); \ + }) + +/* + * Enable IRQs + */ +#define local_irq_enable() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ local_irq_enable\n" \ +" bic %0, %0, #128\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory", "cc"); \ + }) + +/* + * Disable IRQs + */ +#define local_irq_disable() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ local_irq_disable\n" \ +" orr %0, %0, #128\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory", "cc"); \ + }) + +/* + * Enable FIQs + */ +#define local_fiq_enable() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ stf\n" \ +" bic %0, %0, #64\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory", "cc"); \ + }) + +/* + * Disable FIQs + */ +#define local_fiq_disable() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ clf\n" \ +" orr %0, %0, #64\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory", "cc"); \ + }) + +/* + * Save the current interrupt enable state. + */ +#define local_save_flags(x) \ + ({ \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ local_save_flags" \ + : "=r" (x) : : "memory", "cc"); \ + }) + +/* + * restore saved IRQ & FIQ state + */ +#define local_irq_restore(x) \ + __asm__ __volatile__( \ + "msr cpsr_c, %0 @ local_irq_restore\n" \ + : \ + : "r" (x) \ + : "memory", "cc") + +#define irqs_disabled() \ +({ \ + unsigned long flags; \ + local_save_flags(flags); \ + (int)(flags & PSR_I_BIT); \ +}) + +#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t" + +#endif diff --git a/firmware/include/board.h b/firmware/include/board.h new file mode 100644 index 0000000..eded556 --- /dev/null +++ b/firmware/include/board.h @@ -0,0 +1,14 @@ +#ifndef __BOARD_H__ +#define __BOARD_H__ + +#include +#include + +/*--------------*/ +/* Master Clock */ +/*--------------*/ +#define EXT_OSC 18432000 // External Crystal Oscillator +#define MCK 47923200 // Resulting PLL CLock +#define ENVIRONMENT_SIZE ( AT91C_IFLASH_PAGE_SIZE ) + +#endif/*__BOARD_H__*/ diff --git a/firmware/include/cl_rc632.h b/firmware/include/cl_rc632.h new file mode 100644 index 0000000..668986c --- /dev/null +++ b/firmware/include/cl_rc632.h @@ -0,0 +1,271 @@ +/* Register definitions for Philips CL RC632 RFID Reader IC + * + * (C) 2005 Harald Welte + * + * Licensed under GNU General Public License, Version 2 + */ + +#ifndef _CLRC632_H +#define _CLRC632_H + +enum rc632_registers { + RC632_REG_PAGE0 = 0x00, + RC632_REG_COMMAND = 0x01, + RC632_REG_FIFO_DATA = 0x02, + RC632_REG_PRIMARY_STATUS = 0x03, + RC632_REG_FIFO_LENGTH = 0x04, + RC632_REG_SECONDARY_STATUS = 0x05, + RC632_REG_INTERRUPT_EN = 0x06, + RC632_REG_INTERRUPT_RQ = 0x07, + + RC632_REG_PAGE1 = 0x08, + RC632_REG_CONTROL = 0x09, + RC632_REG_ERROR_FLAG = 0x0a, + RC632_REG_COLL_POS = 0x0b, + RC632_REG_TIMER_VALUE = 0x0c, + RC632_REG_CRC_RESULT_LSB = 0x0d, + RC632_REG_CRC_RESULT_MSB = 0x0e, + RC632_REG_BIT_FRAMING = 0x0f, + + RC632_REG_PAGE2 = 0x10, + RC632_REG_TX_CONTROL = 0x11, + RC632_REG_CW_CONDUCTANCE = 0x12, + RC632_REG_MOD_CONDUCTANCE = 0x13, + RC632_REG_CODER_CONTROL = 0x14, + RC632_REG_MOD_WIDTH = 0x15, + RC632_REG_MOD_WIDTH_SOF = 0x16, + RC632_REG_TYPE_B_FRAMING = 0x17, + + RC632_REG_PAGE3 = 0x18, + RC632_REG_RX_CONTROL1 = 0x19, + RC632_REG_DECODER_CONTROL = 0x1a, + RC632_REG_BIT_PHASE = 0x1b, + RC632_REG_RX_THRESHOLD = 0x1c, + RC632_REG_BPSK_DEM_CONTROL = 0x1d, + RC632_REG_RX_CONTROL2 = 0x1e, + RC632_REG_CLOCK_Q_CONTROL = 0x1f, + + RC632_REG_PAGE4 = 0x20, + RC632_REG_RX_WAIT = 0x21, + RC632_REG_CHANNEL_REDUNDANCY = 0x22, + RC632_REG_CRC_PRESET_LSB = 0x23, + RC632_REG_CRC_PRESET_MSB = 0x24, + RC632_REG_TIME_SLOT_PERIOD = 0x25, + RC632_REG_MFOUT_SELECT = 0x26, + RC632_REG_PRESET_27 = 0x27, + + RC632_REG_PAGE5 = 0x28, + RC632_REG_FIFO_LEVEL = 0x29, + RC632_REG_TIMER_CLOCK = 0x2a, + RC632_REG_TIMER_CONTROL = 0x2b, + RC632_REG_TIMER_RELOAD = 0x2c, + RC632_REG_IRQ_PIN_CONFIG = 0x2d, + RC632_REG_PRESET_2E = 0x2e, + RC632_REG_PRESET_2F = 0x2f, + + RC632_REG_PAGE6 = 0x30, + + RC632_REG_PAGE7 = 0x38, + RC632_REG_TEST_ANA_SELECT = 0x3a, + RC632_REG_TEST_DIGI_SELECT = 0x3d, +}; + +enum rc632_reg_status { + RC632_STAT_LOALERT = 0x01, + RC632_STAT_HIALERT = 0x02, + RC632_STAT_ERR = 0x04, + RC632_STAT_IRQ = 0x08, +#define RC632_STAT_MODEM_MASK 0x70 + RC632_STAT_MODEM_IDLE = 0x00, + RC632_STAT_MODEM_TXSOF = 0x10, + RC632_STAT_MODEM_TXDATA = 0x20, + RC632_STAT_MODEM_TXEOF = 0x30, + RC632_STAT_MODEM_GOTORX = 0x40, + RC632_STAT_MODEM_PREPARERX = 0x50, + RC632_STAT_MODEM_AWAITINGRX = 0x60, + RC632_STAT_MODEM_RECV = 0x70, +}; + +enum rc632_reg_command { + RC632_CMD_IDLE = 0x00, + RC632_CMD_WRITE_E2 = 0x01, + RC632_CMD_READ_E2 = 0x03, + RC632_CMD_LOAD_CONFIG = 0x07, + RC632_CMD_LOAD_KEY_E2 = 0x0b, + RC632_CMD_AUTHENT1 = 0x0c, + RC632_CMD_CALC_CRC = 0x12, + RC632_CMD_AUTHENT2 = 0x14, + RC632_CMD_RECEIVE = 0x16, + RC632_CMD_LOAD_KEY = 0x19, + RC632_CMD_TRANSMIT = 0x1a, + RC632_CMD_TRANSCEIVE = 0x1e, + RC632_CMD_STARTUP = 0x3f, +}; + +enum rc632_reg_interrupt { + RC632_INT_LOALERT = 0x01, + RC632_INT_HIALERT = 0x02, + RC632_INT_IDLE = 0x04, + RC632_INT_RX = 0x08, + RC632_INT_TX = 0x10, + RC632_INT_TIMER = 0x20, + RC632_INT_SET = 0x80, +}; + +enum rc632_reg_control { + RC632_CONTROL_FIFO_FLUSH = 0x01, + RC632_CONTROL_TIMER_START = 0x02, + RC632_CONTROL_TIMER_STOP = 0x04, + RC632_CONTROL_CRYPTO1_ON = 0x08, + RC632_CONTROL_POWERDOWN = 0x10, + RC632_CONTROL_STANDBY = 0x20, +}; + +enum rc632_reg_error_flag { + RC632_ERR_FLAG_COL_ERR = 0x01, + RC632_ERR_FLAG_PARITY_ERR = 0x02, + RC632_ERR_FLAG_FRAMING_ERR = 0x04, + RC632_ERR_FLAG_CRC_ERR = 0x08, + RC632_ERR_FLAG_FIFO_OVERFLOW = 0x10, + RC632_ERR_FLAG_ACCESS_ERR = 0x20, + RC632_ERR_FLAG_KEY_ERR = 0x40, +}; + +enum rc632_reg_tx_control { + RC632_TXCTRL_TX1_RF_EN = 0x01, + RC632_TXCTRL_TX2_RF_EN = 0x02, + RC632_TXCTRL_TX2_CW = 0x04, + RC632_TXCTRL_TX2_INV = 0x08, + RC632_TXCTRL_FORCE_100_ASK = 0x10, + + RC632_TXCTRL_MOD_SRC_LOW = 0x00, + RC632_TXCTRL_MOD_SRC_HIGH = 0x20, + RC632_TXCTRL_MOD_SRC_INT = 0x40, + RC632_TXCTRL_MOD_SRC_MFIN = 0x60, +}; + +enum rc632_reg_coder_control { + /* bit 2-0 TXCoding */ +#define RC632_CDRCTRL_TXCD_MASK 0x07 + RC632_CDRCTRL_TXCD_NRZ = 0x00, + RC632_CDRCTRL_TXCD_14443A = 0x01, + RC632_CDRCTRL_TXCD_ICODE_STD = 0x04, + RC632_CDRCTRL_TXCD_ICODE_FAST = 0x05, + RC632_CDRCTRL_TXCD_15693_STD = 0x06, + RC632_CDRCTRL_TXCD_15693_FAST = 0x07, + + /* bit5-3 CoderRate*/ +#define RC632_CDRCTRL_RATE_MASK 0x38 + RC632_CDRCTRL_RATE_848K = 0x00, + RC632_CDRCTRL_RATE_424K = 0x08, + RC632_CDRCTRL_RATE_212K = 0x10, + RC632_CDRCTRL_RATE_106K = 0x18, + RC632_CDRCTRL_RATE_14443B = 0x20, + RC632_CDRCTRL_RATE_15693 = 0x28, + RC632_CDRCTRL_RATE_ICODE_FAST = 0x30, + + /* bit 7 SendOnePuls */ + RC632_CDRCTRL_15693_EOF_PULSE = 0x80, +}; + +enum rc632_erg_type_b_framing { + RC632_TBFRAMING_SOF_10L_2H = 0x00, + RC632_TBFRAMING_SOF_10L_3H = 0x01, + RC632_TBFRAMING_SOF_11L_2H = 0x02, + RC632_TBFRAMING_SOF_11L_3H = 0x03, + + RC632_TBFRAMING_EOF_10 = 0x00, + RC632_TBFRAMING_EOF_11 = 0x20, + + RC632_TBFRAMING_NO_TX_SOF = 0x80, + RC632_TBFRAMING_NO_TX_EOF = 0x40, +}; +#define RC632_TBFRAMING_SPACE_SHIFT 2 +#define RC632_TBFRAMING_SPACE_MASK 7 + +enum rc632_reg_rx_control1 { + RC632_RXCTRL1_GAIN_20DB = 0x00, + RC632_RXCTRL1_GAIN_24DB = 0x01, + RC632_RXCTRL1_GAIN_31DB = 0x02, + RC632_RXCTRL1_GAIN_35DB = 0x03, + + RC632_RXCTRL1_LP_OFF = 0x04, + RC632_RXCTRL1_ISO15693 = 0x08, + RC632_RXCTRL1_ISO14443 = 0x10, + +#define RC632_RXCTRL1_SUBCP_MASK 0xe0 + RC632_RXCTRL1_SUBCP_1 = 0x00, + RC632_RXCTRL1_SUBCP_2 = 0x20, + RC632_RXCTRL1_SUBCP_4 = 0x40, + RC632_RXCTRL1_SUBCP_8 = 0x60, + RC632_RXCTRL1_SUBCP_16 = 0x80, +}; + +enum rc632_reg_decoder_control { + RC632_DECCTRL_MANCHESTER = 0x00, + RC632_DECCTRL_BPSK = 0x01, + + RC632_DECCTRL_RX_INVERT = 0x04, + + RC632_DECCTRL_RXFR_ICODE = 0x00, + RC632_DECCTRL_RXFR_14443A = 0x08, + RC632_DECCTRL_RXFR_15693 = 0x10, + RC632_DECCTRL_RXFR_14443B = 0x18, + + RC632_DECCTRL_ZEROAFTERCOL = 0x20, + + RC632_DECCTRL_RX_MULTIPLE = 0x40, +}; + +enum rc632_reg_bpsk_dem_control { + RC632_BPSKD_TAUB_SHIFT = 0x00, + RC632_BPSKD_TAUB_MASK = 0x03, + + RC632_BPSKD_TAUD_SHIFT = 0x02, + RC632_BPSKD_TAUD_MASK = 0x03, + + RC632_BPSKD_FILTER_AMP_DETECT = 0x10, + RC632_BPSKD_NO_RX_EOF = 0x20, + RC632_BPSKD_NO_RX_EGT = 0x40, + RC632_BPSKD_NO_RX_SOF = 0x80, +}; + +enum rc632_reg_rx_control2 { + RC632_RXCTRL2_DECSRC_LOW = 0x00, + RC632_RXCTRL2_DECSRC_INT = 0x01, + RC632_RXCTRL2_DECSRC_SUBC_MFIN = 0x10, + RC632_RXCTRL2_DECSRC_BASE_MFIN = 0x11, + + RC632_RXCTRL2_AUTO_PD = 0x40, + RC632_RXCTRL2_CLK_I = 0x80, + RC632_RXCTRL2_CLK_Q = 0x00, +}; + +enum rc632_reg_channel_redundancy { + RC632_CR_PARITY_ENABLE = 0x01, + RC632_CR_PARITY_ODD = 0x02, + RC632_CR_TX_CRC_ENABLE = 0x04, + RC632_CR_RX_CRC_ENABLE = 0x08, + RC632_CR_CRC8 = 0x10, + RC632_CR_CRC3309 = 0x20, +}; + +enum rc632_reg_timer_control { + RC632_TMR_START_TX_BEGIN = 0x01, + RC632_TMR_START_TX_END = 0x02, + RC632_TMR_STOP_RX_BEGIN = 0x04, + RC632_TMR_STOP_RX_END = 0x08, +}; + +enum rc632_reg_irq_pin_cfg { + RC632_IRQCFG_CMOS = 0x01, + RC632_IRQCFG_INV = 0x02, +}; + +enum rc632_reg_secondary_status { + RC632_SEC_ST_TMR_RUNNING = 0x80, + RC632_SEC_ST_E2_READY = 0x40, + RC632_SEC_ST_CRC_READY = 0x20, +}; + +#endif diff --git a/firmware/include/compile.h b/firmware/include/compile.h new file mode 100644 index 0000000..8e792e9 --- /dev/null +++ b/firmware/include/compile.h @@ -0,0 +1,9 @@ +#ifndef _COMPILE_H +#define _COMPILE_H + +/* This file is auto generated */ +#define COMPILE_DATE "20110510-160907" +#define COMPILE_BY "netz@BlubbFish" +#define COMPILE_SVNREV "495-unclean" + +#endif /* _COMPILE_H */ diff --git a/firmware/include/lib_AT91SAM7.h b/firmware/include/lib_AT91SAM7.h new file mode 100644 index 0000000..f26ac54 --- /dev/null +++ b/firmware/include/lib_AT91SAM7.h @@ -0,0 +1,3476 @@ +//* ---------------------------------------------------------------------------- +//* ATMEL Microcontroller Software Support - ROUSSET - +//* ---------------------------------------------------------------------------- +//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +//* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, +//* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +//* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +//* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +//* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +//* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +//* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//* ---------------------------------------------------------------------------- +//* File Name : lib_AT91SAM7S64.h +//* Object : AT91SAM7S64 inlined functions +//* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) +//* +//* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// +//* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// +//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// +//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// +//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// +//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// +//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// +//* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// +//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// +//* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// +//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// +//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// +//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// +//* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// +//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// +//* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// +//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// +//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// +//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// +//* ---------------------------------------------------------------------------- + +#ifndef lib_AT91SAM7S64_H +#define lib_AT91SAM7S64_H + +#include + +/* ***************************************************************************** + SOFTWARE API FOR AIC + ***************************************************************************** */ +#define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_ConfigureIt +//* \brief Interrupt Handler Initialization +//*---------------------------------------------------------------------------- +extern unsigned int AT91F_AIC_ConfigureIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id, // \arg interrupt number to initialize + unsigned int priority, // \arg priority to give to the interrupt + unsigned int src_type, // \arg activation and sense of activation + void (*newHandler) () ); // \arg address of the interrupt handler + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_EnableIt +//* \brief Enable corresponding IT number +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_DisableIt +//* \brief Disable corresponding IT number +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_DisableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_ClearIt +//* \brief Clear corresponding IT number +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_AcknowledgeIt +//* \brief Acknowledge corresponding IT number +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_AcknowledgeIt ( + AT91PS_AIC pAic) // \arg pointer to the AIC registers +{ + pAic->AIC_EOICR = pAic->AIC_EOICR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_SetExceptionVector +//* \brief Configure vector handler +//*---------------------------------------------------------------------------- +extern unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ); // \arg Interrupt Handler + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_Trig +//* \brief Trig an IT +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_Trig ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number +{ + pAic->AIC_ISCR = (0x1 << irq_id) ; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_IsActive +//* \brief Test if an IT is active +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_AIC_IsActive ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg Interrupt Number +{ + return (pAic->AIC_ISR & (0x1 << irq_id)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_IsPending +//* \brief Test if an IT is pending +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_AIC_IsPending ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg Interrupt Number +{ + return (pAic->AIC_IPR & (0x1 << irq_id)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_Open +//* \brief Set exception vectors and AIC registers to default values +//*---------------------------------------------------------------------------- +extern void AT91F_AIC_Open( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + void (*IrqHandler) (), // \arg Default IRQ vector exception + void (*FiqHandler) (), // \arg Default FIQ vector exception + void (*DefaultHandler) (), // \arg Default Handler set in ISR + void (*SpuriousHandler) (), // \arg Default Spurious Handler + unsigned int protectMode); // \arg Debug Control Register + +/* ***************************************************************************** + SOFTWARE API FOR PDC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SetNextRx +//* \brief Set the next receive transfer descriptor +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + pPDC->PDC_RNCR = bytes; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SetNextTx +//* \brief Set the next transmit transfer descriptor +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + pPDC->PDC_TNCR = bytes; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SetRx +//* \brief Set the receive transfer descriptor +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + pPDC->PDC_RCR = bytes; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SetTx +//* \brief Set the transmit transfer descriptor +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + pPDC->PDC_TCR = bytes; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_EnableTx +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_EnableRx +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_DisableTx +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_DisableRx +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_IsTxEmpty +//* \brief Test if the current transfer descriptor has been sent +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TCR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_IsNextTxEmpty +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TNCR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_IsRxEmpty +//* \brief Test if the current transfer descriptor has been filled +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RCR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_IsNextRxEmpty +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RNCR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Open +//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX +//*---------------------------------------------------------------------------- +extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Close +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SendFrame +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +extern unsigned int AT91F_PDC_SendFrame( + AT91PS_PDC pPDC, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer); + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_ReceiveFrame +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +extern unsigned int AT91F_PDC_ReceiveFrame ( + AT91PS_PDC pPDC, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer); + +/* ***************************************************************************** + SOFTWARE API FOR DBGU + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_InterruptEnable +//* \brief Enable DBGU Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_DBGU_InterruptEnable( + AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + unsigned int flag) // \arg dbgu interrupt to be enabled +{ + pDbgu->DBGU_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_InterruptDisable +//* \brief Disable DBGU Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_DBGU_InterruptDisable( + AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + unsigned int flag) // \arg dbgu interrupt to be disabled +{ + pDbgu->DBGU_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_GetInterruptMaskStatus +//* \brief Return DBGU Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller +{ + return pDbgu->DBGU_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_IsInterruptMasked +//* \brief Test if DBGU Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_DBGU_IsInterruptMasked( + AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR PIO + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgPeriph +//* \brief Enable pins to be drived by peripheral +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgPeriph( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + pPio->PIO_BSR = periphBEnable; + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgOutput +//* \brief Enable PIO in output mode +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + pPio->PIO_OER = pioEnable; // Configure in Output +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgInput +//* \brief Enable PIO in input mode +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + pPio->PIO_PER = inputEnable; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgOpendrain +//* \brief Configure PIO in open drain +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOpendrain( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int multiDrvEnable) // \arg pio to be configured in open drain +{ + // Configure the multi-drive option + pPio->PIO_MDDR = ~multiDrvEnable; + pPio->PIO_MDER = multiDrvEnable; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgPullup +//* \brief Enable pullup on PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgPullup( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pullupEnable) // \arg enable pullup on PIO +{ + // Connect or not Pullup + pPio->PIO_PPUDR = ~pullupEnable; + pPio->PIO_PPUER = pullupEnable; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgDirectDrive +//* \brief Enable direct drive on PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgDirectDrive( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int directDrive) // \arg PIO to be configured with direct drive + +{ + // Configure the Direct Drive + pPio->PIO_OWDR = ~directDrive; + pPio->PIO_OWER = directDrive; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_CfgInputFilter +//* \brief Enable input filter on input PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgInputFilter( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputFilter) // \arg PIO to be configured with input filter + +{ + // Configure the Direct Drive + pPio->PIO_IFDR = ~inputFilter; + pPio->PIO_IFER = inputFilter; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetInput +//* \brief Return PIO input value +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_PDSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsInputSet +//* \brief Test if PIO is input flag is active +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsInputSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetInput(pPio) & flag); +} + + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_SetOutput +//* \brief Set to 1 output PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_ClearOutput +//* \brief Set to 0 output PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_ForceOutput +//* \brief Force output when Direct drive option is enabled +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ForceOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be forced +{ + pPio->PIO_ODSR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_Enable +//* \brief Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_Enable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio to be enabled +{ + pPio->PIO_PER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_Disable +//* \brief Disable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_Disable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio to be disabled +{ + pPio->PIO_PDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetStatus +//* \brief Return PIO Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_PSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsSet +//* \brief Test if PIO is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_OutputEnable +//* \brief Output Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_OutputEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio output to be enabled +{ + pPio->PIO_OER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_OutputDisable +//* \brief Output Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_OutputDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio output to be disabled +{ + pPio->PIO_ODR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetOutputStatus +//* \brief Return PIO Output Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_OSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsOuputSet +//* \brief Test if PIO Output is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsOutputSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetOutputStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_InputFilterEnable +//* \brief Input Filter Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InputFilterEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio input filter to be enabled +{ + pPio->PIO_IFER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_InputFilterDisable +//* \brief Input Filter Disable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InputFilterDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio input filter to be disabled +{ + pPio->PIO_IFDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetInputFilterStatus +//* \brief Return PIO Input Filter Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_IFSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsInputFilterSet +//* \brief Test if PIO Input filter is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsInputFilterSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetOutputDataStatus +//* \brief Return PIO Output Data Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_ODSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_InterruptEnable +//* \brief Enable PIO Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InterruptEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio interrupt to be enabled +{ + pPio->PIO_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_InterruptDisable +//* \brief Disable PIO Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InterruptDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio interrupt to be disabled +{ + pPio->PIO_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetInterruptMaskStatus +//* \brief Return PIO Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetInterruptStatus +//* \brief Return PIO Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_ISR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsInterruptMasked +//* \brief Test if PIO Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsInterruptMasked( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsInterruptSet +//* \brief Test if PIO Interrupt is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsInterruptSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetInterruptStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_MultiDriverEnable +//* \brief Multi Driver Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_MultiDriverEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio to be enabled +{ + pPio->PIO_MDER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_MultiDriverDisable +//* \brief Multi Driver Disable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_MultiDriverDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio to be disabled +{ + pPio->PIO_MDDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetMultiDriverStatus +//* \brief Return PIO Multi Driver Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_MDSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsMultiDriverSet +//* \brief Test if PIO MultiDriver is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsMultiDriverSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_A_RegisterSelection +//* \brief PIO A Register Selection +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_A_RegisterSelection( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio A register selection +{ + pPio->PIO_ASR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_B_RegisterSelection +//* \brief PIO B Register Selection +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_B_RegisterSelection( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio B register selection +{ + pPio->PIO_BSR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_Get_AB_RegisterStatus +//* \brief Return PIO Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_ABSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsAB_RegisterSet +//* \brief Test if PIO AB Register is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsAB_RegisterSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_OutputWriteEnable +//* \brief Output Write Enable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_OutputWriteEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio output write to be enabled +{ + pPio->PIO_OWER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_OutputWriteDisable +//* \brief Output Write Disable PIO +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_OutputWriteDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio output write to be disabled +{ + pPio->PIO_OWDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetOutputWriteStatus +//* \brief Return PIO Output Write Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_OWSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsOutputWriteSet +//* \brief Test if PIO OutputWrite is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsOutputWriteSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_GetCfgPullup +//* \brief Return PIO Configuration Pullup +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_PPUSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsOutputDataStatusSet +//* \brief Test if PIO Output Data Status is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsOutputDataStatusSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIO_IsCfgPullupStatusSet +//* \brief Test if PIO Configuration Pullup Status is Set +//*---------------------------------------------------------------------------- +static inline int AT91F_PIO_IsCfgPullupStatusSet( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg flag to be tested +{ + return (~AT91F_PIO_GetCfgPullup(pPio) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR PMC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_CfgSysClkEnableReg +//* \brief Configure the System Clock Enable Register of the PMC controller +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_CfgSysClkEnableReg ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int mode) +{ + //* Write to the SCER register + pPMC->PMC_SCER = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_CfgSysClkDisableReg +//* \brief Configure the System Clock Disable Register of the PMC controller +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_CfgSysClkDisableReg ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int mode) +{ + //* Write to the SCDR register + pPMC->PMC_SCDR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_GetSysClkStatusReg +//* \brief Return the System Clock Status Register of the PMC controller +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + AT91PS_PMC pPMC // pointer to a CAN controller + ) +{ + return pPMC->PMC_SCSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_EnablePeriphClock +//* \brief Enable peripheral clock +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_DisablePeriphClock +//* \brief Disable peripheral clock +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_DisablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCDR = periphIds; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_GetPeriphClock +//* \brief Get peripheral clock status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_GetPeriphClock ( + AT91PS_PMC pPMC) // \arg pointer to PMC controller +{ + return pPMC->PMC_PCSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_CfgMainOscillatorReg +//* \brief Cfg the main oscillator +//*---------------------------------------------------------------------------- +static inline void AT91F_CKGR_CfgMainOscillatorReg ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int mode) +{ + pCKGR->CKGR_MOR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_GetMainOscillatorReg +//* \brief Cfg the main oscillator +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +{ + return pCKGR->CKGR_MOR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_EnableMainOscillator +//* \brief Enable the main oscillator +//*---------------------------------------------------------------------------- +static inline void AT91F_CKGR_EnableMainOscillator( + AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +{ + pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_DisableMainOscillator +//* \brief Disable the main oscillator +//*---------------------------------------------------------------------------- +static inline void AT91F_CKGR_DisableMainOscillator ( + AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +{ + pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_CfgMainOscStartUpTime +//* \brief Cfg MOR Register according to the main osc startup time +//*---------------------------------------------------------------------------- +static inline void AT91F_CKGR_CfgMainOscStartUpTime ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int startup_time, // \arg main osc startup time in microsecond (us) + unsigned int slowClock) // \arg slowClock in Hz +{ + pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; + pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_GetMainClockFreqReg +//* \brief Cfg the main oscillator +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( + AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +{ + return pCKGR->CKGR_MCFR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_CKGR_GetMainClock +//* \brief Return Main clock in Hz +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetMainClock ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_CfgMCKReg +//* \brief Cfg Master Clock Register +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_CfgMCKReg ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int mode) +{ + pPMC->PMC_MCKR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_GetMCKReg +//* \brief Return Master Clock Register +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_GetMCKReg( + AT91PS_PMC pPMC) // \arg pointer to PMC controller +{ + return pPMC->PMC_MCKR; +} + +//*------------------------------------------------------------------------------ +//* \fn AT91F_PMC_GetMasterClock +//* \brief Return master clock in Hz which correponds to processor clock for ARM7 +//*------------------------------------------------------------------------------ +extern unsigned int AT91F_PMC_GetMasterClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock); // \arg slowClock in Hz + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_EnablePCK +//* \brief Enable peripheral clock +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePCK ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 + unsigned int mode) +{ + pPMC->PMC_PCKR[pck] = mode; + pPMC->PMC_SCER = (1 << pck) << 8; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_DisablePCK +//* \brief Enable peripheral clock +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_DisablePCK ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +{ + pPMC->PMC_SCDR = (1 << pck) << 8; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_EnableIt +//* \brief Enable PMC interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnableIt ( + AT91PS_PMC pPMC, // pointer to a PMC controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pPMC->PMC_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_DisableIt +//* \brief Disable PMC interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_DisableIt ( + AT91PS_PMC pPMC, // pointer to a PMC controller + unsigned int flag) // IT to be disabled +{ + //* Write to the IDR register + pPMC->PMC_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_GetStatus +//* \brief Return PMC Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status + AT91PS_PMC pPMC) // pointer to a PMC controller +{ + return pPMC->PMC_SR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_GetInterruptMaskStatus +//* \brief Return PMC Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status + AT91PS_PMC pPMC) // pointer to a PMC controller +{ + return pPMC->PMC_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_IsInterruptMasked +//* \brief Test if PMC Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_IsInterruptMasked( + AT91PS_PMC pPMC, // \arg pointer to a PMC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_IsStatusSet +//* \brief Test if PMC Status is Set +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PMC_IsStatusSet( + AT91PS_PMC pPMC, // \arg pointer to a PMC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PMC_GetStatus(pPMC) & flag); +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_CKGR_CfgPLLReg +// \brief Cfg the PLL Register +// ---------------------------------------------------------------------------- +static inline void AT91F_CKGR_CfgPLLReg ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int mode) +{ + pCKGR->CKGR_PLLR = mode; +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_CKGR_GetPLLReg +// \brief Get the PLL Register +// ---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetPLLReg ( + AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +{ + return pCKGR->CKGR_PLLR; +} + + + +/* ***************************************************************************** + SOFTWARE API FOR RSTC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTSoftReset +//* \brief Start Software Reset +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSoftReset( + AT91PS_RSTC pRSTC, + unsigned int reset) +{ + pRSTC->RSTC_RCR = (0xA5000000 | reset); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTSetMode +//* \brief Set Reset Mode +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSetMode( + AT91PS_RSTC pRSTC, + unsigned int mode) +{ + pRSTC->RSTC_RMR = (0xA5000000 | mode); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTGetMode +//* \brief Get Reset Mode +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_RSTGetMode( + AT91PS_RSTC pRSTC) +{ + return (pRSTC->RSTC_RMR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTGetStatus +//* \brief Get Reset Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_RSTGetStatus( + AT91PS_RSTC pRSTC) +{ + return (pRSTC->RSTC_RSR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTIsSoftRstActive +//* \brief Return !=0 if software reset is still not completed +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_RSTIsSoftRstActive( + AT91PS_RSTC pRSTC) +{ + return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +} +/* ***************************************************************************** + SOFTWARE API FOR RTTC + ***************************************************************************** */ +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_SetRTT_TimeBase() +//* \brief Set the RTT prescaler according to the TimeBase in ms +//*-------------------------------------------------------------------------------------- +static inline unsigned int AT91F_RTTSetTimeBase( + AT91PS_RTTC pRTTC, + unsigned int ms) +{ + if (ms > 2000) + return 1; // AT91C_TIME_OUT_OF_RANGE + pRTTC->RTTC_RTMR &= ~0xFFFF; + pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); + return 0; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTTSetPrescaler() +//* \brief Set the new prescaler value +//*-------------------------------------------------------------------------------------- +static inline unsigned int AT91F_RTTSetPrescaler( + AT91PS_RTTC pRTTC, + unsigned int rtpres) +{ + pRTTC->RTTC_RTMR &= ~0xFFFF; + pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); + return (pRTTC->RTTC_RTMR); +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTTRestart() +//* \brief Restart the RTT prescaler +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTRestart( + AT91PS_RTTC pRTTC) +{ + pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +} + + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_SetAlarmINT() +//* \brief Enable RTT Alarm Interrupt +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTSetAlarmINT( + AT91PS_RTTC pRTTC) +{ + pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ClearAlarmINT() +//* \brief Disable RTT Alarm Interrupt +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTClearAlarmINT( + AT91PS_RTTC pRTTC) +{ + pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_SetRttIncINT() +//* \brief Enable RTT INC Interrupt +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTSetRttIncINT( + AT91PS_RTTC pRTTC) +{ + pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ClearRttIncINT() +//* \brief Disable RTT INC Interrupt +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTClearRttIncINT( + AT91PS_RTTC pRTTC) +{ + pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_SetAlarmValue() +//* \brief Set RTT Alarm Value +//*-------------------------------------------------------------------------------------- +static inline void AT91F_RTTSetAlarmValue( + AT91PS_RTTC pRTTC, unsigned int _alarm) +{ + pRTTC->RTTC_RTAR = _alarm; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_GetAlarmValue() +//* \brief Get RTT Alarm Value +//*-------------------------------------------------------------------------------------- +static inline unsigned int AT91F_RTTGetAlarmValue( + AT91PS_RTTC pRTTC) +{ + return(pRTTC->RTTC_RTAR); +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTTGetStatus() +//* \brief Read the RTT status +//*-------------------------------------------------------------------------------------- +static inline unsigned int AT91F_RTTGetStatus( + AT91PS_RTTC pRTTC) +{ + return(pRTTC->RTTC_RTSR); +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ReadValue() +//* \brief Read the RTT value +//*-------------------------------------------------------------------------------------- +extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); + +/* ***************************************************************************** + SOFTWARE API FOR PITC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITInit +//* \brief System timer init : period in ‘second, system clock freq in MHz +//*---------------------------------------------------------------------------- +static inline void AT91F_PITInit( + AT91PS_PITC pPITC, + unsigned int period, + unsigned int pit_frequency) +{ + pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITSetPIV +//* \brief Set the PIT Periodic Interval Value +//*---------------------------------------------------------------------------- +static inline void AT91F_PITSetPIV( + AT91PS_PITC pPITC, + unsigned int piv) +{ + pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITEnableInt +//* \brief Enable PIT periodic interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PITEnableInt( + AT91PS_PITC pPITC) +{ + pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITDisableInt +//* \brief Disable PIT periodic interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PITDisableInt( + AT91PS_PITC pPITC) +{ + pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITGetMode +//* \brief Read PIT mode register +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PITGetMode( + AT91PS_PITC pPITC) +{ + return(pPITC->PITC_PIMR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITGetStatus +//* \brief Read PIT status register +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PITGetStatus( + AT91PS_PITC pPITC) +{ + return(pPITC->PITC_PISR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITGetPIIR +//* \brief Read PIT CPIV and PICNT without ressetting the counters +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PITGetPIIR( + AT91PS_PITC pPITC) +{ + return(pPITC->PITC_PIIR); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITGetPIVR +//* \brief Read System timer CPIV and PICNT without ressetting the counters +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PITGetPIVR( + AT91PS_PITC pPITC) +{ + return(pPITC->PITC_PIVR); +} +/* ***************************************************************************** + SOFTWARE API FOR WDTC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_WDTSetMode +//* \brief Set Watchdog Mode Register +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTSetMode( + AT91PS_WDTC pWDTC, + unsigned int Mode) +{ + pWDTC->WDTC_WDMR = Mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_WDTRestart +//* \brief Restart Watchdog +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTRestart( + AT91PS_WDTC pWDTC) +{ + pWDTC->WDTC_WDCR = 0xA5000001; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_WDTSGettatus +//* \brief Get Watchdog Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_WDTSGettatus( + AT91PS_WDTC pWDTC) +{ + return(pWDTC->WDTC_WDSR & 0x3); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_WDTGetPeriod +//* \brief Translate ms into Watchdog Compatible value +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +{ + if ((ms < 4) || (ms > 16000)) + return 0; + return((ms << 8) / 1000); +} +/* ***************************************************************************** + SOFTWARE API FOR VREG + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_VREG_Enable_LowPowerMode +//* \brief Enable VREG Low Power Mode +//*---------------------------------------------------------------------------- +static inline void AT91F_VREG_Enable_LowPowerMode( + AT91PS_VREG pVREG) +{ + pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_VREG_Disable_LowPowerMode +//* \brief Disable VREG Low Power Mode +//*---------------------------------------------------------------------------- +static inline void AT91F_VREG_Disable_LowPowerMode( + AT91PS_VREG pVREG) +{ + pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +}/* ***************************************************************************** + SOFTWARE API FOR MC + ***************************************************************************** */ + +#define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_Remap +//* \brief Make Remap +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_Remap (void) // +{ + AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; + + pMC->MC_RCR = AT91C_MC_RCB; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_CfgModeReg +//* \brief Configure the EFC Mode Register of the MC controller +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_EFC_CfgModeReg ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int mode) // mode register +{ + // Write to the FMR register + pMC->MC_FMR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_GetModeReg +//* \brief Return MC EFC Mode Regsiter +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_GetModeReg( + AT91PS_MC pMC) // pointer to a MC controller +{ + return pMC->MC_FMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_ComputeFMCN +//* \brief Return MC EFC Mode Regsiter +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_ComputeFMCN( + int master_clock) // master clock in Hz +{ + return (master_clock/1000000 +2); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_PerformCmd +//* \brief Perform EFC Command +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_EFC_PerformCmd ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int transfer_cmd) +{ + pMC->MC_FCR = transfer_cmd; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_GetStatus +//* \brief Return MC EFC Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_GetStatus( + AT91PS_MC pMC) // pointer to a MC controller +{ + return pMC->MC_FSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_IsInterruptMasked +//* \brief Test if EFC MC Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( + AT91PS_MC pMC, // \arg pointer to a MC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_EFC_IsInterruptSet +//* \brief Test if EFC MC Interrupt is Set +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_IsInterruptSet( + AT91PS_MC pMC, // \arg pointer to a MC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_MC_EFC_GetStatus(pMC) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR SPI + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_CfgCs +//* \brief Configure SPI chip select register +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_CfgCs ( + AT91PS_SPI pSPI, // pointer to a SPI controller + int cs, // SPI cs number (0 to 3) + int val) // chip select register +{ + //* Write to the CSR register + *(pSPI->SPI_CSR + cs) = val; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_EnableIt +//* \brief Enable SPI interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_EnableIt ( + AT91PS_SPI pSPI, // pointer to a SPI controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pSPI->SPI_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_DisableIt +//* \brief Disable SPI interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_DisableIt ( + AT91PS_SPI pSPI, // pointer to a SPI controller + unsigned int flag) // IT to be disabled +{ + //* Write to the IDR register + pSPI->SPI_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Reset +//* \brief Reset the SPI controller +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_Reset ( + AT91PS_SPI pSPI // pointer to a SPI controller + ) +{ + //* Write to the CR register + pSPI->SPI_CR = AT91C_SPI_SWRST; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Enable +//* \brief Enable the SPI controller +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_Enable ( + AT91PS_SPI pSPI // pointer to a SPI controller + ) +{ + //* Write to the CR register + pSPI->SPI_CR = AT91C_SPI_SPIEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Disable +//* \brief Disable the SPI controller +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_Disable ( + AT91PS_SPI pSPI // pointer to a SPI controller + ) +{ + //* Write to the CR register + pSPI->SPI_CR = AT91C_SPI_SPIDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_CfgMode +//* \brief Enable the SPI controller +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_CfgMode ( + AT91PS_SPI pSPI, // pointer to a SPI controller + int mode) // mode register +{ + //* Write to the MR register + pSPI->SPI_MR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_CfgPCS +//* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_CfgPCS ( + AT91PS_SPI pSPI, // pointer to a SPI controller + char PCS_Device) // PCS of the Device +{ + //* Write to the MR register + pSPI->SPI_MR &= 0xFFF0FFFF; + pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_ReceiveFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SPI_ReceiveFrame ( + AT91PS_SPI pSPI, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + (AT91PS_PDC) &(pSPI->SPI_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_SendFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is bSPIy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SPI_SendFrame( + AT91PS_SPI pSPI, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_SendFrame( + (AT91PS_PDC) &(pSPI->SPI_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Close +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_PutChar +//* \brief Send a character,does not check if ready to send +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_PutChar ( + AT91PS_SPI pSPI, + unsigned int character, + unsigned int cs_number ) +{ + unsigned int value_for_cs; + value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number + pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_GetChar +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_SPI_GetChar ( + const AT91PS_SPI pSPI) +{ + return((pSPI->SPI_RDR) & 0xFFFF); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_GetInterruptMaskStatus +//* \brief Return SPI Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status + AT91PS_SPI pSpi) // \arg pointer to a SPI controller +{ + return pSpi->SPI_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_IsInterruptMasked +//* \brief Test if SPI Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_SPI_IsInterruptMasked( + AT91PS_SPI pSpi, // \arg pointer to a SPI controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR ADC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_EnableIt +//* \brief Enable ADC interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_EnableIt ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pADC->ADC_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_DisableIt +//* \brief Disable ADC interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_DisableIt ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int flag) // IT to be disabled +{ + //* Write to the IDR register + pADC->ADC_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetStatus +//* \brief Return ADC Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status + AT91PS_ADC pADC) // pointer to a ADC controller +{ + return pADC->ADC_SR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetInterruptMaskStatus +//* \brief Return ADC Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status + AT91PS_ADC pADC) // pointer to a ADC controller +{ + return pADC->ADC_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_IsInterruptMasked +//* \brief Test if ADC Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_IsInterruptMasked( + AT91PS_ADC pADC, // \arg pointer to a ADC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_IsStatusSet +//* \brief Test if ADC Status is Set +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_IsStatusSet( + AT91PS_ADC pADC, // \arg pointer to a ADC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_ADC_GetStatus(pADC) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_CfgModeReg +//* \brief Configure the Mode Register of the ADC controller +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_CfgModeReg ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mode) // mode register +{ + //* Write to the MR register + pADC->ADC_MR = mode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetModeReg +//* \brief Return the Mode Register of the ADC controller value +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetModeReg ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_MR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_CfgTimings +//* \brief Configure the different necessary timings of the ADC controller +//*---------------------------------------------------------------------------- +extern void AT91F_ADC_CfgTimings ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time); // in ns + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_EnableChannel +//* \brief Return ADC Timer Register Value +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_EnableChannel ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int channel) // mode register +{ + //* Write to the CHER register + pADC->ADC_CHER = channel; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_DisableChannel +//* \brief Return ADC Timer Register Value +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_DisableChannel ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int channel) // mode register +{ + //* Write to the CHDR register + pADC->ADC_CHDR = channel; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetChannelStatus +//* \brief Return ADC Timer Register Value +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetChannelStatus ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CHSR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_StartConversion +//* \brief Software request for a analog to digital conversion +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_StartConversion ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + pADC->ADC_CR = AT91C_ADC_START; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_SoftReset +//* \brief Software reset +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_SoftReset ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + pADC->ADC_CR = AT91C_ADC_SWRST; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetLastConvertedData +//* \brief Return the Last Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetLastConvertedData ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_LCDR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH0 +//* \brief Return the Channel 0 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR0; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH1 +//* \brief Return the Channel 1 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR1; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH2 +//* \brief Return the Channel 2 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR2; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH3 +//* \brief Return the Channel 3 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR3; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH4 +//* \brief Return the Channel 4 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR4; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH5 +//* \brief Return the Channel 5 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR5; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH6 +//* \brief Return the Channel 6 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR6; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_GetConvertedDataCH7 +//* \brief Return the Channel 7 Converted Data +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( + AT91PS_ADC pADC // pointer to a ADC controller + ) +{ + return pADC->ADC_CDR7; +} + +/* ***************************************************************************** + SOFTWARE API FOR SSC + ***************************************************************************** */ +//* Define the standard I2S mode configuration + +//* Configuration to set in the SSC Transmit Clock Mode Register +//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +//* nb_slot_by_frame : number of channels +#define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ + AT91C_SSC_CKS_DIV +\ + AT91C_SSC_CKO_CONTINOUS +\ + AT91C_SSC_CKG_NONE +\ + AT91C_SSC_START_FALL_RF +\ + AT91C_SSC_STTOUT +\ + ((1<<16) & AT91C_SSC_STTDLY) +\ + ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) + + +//* Configuration to set in the SSC Transmit Frame Mode Register +//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +//* nb_slot_by_frame : number of channels +#define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ + (nb_bit_by_slot-1) +\ + AT91C_SSC_MSBF +\ + (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ + (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ + AT91C_SSC_FSOS_NEGATIVE) + + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_SetBaudrate +//* \brief Set the baudrate according to the CPU clock +//*---------------------------------------------------------------------------- +extern void AT91F_SSC_SetBaudrate ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed); // \arg SSC baudrate + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_Configure +//* \brief Configure SSC +//*---------------------------------------------------------------------------- +extern void AT91F_SSC_Configure ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int syst_clock, // \arg System Clock Frequency + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx); // \arg mode Register to be programmed + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_EnableRx +//* \brief Enable receiving datas +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_EnableRx ( + AT91PS_SSC pSSC) // \arg pointer to a SSC controller +{ + //* Enable receiver + pSSC->SSC_CR = AT91C_SSC_RXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_DisableRx +//* \brief Disable receiving datas +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_DisableRx ( + AT91PS_SSC pSSC) // \arg pointer to a SSC controller +{ + //* Disable receiver + pSSC->SSC_CR = AT91C_SSC_RXDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_EnableTx +//* \brief Enable sending datas +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_EnableTx ( + AT91PS_SSC pSSC) // \arg pointer to a SSC controller +{ + //* Enable transmitter + pSSC->SSC_CR = AT91C_SSC_TXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_DisableTx +//* \brief Disable sending datas +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_DisableTx ( + AT91PS_SSC pSSC) // \arg pointer to a SSC controller +{ + //* Disable transmitter + pSSC->SSC_CR = AT91C_SSC_TXDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_EnableIt +//* \brief Enable SSC IT +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_EnableIt ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pSSC->SSC_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_DisableIt +//* \brief Disable SSC IT +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_DisableIt ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int flag) // \arg IT to be disabled +{ + //* Write to the IDR register + pSSC->SSC_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_ReceiveFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SSC_ReceiveFrame ( + AT91PS_SSC pSSC, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + (AT91PS_PDC) &(pSSC->SSC_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_SendFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SSC_SendFrame( + AT91PS_SSC pSSC, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_SendFrame( + (AT91PS_PDC) &(pSSC->SSC_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_GetInterruptMaskStatus +//* \brief Return SSC Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status + AT91PS_SSC pSsc) // \arg pointer to a SSC controller +{ + return pSsc->SSC_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_IsInterruptMasked +//* \brief Test if SSC Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_SSC_IsInterruptMasked( + AT91PS_SSC pSsc, // \arg pointer to a SSC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR USART + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Baudrate +//* \brief Calculate the baudrate +//* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +#define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ + AT91C_US_NBSTOP_1_BIT + \ + AT91C_US_PAR_NONE + \ + AT91C_US_CHRL_8_BITS + \ + AT91C_US_CLKS_CLOCK ) + +//* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +#define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ + AT91C_US_NBSTOP_1_BIT + \ + AT91C_US_PAR_NONE + \ + AT91C_US_CHRL_8_BITS + \ + AT91C_US_CLKS_EXT ) + +//* Standard Synchronous Mode : 8 bits , 1 stop , no parity +#define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ + AT91C_US_USMODE_NORMAL + \ + AT91C_US_NBSTOP_1_BIT + \ + AT91C_US_PAR_NONE + \ + AT91C_US_CHRL_8_BITS + \ + AT91C_US_CLKS_CLOCK ) + +//* SCK used Label +#define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) + +//* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +#define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ + AT91C_US_CLKS_CLOCK +\ + AT91C_US_NBSTOP_1_BIT + \ + AT91C_US_PAR_EVEN + \ + AT91C_US_CHRL_8_BITS + \ + AT91C_US_CKLO +\ + AT91C_US_OVER) + +//* Standard IRDA mode +#define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ + AT91C_US_NBSTOP_1_BIT + \ + AT91C_US_PAR_NONE + \ + AT91C_US_CHRL_8_BITS + \ + AT91C_US_CLKS_CLOCK ) + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Baudrate +//* \brief Caluculate baud_value according to the main clock and the baud rate +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_Baudrate ( + const unsigned int main_clock, // \arg peripheral clock + const unsigned int baud_rate) // \arg UART baudrate +{ + unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + if ((baud_value % 10) >= 5) + baud_value = (baud_value / 10) + 1; + else + baud_value /= 10; + return baud_value; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_SetBaudrate +//* \brief Set the baudrate according to the CPU clock +//*---------------------------------------------------------------------------- +static inline void AT91F_US_SetBaudrate ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg UART baudrate +{ + //* Define the baud rate divisor register + pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_SetTimeguard +//* \brief Set USART timeguard +//*---------------------------------------------------------------------------- +static inline void AT91F_US_SetTimeguard ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int timeguard) // \arg timeguard value +{ + //* Write the Timeguard Register + pUSART->US_TTGR = timeguard ; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_EnableIt +//* \brief Enable USART IT +//*---------------------------------------------------------------------------- +static inline void AT91F_US_EnableIt ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pUSART->US_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_DisableIt +//* \brief Disable USART IT +//*---------------------------------------------------------------------------- +static inline void AT91F_US_DisableIt ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int flag) // \arg IT to be disabled +{ + //* Write to the IER register + pUSART->US_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Configure +//* \brief Configure USART +//*---------------------------------------------------------------------------- +extern void AT91F_US_Configure ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ); // \arg timeguard to be programmed + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_EnableRx +//* \brief Enable receiving characters +//*---------------------------------------------------------------------------- +static inline void AT91F_US_EnableRx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Enable receiver + pUSART->US_CR = AT91C_US_RXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_EnableTx +//* \brief Enable sending characters +//*---------------------------------------------------------------------------- +static inline void AT91F_US_EnableTx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Enable transmitter + pUSART->US_CR = AT91C_US_TXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_ResetRx +//* \brief Reset Receiver and re-enable it +//*---------------------------------------------------------------------------- +static inline void AT91F_US_ResetRx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset receiver + pUSART->US_CR = AT91C_US_RSTRX; + //* Re-Enable receiver + pUSART->US_CR = AT91C_US_RXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_ResetTx +//* \brief Reset Transmitter and re-enable it +//*---------------------------------------------------------------------------- +static inline void AT91F_US_ResetTx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset transmitter + pUSART->US_CR = AT91C_US_RSTTX; + //* Enable transmitter + pUSART->US_CR = AT91C_US_TXEN; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_DisableRx +//* \brief Disable Receiver +//*---------------------------------------------------------------------------- +static inline void AT91F_US_DisableRx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Disable receiver + pUSART->US_CR = AT91C_US_RXDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_DisableTx +//* \brief Disable Transmitter +//*---------------------------------------------------------------------------- +static inline void AT91F_US_DisableTx ( + AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Disable transmitter + pUSART->US_CR = AT91C_US_TXDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Close +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +extern void AT91F_US_Close(AT91PS_USART pUSART); // \arg pointer to a USART controller + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_TxReady +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_RxReady +//* \brief Return 1 if a character can be read in US_RHR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_RxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_RXRDY); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Error +//* \brief Return the error flag +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_Error ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & + (AT91C_US_OVRE | // Overrun error + AT91C_US_FRAME | // Framing error + AT91C_US_PARE)); // Parity error +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_PutChar +//* \brief Send a character,does not check if ready to send +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_GetChar +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_US_GetChar ( + const AT91PS_USART pUSART) +{ + return((pUSART->US_RHR) & 0x1FF); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_SendFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_SendFrame( + AT91PS_USART pUSART, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_SendFrame( + (AT91PS_PDC) &(pUSART->US_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_ReceiveFrame +//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_ReceiveFrame ( + AT91PS_USART pUSART, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + (AT91PS_PDC) &(pUSART->US_RPR), + pBuffer, + szBuffer, + pNextBuffer, + szNextBuffer); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_SetIrdaFilter +//* \brief Set the value of IrDa filter tregister +//*---------------------------------------------------------------------------- +static inline void AT91F_US_SetIrdaFilter ( + AT91PS_USART pUSART, + unsigned char value +) +{ + pUSART->US_IF = value; +} + +/* ***************************************************************************** + SOFTWARE API FOR TWI + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_EnableIt +//* \brief Enable TWI IT +//*---------------------------------------------------------------------------- +static inline void AT91F_TWI_EnableIt ( + AT91PS_TWI pTWI, // \arg pointer to a TWI controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pTWI->TWI_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_DisableIt +//* \brief Disable TWI IT +//*---------------------------------------------------------------------------- +static inline void AT91F_TWI_DisableIt ( + AT91PS_TWI pTWI, // \arg pointer to a TWI controller + unsigned int flag) // \arg IT to be disabled +{ + //* Write to the IDR register + pTWI->TWI_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_Configure +//* \brief Configure TWI in master mode +//*---------------------------------------------------------------------------- +static inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI controller +{ + //* Disable interrupts + pTWI->TWI_IDR = (unsigned int) -1; + + //* Reset peripheral + pTWI->TWI_CR = AT91C_TWI_SWRST; + + //* Set Master mode + pTWI->TWI_CR = AT91C_TWI_MSEN; + +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_GetInterruptMaskStatus +//* \brief Return TWI Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status + AT91PS_TWI pTwi) // \arg pointer to a TWI controller +{ + return pTwi->TWI_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_IsInterruptMasked +//* \brief Test if TWI Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_TWI_IsInterruptMasked( + AT91PS_TWI pTwi, // \arg pointer to a TWI controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR TC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC_InterruptEnable +//* \brief Enable TC Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_TC_InterruptEnable( + AT91PS_TC pTc, // \arg pointer to a TC controller + unsigned int flag) // \arg TC interrupt to be enabled +{ + pTc->TC_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC_InterruptDisable +//* \brief Disable TC Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_TC_InterruptDisable( + AT91PS_TC pTc, // \arg pointer to a TC controller + unsigned int flag) // \arg TC interrupt to be disabled +{ + pTc->TC_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC_GetInterruptMaskStatus +//* \brief Return TC Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status + AT91PS_TC pTc) // \arg pointer to a TC controller +{ + return pTc->TC_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC_IsInterruptMasked +//* \brief Test if TC Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_TC_IsInterruptMasked( + AT91PS_TC pTc, // \arg pointer to a TC controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); +} + +/* ***************************************************************************** + SOFTWARE API FOR PWMC + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_GetStatus +//* \brief Return PWM Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status + AT91PS_PWMC pPWM) // pointer to a PWM controller +{ + return pPWM->PWMC_SR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_InterruptEnable +//* \brief Enable PWM Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_InterruptEnable( + AT91PS_PWMC pPwm, // \arg pointer to a PWM controller + unsigned int flag) // \arg PWM interrupt to be enabled +{ + pPwm->PWMC_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_InterruptDisable +//* \brief Disable PWM Interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_InterruptDisable( + AT91PS_PWMC pPwm, // \arg pointer to a PWM controller + unsigned int flag) // \arg PWM interrupt to be disabled +{ + pPwm->PWMC_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_GetInterruptMaskStatus +//* \brief Return PWM Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status + AT91PS_PWMC pPwm) // \arg pointer to a PWM controller +{ + return pPwm->PWMC_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_IsInterruptMasked +//* \brief Test if PWM Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PWMC_IsInterruptMasked( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_IsStatusSet +//* \brief Test if PWM Interrupt is Set +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PWMC_IsStatusSet( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_PWMC_GetStatus(pPWM) & flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_CfgChannel +//* \brief Test if PWM Interrupt is Set +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CfgChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int channelId, // \arg PWM channel ID + unsigned int mode, // \arg PWM mode + unsigned int period, // \arg PWM period + unsigned int duty) // \arg PWM duty cycle +{ + pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_StartChannel +//* \brief Enable channel +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StartChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_ENA = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_StopChannel +//* \brief Disable channel +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StopChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_DIS = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWM_UpdateChannel +//* \brief Update Period or Duty Cycle +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_UpdateChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int channelId, // \arg PWM channel ID + unsigned int update) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; +} + +/* ***************************************************************************** + SOFTWARE API FOR UDP + ***************************************************************************** */ +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EnableIt +//* \brief Enable UDP IT +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EnableIt ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pUDP->UDP_IER = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_DisableIt +//* \brief Disable UDP IT +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_DisableIt ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned int flag) // \arg IT to be disabled +{ + //* Write to the IDR register + pUDP->UDP_IDR = flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_SetAddress +//* \brief Set UDP functional address +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_SetAddress ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char address) // \arg new UDP address +{ + pUDP->UDP_FADDR = (AT91C_UDP_FEN | address); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EnableEp +//* \brief Enable Endpoint +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EnableEp ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + pUDP->UDP_CSR[endpoint] |= AT91C_UDP_EPEDS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_DisableEp +//* \brief Enable Endpoint +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_DisableEp ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + pUDP->UDP_CSR[endpoint] &= ~AT91C_UDP_EPEDS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_SetState +//* \brief Set UDP Device state +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_SetState ( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned int flag) // \arg new UDP address +{ + pUDP->UDP_GLBSTATE &= ~(AT91C_UDP_FADDEN | AT91C_UDP_CONFG); + pUDP->UDP_GLBSTATE |= flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_GetState +//* \brief return UDP Device state +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_UDP_GetState ( // \return the UDP device state + AT91PS_UDP pUDP) // \arg pointer to a UDP controller +{ + return (pUDP->UDP_GLBSTATE & (AT91C_UDP_FADDEN | AT91C_UDP_CONFG)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_ResetEp +//* \brief Reset UDP endpoint +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_ResetEp ( // \return the UDP device state + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned int flag) // \arg Endpoints to be reset +{ + pUDP->UDP_RSTEP = flag; + pUDP->UDP_RSTEP = 0; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpStall +//* \brief Endpoint will STALL requests +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EpStall( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + pUDP->UDP_CSR[endpoint] |= AT91C_UDP_FORCESTALL; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpWrite +//* \brief Write value in the DPR +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EpWrite( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint, // \arg endpoint number + unsigned char value) // \arg value to be written in the DPR +{ + pUDP->UDP_FDR[endpoint] = value; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpRead +//* \brief Return value from the DPR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_UDP_EpRead( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + return pUDP->UDP_FDR[endpoint]; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpEndOfWr +//* \brief Notify the UDP that values in DPR are ready to be sent +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EpEndOfWr( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + pUDP->UDP_CSR[endpoint] |= AT91C_UDP_TXPKTRDY; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpClear +//* \brief Clear flag in the endpoint CSR register +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EpClear( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint, // \arg endpoint number + unsigned int flag) // \arg flag to be cleared +{ + pUDP->UDP_CSR[endpoint] &= ~(flag); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpSet +//* \brief Set flag in the endpoint CSR register +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_EpSet( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint, // \arg endpoint number + unsigned int flag) // \arg flag to be cleared +{ + pUDP->UDP_CSR[endpoint] |= flag; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_EpStatus +//* \brief Return the endpoint CSR register +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_UDP_EpStatus( + AT91PS_UDP pUDP, // \arg pointer to a UDP controller + unsigned char endpoint) // \arg endpoint number +{ + return pUDP->UDP_CSR[endpoint]; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_GetInterruptMaskStatus +//* \brief Return UDP Interrupt Mask Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_UDP_GetInterruptMaskStatus( + AT91PS_UDP pUdp) // \arg pointer to a UDP controller +{ + return pUdp->UDP_IMR; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_IsInterruptMasked +//* \brief Test if UDP Interrupt is Masked +//*---------------------------------------------------------------------------- +static inline int AT91F_UDP_IsInterruptMasked( + AT91PS_UDP pUdp, // \arg pointer to a UDP controller + unsigned int flag) // \arg flag to be tested +{ + return (AT91F_UDP_GetInterruptMaskStatus(pUdp) & flag); +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_UDP_InterruptStatusRegister +// \brief Return the Interrupt Status Register +// ---------------------------------------------------------------------------- +static inline unsigned int AT91F_UDP_InterruptStatusRegister( + AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +{ + return pUDP->UDP_ISR; +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_UDP_InterruptClearRegister +// \brief Clear Interrupt Register +// ---------------------------------------------------------------------------- +static inline void AT91F_UDP_InterruptClearRegister ( + AT91PS_UDP pUDP, // \arg pointer to UDP controller + unsigned int flag) // \arg IT to be cleat +{ + pUDP->UDP_ICR = flag; +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_UDP_EnableTransceiver +// \brief Enable transceiver +// ---------------------------------------------------------------------------- +static inline void AT91F_UDP_EnableTransceiver( + AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +{ + pUDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS; +} + +// ---------------------------------------------------------------------------- +// \fn AT91F_UDP_DisableTransceiver +// \brief Disable transceiver +// ---------------------------------------------------------------------------- +static inline void AT91F_UDP_DisableTransceiver( + AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +{ + pUDP->UDP_TXVC = AT91C_UDP_TXVDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_CfgPMC +//* \brief Enable Peripheral clock in PMC for DBGU +//*---------------------------------------------------------------------------- +static inline void AT91F_DBGU_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_CfgPIO +//* \brief Configure PIO controllers to drive DBGU signals +//*---------------------------------------------------------------------------- +static inline void AT91F_DBGU_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA9_DRXD ) | + ((unsigned int) AT91C_PA10_DTXD ), // Peripheral A + 0); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_CfgPMC +//* \brief Enable Peripheral clock in PMC for PMC +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PMC_CfgPIO +//* \brief Configure PIO controllers to drive PMC signals +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA6_PCK0 ) | + ((unsigned int) AT91C_PA18_PCK2 ) | + ((unsigned int) AT91C_PA31_PCK2 ) | + ((unsigned int) AT91C_PA21_PCK1 ) | + ((unsigned int) AT91C_PA17_PCK1 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_VREG_CfgPMC +//* \brief Enable Peripheral clock in PMC for VREG +//*---------------------------------------------------------------------------- +static inline void AT91F_VREG_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RSTC_CfgPMC +//* \brief Enable Peripheral clock in PMC for RSTC +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_CfgPMC +//* \brief Enable Peripheral clock in PMC for SSC +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SSC)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_CfgPIO +//* \brief Configure PIO controllers to drive SSC signals +//*---------------------------------------------------------------------------- +static inline void AT91F_SSC_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA19_RK ) | + ((unsigned int) AT91C_PA16_TK ) | + ((unsigned int) AT91C_PA15_TF ) | + ((unsigned int) AT91C_PA18_RD ) | + ((unsigned int) AT91C_PA20_RF ) | + ((unsigned int) AT91C_PA17_TD ), // Peripheral A + 0); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_WDTC_CfgPMC +//* \brief Enable Peripheral clock in PMC for WDTC +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US1_CfgPMC +//* \brief Enable Peripheral clock in PMC for US1 +//*---------------------------------------------------------------------------- +static inline void AT91F_US1_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_US1)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US1_CfgPIO +//* \brief Configure PIO controllers to drive US1 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_US1_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA29_RI1 ) | + ((unsigned int) AT91C_PA26_DCD1 ) | + ((unsigned int) AT91C_PA28_DSR1 ) | + ((unsigned int) AT91C_PA27_DTR1 ) | + ((unsigned int) AT91C_PA23_SCK1 ) | + ((unsigned int) AT91C_PA24_RTS1 ) | + ((unsigned int) AT91C_PA22_TXD1 ) | + ((unsigned int) AT91C_PA21_RXD1 ) | + ((unsigned int) AT91C_PA25_CTS1 ), // Peripheral A + 0); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US0_CfgPMC +//* \brief Enable Peripheral clock in PMC for US0 +//*---------------------------------------------------------------------------- +static inline void AT91F_US0_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_US0)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US0_CfgPIO +//* \brief Configure PIO controllers to drive US0 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_US0_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA5_RXD0 ) | + ((unsigned int) AT91C_PA8_CTS0 ) | + ((unsigned int) AT91C_PA7_RTS0 ) | + ((unsigned int) AT91C_PA6_TXD0 ), // Peripheral A + ((unsigned int) AT91C_PA2_SCK0 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_CfgPMC +//* \brief Enable Peripheral clock in PMC for SPI +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SPI)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_CfgPIO +//* \brief Configure PIO controllers to drive SPI signals +//*---------------------------------------------------------------------------- +static inline void AT91F_SPI_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA13_MOSI ) | + ((unsigned int) AT91C_PA31_NPCS1 ) | + ((unsigned int) AT91C_PA14_SPCK ) | + ((unsigned int) AT91C_PA11_NPCS0 ) | + ((unsigned int) AT91C_PA12_MISO ), // Peripheral A + ((unsigned int) AT91C_PA9_NPCS1 ) | + ((unsigned int) AT91C_PA22_NPCS3 ) | + ((unsigned int) AT91C_PA3_NPCS3 ) | + ((unsigned int) AT91C_PA5_NPCS3 ) | + ((unsigned int) AT91C_PA10_NPCS2 ) | + ((unsigned int) AT91C_PA30_NPCS2 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PITC_CfgPMC +//* \brief Enable Peripheral clock in PMC for PITC +//*---------------------------------------------------------------------------- +static inline void AT91F_PITC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_CfgPMC +//* \brief Enable Peripheral clock in PMC for AIC +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_FIQ) | + ((unsigned int) 1 << AT91C_ID_IRQ0) | + ((unsigned int) 1 << AT91C_ID_IRQ1)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_CfgPIO +//* \brief Configure PIO controllers to drive AIC signals +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA30_IRQ1 ), // Peripheral A + ((unsigned int) AT91C_PA20_IRQ0 ) | + ((unsigned int) AT91C_PA19_FIQ )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_CfgPMC +//* \brief Enable Peripheral clock in PMC for TWI +//*---------------------------------------------------------------------------- +static inline void AT91F_TWI_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_TWI)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TWI_CfgPIO +//* \brief Configure PIO controllers to drive TWI signals +//*---------------------------------------------------------------------------- +static inline void AT91F_TWI_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA4_TWCK ) | + ((unsigned int) AT91C_PA3_TWD ), // Peripheral A + 0); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWMC_CH3_CfgPIO +//* \brief Configure PIO controllers to drive PWMC_CH3 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CH3_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA7_PWM3 ) | + ((unsigned int) AT91C_PA14_PWM3 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWMC_CH2_CfgPIO +//* \brief Configure PIO controllers to drive PWMC_CH2 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CH2_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA2_PWM2 ), // Peripheral A + ((unsigned int) AT91C_PA13_PWM2 ) | + ((unsigned int) AT91C_PA25_PWM2 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWMC_CH1_CfgPIO +//* \brief Configure PIO controllers to drive PWMC_CH1 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CH1_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA1_PWM1 ), // Peripheral A + ((unsigned int) AT91C_PA24_PWM1 ) | + ((unsigned int) AT91C_PA12_PWM1 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWMC_CH0_CfgPIO +//* \brief Configure PIO controllers to drive PWMC_CH0 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CH0_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + ((unsigned int) AT91C_PA0_PWM0 ), // Peripheral A + ((unsigned int) AT91C_PA23_PWM0 ) | + ((unsigned int) AT91C_PA11_PWM0 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_CfgPMC +//* \brief Enable Peripheral clock in PMC for ADC +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_ADC)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_CfgPIO +//* \brief Configure PIO controllers to drive ADC signals +//*---------------------------------------------------------------------------- +static inline void AT91F_ADC_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA8_ADTRG )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_RTTC_CfgPMC +//* \brief Enable Peripheral clock in PMC for RTTC +//*---------------------------------------------------------------------------- +static inline void AT91F_RTTC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_UDP_CfgPMC +//* \brief Enable Peripheral clock in PMC for UDP +//*---------------------------------------------------------------------------- +static inline void AT91F_UDP_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_UDP)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC0_CfgPMC +//* \brief Enable Peripheral clock in PMC for TC0 +//*---------------------------------------------------------------------------- +static inline void AT91F_TC0_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_TC0)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC0_CfgPIO +//* \brief Configure PIO controllers to drive TC0 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_TC0_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA0_TIOA0 ) | + ((unsigned int) AT91C_PA4_TCLK0 ) | + ((unsigned int) AT91C_PA1_TIOB0 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC1_CfgPMC +//* \brief Enable Peripheral clock in PMC for TC1 +//*---------------------------------------------------------------------------- +static inline void AT91F_TC1_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_TC1)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC1_CfgPIO +//* \brief Configure PIO controllers to drive TC1 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_TC1_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA15_TIOA1 ) | + ((unsigned int) AT91C_PA28_TCLK1 ) | + ((unsigned int) AT91C_PA16_TIOB1 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC2_CfgPMC +//* \brief Enable Peripheral clock in PMC for TC2 +//*---------------------------------------------------------------------------- +static inline void AT91F_TC2_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_TC2)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_TC2_CfgPIO +//* \brief Configure PIO controllers to drive TC2 signals +//*---------------------------------------------------------------------------- +static inline void AT91F_TC2_CfgPIO (void) +{ + // Configure PIO controllers to periph mode + AT91F_PIO_CfgPeriph( + AT91C_BASE_PIOA, // PIO controller base address + 0, // Peripheral A + ((unsigned int) AT91C_PA27_TIOB2 ) | + ((unsigned int) AT91C_PA26_TIOA2 ) | + ((unsigned int) AT91C_PA29_TCLK2 )); // Peripheral B +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_MC_CfgPMC +//* \brief Enable Peripheral clock in PMC for MC +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_SYS)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PIOA_CfgPMC +//* \brief Enable Peripheral clock in PMC for PIOA +//*---------------------------------------------------------------------------- +static inline void AT91F_PIOA_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_PIOA)); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PWMC_CfgPMC +//* \brief Enable Peripheral clock in PMC for PWMC +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_CfgPMC (void) +{ + AT91F_PMC_EnablePeriphClock( + AT91C_BASE_PMC, // PIO controller base address + ((unsigned int) 1 << AT91C_ID_PWMC)); +} + +#define __ramfunc __attribute__ ((long_call, section (".fastrun"))) + +#endif // lib_AT91SAM7S64_H diff --git a/firmware/include/openpcd.h b/firmware/include/openpcd.h new file mode 100644 index 0000000..e5a0ac7 --- /dev/null +++ b/firmware/include/openpcd.h @@ -0,0 +1,111 @@ +#ifndef _OPENPCD_PROTO_H +#define _OPENPCD_PROTO_H + +/* This header file describes the USB protocol of the OpenPCD RFID reader */ + +#include + +struct openpcd_hdr { + u_int8_t cmd; /* command. high nibble: class, + * low nibble: cmd */ + u_int8_t flags; + u_int8_t reg; /* register */ + u_int8_t val; /* value (in case of write *) */ + u_int8_t data[0]; +} __attribute__ ((packed)); + +#define OPCD_REV_LEN 16 +struct openpcd_compile_version { + char svnrev[OPCD_REV_LEN]; + char by[OPCD_REV_LEN]; + char date[OPCD_REV_LEN]; +} __attribute__ ((packed)); + +#define OPENPCD_FLAG_RESPOND 0x01 /* Response requested */ +#define OPENPCD_FLAG_ERROR 0x80 /* An error occurred */ + +enum openpcd_cmd_class { + OPENPCD_CMD_CLS_GENERIC = 0x0, + /* PCD (reader) side */ + OPENPCD_CMD_CLS_RC632 = 0x1, + //OPENPCD_CMD_CLS_LED = 0x2, + OPENPCD_CMD_CLS_SSC = 0x3, + OPENPCD_CMD_CLS_PWM = 0x4, + OPENPCD_CMD_CLS_ADC = 0x5, + OPENPCD_CMD_CLS_LIBRFID = 0x6, + OPENPCD_CMD_CLS_PRESENCE = 0x7, + /* PICC (transponder) side */ + OPENPCD_CMD_CLS_PICC = 0xe, + + OPENPCD_CMD_CLS_USBTEST = 0xf, +}; + +#define OPENPCD_REG_MAX 0x3f + +#define OPENPCD_CMD_CLS(x) (x >> 4) +#define OPENPCD_CMD(x) (x & 0xf) + +#define OPENPCD_CLS2CMD(x) (x << 4) + +/* Generic */ +#define OPENPCD_CMD_GET_VERSION (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_LED (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_SERIAL (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_API_VERSION (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_ENVIRONMENT (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_ENVIRONMENT (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_RESET (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) + +/* CMD_CLS_RC632 */ +#define OPENPCD_CMD_WRITE_REG (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_FIFO (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_VFIFO (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_CLEAR (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_SET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_REG (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_FIFO (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_VFIFO (0x8|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_DUMP_REGS (0x9|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_IRQ (0xa|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_REG_SET (0xb|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) + +/* CMD_CLS_SSC */ +#define OPENPCD_CMD_SSC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) +#define OPENPCD_CMD_SSC_WRITE (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) + +/* CMD_CLS_PWM */ +#define OPENPCD_CMD_PWM_ENABLE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_SET (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_GET (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_SET (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_GET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) + +/* CMD_CLS_PICC */ +#define OPENPCD_CMD_PICC_REG_WRITE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) +#define OPENPCD_CMD_PICC_REG_READ (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) + +/* CMD_CLS_ADC */ +#define OPENPCD_CMD_ADC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_ADC)) + +/* CMD_CLS_LIBRFID */ +#define OPENPCD_CMD_LRFID_DETECT_IRQ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_LIBRFID)) + +/* CMD_CLS_LIBRFID */ +#define OPENPCD_CMD_PRESENCE_UID_GET (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PRESENCE)) + +/* CMD_CLS_USBTEST */ +#define OPENPCD_CMD_USBTEST_IN (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) +#define OPENPCD_CMD_USBTEST_OUT (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + +/* FIXME */ +#define OPENPCD_CMD_PIO_IRQ (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + + +#define OPENPCD_VENDOR_ID 0x16c0 +#define OPENPCD_PRODUCT_ID 0x076b +#define OPENPICC_PRODUCT_ID 0x076c +#define OPENPCD_OUT_EP 0x01 +#define OPENPCD_IN_EP 0x82 +#define OPENPCD_IRQ_EP 0x83 + +#endif diff --git a/firmware/include/openpicc.h b/firmware/include/openpicc.h new file mode 100644 index 0000000..2a9f1bc --- /dev/null +++ b/firmware/include/openpicc.h @@ -0,0 +1,31 @@ +#ifndef _OPENPICC_H +#define _OPENPICC_H + +/* OpenPICC Register definition + * (C) 2006 by Harald Welte + */ + +enum openpicc_register { + OPICC_REG_MODE, /* operational mode */ + OPICC_REG_ISO14443A_FDT_0, /* FDT (after 0) in carrier cycles */ + OPICC_REG_ISO14443A_FDT_1, /* FDT (after 1) in carrier cycles */ + OPICC_REG_BITCLK_PHASE_CORR, /* signed 8bit phase correction */ + OPICC_REG_SPEED_RX, + OPICC_REG_SPEED_TX, + OPICC_REG_UID_PUPI, /* UID (14443A) / PUPI (14443B) */ +}; + +enum openpicc_reg_mode { + OPICC_MODE_14443A, + OPICC_MODE_14443B, + OPICC_MODE_LOWLEVEL, /* low-level bit-transceive mode TBD */ +}; + +enum openpicc_reg_speed { + OPICC_SPEED_14443_106K, + OPICC_SPEED_14443_212K, + OPICC_SPEED_14443_424K, + OPICC_SPEED_14443_848K, +}; + +#endif /* _OPENPICC_H */ diff --git a/firmware/include/openpicc_regs.h b/firmware/include/openpicc_regs.h new file mode 100644 index 0000000..659a82c --- /dev/null +++ b/firmware/include/openpicc_regs.h @@ -0,0 +1,47 @@ +#ifndef _OPENPICC_STATE +#define _OPENPICC_STATE + +/* according to ISO 14443-3(2000) 6.2 */ +enum opicc_14443a_state { + ISO14443A_ST_POWEROFF, + ISO14443A_ST_IDLE, + ISO14443A_ST_READY, + ISO14443A_ST_ACTIVE, + ISO14443A_ST_HALT, + ISO14443A_ST_READY2, + ISO14443A_ST_ACTIVE2, +}; + +enum opicc_reg_tx_control { + OPICC_REG_TX_BPSK = 0x01, + OPICC_REG_TX_MANCHESTER = 0x02, + OPICC_REG_TX_INTENSITY0 = 0x00, + OPICC_REG_TX_INTENSITY1 = 0x10, + OPICC_REG_TX_INTENSITY2 = 0x20, + OPICC_REG_TX_INTENSITY3 = 0x30, +}; + +enum opicc_reg { + OPICC_REG_14443A_UIDLEN,/* Length of UID in bytes */ + + OPICC_REG_14443A_FDT0, /* Frame delay time if last bit 0 */ + OPICC_REG_14443A_FDT1, /* Frame delay time if last bit 1 */ + OPICC_REG_14443A_STATE, /* see 'enum opicc_14443a_state' */ + OPICC_REG_14443A_ATQA, /* The ATQA template for 14443A */ + + OPICC_REG_RX_CLK_DIV, /* Clock divider for Rx sample clock */ + OPICC_REG_RX_CLK_PHASE, /* Phase shift of Rx sample clock */ + OPICC_REG_RX_COMP_LEVEL,/* Comparator level of Demodulator */ + OPICC_REG_RX_CONTROL, + + OPICC_REG_TX_CLK_DIV, /* Clock divider for Tx sample clock */ + OPICC_REG_TX_CONTROL, /* see 'enum opicc_reg_tx_Control */ + _OPICC_NUM_REGS, +}; + +enum openpicc_14443a_sregs { + /* string 'registers' */ + OPICC_REG_14443A_UID, /* The UID (4...10 bytes) */ +}; + +#endif diff --git a/firmware/include/usb_ch9.h b/firmware/include/usb_ch9.h new file mode 100644 index 0000000..46066f2 --- /dev/null +++ b/firmware/include/usb_ch9.h @@ -0,0 +1,550 @@ +/* + * This file holds USB constants and structures that are needed for USB + * device APIs. These are used by the USB device model, which is defined + * in chapter 9 of the USB 2.0 specification. Linux has several APIs in C + * that need these: + * + * - the master/host side Linux-USB kernel driver API; + * - the "usbfs" user space API; and + * - the Linux "gadget" slave/device/peripheral side driver API. + * + * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems + * act either as a USB master/host or as a USB slave/device. That means + * the master and slave side APIs benefit from working well together. + * + * There's also "Wireless USB", using low power short range radios for + * peripheral interconnection but otherwise building on the USB framework. + */ + +#ifndef __LINUX_USB_CH9_H +#define __LINUX_USB_CH9_H + +#include + +/*-------------------------------------------------------------------------*/ + +/* CONTROL REQUEST SUPPORT */ + +/* + * USB directions + * + * This bit flag is used in endpoint descriptors' bEndpointAddress field. + * It's also one of three fields in control requests bRequestType. + */ +#define USB_DIR_OUT 0 /* to device */ +#define USB_DIR_IN 0x80 /* to host */ + +/* + * USB types, the second of three bRequestType fields + */ +#define USB_TYPE_MASK (0x03 << 5) +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +/* + * USB recipients, the third of three bRequestType fields + */ +#define USB_RECIP_MASK 0x1f +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Standard requests, for the bRequest field of a SETUP packet. + * + * These are qualified by the bRequestType field, so that for example + * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved + * by a GET_STATUS request. + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +#define USB_REQ_SET_FEATURE 0x03 +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ +#define USB_REQ_GET_ENCRYPTION 0x0E +#define USB_REQ_SET_HANDSHAKE 0x0F +#define USB_REQ_GET_HANDSHAKE 0x10 +#define USB_REQ_SET_CONNECTION 0x11 +#define USB_REQ_SET_SECURITY_DATA 0x12 +#define USB_REQ_GET_SECURITY_DATA 0x13 +#define USB_REQ_SET_WUSB_DATA 0x14 +#define USB_REQ_LOOPBACK_DATA_WRITE 0x15 +#define USB_REQ_LOOPBACK_DATA_READ 0x16 +#define USB_REQ_SET_INTERFACE_DS 0x17 + +/* + * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and + * are read as a bit array returned by USB_REQ_GET_STATUS. (So there + * are at most sixteen features of each type.) + */ +#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ +#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ +#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ +#define USB_DEVICE_BATTERY 2 /* (wireless) */ +#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ +#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ +#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ +#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ +#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ + +#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ + + +/** + * struct usb_ctrlrequest - SETUP data for a USB device control request + * @bRequestType: matches the USB bmRequestType field + * @bRequest: matches the USB bRequest field + * @wValue: matches the USB wValue field (le16 byte order) + * @wIndex: matches the USB wIndex field (le16 byte order) + * @wLength: matches the USB wLength field (le16 byte order) + * + * This structure is used to send control requests to a USB device. It matches + * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the + * USB spec for a fuller description of the different fields, and what they are + * used for. + * + * Note that the driver for any interface can issue control requests. + * For most devices, interfaces don't coordinate with each other, so + * such requests may be made at any time. + */ +struct usb_ctrlrequest { + u_int8_t bRequestType; + u_int8_t bRequest; + u_int16_t wValue; + u_int16_t wIndex; + u_int16_t wLength; +} __attribute__ ((packed)); + +/*-------------------------------------------------------------------------*/ + +/* + * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or + * (rarely) accepted by SET_DESCRIPTOR. + * + * Note that all multi-byte values here are encoded in little endian + * byte order "on the wire". But when exposed through Linux-USB APIs, + * they've been converted to cpu byte order. + */ + +/* + * Descriptor types ... USB 2.0 spec table 9.5 + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 +#define USB_DT_DEVICE_QUALIFIER 0x06 +#define USB_DT_OTHER_SPEED_CONFIG 0x07 +#define USB_DT_INTERFACE_POWER 0x08 +/* these are from a minor usb 2.0 revision (ECN) */ +#define USB_DT_OTG 0x09 +#define USB_DT_DEBUG 0x0a +#define USB_DT_INTERFACE_ASSOCIATION 0x0b +/* these are from the Wireless USB spec */ +#define USB_DT_SECURITY 0x0c +#define USB_DT_KEY 0x0d +#define USB_DT_ENCRYPTION_TYPE 0x0e +#define USB_DT_BOS 0x0f +#define USB_DT_DEVICE_CAPABILITY 0x10 +#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 + +/* conventional codes for class-specific descriptors */ +#define USB_DT_CS_DEVICE 0x21 +#define USB_DT_CS_CONFIG 0x22 +#define USB_DT_CS_STRING 0x23 +#define USB_DT_CS_INTERFACE 0x24 +#define USB_DT_CS_ENDPOINT 0x25 + +/* All standard descriptors have these 2 fields at the beginning */ +struct usb_descriptor_header { + u_int8_t bLength; + u_int8_t bDescriptorType; +} __attribute__ ((packed)); + + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_DEVICE: Device descriptor */ +struct usb_device_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t bcdUSB; + u_int8_t bDeviceClass; + u_int8_t bDeviceSubClass; + u_int8_t bDeviceProtocol; + u_int8_t bMaxPacketSize0; + u_int16_t idVendor; + u_int16_t idProduct; + u_int16_t bcdDevice; + u_int8_t iManufacturer; + u_int8_t iProduct; + u_int8_t iSerialNumber; + u_int8_t bNumConfigurations; +} __attribute__ ((packed)); + +#define USB_DT_DEVICE_SIZE 18 + + +/* + * Device and/or Interface Class codes + * as found in bDeviceClass or bInterfaceClass + * and defined by www.usb.org documents + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PHYSICAL 5 +#define USB_CLASS_STILL_IMAGE 6 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_CDC_DATA 0x0a +#define USB_CLASS_CSCID 0x0b /* chip+ smart card */ +#define USB_CLASS_CONTENT_SEC 0x0d /* content security */ +#define USB_CLASS_VIDEO 0x0e +#define USB_CLASS_WIRELESS_CONTROLLER 0xe0 +#define USB_CLASS_APP_SPEC 0xfe +#define USB_CLASS_VENDOR_SPEC 0xff + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_CONFIG: Configuration descriptor information. + * + * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the + * descriptor type is different. Highspeed-capable devices can look + * different depending on what speed they're currently running. Only + * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG + * descriptors. + */ +struct usb_config_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t wTotalLength; + u_int8_t bNumInterfaces; + u_int8_t bConfigurationValue; + u_int8_t iConfiguration; + u_int8_t bmAttributes; + u_int8_t bMaxPower; +} __attribute__ ((packed)); + +#define USB_DT_CONFIG_SIZE 9 + +/* from config descriptor bmAttributes */ +#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */ +#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */ +#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */ +#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */ + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_STRING: String descriptor */ +struct usb_string_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t wData[0]; /* UTF-16LE encoded */ +} __attribute__ ((packed)); + +/* note that "string" zero is special, it holds language codes that + * the device supports, not Unicode characters. + */ + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_INTERFACE: Interface descriptor */ +struct usb_interface_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bInterfaceNumber; + u_int8_t bAlternateSetting; + u_int8_t bNumEndpoints; + u_int8_t bInterfaceClass; + u_int8_t bInterfaceSubClass; + u_int8_t bInterfaceProtocol; + u_int8_t iInterface; +} __attribute__ ((packed)); + +#define USB_DT_INTERFACE_SIZE 9 + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_ENDPOINT: Endpoint descriptor */ +struct usb_endpoint_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bEndpointAddress; + u_int8_t bmAttributes; + u_int16_t wMaxPacketSize; + u_int8_t bInterval; +} __attribute__ ((packed)); + +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ + + +/* + * Endpoints + */ +#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_XFER_CONTROL 0 +#define USB_ENDPOINT_XFER_ISOC 1 +#define USB_ENDPOINT_XFER_BULK 2 +#define USB_ENDPOINT_XFER_INT 3 +#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 + + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ +struct usb_qualifier_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t bcdUSB; + u_int8_t bDeviceClass; + u_int8_t bDeviceSubClass; + u_int8_t bDeviceProtocol; + u_int8_t bMaxPacketSize0; + u_int8_t bNumConfigurations; + u_int8_t bRESERVED; +} __attribute__ ((packed)); + + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_OTG (from OTG 1.0a supplement) */ +struct usb_otg_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bmAttributes; /* support for HNP, SRP, etc */ +} __attribute__ ((packed)); + +/* from usb_otg_descriptor.bmAttributes */ +#define USB_OTG_SRP (1 << 0) +#define USB_OTG_HNP (1 << 1) /* swap host/device roles */ + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */ +struct usb_debug_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + /* bulk endpoints with 8 byte maxpacket */ + u_int8_t bDebugInEndpoint; + u_int8_t bDebugOutEndpoint; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ +struct usb_interface_assoc_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bFirstInterface; + u_int8_t bInterfaceCount; + u_int8_t bFunctionClass; + u_int8_t bFunctionSubClass; + u_int8_t bFunctionProtocol; + u_int8_t iFunction; +} __attribute__ ((packed)); + + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_SECURITY: group of wireless security descriptors, including + * encryption types available for setting up a CC/association. + */ +struct usb_security_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t wTotalLength; + u_int8_t bNumEncryptionTypes; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys + * may be retrieved. + */ +struct usb_key_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t tTKID[3]; + u_int8_t bReserved; + u_int8_t bKeyData[0]; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */ +struct usb_encryption_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bEncryptionType; +#define USB_ENC_TYPE_UNSECURE 0 +#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */ +#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */ +#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ + u_int8_t bEncryptionValue; /* use in SET_ENCRYPTION */ + u_int8_t bAuthKeyIndex; +}; + + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_BOS: group of wireless capabilities */ +struct usb_bos_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int16_t wTotalLength; + u_int8_t bNumDeviceCaps; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */ +struct usb_dev_cap_header { + u_int8_t bLength; + u_int8_t bDescriptorType; + u_int8_t bDevCapabilityType; +}; + +#define USB_CAP_TYPE_WIRELESS_USB 1 + +struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ + u_int8_t bLength; + u_int8_t bDescriptorType; + u_int8_t bDevCapabilityType; + + u_int8_t bmAttributes; +#define USB_WIRELESS_P2P_DRD (1 << 1) +#define USB_WIRELESS_BEACON_MASK (3 << 2) +#define USB_WIRELESS_BEACON_SELF (1 << 2) +#define USB_WIRELESS_BEACON_DIRECTED (2 << 2) +#define USB_WIRELESS_BEACON_NONE (3 << 2) + u_int16_t wPHYRates; /* bit rates, Mbps */ +#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */ +#define USB_WIRELESS_PHY_80 (1 << 1) +#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */ +#define USB_WIRELESS_PHY_160 (1 << 3) +#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */ +#define USB_WIRELESS_PHY_320 (1 << 5) +#define USB_WIRELESS_PHY_400 (1 << 6) +#define USB_WIRELESS_PHY_480 (1 << 7) + u_int8_t bmTFITXPowerInfo; /* TFI power levels */ + u_int8_t bmFFITXPowerInfo; /* FFI power levels */ + u_int16_t bmBandGroup; + u_int8_t bReserved; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with + * each endpoint descriptor for a wireless device + */ +struct usb_wireless_ep_comp_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + + u_int8_t bMaxBurst; + u_int8_t bMaxSequence; + u_int16_t wMaxStreamDelay; + u_int16_t wOverTheAirPacketSize; + u_int8_t bOverTheAirInterval; + u_int8_t bmCompAttributes; +#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */ +#define USB_ENDPOINT_SWITCH_NO 0 +#define USB_ENDPOINT_SWITCH_SWITCH 1 +#define USB_ENDPOINT_SWITCH_SCALE 2 +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless + * host and a device for connection set up, mutual authentication, and + * exchanging short lived session keys. The handshake depends on a CC. + */ +struct usb_handshake { + u_int8_t bMessageNumber; + u_int8_t bStatus; + u_int8_t tTKID[3]; + u_int8_t bReserved; + u_int8_t CDID[16]; + u_int8_t nonce[16]; + u_int8_t MIC[8]; +}; + +/*-------------------------------------------------------------------------*/ + +/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC). + * A CC may also be set up using non-wireless secure channels (including + * wired USB!), and some devices may support CCs with multiple hosts. + */ +struct usb_connection_context { + u_int8_t CHID[16]; /* persistent host id */ + u_int8_t CDID[16]; /* device id (unique w/in host context) */ + u_int8_t CK[16]; /* connection key */ +}; + +/*-------------------------------------------------------------------------*/ + +/* USB 2.0 defines three speeds, here's how Linux identifies them */ + +enum usb_device_speed { + USB_SPEED_UNKNOWN = 0, /* enumerating */ + USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ + USB_SPEED_HIGH, /* usb 2.0 */ + USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ +}; + +enum usb_device_state { + /* NOTATTACHED isn't in the USB spec, and this state acts + * the same as ATTACHED ... but it's clearer this way. + */ + USB_STATE_NOTATTACHED = 0, + + /* chapter 9 and authentication (wireless) device states */ + USB_STATE_ATTACHED, + USB_STATE_POWERED, /* wired */ + USB_STATE_UNAUTHENTICATED, /* auth */ + USB_STATE_RECONNECTING, /* auth */ + USB_STATE_DEFAULT, /* limited function */ + USB_STATE_ADDRESS, + USB_STATE_CONFIGURED, /* most functions */ + + USB_STATE_SUSPENDED + + /* NOTE: there are actually four different SUSPENDED + * states, returning to POWERED, DEFAULT, ADDRESS, or + * CONFIGURED respectively when SOF tokens flow again. + */ +}; + +#endif /* __LINUX_USB_CH9_H */ diff --git a/firmware/include/usb_dfu.h b/firmware/include/usb_dfu.h new file mode 100644 index 0000000..5000edc --- /dev/null +++ b/firmware/include/usb_dfu.h @@ -0,0 +1,81 @@ +#ifndef _USB_DFU_H +#define _USB_DFU_H +/* USB Device Firmware Update Implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * Protocol definitions for USB DFU + * + * This ought to be compliant to the USB DFU Spec 1.0 as available from + * http://www.usb.org/developers/devclass_docs/usbdfu10.pdf + * + */ + +#include + +#define USB_DT_DFU 0x21 + +struct usb_dfu_func_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + u_int8_t bmAttributes; +#define USB_DFU_CAN_DOWNLOAD (1 << 0) +#define USB_DFU_CAN_UPLOAD (1 << 1) +#define USB_DFU_MANIFEST_TOL (1 << 2) +#define USB_DFU_WILL_DETACH (1 << 3) + u_int16_t wDetachTimeOut; + u_int16_t wTransferSize; + u_int16_t bcdDFUVersion; +} __attribute__ ((packed)); + +#define USB_DT_DFU_SIZE 9 + +#define USB_TYPE_DFU (USB_TYPE_CLASS|USB_RECIP_INTERFACE) + +/* DFU class-specific requests (Section 3, DFU Rev 1.1) */ +#define USB_REQ_DFU_DETACH 0x00 +#define USB_REQ_DFU_DNLOAD 0x01 +#define USB_REQ_DFU_UPLOAD 0x02 +#define USB_REQ_DFU_GETSTATUS 0x03 +#define USB_REQ_DFU_CLRSTATUS 0x04 +#define USB_REQ_DFU_GETSTATE 0x05 +#define USB_REQ_DFU_ABORT 0x06 + +struct dfu_status { + u_int8_t bStatus; + u_int8_t bwPollTimeout[3]; + u_int8_t bState; + u_int8_t iString; +} __attribute__((packed)); + +#define DFU_STATUS_OK 0x00 +#define DFU_STATUS_errTARGET 0x01 +#define DFU_STATUS_errFILE 0x02 +#define DFU_STATUS_errWRITE 0x03 +#define DFU_STATUS_errERASE 0x04 +#define DFU_STATUS_errCHECK_ERASED 0x05 +#define DFU_STATUS_errPROG 0x06 +#define DFU_STATUS_errVERIFY 0x07 +#define DFU_STATUS_errADDRESS 0x08 +#define DFU_STATUS_errNOTDONE 0x09 +#define DFU_STATUS_errFIRMWARE 0x0a +#define DFU_STATUS_errVENDOR 0x0b +#define DFU_STATUS_errUSBR 0x0c +#define DFU_STATUS_errPOR 0x0d +#define DFU_STATUS_errUNKNOWN 0x0e +#define DFU_STATUS_errSTALLEDPKT 0x0f + +enum dfu_state { + DFU_STATE_appIDLE = 0, + DFU_STATE_appDETACH = 1, + DFU_STATE_dfuIDLE = 2, + DFU_STATE_dfuDNLOAD_SYNC = 3, + DFU_STATE_dfuDNBUSY = 4, + DFU_STATE_dfuDNLOAD_IDLE = 5, + DFU_STATE_dfuMANIFEST_SYNC = 6, + DFU_STATE_dfuMANIFEST = 7, + DFU_STATE_dfuMANIFEST_WAIT_RST = 8, + DFU_STATE_dfuUPLOAD_IDLE = 9, + DFU_STATE_dfuERROR = 10, +}; + +#endif /* _USB_DFU_H */ diff --git a/firmware/include/usb_hid.h b/firmware/include/usb_hid.h new file mode 100644 index 0000000..49f5ab8 --- /dev/null +++ b/firmware/include/usb_hid.h @@ -0,0 +1,236 @@ +#ifndef _USB_HID_H +#define _USB_HID_H + +/* + * + * Portions of : + * Copyright (c) 1999 Andreas Gal + * Copyright (c) 2000-2001 Vojtech Pavlik + * Copyright (c) 2006-2007 Jiri Kosina + */ + +/* + * 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 + * + */ + +/* + * USB HID (Human Interface Device) interface class code + */ + +#define USB_INTERFACE_CLASS_HID 3 + +/* + * USB HID interface subclass and protocol codes + */ + +#define USB_INTERFACE_SUBCLASS_BOOT 1 +#define USB_INTERFACE_PROTOCOL_KEYBOARD 1 +#define USB_INTERFACE_PROTOCOL_MOUSE 2 + +/* + * HID class requests + */ + +#define HID_REQ_GET_REPORT 0x01 +#define HID_REQ_GET_IDLE 0x02 +#define HID_REQ_GET_PROTOCOL 0x03 +#define HID_REQ_SET_REPORT 0x09 +#define HID_REQ_SET_IDLE 0x0A +#define HID_REQ_SET_PROTOCOL 0x0B + +/* + * HID class descriptor types + */ + +#define HID_DT_HID (USB_TYPE_CLASS | 0x01) +#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) +#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) + +#define HID_MAX_DESCRIPTOR_SIZE 4096 + +/* + * HID report item format + */ + +#define HID_ITEM_FORMAT_SHORT 0 +#define HID_ITEM_FORMAT_LONG 1 + +/* + * Special tag indicating long items + */ + +#define HID_ITEM_TAG_LONG 15 + +/* + * HID report descriptor item type (prefix bit 2,3) + */ + +#define HID_ITEM_TYPE_MAIN 0 +#define HID_ITEM_TYPE_GLOBAL 1 +#define HID_ITEM_TYPE_LOCAL 2 +#define HID_ITEM_TYPE_RESERVED 3 + +/* + * HID report descriptor main item tags + */ + +#define HID_MAIN_ITEM_TAG_INPUT 8 +#define HID_MAIN_ITEM_TAG_OUTPUT 9 +#define HID_MAIN_ITEM_TAG_FEATURE 11 +#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10 +#define HID_MAIN_ITEM_TAG_END_COLLECTION 12 + +/* + * HID report descriptor main item contents + */ + +#define HID_MAIN_ITEM_CONSTANT 0x001 +#define HID_MAIN_ITEM_VARIABLE 0x002 +#define HID_MAIN_ITEM_RELATIVE 0x004 +#define HID_MAIN_ITEM_WRAP 0x008 +#define HID_MAIN_ITEM_NONLINEAR 0x010 +#define HID_MAIN_ITEM_NO_PREFERRED 0x020 +#define HID_MAIN_ITEM_NULL_STATE 0x040 +#define HID_MAIN_ITEM_VOLATILE 0x080 +#define HID_MAIN_ITEM_BUFFERED_BYTE 0x100 + +/* + * HID report descriptor collection item types + */ + +#define HID_COLLECTION_PHYSICAL 0 +#define HID_COLLECTION_APPLICATION 1 +#define HID_COLLECTION_LOGICAL 2 + +/* + * HID report descriptor global item tags + */ + +#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0 +#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1 +#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2 +#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3 +#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4 +#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5 +#define HID_GLOBAL_ITEM_TAG_UNIT 6 +#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7 +#define HID_GLOBAL_ITEM_TAG_REPORT_ID 8 +#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9 +#define HID_GLOBAL_ITEM_TAG_PUSH 10 +#define HID_GLOBAL_ITEM_TAG_POP 11 + +/* + * HID report descriptor local item tags + */ + +#define HID_LOCAL_ITEM_TAG_USAGE 0 +#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1 +#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2 +#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3 +#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4 +#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5 +#define HID_LOCAL_ITEM_TAG_STRING_INDEX 7 +#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8 +#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9 +#define HID_LOCAL_ITEM_TAG_DELIMITER 10 + +/* + * HID usage tables + */ + +#define HID_USAGE_PAGE 0xffff0000 + +#define HID_UP_UNDEFINED 0x00000000 +#define HID_UP_GENDESK 0x00010000 +#define HID_UP_SIMULATION 0x00020000 +#define HID_UP_KEYBOARD 0x00070000 +#define HID_UP_LED 0x00080000 +#define HID_UP_BUTTON 0x00090000 +#define HID_UP_ORDINAL 0x000a0000 +#define HID_UP_CONSUMER 0x000c0000 +#define HID_UP_DIGITIZER 0x000d0000 +#define HID_UP_PID 0x000f0000 +#define HID_UP_HPVENDOR 0xff7f0000 +#define HID_UP_MSVENDOR 0xff000000 +#define HID_UP_CUSTOM 0x00ff0000 +#define HID_UP_LOGIVENDOR 0xffbc0000 + +#define HID_USAGE 0x0000ffff + +#define HID_GD_POINTER 0x00010001 +#define HID_GD_MOUSE 0x00010002 +#define HID_GD_JOYSTICK 0x00010004 +#define HID_GD_GAMEPAD 0x00010005 +#define HID_GD_KEYBOARD 0x00010006 +#define HID_GD_KEYPAD 0x00010007 +#define HID_GD_MULTIAXIS 0x00010008 +#define HID_GD_X 0x00010030 +#define HID_GD_Y 0x00010031 +#define HID_GD_Z 0x00010032 +#define HID_GD_RX 0x00010033 +#define HID_GD_RY 0x00010034 +#define HID_GD_RZ 0x00010035 +#define HID_GD_SLIDER 0x00010036 +#define HID_GD_DIAL 0x00010037 +#define HID_GD_WHEEL 0x00010038 +#define HID_GD_HATSWITCH 0x00010039 +#define HID_GD_BUFFER 0x0001003a +#define HID_GD_BYTECOUNT 0x0001003b +#define HID_GD_MOTION 0x0001003c +#define HID_GD_START 0x0001003d +#define HID_GD_SELECT 0x0001003e +#define HID_GD_VX 0x00010040 +#define HID_GD_VY 0x00010041 +#define HID_GD_VZ 0x00010042 +#define HID_GD_VBRX 0x00010043 +#define HID_GD_VBRY 0x00010044 +#define HID_GD_VBRZ 0x00010045 +#define HID_GD_VNO 0x00010046 +#define HID_GD_FEATURE 0x00010047 +#define HID_GD_UP 0x00010090 +#define HID_GD_DOWN 0x00010091 +#define HID_GD_RIGHT 0x00010092 +#define HID_GD_LEFT 0x00010093 + +/* + * HID report types --- Ouch! HID spec says 1 2 3! + */ + +#define HID_INPUT_REPORT 0 +#define HID_OUTPUT_REPORT 1 +#define HID_FEATURE_REPORT 2 + +struct usb_hid_class_descriptor { + u_int8_t bDescriptorType; + u_int16_t wDescriptorLength; +} __attribute__ ((packed)); + +struct usb_hid_descriptor { + u_int8_t bLength; + u_int8_t bDescriptorType; + u_int16_t bcdHID; + u_int8_t bCountryCode; + u_int8_t bNumDescriptors; + + struct hid_class_descriptor desc[1]; +} __attribute__ ((packed)); + +/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ +/* We ignore a few input applications that are not widely used */ +#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) + +#endif + diff --git a/firmware/lib/bitops.h b/firmware/lib/bitops.h new file mode 100644 index 0000000..428c9a6 --- /dev/null +++ b/firmware/lib/bitops.h @@ -0,0 +1,33 @@ + .macro bitop, instr + and r2, r0, #7 + mov r3, #1 + mov r3, r3, lsl r2 + save_and_disable_irqs ip + ldrb r2, [r1, r0, lsr #3] + \instr r2, r2, r3 + strb r2, [r1, r0, lsr #3] + restore_irqs ip + mov pc, lr + .endm + +/** + * testop - implement a test_and_xxx_bit operation. + * @instr: operational instruction + * @store: store instruction + * + * Note: we can trivially conditionalise the store instruction + * to avoid dirting the data cache. + */ + .macro testop, instr, store + add r1, r1, r0, lsr #3 + and r3, r0, #7 + mov r0, #1 + save_and_disable_irqs ip + ldrb r2, [r1] + tst r2, r0, lsl r3 + \instr r2, r2, r0, lsl r3 + \store r2, [r1] + restore_irqs ip + moveq r0, #0 + mov pc, lr + .endm diff --git a/firmware/lib/changebit.S b/firmware/lib/changebit.S new file mode 100644 index 0000000..7c709fb --- /dev/null +++ b/firmware/lib/changebit.S @@ -0,0 +1,21 @@ +/* + * linux/arch/arm/lib/changebit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* Purpose : Function to change a bit + * Prototype: int change_bit(int bit, void *addr) + */ +ENTRY(_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_change_bit_le) + bitop eor diff --git a/firmware/lib/changebit.lst b/firmware/lib/changebit.lst new file mode 100644 index 0000000..bae325c --- /dev/null +++ b/firmware/lib/changebit.lst @@ -0,0 +1,169 @@ + 1 # 1 "lib/changebit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/changebit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 /* Purpose : Function to change a bit + 16 * Prototype: int change_bit(int bit, void *addr) + 17 */ + 18 ENTRY(_change_bit_be) + 19 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 20 ENTRY(_change_bit_le) + 21 0004 072000E2 bitop eor + 21 0130A0E3 + 21 1332A0E1 + 21 00C00FE1 + 21 93F021E3 +DEFINED SYMBOLS + lib/changebit.S:18 .text:00000000 _change_bit_be + lib/changebit.S:18 .text:00000000 $a + lib/changebit.S:20 .text:00000004 _change_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/clearbit.S b/firmware/lib/clearbit.S new file mode 100644 index 0000000..cb48f7a --- /dev/null +++ b/firmware/lib/clearbit.S @@ -0,0 +1,22 @@ +/* + * linux/arch/arm/lib/clearbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* + * Purpose : Function to clear a bit + * Prototype: int clear_bit(int bit, void *addr) + */ +ENTRY(_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_clear_bit_le) + bitop bic diff --git a/firmware/lib/clearbit.lst b/firmware/lib/clearbit.lst new file mode 100644 index 0000000..dc9bfe6 --- /dev/null +++ b/firmware/lib/clearbit.lst @@ -0,0 +1,170 @@ + 1 # 1 "lib/clearbit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/clearbit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 /* + 16 * Purpose : Function to clear a bit + 17 * Prototype: int clear_bit(int bit, void *addr) + 18 */ + 19 ENTRY(_clear_bit_be) + 20 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 21 ENTRY(_clear_bit_le) + 22 0004 072000E2 bitop bic + 22 0130A0E3 + 22 1332A0E1 + 22 00C00FE1 + 22 93F021E3 +DEFINED SYMBOLS + lib/clearbit.S:19 .text:00000000 _clear_bit_be + lib/clearbit.S:19 .text:00000000 $a + lib/clearbit.S:21 .text:00000004 _clear_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/copy_template.S b/firmware/lib/copy_template.S new file mode 100644 index 0000000..cab355c --- /dev/null +++ b/firmware/lib/copy_template.S @@ -0,0 +1,255 @@ +/* + * linux/arch/arm/lib/copy_template.s + * + * Code template for optimized memory copy functions + * + * Author: Nicolas Pitre + * Created: Sep 28, 2005 + * Copyright: MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * This can be used to enable code to cacheline align the source pointer. + * Experiments on tested architectures (StrongARM and XScale) didn't show + * this a worthwhile thing to do. That might be different in the future. + */ +//#define CALGN(code...) code +#define CALGN(code...) + +/* + * Theory of operation + * ------------------- + * + * This file provides the core code for a forward memory copy used in + * the implementation of memcopy(), copy_to_user() and copy_from_user(). + * + * The including file must define the following accessor macros + * according to the need of the given function: + * + * ldr1w ptr reg abort + * + * This loads one word from 'ptr', stores it in 'reg' and increments + * 'ptr' to the next word. The 'abort' argument is used for fixup tables. + * + * ldr4w ptr reg1 reg2 reg3 reg4 abort + * ldr8w ptr, reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort + * + * This loads four or eight words starting from 'ptr', stores them + * in provided registers and increments 'ptr' past those words. + * The'abort' argument is used for fixup tables. + * + * ldr1b ptr reg cond abort + * + * Similar to ldr1w, but it loads a byte and increments 'ptr' one byte. + * It also must apply the condition code if provided, otherwise the + * "al" condition is assumed by default. + * + * str1w ptr reg abort + * str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort + * str1b ptr reg cond abort + * + * Same as their ldr* counterparts, but data is stored to 'ptr' location + * rather than being loaded. + * + * enter reg1 reg2 + * + * Preserve the provided registers on the stack plus any additional + * data as needed by the implementation including this code. Called + * upon code entry. + * + * exit reg1 reg2 + * + * Restore registers with the values previously saved with the + * 'preserv' macro. Called upon code termination. + */ + + + enter r4, lr + + subs r2, r2, #4 + blt 8f + ands ip, r0, #3 + PLD( pld [r1, #0] ) + bne 9f + ands ip, r1, #3 + bne 10f + +1: subs r2, r2, #(28) + stmfd sp!, {r5 - r8} + blt 5f + + CALGN( ands ip, r1, #31 ) + CALGN( rsb r3, ip, #32 ) + CALGN( sbcnes r4, r3, r2 ) @ C is always set here + CALGN( bcs 2f ) + CALGN( adr r4, 6f ) + CALGN( subs r2, r2, r3 ) @ C gets set + CALGN( add pc, r4, ip ) + + PLD( pld [r1, #0] ) +2: PLD( subs r2, r2, #96 ) + PLD( pld [r1, #28] ) + PLD( blt 4f ) + PLD( pld [r1, #60] ) + PLD( pld [r1, #92] ) + +3: PLD( pld [r1, #124] ) +4: ldr8w r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f + subs r2, r2, #32 + str8w r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f + bge 3b + PLD( cmn r2, #96 ) + PLD( bge 4b ) + +5: ands ip, r2, #28 + rsb ip, ip, #32 + addne pc, pc, ip @ C is always clear here + b 7f +6: nop + ldr1w r1, r3, abort=20f + ldr1w r1, r4, abort=20f + ldr1w r1, r5, abort=20f + ldr1w r1, r6, abort=20f + ldr1w r1, r7, abort=20f + ldr1w r1, r8, abort=20f + ldr1w r1, lr, abort=20f + + add pc, pc, ip + nop + nop + str1w r0, r3, abort=20f + str1w r0, r4, abort=20f + str1w r0, r5, abort=20f + str1w r0, r6, abort=20f + str1w r0, r7, abort=20f + str1w r0, r8, abort=20f + str1w r0, lr, abort=20f + + CALGN( bcs 2b ) + +7: ldmfd sp!, {r5 - r8} + +8: movs r2, r2, lsl #31 + ldr1b r1, r3, ne, abort=21f + ldr1b r1, r4, cs, abort=21f + ldr1b r1, ip, cs, abort=21f + str1b r0, r3, ne, abort=21f + str1b r0, r4, cs, abort=21f + str1b r0, ip, cs, abort=21f + + exit r4, pc + +9: rsb ip, ip, #4 + cmp ip, #2 + ldr1b r1, r3, gt, abort=21f + ldr1b r1, r4, ge, abort=21f + ldr1b r1, lr, abort=21f + str1b r0, r3, gt, abort=21f + str1b r0, r4, ge, abort=21f + subs r2, r2, ip + str1b r0, lr, abort=21f + blt 8b + ands ip, r1, #3 + beq 1b + +10: bic r1, r1, #3 + cmp ip, #2 + ldr1w r1, lr, abort=21f + beq 17f + bgt 18f + + + .macro forward_copy_shift pull push + + subs r2, r2, #28 + blt 14f + + CALGN( ands ip, r1, #31 ) + CALGN( rsb ip, ip, #32 ) + CALGN( sbcnes r4, ip, r2 ) @ C is always set here + CALGN( subcc r2, r2, ip ) + CALGN( bcc 15f ) + +11: stmfd sp!, {r5 - r9} + + PLD( pld [r1, #0] ) + PLD( subs r2, r2, #96 ) + PLD( pld [r1, #28] ) + PLD( blt 13f ) + PLD( pld [r1, #60] ) + PLD( pld [r1, #92] ) + +12: PLD( pld [r1, #124] ) +13: ldr4w r1, r4, r5, r6, r7, abort=19f + mov r3, lr, pull #\pull + subs r2, r2, #32 + ldr4w r1, r8, r9, ip, lr, abort=19f + orr r3, r3, r4, push #\push + mov r4, r4, pull #\pull + orr r4, r4, r5, push #\push + mov r5, r5, pull #\pull + orr r5, r5, r6, push #\push + mov r6, r6, pull #\pull + orr r6, r6, r7, push #\push + mov r7, r7, pull #\pull + orr r7, r7, r8, push #\push + mov r8, r8, pull #\pull + orr r8, r8, r9, push #\push + mov r9, r9, pull #\pull + orr r9, r9, ip, push #\push + mov ip, ip, pull #\pull + orr ip, ip, lr, push #\push + str8w r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f + bge 12b + PLD( cmn r2, #96 ) + PLD( bge 13b ) + + ldmfd sp!, {r5 - r9} + +14: ands ip, r2, #28 + beq 16f + +15: mov r3, lr, pull #\pull + ldr1w r1, lr, abort=21f + subs ip, ip, #4 + orr r3, r3, lr, push #\push + str1w r0, r3, abort=21f + bgt 15b + CALGN( cmp r2, #0 ) + CALGN( bge 11b ) + +16: sub r1, r1, #(\push / 8) + b 8b + + .endm + + + forward_copy_shift pull=8 push=24 + +17: forward_copy_shift pull=16 push=16 + +18: forward_copy_shift pull=24 push=8 + + +/* + * Abort preamble and completion macros. + * If a fixup handler is required then those macros must surround it. + * It is assumed that the fixup code will handle the private part of + * the exit macro. + */ + + .macro copy_abort_preamble +19: ldmfd sp!, {r5 - r9} + b 21f +20: ldmfd sp!, {r5 - r8} +21: + .endm + + .macro copy_abort_end + ldmfd sp!, {r4, pc} + .endm + diff --git a/firmware/lib/ctype.c b/firmware/lib/ctype.c new file mode 100644 index 0000000..6ec51cc --- /dev/null +++ b/firmware/lib/ctype.c @@ -0,0 +1,34 @@ +/* + * linux/lib/ctype.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#include + +unsigned char _ctype[] = { +_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ +_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ +_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ +_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */ +_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */ +_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */ +_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */ +_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */ +_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */ +_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */ +_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */ +_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */ +_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */ +_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */ +_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */ +_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */ +_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */ +_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */ +_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ +_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */ +_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ +_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ + diff --git a/firmware/lib/ctype.lst b/firmware/lib/ctype.lst new file mode 100644 index 0000000..1c7d72e --- /dev/null +++ b/firmware/lib/ctype.lst @@ -0,0 +1,281 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "ctype.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .global _ctype + 22 .data + 25 _ctype: + 26 0000 08 .byte 8 + 27 0001 08 .byte 8 + 28 0002 08 .byte 8 + 29 0003 08 .byte 8 + 30 0004 08 .byte 8 + 31 0005 08 .byte 8 + 32 0006 08 .byte 8 + 33 0007 08 .byte 8 + 34 0008 08 .byte 8 + 35 0009 28 .byte 40 + 36 000a 28 .byte 40 + 37 000b 28 .byte 40 + 38 000c 28 .byte 40 + 39 000d 28 .byte 40 + 40 000e 08 .byte 8 + 41 000f 08 .byte 8 + 42 0010 08 .byte 8 + 43 0011 08 .byte 8 + 44 0012 08 .byte 8 + 45 0013 08 .byte 8 + 46 0014 08 .byte 8 + 47 0015 08 .byte 8 + 48 0016 08 .byte 8 + 49 0017 08 .byte 8 + 50 0018 08 .byte 8 + 51 0019 08 .byte 8 + 52 001a 08 .byte 8 + 53 001b 08 .byte 8 + 54 001c 08 .byte 8 + 55 001d 08 .byte 8 + 56 001e 08 .byte 8 + 57 001f 08 .byte 8 + 58 0020 A0 .byte -96 + 59 0021 10 .byte 16 + 60 0022 10 .byte 16 + 61 0023 10 .byte 16 + 62 0024 10 .byte 16 + 63 0025 10 .byte 16 + 64 0026 10 .byte 16 + 65 0027 10 .byte 16 + 66 0028 10 .byte 16 + 67 0029 10 .byte 16 + 68 002a 10 .byte 16 + 69 002b 10 .byte 16 + 70 002c 10 .byte 16 + 71 002d 10 .byte 16 + 72 002e 10 .byte 16 + 73 002f 10 .byte 16 + 74 0030 04 .byte 4 + 75 0031 04 .byte 4 + 76 0032 04 .byte 4 + 77 0033 04 .byte 4 + 78 0034 04 .byte 4 + 79 0035 04 .byte 4 + 80 0036 04 .byte 4 + 81 0037 04 .byte 4 + 82 0038 04 .byte 4 + 83 0039 04 .byte 4 + 84 003a 10 .byte 16 + 85 003b 10 .byte 16 + 86 003c 10 .byte 16 + 87 003d 10 .byte 16 + 88 003e 10 .byte 16 + 89 003f 10 .byte 16 + 90 0040 10 .byte 16 + 91 0041 41 .byte 65 + 92 0042 41 .byte 65 + 93 0043 41 .byte 65 + 94 0044 41 .byte 65 + 95 0045 41 .byte 65 + 96 0046 41 .byte 65 + 97 0047 01 .byte 1 + 98 0048 01 .byte 1 + 99 0049 01 .byte 1 + 100 004a 01 .byte 1 + 101 004b 01 .byte 1 + 102 004c 01 .byte 1 + 103 004d 01 .byte 1 + 104 004e 01 .byte 1 + 105 004f 01 .byte 1 + 106 0050 01 .byte 1 + 107 0051 01 .byte 1 + 108 0052 01 .byte 1 + 109 0053 01 .byte 1 + 110 0054 01 .byte 1 + 111 0055 01 .byte 1 + 112 0056 01 .byte 1 + 113 0057 01 .byte 1 + 114 0058 01 .byte 1 + 115 0059 01 .byte 1 + 116 005a 01 .byte 1 + 117 005b 10 .byte 16 + 118 005c 10 .byte 16 + 119 005d 10 .byte 16 + 120 005e 10 .byte 16 + 121 005f 10 .byte 16 + 122 0060 10 .byte 16 + 123 0061 42 .byte 66 + 124 0062 42 .byte 66 + 125 0063 42 .byte 66 + 126 0064 42 .byte 66 + 127 0065 42 .byte 66 + 128 0066 42 .byte 66 + 129 0067 02 .byte 2 + 130 0068 02 .byte 2 + 131 0069 02 .byte 2 + 132 006a 02 .byte 2 + 133 006b 02 .byte 2 + 134 006c 02 .byte 2 + 135 006d 02 .byte 2 + 136 006e 02 .byte 2 + 137 006f 02 .byte 2 + 138 0070 02 .byte 2 + 139 0071 02 .byte 2 + 140 0072 02 .byte 2 + 141 0073 02 .byte 2 + 142 0074 02 .byte 2 + 143 0075 02 .byte 2 + 144 0076 02 .byte 2 + 145 0077 02 .byte 2 + 146 0078 02 .byte 2 + 147 0079 02 .byte 2 + 148 007a 02 .byte 2 + 149 007b 10 .byte 16 + 150 007c 10 .byte 16 + 151 007d 10 .byte 16 + 152 007e 10 .byte 16 + 153 007f 08 .byte 8 + 154 0080 00 .byte 0 + 155 0081 00 .byte 0 + 156 0082 00 .byte 0 + 157 0083 00 .byte 0 + 158 0084 00 .byte 0 + 159 0085 00 .byte 0 + 160 0086 00 .byte 0 + 161 0087 00 .byte 0 + 162 0088 00 .byte 0 + 163 0089 00 .byte 0 + 164 008a 00 .byte 0 + 165 008b 00 .byte 0 + 166 008c 00 .byte 0 + 167 008d 00 .byte 0 + 168 008e 00 .byte 0 + 169 008f 00 .byte 0 + 170 0090 00 .byte 0 + 171 0091 00 .byte 0 + 172 0092 00 .byte 0 + 173 0093 00 .byte 0 + 174 0094 00 .byte 0 + 175 0095 00 .byte 0 + 176 0096 00 .byte 0 + 177 0097 00 .byte 0 + 178 0098 00 .byte 0 + 179 0099 00 .byte 0 + 180 009a 00 .byte 0 + 181 009b 00 .byte 0 + 182 009c 00 .byte 0 + 183 009d 00 .byte 0 + 184 009e 00 .byte 0 + 185 009f 00 .byte 0 + 186 00a0 A0 .byte -96 + 187 00a1 10 .byte 16 + 188 00a2 10 .byte 16 + 189 00a3 10 .byte 16 + 190 00a4 10 .byte 16 + 191 00a5 10 .byte 16 + 192 00a6 10 .byte 16 + 193 00a7 10 .byte 16 + 194 00a8 10 .byte 16 + 195 00a9 10 .byte 16 + 196 00aa 10 .byte 16 + 197 00ab 10 .byte 16 + 198 00ac 10 .byte 16 + 199 00ad 10 .byte 16 + 200 00ae 10 .byte 16 + 201 00af 10 .byte 16 + 202 00b0 10 .byte 16 + 203 00b1 10 .byte 16 + 204 00b2 10 .byte 16 + 205 00b3 10 .byte 16 + 206 00b4 10 .byte 16 + 207 00b5 10 .byte 16 + 208 00b6 10 .byte 16 + 209 00b7 10 .byte 16 + 210 00b8 10 .byte 16 + 211 00b9 10 .byte 16 + 212 00ba 10 .byte 16 + 213 00bb 10 .byte 16 + 214 00bc 10 .byte 16 + 215 00bd 10 .byte 16 + 216 00be 10 .byte 16 + 217 00bf 10 .byte 16 + 218 00c0 01 .byte 1 + 219 00c1 01 .byte 1 + 220 00c2 01 .byte 1 + 221 00c3 01 .byte 1 + 222 00c4 01 .byte 1 + 223 00c5 01 .byte 1 + 224 00c6 01 .byte 1 + 225 00c7 01 .byte 1 + 226 00c8 01 .byte 1 + 227 00c9 01 .byte 1 + 228 00ca 01 .byte 1 + 229 00cb 01 .byte 1 + 230 00cc 01 .byte 1 + 231 00cd 01 .byte 1 + 232 00ce 01 .byte 1 + 233 00cf 01 .byte 1 + 234 00d0 01 .byte 1 + 235 00d1 01 .byte 1 + 236 00d2 01 .byte 1 + 237 00d3 01 .byte 1 + 238 00d4 01 .byte 1 + 239 00d5 01 .byte 1 + 240 00d6 01 .byte 1 + 241 00d7 10 .byte 16 + 242 00d8 01 .byte 1 + 243 00d9 01 .byte 1 + 244 00da 01 .byte 1 + 245 00db 01 .byte 1 + 246 00dc 01 .byte 1 + 247 00dd 01 .byte 1 + 248 00de 01 .byte 1 + 249 00df 02 .byte 2 + 250 00e0 02 .byte 2 + 251 00e1 02 .byte 2 + 252 00e2 02 .byte 2 + 253 00e3 02 .byte 2 + 254 00e4 02 .byte 2 + 255 00e5 02 .byte 2 + 256 00e6 02 .byte 2 + 257 00e7 02 .byte 2 + 258 00e8 02 .byte 2 + 259 00e9 02 .byte 2 + 260 00ea 02 .byte 2 + 261 00eb 02 .byte 2 + 262 00ec 02 .byte 2 + 263 00ed 02 .byte 2 + 264 00ee 02 .byte 2 + 265 00ef 02 .byte 2 + 266 00f0 02 .byte 2 + 267 00f1 02 .byte 2 + 268 00f2 02 .byte 2 + 269 00f3 02 .byte 2 + 270 00f4 02 .byte 2 + 271 00f5 02 .byte 2 + 272 00f6 02 .byte 2 + 273 00f7 10 .byte 16 + 274 00f8 02 .byte 2 + 275 00f9 02 .byte 2 + 276 00fa 02 .byte 2 + 277 00fb 02 .byte 2 + 278 00fc 02 .byte 2 + 279 00fd 02 .byte 2 + 280 00fe 02 .byte 2 + 281 00ff 02 .byte 2 + 282 .text + 283 .Letext0: + 284 .file 1 "include/asm/ctype.h" + 285 .file 2 "lib/ctype.c" +DEFINED SYMBOLS + *ABS*:00000000 ctype.c +C:\Users\netz\AppData\Local\Temp\cc1cqvvg.s:25 .data:00000000 _ctype + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/div64.S b/firmware/lib/div64.S new file mode 100644 index 0000000..7eeef50 --- /dev/null +++ b/firmware/lib/div64.S @@ -0,0 +1,200 @@ +/* + * linux/arch/arm/lib/div64.S + * + * Optimized computation of 64-bit dividend / 32-bit divisor + * + * Author: Nicolas Pitre + * Created: Oct 5, 2003 + * Copyright: Monta Vista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + +#ifdef __ARMEB__ +#define xh r0 +#define xl r1 +#define yh r2 +#define yl r3 +#else +#define xl r0 +#define xh r1 +#define yl r2 +#define yh r3 +#endif + +/* + * __do_div64: perform a division with 64-bit dividend and 32-bit divisor. + * + * Note: Calling convention is totally non standard for optimal code. + * This is meant to be used by do_div() from include/asm/div64.h only. + * + * Input parameters: + * xh-xl = dividend (clobbered) + * r4 = divisor (preserved) + * + * Output values: + * yh-yl = result + * xh = remainder + * + * Clobbered regs: xl, ip + */ + +ENTRY(__do_div64) + + @ Test for easy paths first. + subs ip, r4, #1 + bls 9f @ divisor is 0 or 1 + tst ip, r4 + beq 8f @ divisor is power of 2 + + @ See if we need to handle upper 32-bit result. + cmp xh, r4 + mov yh, #0 + blo 3f + + @ Align divisor with upper part of dividend. + @ The aligned divisor is stored in yl preserving the original. + @ The bit position is stored in ip. + +#if __LINUX_ARM_ARCH__ >= 5 + + clz yl, r4 + clz ip, xh + sub yl, yl, ip + mov ip, #1 + mov ip, ip, lsl yl + mov yl, r4, lsl yl + +#else + + mov yl, r4 + mov ip, #1 +1: cmp yl, #0x80000000 + cmpcc yl, xh + movcc yl, yl, lsl #1 + movcc ip, ip, lsl #1 + bcc 1b + +#endif + + @ The division loop for needed upper bit positions. + @ Break out early if dividend reaches 0. +2: cmp xh, yl + orrcs yh, yh, ip + subcss xh, xh, yl + movnes ip, ip, lsr #1 + mov yl, yl, lsr #1 + bne 2b + + @ See if we need to handle lower 32-bit result. +3: cmp xh, #0 + mov yl, #0 + cmpeq xl, r4 + movlo xh, xl + movlo pc, lr + + @ The division loop for lower bit positions. + @ Here we shift remainer bits leftwards rather than moving the + @ divisor for comparisons, considering the carry-out bit as well. + mov ip, #0x80000000 +4: movs xl, xl, lsl #1 + adcs xh, xh, xh + beq 6f + cmpcc xh, r4 +5: orrcs yl, yl, ip + subcs xh, xh, r4 + movs ip, ip, lsr #1 + bne 4b + mov pc, lr + + @ The top part of remainder became zero. If carry is set + @ (the 33th bit) this is a false positive so resume the loop. + @ Otherwise, if lower part is also null then we are done. +6: bcs 5b + cmp xl, #0 + moveq pc, lr + + @ We still have remainer bits in the low part. Bring them up. + +#if __LINUX_ARM_ARCH__ >= 5 + + clz xh, xl @ we know xh is zero here so... + add xh, xh, #1 + mov xl, xl, lsl xh + mov ip, ip, lsr xh + +#else + +7: movs xl, xl, lsl #1 + mov ip, ip, lsr #1 + bcc 7b + +#endif + + @ Current remainder is now 1. It is worthless to compare with + @ divisor at this point since divisor can not be smaller than 3 here. + @ If possible, branch for another shift in the division loop. + @ If no bit position left then we are done. + movs ip, ip, lsr #1 + mov xh, #1 + bne 4b + mov pc, lr + +8: @ Division by a power of 2: determine what that divisor order is + @ then simply shift values around + +#if __LINUX_ARM_ARCH__ >= 5 + + clz ip, r4 + rsb ip, ip, #31 + +#else + + mov yl, r4 + cmp r4, #(1 << 16) + mov ip, #0 + movhs yl, yl, lsr #16 + movhs ip, #16 + + cmp yl, #(1 << 8) + movhs yl, yl, lsr #8 + addhs ip, ip, #8 + + cmp yl, #(1 << 4) + movhs yl, yl, lsr #4 + addhs ip, ip, #4 + + cmp yl, #(1 << 2) + addhi ip, ip, #3 + addls ip, ip, yl, lsr #1 + +#endif + + mov yh, xh, lsr ip + mov yl, xl, lsr ip + rsb ip, ip, #32 + orr yl, yl, xh, lsl ip + mov xh, xl, lsl ip + mov xh, xh, lsr ip + mov pc, lr + + @ eq -> division by 1: obvious enough... +9: moveq yl, xl + moveq yh, xh + moveq xh, #0 + moveq pc, lr + + @ Division by 0: + str lr, [sp, #-8]! + bl __div0 + + @ as wrong as it could be... + mov yl, #0 + mov yh, #0 + mov xh, #0 + ldr pc, [sp], #8 + diff --git a/firmware/lib/div64.lst b/firmware/lib/div64.lst new file mode 100644 index 0000000..00de99e --- /dev/null +++ b/firmware/lib/div64.lst @@ -0,0 +1,210 @@ + 1 # 1 "lib/div64.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/div64.S + 3 * + 4 * Optimized computation of 64-bit dividend / 32-bit divisor + 5 * + 6 * Author: Nicolas Pitre + 7 * Created: Oct 5, 2003 + 8 * Copyright: Monta Vista Software, Inc. + 9 * + 10 * This program is free software; you can redistribute it and/or modify + 11 * it under the terms of the GNU General Public License version 2 as + 12 * published by the Free Software Foundation. + 13 */ + 14 + 15 #include + 1 #ifndef __ASM_LINKAGE_H + 16 + 17 #ifdef __ARMEB__ + 18 #define xh r0 + 19 #define xl r1 + 20 #define yh r2 + 21 #define yl r3 + 22 #else + 23 #define xl r0 + 24 #define xh r1 + 25 #define yl r2 + 26 #define yh r3 + 27 #endif + 28 + 29 /* + 30 * __do_div64: perform a division with 64-bit dividend and 32-bit divisor. + 31 * + 32 * Note: Calling convention is totally non standard for optimal code. + 33 * This is meant to be used by do_div() from include/asm/div64.h only. + 34 * + 35 * Input parameters: + 36 * xh-xl = dividend (clobbered) + 37 * r4 = divisor (preserved) + 38 * + 39 * Output values: + 40 * yh-yl = result + 41 * xh = remainder + 42 * + 43 * Clobbered regs: xl, ip + 44 */ + 45 + 46 ENTRY(__do_div64) + 47 + 48 @ Test for easy paths first. + 49 0000 01C054E2 subs ip, r4, #1 + 50 0004 3F00009A bls 9f @ divisor is 0 or 1 + 51 0008 04001CE1 tst ip, r4 + 52 000c 2800000A beq 8f @ divisor is power of 2 + 53 + 54 @ See if we need to handle upper 32-bit result. + 55 0010 040051E1 cmp xh, r4 + 56 0014 0030A0E3 mov yh, #0 + 57 0018 0C00003A blo 3f + 58 + 59 @ Align divisor with upper part of dividend. + 60 @ The aligned divisor is stored in yl preserving the original. + 61 @ The bit position is stored in ip. + 62 + 63 #if __LINUX_ARM_ARCH__ >= 5 + 64 + 65 clz yl, r4 + 66 clz ip, xh + 67 sub yl, yl, ip + 68 mov ip, #1 + 69 mov ip, ip, lsl yl + 70 mov yl, r4, lsl yl + 71 + 72 #else + 73 + 74 001c 0420A0E1 mov yl, r4 + 75 0020 01C0A0E3 mov ip, #1 + 76 0024 020152E3 1: cmp yl, #0x80000000 + 77 0028 01005231 cmpcc yl, xh + 78 002c 8220A031 movcc yl, yl, lsl #1 + 79 0030 8CC0A031 movcc ip, ip, lsl #1 + 80 0034 FAFFFF3A bcc 1b + 81 + 82 #endif + 83 + 84 @ The division loop for needed upper bit positions. + 85 @ Break out early if dividend reaches 0. + 86 0038 020051E1 2: cmp xh, yl + 87 003c 0C308321 orrcs yh, yh, ip + 88 0040 02105120 subcss xh, xh, yl + 89 0044 ACC0B011 movnes ip, ip, lsr #1 + 90 0048 A220A0E1 mov yl, yl, lsr #1 + 91 004c F9FFFF1A bne 2b + 92 + 93 @ See if we need to handle lower 32-bit result. + 94 0050 000051E3 3: cmp xh, #0 + 95 0054 0020A0E3 mov yl, #0 + 96 0058 04005001 cmpeq xl, r4 + 97 005c 0010A031 movlo xh, xl + 98 0060 0EF0A031 movlo pc, lr + 99 + 100 @ The division loop for lower bit positions. + 101 @ Here we shift remainer bits leftwards rather than moving the + 102 @ divisor for comparisons, considering the carry-out bit as well. + 103 0064 02C1A0E3 mov ip, #0x80000000 + 104 0068 8000B0E1 4: movs xl, xl, lsl #1 + 105 006c 0110B1E0 adcs xh, xh, xh + 106 0070 0500000A beq 6f + 107 0074 04005131 cmpcc xh, r4 + 108 0078 0C208221 5: orrcs yl, yl, ip + 109 007c 04104120 subcs xh, xh, r4 + 110 0080 ACC0B0E1 movs ip, ip, lsr #1 + 111 0084 F7FFFF1A bne 4b + 112 0088 0EF0A0E1 mov pc, lr + 113 + 114 @ The top part of remainder became zero. If carry is set + 115 @ (the 33th bit) this is a false positive so resume the loop. + 116 @ Otherwise, if lower part is also null then we are done. + 117 008c F9FFFF2A 6: bcs 5b + 118 0090 000050E3 cmp xl, #0 + 119 0094 0EF0A001 moveq pc, lr + 120 + 121 @ We still have remainer bits in the low part. Bring them up. + 122 + 123 #if __LINUX_ARM_ARCH__ >= 5 + 124 + 125 clz xh, xl @ we know xh is zero here so... + 126 add xh, xh, #1 + 127 mov xl, xl, lsl xh + 128 mov ip, ip, lsr xh + 129 + 130 #else + 131 + 132 0098 8000B0E1 7: movs xl, xl, lsl #1 + 133 009c ACC0A0E1 mov ip, ip, lsr #1 + 134 00a0 FCFFFF3A bcc 7b + 135 + 136 #endif + 137 + 138 @ Current remainder is now 1. It is worthless to compare with + 139 @ divisor at this point since divisor can not be smaller than 3 here. + 140 @ If possible, branch for another shift in the division loop. + 141 @ If no bit position left then we are done. + 142 00a4 ACC0B0E1 movs ip, ip, lsr #1 + 143 00a8 0110A0E3 mov xh, #1 + 144 00ac EDFFFF1A bne 4b + 145 00b0 0EF0A0E1 mov pc, lr + 146 + 147 8: @ Division by a power of 2: determine what that divisor order is + 148 @ then simply shift values around + 149 + 150 #if __LINUX_ARM_ARCH__ >= 5 + 151 + 152 clz ip, r4 + 153 rsb ip, ip, #31 + 154 + 155 #else + 156 + 157 00b4 0420A0E1 mov yl, r4 + 158 00b8 010854E3 cmp r4, #(1 << 16) + 159 00bc 00C0A0E3 mov ip, #0 + 160 00c0 2228A021 movhs yl, yl, lsr #16 + 161 00c4 10C0A023 movhs ip, #16 + 162 + 163 00c8 010C52E3 cmp yl, #(1 << 8) + 164 00cc 2224A021 movhs yl, yl, lsr #8 + 165 00d0 08C08C22 addhs ip, ip, #8 + 166 + 167 00d4 100052E3 cmp yl, #(1 << 4) + 168 00d8 2222A021 movhs yl, yl, lsr #4 + 169 00dc 04C08C22 addhs ip, ip, #4 + 170 + 171 00e0 040052E3 cmp yl, #(1 << 2) + 172 00e4 03C08C82 addhi ip, ip, #3 + 173 00e8 A2C08C90 addls ip, ip, yl, lsr #1 + 174 + 175 #endif + 176 + 177 00ec 313CA0E1 mov yh, xh, lsr ip + 178 00f0 302CA0E1 mov yl, xl, lsr ip + 179 00f4 20C06CE2 rsb ip, ip, #32 + 180 00f8 112C82E1 orr yl, yl, xh, lsl ip + 181 00fc 101CA0E1 mov xh, xl, lsl ip + 182 0100 311CA0E1 mov xh, xh, lsr ip + 183 0104 0EF0A0E1 mov pc, lr + 184 + 185 @ eq -> division by 1: obvious enough... + 186 0108 0020A001 9: moveq yl, xl + 187 010c 0130A001 moveq yh, xh + 188 0110 0010A003 moveq xh, #0 + 189 0114 0EF0A001 moveq pc, lr + 190 + 191 @ Division by 0: + 192 0118 08E02DE5 str lr, [sp, #-8]! + 193 011c FEFFFFEB bl __div0 + 194 + 195 @ as wrong as it could be... + 196 0120 0020A0E3 mov yl, #0 + 197 0124 0030A0E3 mov yh, #0 + 198 0128 0010A0E3 mov xh, #0 + 199 012c 08F09DE4 ldr pc, [sp], #8 +DEFINED SYMBOLS + lib/div64.S:46 .text:00000000 __do_div64 + lib/div64.S:46 .text:00000000 $a + .debug_aranges:0000000c $d + +UNDEFINED SYMBOLS +__div0 diff --git a/firmware/lib/lib1funcs.S b/firmware/lib/lib1funcs.S new file mode 100644 index 0000000..cd3afa5 --- /dev/null +++ b/firmware/lib/lib1funcs.S @@ -0,0 +1,338 @@ +/* + * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines + * + * Author: Nicolas Pitre + * - contributed to gcc-3.4 on Sep 30, 2003 + * - adapted for the Linux kernel on Oct 2, 2003 + */ + +/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. + +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, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +This file 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; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +#include +#include + + +.macro ARM_DIV_BODY dividend, divisor, result, curbit + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \curbit, \divisor + clz \result, \dividend + sub \result, \curbit, \result + mov \curbit, #1 + mov \divisor, \divisor, lsl \result + mov \curbit, \curbit, lsl \result + mov \result, #0 + +#else + + @ Initially shift the divisor left 3 bits if possible, + @ set curbit accordingly. This allows for curbit to be located + @ at the left end of each 4 bit nibbles in the division loop + @ to save one loop in most cases. + tst \divisor, #0xe0000000 + moveq \divisor, \divisor, lsl #3 + moveq \curbit, #8 + movne \curbit, #1 + + @ Unless the divisor is very big, shift it up in multiples of + @ four bits, since this is the amount of unwinding in the main + @ division loop. Continue shifting until the divisor is + @ larger than the dividend. +1: cmp \divisor, #0x10000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #4 + movlo \curbit, \curbit, lsl #4 + blo 1b + + @ For very big divisors, we must shift it a bit at a time, or + @ we will be in danger of overflowing. +1: cmp \divisor, #0x80000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #1 + movlo \curbit, \curbit, lsl #1 + blo 1b + + mov \result, #0 + +#endif + + @ Division loop +1: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + orrhs \result, \result, \curbit + cmp \dividend, \divisor, lsr #1 + subhs \dividend, \dividend, \divisor, lsr #1 + orrhs \result, \result, \curbit, lsr #1 + cmp \dividend, \divisor, lsr #2 + subhs \dividend, \dividend, \divisor, lsr #2 + orrhs \result, \result, \curbit, lsr #2 + cmp \dividend, \divisor, lsr #3 + subhs \dividend, \dividend, \divisor, lsr #3 + orrhs \result, \result, \curbit, lsr #3 + cmp \dividend, #0 @ Early termination? + movnes \curbit, \curbit, lsr #4 @ No, any more bits to do? + movne \divisor, \divisor, lsr #4 + bne 1b + +.endm + + +.macro ARM_DIV2_ORDER divisor, order + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \order, \divisor + rsb \order, \order, #31 + +#else + + cmp \divisor, #(1 << 16) + movhs \divisor, \divisor, lsr #16 + movhs \order, #16 + movlo \order, #0 + + cmp \divisor, #(1 << 8) + movhs \divisor, \divisor, lsr #8 + addhs \order, \order, #8 + + cmp \divisor, #(1 << 4) + movhs \divisor, \divisor, lsr #4 + addhs \order, \order, #4 + + cmp \divisor, #(1 << 2) + addhi \order, \order, #3 + addls \order, \order, \divisor, lsr #1 + +#endif + +.endm + + +.macro ARM_MOD_BODY dividend, divisor, order, spare + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \order, \divisor + clz \spare, \dividend + sub \order, \order, \spare + mov \divisor, \divisor, lsl \order + +#else + + mov \order, #0 + + @ Unless the divisor is very big, shift it up in multiples of + @ four bits, since this is the amount of unwinding in the main + @ division loop. Continue shifting until the divisor is + @ larger than the dividend. +1: cmp \divisor, #0x10000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #4 + addlo \order, \order, #4 + blo 1b + + @ For very big divisors, we must shift it a bit at a time, or + @ we will be in danger of overflowing. +1: cmp \divisor, #0x80000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #1 + addlo \order, \order, #1 + blo 1b + +#endif + + @ Perform all needed substractions to keep only the reminder. + @ Do comparisons in batch of 4 first. + subs \order, \order, #3 @ yes, 3 is intended here + blt 2f + +1: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + cmp \dividend, \divisor, lsr #1 + subhs \dividend, \dividend, \divisor, lsr #1 + cmp \dividend, \divisor, lsr #2 + subhs \dividend, \dividend, \divisor, lsr #2 + cmp \dividend, \divisor, lsr #3 + subhs \dividend, \dividend, \divisor, lsr #3 + cmp \dividend, #1 + mov \divisor, \divisor, lsr #4 + subges \order, \order, #4 + bge 1b + + tst \order, #3 + teqne \dividend, #0 + beq 5f + + @ Either 1, 2 or 3 comparison/substractions are left. +2: cmn \order, #2 + blt 4f + beq 3f + cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + mov \divisor, \divisor, lsr #1 +3: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + mov \divisor, \divisor, lsr #1 +4: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor +5: +.endm + + +/*ENTRY(__udivsi3) +ENTRY(__aeabi_uidiv) + + subs r2, r1, #1 + moveq pc, lr + bcc Ldiv0 + cmp r0, r1 + bls 11f + tst r1, r2 + beq 12f + + ARM_DIV_BODY r0, r1, r2, r3 + + mov r0, r2 + mov pc, lr + +11: moveq r0, #1 + movne r0, #0 + mov pc, lr + +12: ARM_DIV2_ORDER r1, r2 + + mov r0, r0, lsr r2 + mov pc, lr +*/ + +ENTRY(__umodsi3) + + subs r2, r1, #1 @ compare divisor with 1 + bcc Ldiv0 + cmpne r0, r1 @ compare dividend with divisor + moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + andeq r0, r0, r2 + movls pc, lr + + ARM_MOD_BODY r0, r1, r2, r3 + + mov pc, lr + + +ENTRY(__divsi3) +ENTRY(__aeabi_idiv) + + cmp r1, #0 + eor ip, r0, r1 @ save the sign of the result. + beq Ldiv0 + rsbmi r1, r1, #0 @ loops below use unsigned. + subs r2, r1, #1 @ division by 1 or -1 ? + beq 10f + movs r3, r0 + rsbmi r3, r0, #0 @ positive dividend value + cmp r3, r1 + bls 11f + tst r1, r2 @ divisor is power of 2 ? + beq 12f + + ARM_DIV_BODY r3, r1, r0, r2 + + cmp ip, #0 + rsbmi r0, r0, #0 + mov pc, lr + +10: teq ip, r0 @ same sign ? + rsbmi r0, r0, #0 + mov pc, lr + +11: movlo r0, #0 + moveq r0, ip, asr #31 + orreq r0, r0, #1 + mov pc, lr + +12: ARM_DIV2_ORDER r1, r2 + + cmp ip, #0 + mov r0, r3, lsr r2 + rsbmi r0, r0, #0 + mov pc, lr + + +ENTRY(__modsi3) + + cmp r1, #0 + beq Ldiv0 + rsbmi r1, r1, #0 @ loops below use unsigned. + movs ip, r0 @ preserve sign of dividend + rsbmi r0, r0, #0 @ if negative make positive + subs r2, r1, #1 @ compare divisor with 1 + cmpne r0, r1 @ compare dividend with divisor + moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + andeq r0, r0, r2 + bls 10f + + ARM_MOD_BODY r0, r1, r2, r3 + +10: cmp ip, #0 + rsbmi r0, r0, #0 + mov pc, lr + +#ifdef CONFIG_AEABI + +ENTRY(__aeabi_uidivmod) + + stmfd sp!, {r0, r1, ip, lr} + bl __aeabi_uidiv + ldmfd sp!, {r1, r2, ip, lr} + mul r3, r0, r2 + sub r1, r1, r3 + mov pc, lr + +ENTRY(__aeabi_idivmod) + + stmfd sp!, {r0, r1, ip, lr} + bl __aeabi_idiv + ldmfd sp!, {r1, r2, ip, lr} + mul r3, r0, r2 + sub r1, r1, r3 + mov pc, lr + +#endif + +Ldiv0: + + str lr, [sp, #-8]! + bl __div0 + mov r0, #0 @ About as wrong as it could be. + ldr pc, [sp], #8 + +ENTRY(__div0) + mov pc, lr diff --git a/firmware/lib/lib1funcs.lst b/firmware/lib/lib1funcs.lst new file mode 100644 index 0000000..50dc830 --- /dev/null +++ b/firmware/lib/lib1funcs.lst @@ -0,0 +1,452 @@ + 1 # 1 "lib/lib1funcs.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines + 3 * + 4 * Author: Nicolas Pitre + 5 * - contributed to gcc-3.4 on Sep 30, 2003 + 6 * - adapted for the Linux kernel on Oct 2, 2003 + 7 */ + 8 + 9 /* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. + 10 + 11 This file is free software; you can redistribute it and/or modify it + 12 under the terms of the GNU General Public License as published by the + 13 Free Software Foundation; either version 2, or (at your option) any + 14 later version. + 15 + 16 In addition to the permissions in the GNU General Public License, the + 17 Free Software Foundation gives you unlimited permission to link the + 18 compiled version of this file into combinations with other programs, + 19 and to distribute those combinations without any restriction coming + 20 from the use of this file. (The General Public License restrictions + 21 do apply in other respects; for example, they cover modification of + 22 the file, and distribution when not linked into a combine + 23 executable.) + 24 + 25 This file is distributed in the hope that it will be useful, but + 26 WITHOUT ANY WARRANTY; without even the implied warranty of + 27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + 28 General Public License for more details. + 29 + 30 You should have received a copy of the GNU General Public License + 31 along with this program; see the file COPYING. If not, write to + 32 the Free Software Foundation, 59 Temple Place - Suite 330, + 33 Boston, MA 02111-1307, USA. */ + 34 + 35 + 36 #include + 1 #ifndef __ASM_LINKAGE_H + 37 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 38 + 39 + 40 .macro ARM_DIV_BODY dividend, divisor, result, curbit + 41 + 42 #if __LINUX_ARM_ARCH__ >= 5 + 43 + 44 clz \curbit, \divisor + 45 clz \result, \dividend + 46 sub \result, \curbit, \result + 47 mov \curbit, #1 + 48 mov \divisor, \divisor, lsl \result + 49 mov \curbit, \curbit, lsl \result + 50 mov \result, #0 + 51 + 52 #else + 53 + 54 @ Initially shift the divisor left 3 bits if possible, + 55 @ set curbit accordingly. This allows for curbit to be located + 56 @ at the left end of each 4 bit nibbles in the division loop + 57 @ to save one loop in most cases. + 58 tst \divisor, #0xe0000000 + 59 moveq \divisor, \divisor, lsl #3 + 60 moveq \curbit, #8 + 61 movne \curbit, #1 + 62 + 63 @ Unless the divisor is very big, shift it up in multiples of + 64 @ four bits, since this is the amount of unwinding in the main + 65 @ division loop. Continue shifting until the divisor is + 66 @ larger than the dividend. + 67 1: cmp \divisor, #0x10000000 + 68 cmplo \divisor, \dividend + 69 movlo \divisor, \divisor, lsl #4 + 70 movlo \curbit, \curbit, lsl #4 + 71 blo 1b + 72 + 73 @ For very big divisors, we must shift it a bit at a time, or + 74 @ we will be in danger of overflowing. + 75 1: cmp \divisor, #0x80000000 + 76 cmplo \divisor, \dividend + 77 movlo \divisor, \divisor, lsl #1 + 78 movlo \curbit, \curbit, lsl #1 + 79 blo 1b + 80 + 81 mov \result, #0 + 82 + 83 #endif + 84 + 85 @ Division loop + 86 1: cmp \dividend, \divisor + 87 subhs \dividend, \dividend, \divisor + 88 orrhs \result, \result, \curbit + 89 cmp \dividend, \divisor, lsr #1 + 90 subhs \dividend, \dividend, \divisor, lsr #1 + 91 orrhs \result, \result, \curbit, lsr #1 + 92 cmp \dividend, \divisor, lsr #2 + 93 subhs \dividend, \dividend, \divisor, lsr #2 + 94 orrhs \result, \result, \curbit, lsr #2 + 95 cmp \dividend, \divisor, lsr #3 + 96 subhs \dividend, \dividend, \divisor, lsr #3 + 97 orrhs \result, \result, \curbit, lsr #3 + 98 cmp \dividend, #0 @ Early termination? + 99 movnes \curbit, \curbit, lsr #4 @ No, any more bits to do? + 100 movne \divisor, \divisor, lsr #4 + 101 bne 1b + 102 + 103 .endm + 104 + 105 + 106 .macro ARM_DIV2_ORDER divisor, order + 107 + 108 #if __LINUX_ARM_ARCH__ >= 5 + 109 + 110 clz \order, \divisor + 111 rsb \order, \order, #31 + 112 + 113 #else + 114 + 115 cmp \divisor, #(1 << 16) + 116 movhs \divisor, \divisor, lsr #16 + 117 movhs \order, #16 + 118 movlo \order, #0 + 119 + 120 cmp \divisor, #(1 << 8) + 121 movhs \divisor, \divisor, lsr #8 + 122 addhs \order, \order, #8 + 123 + 124 cmp \divisor, #(1 << 4) + 125 movhs \divisor, \divisor, lsr #4 + 126 addhs \order, \order, #4 + 127 + 128 cmp \divisor, #(1 << 2) + 129 addhi \order, \order, #3 + 130 addls \order, \order, \divisor, lsr #1 + 131 + 132 #endif + 133 + 134 .endm + 135 + 136 + 137 .macro ARM_MOD_BODY dividend, divisor, order, spare + 138 + 139 #if __LINUX_ARM_ARCH__ >= 5 + 140 + 141 clz \order, \divisor + 142 clz \spare, \dividend + 143 sub \order, \order, \spare + 144 mov \divisor, \divisor, lsl \order + 145 + 146 #else + 147 + 148 mov \order, #0 + 149 + 150 @ Unless the divisor is very big, shift it up in multiples of + 151 @ four bits, since this is the amount of unwinding in the main + 152 @ division loop. Continue shifting until the divisor is + 153 @ larger than the dividend. + 154 1: cmp \divisor, #0x10000000 + 155 cmplo \divisor, \dividend + 156 movlo \divisor, \divisor, lsl #4 + 157 addlo \order, \order, #4 + 158 blo 1b + 159 + 160 @ For very big divisors, we must shift it a bit at a time, or + 161 @ we will be in danger of overflowing. + 162 1: cmp \divisor, #0x80000000 + 163 cmplo \divisor, \dividend + 164 movlo \divisor, \divisor, lsl #1 + 165 addlo \order, \order, #1 + 166 blo 1b + 167 + 168 #endif + 169 + 170 @ Perform all needed substractions to keep only the reminder. + 171 @ Do comparisons in batch of 4 first. + 172 subs \order, \order, #3 @ yes, 3 is intended here + 173 blt 2f + 174 + 175 1: cmp \dividend, \divisor + 176 subhs \dividend, \dividend, \divisor + 177 cmp \dividend, \divisor, lsr #1 + 178 subhs \dividend, \dividend, \divisor, lsr #1 + 179 cmp \dividend, \divisor, lsr #2 + 180 subhs \dividend, \dividend, \divisor, lsr #2 + 181 cmp \dividend, \divisor, lsr #3 + 182 subhs \dividend, \dividend, \divisor, lsr #3 + 183 cmp \dividend, #1 + 184 mov \divisor, \divisor, lsr #4 + 185 subges \order, \order, #4 + 186 bge 1b + 187 + 188 tst \order, #3 + 189 teqne \dividend, #0 + 190 beq 5f + 191 + 192 @ Either 1, 2 or 3 comparison/substractions are left. + 193 2: cmn \order, #2 + 194 blt 4f + 195 beq 3f + 196 cmp \dividend, \divisor + 197 subhs \dividend, \dividend, \divisor + 198 mov \divisor, \divisor, lsr #1 + 199 3: cmp \dividend, \divisor + 200 subhs \dividend, \dividend, \divisor + 201 mov \divisor, \divisor, lsr #1 + 202 4: cmp \dividend, \divisor + 203 subhs \dividend, \dividend, \divisor + 204 5: + 205 .endm + 206 + 207 + 208 /*ENTRY(__udivsi3) + 209 ENTRY(__aeabi_uidiv) + 210 + 211 subs r2, r1, #1 + 212 moveq pc, lr + 213 bcc Ldiv0 + 214 cmp r0, r1 + 215 bls 11f + 216 tst r1, r2 + 217 beq 12f + 218 + 219 ARM_DIV_BODY r0, r1, r2, r3 + 220 + 221 mov r0, r2 + 222 mov pc, lr + 223 + 224 11: moveq r0, #1 + 225 movne r0, #0 + 226 mov pc, lr + 227 + 228 12: ARM_DIV2_ORDER r1, r2 + 229 + 230 mov r0, r0, lsr r2 + 231 mov pc, lr + 232 */ + 233 + 234 ENTRY(__umodsi3) + 235 + 236 0000 012051E2 subs r2, r1, #1 @ compare divisor with 1 + 237 0004 A700003A bcc Ldiv0 + 238 0008 01005011 cmpne r0, r1 @ compare dividend with divisor + 239 000c 0000A003 moveq r0, #0 + 240 0010 02001181 tsthi r1, r2 @ see if divisor is power of 2 + 241 0014 02000000 andeq r0, r0, r2 + 242 0018 0EF0A091 movls pc, lr + 243 + 244 ARM_MOD_BODY r0, r1, r2, r3 + 245 + 246 00b8 0EF0A0E1 mov pc, lr + 247 + 248 + 249 ENTRY(__divsi3) + 250 ENTRY(__aeabi_idiv) + 251 + 252 00bc 000051E3 cmp r1, #0 + 253 00c0 01C020E0 eor ip, r0, r1 @ save the sign of the result. + 254 00c4 7700000A beq Ldiv0 + 255 00c8 00106142 rsbmi r1, r1, #0 @ loops below use unsigned. + 256 00cc 012051E2 subs r2, r1, #1 @ division by 1 or -1 ? + 257 00d0 2700000A beq 10f + 258 00d4 0030B0E1 movs r3, r0 + 259 00d8 00306042 rsbmi r3, r0, #0 @ positive dividend value + 260 00dc 010053E1 cmp r3, r1 + 261 00e0 2600009A bls 11f + 262 00e4 020011E1 tst r1, r2 @ divisor is power of 2 ? + 263 00e8 2800000A beq 12f + 264 + 265 ARM_DIV_BODY r3, r1, r0, r2 + 266 + 267 0168 00005CE3 cmp ip, #0 + 268 016c 00006042 rsbmi r0, r0, #0 + 269 0170 0EF0A0E1 mov pc, lr + 270 + 271 0174 00003CE1 10: teq ip, r0 @ same sign ? + 272 0178 00006042 rsbmi r0, r0, #0 + 273 017c 0EF0A0E1 mov pc, lr + 274 + 275 0180 0000A033 11: movlo r0, #0 + 276 0184 CC0FA001 moveq r0, ip, asr #31 + 277 0188 01008003 orreq r0, r0, #1 + 278 018c 0EF0A0E1 mov pc, lr + 279 + 280 12: ARM_DIV2_ORDER r1, r2 + 281 + 282 01c4 00005CE3 cmp ip, #0 + 283 01c8 3302A0E1 mov r0, r3, lsr r2 + 284 01cc 00006042 rsbmi r0, r0, #0 + 285 01d0 0EF0A0E1 mov pc, lr + 286 + 287 + 288 ENTRY(__modsi3) + 289 + 290 01d4 000051E3 cmp r1, #0 + 291 01d8 3200000A beq Ldiv0 + 292 01dc 00106142 rsbmi r1, r1, #0 @ loops below use unsigned. + 293 01e0 00C0B0E1 movs ip, r0 @ preserve sign of dividend + 294 01e4 00006042 rsbmi r0, r0, #0 @ if negative make positive + 295 01e8 012051E2 subs r2, r1, #1 @ compare divisor with 1 + 296 01ec 01005011 cmpne r0, r1 @ compare dividend with divisor + 297 01f0 0000A003 moveq r0, #0 + 298 01f4 02001181 tsthi r1, r2 @ see if divisor is power of 2 + 299 01f8 02000000 andeq r0, r0, r2 + 300 01fc 2600009A bls 10f + 301 + 302 ARM_MOD_BODY r0, r1, r2, r3 + 303 + 304 029c 00005CE3 10: cmp ip, #0 + 305 02a0 00006042 rsbmi r0, r0, #0 + 306 02a4 0EF0A0E1 mov pc, lr + 307 + 308 #ifdef CONFIG_AEABI + 309 + 310 ENTRY(__aeabi_uidivmod) + 311 + 312 stmfd sp!, {r0, r1, ip, lr} + 313 bl __aeabi_uidiv + 314 ldmfd sp!, {r1, r2, ip, lr} + 315 mul r3, r0, r2 + 316 sub r1, r1, r3 + 317 mov pc, lr + 318 + 319 ENTRY(__aeabi_idivmod) + 320 + 321 stmfd sp!, {r0, r1, ip, lr} + 322 bl __aeabi_idiv + 323 ldmfd sp!, {r1, r2, ip, lr} + 324 mul r3, r0, r2 + 325 sub r1, r1, r3 + 326 mov pc, lr + 327 + 328 #endif + 329 + 330 Ldiv0: + 331 + 332 02a8 08E02DE5 str lr, [sp, #-8]! + 333 02ac FEFFFFEB bl __div0 + 334 02b0 0000A0E3 mov r0, #0 @ About as wrong as it could be. + 335 02b4 08F09DE4 ldr pc, [sp], #8 + 336 + 337 ENTRY(__div0) + 338 02b8 0EF0A0E1 mov pc, lr +DEFINED SYMBOLS + lib/lib1funcs.S:234 .text:00000000 __umodsi3 + lib/lib1funcs.S:234 .text:00000000 $a + lib/lib1funcs.S:330 .text:000002a8 Ldiv0 + lib/lib1funcs.S:249 .text:000000bc __divsi3 + lib/lib1funcs.S:250 .text:000000bc __aeabi_idiv + lib/lib1funcs.S:288 .text:000001d4 __modsi3 + lib/lib1funcs.S:337 .text:000002b8 __div0 + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/lib_AT91SAM7.c b/firmware/lib/lib_AT91SAM7.c new file mode 100644 index 0000000..950761f --- /dev/null +++ b/firmware/lib/lib_AT91SAM7.c @@ -0,0 +1,405 @@ +//* ---------------------------------------------------------------------------- +//* ATMEL Microcontroller Software Support - ROUSSET - +//* ---------------------------------------------------------------------------- +//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +//* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, +//* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +//* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +//* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +//* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +//* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +//* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//* ---------------------------------------------------------------------------- +//* File Name : lib_AT91SAM7S64.h +//* Object : AT91SAM7S64 inlined functions +//* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) +//* + +#include +#include +#include + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_ConfigureIt +//* \brief Interrupt Handler Initialization +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_ConfigureIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id, // \arg interrupt number to initialize + unsigned int priority, // \arg priority to give to the interrupt + unsigned int src_type, // \arg activation and sense of activation + void (*newHandler) () ) // \arg address of the interrupt handler +{ + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + //* Clear the interrupt on the interrupt controller + pAic->AIC_ICCR = mask ; + + return oldHandler; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_SetExceptionVector +//* \brief Configure vector handler +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + + return oldVector; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_AIC_Open +//* \brief Set exception vectors and AIC registers to default values +//*---------------------------------------------------------------------------- +void AT91F_AIC_Open( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + void (*IrqHandler) (), // \arg Default IRQ vector exception + void (*FiqHandler) (), // \arg Default FIQ vector exception + void (*DefaultHandler) (), // \arg Default Handler set in ISR + void (*SpuriousHandler) (), // \arg Default Spurious Handler + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + AT91F_AIC_DisableIt(pAic, i); + AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); + } + + // Set the IRQ exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); + // Set the Fast Interrupt exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); + + pAic->AIC_SPU = (unsigned int) SpuriousHandler; + pAic->AIC_DCR = protectMode; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Open +//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX +//*---------------------------------------------------------------------------- +void AT91F_PDC_Open(AT91PS_PDC pPDC) // \arg pointer to a PDC controller +{ + //* Disable the RX and TX PDC transfer requests + AT91F_PDC_DisableRx(pPDC); + AT91F_PDC_DisableTx(pPDC); + + //* Reset all Counter register Next buffer first + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); + + //* Enable the RX and TX PDC transfer requests + AT91F_PDC_EnableRx(pPDC); + AT91F_PDC_EnableTx(pPDC); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_Close +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +void AT91F_PDC_Close(AT91PS_PDC pPDC) // \arg pointer to a PDC controller +{ + //* Disable the RX and TX PDC transfer requests + AT91F_PDC_DisableRx(pPDC); + AT91F_PDC_DisableTx(pPDC); + + //* Reset all Counter register Next buffer first + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); + +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_SendFrame +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +unsigned int AT91F_PDC_SendFrame( + AT91PS_PDC pPDC, + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + if (AT91F_PDC_IsTxEmpty(pPDC)) { + //* Buffer and next buffer can be initialized + AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + //* Only one buffer can be initialized + AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + } +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_PDC_ReceiveFrame +//* \brief Close PDC: disable TX and RX reset transfer descriptors +//*---------------------------------------------------------------------------- +unsigned int AT91F_PDC_ReceiveFrame ( + AT91PS_PDC pPDC, + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + if (AT91F_PDC_IsRxEmpty(pPDC)) { + //* Buffer and next buffer can be initialized + AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + //* Only one buffer can be initialized + AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + } +} + +//*------------------------------------------------------------------------------ +//* \fn AT91F_PMC_GetMasterClock +//* \brief Return master clock in Hz which correponds to processor clock for ARM7 +//*------------------------------------------------------------------------------ +unsigned int AT91F_PMC_GetMasterClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + return slowClock / prescaler; + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + } + return 0; +} + +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ReadValue() +//* \brief Read the RTT value +//*-------------------------------------------------------------------------------------- +unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC) +{ + register volatile unsigned int val1,val2; + do + { + val1 = pRTTC->RTTC_RTVR; + val2 = pRTTC->RTTC_RTVR; + } + while(val1 != val2); + return(val1); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SPI_Close +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + //* Reset all the Chip Select register + pSPI->SPI_CSR[0] = 0 ; + pSPI->SPI_CSR[1] = 0 ; + pSPI->SPI_CSR[2] = 0 ; + pSPI->SPI_CSR[3] = 0 ; + + //* Reset the SPI mode + pSPI->SPI_MR = 0 ; + + //* Disable all interrupts + pSPI->SPI_IDR = 0xFFFFFFFF ; + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); + + //* Disable receiver and transmitter and stop any activity immediately + pSPI->SPI_CR = AT91C_SPI_SPIDIS; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_ADC_CfgTimings +//* \brief Configure the different necessary timings of the ADC controller +//*---------------------------------------------------------------------------- +void AT91F_ADC_CfgTimings ( + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_SetBaudrate +//* \brief Set the baudrate according to the CPU clock +//*---------------------------------------------------------------------------- +void AT91F_SSC_SetBaudrate ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + baud_value = 0; + else + { + baud_value = (unsigned int) (mainClock * 10)/(2*speed); + if ((baud_value % 10) >= 5) + baud_value = (baud_value / 10) + 1; + else + baud_value /= 10; + } + + pSSC->SSC_CMR = baud_value; +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_SSC_Configure +//* \brief Configure SSC +//*---------------------------------------------------------------------------- +void AT91F_SSC_Configure ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int syst_clock, // \arg System Clock Frequency + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + //* Disable interrupts + pSSC->SSC_IDR = (unsigned int) -1; + + //* Reset receiver and transmitter + pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + + //* Define the Clock Mode Register + AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); + + //* Write the Receive Clock Mode Register + pSSC->SSC_RCMR = clock_rx; + + //* Write the Transmit Clock Mode Register + pSSC->SSC_TCMR = clock_tx; + + //* Write the Receive Frame Mode Register + pSSC->SSC_RFMR = mode_rx; + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + + +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Configure +//* \brief Configure USART +//*---------------------------------------------------------------------------- +void AT91F_US_Configure ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + //* Disable interrupts + pUSART->US_IDR = (unsigned int) -1; + + //* Reset receiver and transmitter + pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; + + //* Define the baud rate divisor register + AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); + + //* Write the Timeguard Register + AT91F_US_SetTimeguard(pUSART, timeguard); + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); + + //* Define the USART mode + pUSART->US_MR = mode ; + +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Close +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset the baud rate divisor register + pUSART->US_BRGR = 0 ; + + //* Reset the USART mode + pUSART->US_MR = 0 ; + + //* Reset the Timeguard Register + pUSART->US_TTGR = 0; + + //* Disable all interrupts + pUSART->US_IDR = 0xFFFFFFFF ; + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); + + //* Disable receiver and transmitter and stop any activity immediately + pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; +} + + diff --git a/firmware/lib/lib_AT91SAM7.lst b/firmware/lib/lib_AT91SAM7.lst new file mode 100644 index 0000000..6182c45 --- /dev/null +++ b/firmware/lib/lib_AT91SAM7.lst @@ -0,0 +1,3888 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "lib_AT91SAM7.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 AT91F_PDC_SetNextRx: + 24 .LFB7: + 25 .file 1 "./include/lib_AT91SAM7.h" + 1:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:./include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:./include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:./include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:./include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:./include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:./include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:./include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:./include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:./include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:./include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:./include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:./include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:./include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:./include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:./include/lib_AT91SAM7.h **** //* + 19:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:./include/lib_AT91SAM7.h **** + 40:./include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:./include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:./include/lib_AT91SAM7.h **** + 43:./include/lib_AT91SAM7.h **** #include + 44:./include/lib_AT91SAM7.h **** + 45:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:./include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:./include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:./include/lib_AT91SAM7.h **** + 50:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:./include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:./include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:./include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:./include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:./include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:./include/lib_AT91SAM7.h **** + 61:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:./include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:./include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:./include/lib_AT91SAM7.h **** { + 69:./include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:./include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:./include/lib_AT91SAM7.h **** } + 72:./include/lib_AT91SAM7.h **** + 73:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:./include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:./include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:./include/lib_AT91SAM7.h **** { + 81:./include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:./include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:./include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:./include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:./include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:./include/lib_AT91SAM7.h **** } + 87:./include/lib_AT91SAM7.h **** + 88:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:./include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:./include/lib_AT91SAM7.h **** { + 96:./include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:./include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:./include/lib_AT91SAM7.h **** } + 99:./include/lib_AT91SAM7.h **** + 100:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:./include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:./include/lib_AT91SAM7.h **** { + 107:./include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:./include/lib_AT91SAM7.h **** } + 109:./include/lib_AT91SAM7.h **** + 110:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:./include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:./include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:./include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:./include/lib_AT91SAM7.h **** + 118:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:./include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:./include/lib_AT91SAM7.h **** { + 126:./include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:./include/lib_AT91SAM7.h **** } + 128:./include/lib_AT91SAM7.h **** + 129:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:./include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:./include/lib_AT91SAM7.h **** { + 137:./include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:./include/lib_AT91SAM7.h **** } + 139:./include/lib_AT91SAM7.h **** + 140:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:./include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:./include/lib_AT91SAM7.h **** { + 148:./include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:./include/lib_AT91SAM7.h **** } + 150:./include/lib_AT91SAM7.h **** + 151:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:./include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:./include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:./include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:./include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:./include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:./include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:./include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:./include/lib_AT91SAM7.h **** + 163:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:./include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:./include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:./include/lib_AT91SAM7.h **** { + 26 .loc 1 174 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 32 .LVL0: + 175:./include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 33 .loc 1 175 0 + 34 0000 101080E5 str r1, [r0, #16] + 176:./include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 35 .loc 1 176 0 + 36 0004 142080E5 str r2, [r0, #20] + 177:./include/lib_AT91SAM7.h **** } + 37 .loc 1 177 0 + 38 0008 1EFF2FE1 bx lr + 39 .cfi_endproc + 40 .LFE7: + 42 .align 2 + 44 AT91F_PDC_SetNextTx: + 45 .LFB8: + 178:./include/lib_AT91SAM7.h **** + 179:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:./include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:./include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:./include/lib_AT91SAM7.h **** { + 46 .loc 1 187 0 + 47 .cfi_startproc + 48 @ Function supports interworking. + 49 @ args = 0, pretend = 0, frame = 0 + 50 @ frame_needed = 0, uses_anonymous_args = 0 + 51 @ link register save eliminated. + 52 .LVL1: + 188:./include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 53 .loc 1 188 0 + 54 000c 181080E5 str r1, [r0, #24] + 189:./include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 55 .loc 1 189 0 + 56 0010 1C2080E5 str r2, [r0, #28] + 190:./include/lib_AT91SAM7.h **** } + 57 .loc 1 190 0 + 58 0014 1EFF2FE1 bx lr + 59 .cfi_endproc + 60 .LFE8: + 62 .align 2 + 64 AT91F_PDC_SetRx: + 65 .LFB9: + 191:./include/lib_AT91SAM7.h **** + 192:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:./include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:./include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:./include/lib_AT91SAM7.h **** { + 66 .loc 1 200 0 + 67 .cfi_startproc + 68 @ Function supports interworking. + 69 @ args = 0, pretend = 0, frame = 0 + 70 @ frame_needed = 0, uses_anonymous_args = 0 + 71 @ link register save eliminated. + 72 .LVL2: + 201:./include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 73 .loc 1 201 0 + 74 0018 001080E5 str r1, [r0, #0] + 202:./include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 75 .loc 1 202 0 + 76 001c 042080E5 str r2, [r0, #4] + 203:./include/lib_AT91SAM7.h **** } + 77 .loc 1 203 0 + 78 0020 1EFF2FE1 bx lr + 79 .cfi_endproc + 80 .LFE9: + 82 .align 2 + 84 AT91F_PDC_SetTx: + 85 .LFB10: + 204:./include/lib_AT91SAM7.h **** + 205:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:./include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:./include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:./include/lib_AT91SAM7.h **** { + 86 .loc 1 213 0 + 87 .cfi_startproc + 88 @ Function supports interworking. + 89 @ args = 0, pretend = 0, frame = 0 + 90 @ frame_needed = 0, uses_anonymous_args = 0 + 91 @ link register save eliminated. + 92 .LVL3: + 214:./include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 93 .loc 1 214 0 + 94 0024 081080E5 str r1, [r0, #8] + 215:./include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 95 .loc 1 215 0 + 96 0028 0C2080E5 str r2, [r0, #12] + 216:./include/lib_AT91SAM7.h **** } + 97 .loc 1 216 0 + 98 002c 1EFF2FE1 bx lr + 99 .cfi_endproc + 100 .LFE10: + 102 .align 2 + 104 AT91F_PDC_DisableTx: + 105 .LFB13: + 217:./include/lib_AT91SAM7.h **** + 218:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:./include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:./include/lib_AT91SAM7.h **** { + 225:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:./include/lib_AT91SAM7.h **** } + 227:./include/lib_AT91SAM7.h **** + 228:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:./include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:./include/lib_AT91SAM7.h **** { + 235:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:./include/lib_AT91SAM7.h **** } + 237:./include/lib_AT91SAM7.h **** + 238:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:./include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:./include/lib_AT91SAM7.h **** { + 106 .loc 1 244 0 + 107 .cfi_startproc + 108 @ Function supports interworking. + 109 @ args = 0, pretend = 0, frame = 0 + 110 @ frame_needed = 0, uses_anonymous_args = 0 + 111 @ link register save eliminated. + 112 .LVL4: + 245:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 113 .loc 1 245 0 + 114 0030 023CA0E3 mov r3, #512 + 115 0034 203080E5 str r3, [r0, #32] + 246:./include/lib_AT91SAM7.h **** } + 116 .loc 1 246 0 + 117 0038 1EFF2FE1 bx lr + 118 .cfi_endproc + 119 .LFE13: + 121 .align 2 + 123 AT91F_PDC_DisableRx: + 124 .LFB14: + 247:./include/lib_AT91SAM7.h **** + 248:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:./include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:./include/lib_AT91SAM7.h **** { + 125 .loc 1 254 0 + 126 .cfi_startproc + 127 @ Function supports interworking. + 128 @ args = 0, pretend = 0, frame = 0 + 129 @ frame_needed = 0, uses_anonymous_args = 0 + 130 @ link register save eliminated. + 131 .LVL5: + 255:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 132 .loc 1 255 0 + 133 003c 0230A0E3 mov r3, #2 + 134 0040 203080E5 str r3, [r0, #32] + 256:./include/lib_AT91SAM7.h **** } + 135 .loc 1 256 0 + 136 0044 1EFF2FE1 bx lr + 137 .cfi_endproc + 138 .LFE14: + 140 .align 2 + 142 AT91F_CKGR_GetMainClock: + 143 .LFB81: + 257:./include/lib_AT91SAM7.h **** + 258:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:./include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:./include/lib_AT91SAM7.h **** { + 265:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:./include/lib_AT91SAM7.h **** } + 267:./include/lib_AT91SAM7.h **** + 268:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:./include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:./include/lib_AT91SAM7.h **** { + 275:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:./include/lib_AT91SAM7.h **** } + 277:./include/lib_AT91SAM7.h **** + 278:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:./include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:./include/lib_AT91SAM7.h **** { + 285:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:./include/lib_AT91SAM7.h **** } + 287:./include/lib_AT91SAM7.h **** + 288:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:./include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:./include/lib_AT91SAM7.h **** { + 295:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:./include/lib_AT91SAM7.h **** } + 297:./include/lib_AT91SAM7.h **** + 298:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:./include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:./include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:./include/lib_AT91SAM7.h **** + 304:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:./include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:./include/lib_AT91SAM7.h **** + 310:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:./include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:./include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:./include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:./include/lib_AT91SAM7.h **** + 321:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:./include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:./include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:./include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:./include/lib_AT91SAM7.h **** + 332:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:./include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:./include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:./include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:./include/lib_AT91SAM7.h **** { + 343:./include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:./include/lib_AT91SAM7.h **** } + 345:./include/lib_AT91SAM7.h **** + 346:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:./include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:./include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:./include/lib_AT91SAM7.h **** { + 354:./include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:./include/lib_AT91SAM7.h **** } + 356:./include/lib_AT91SAM7.h **** + 357:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:./include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:./include/lib_AT91SAM7.h **** { + 364:./include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:./include/lib_AT91SAM7.h **** } + 366:./include/lib_AT91SAM7.h **** + 367:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:./include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:./include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:./include/lib_AT91SAM7.h **** { + 375:./include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:./include/lib_AT91SAM7.h **** } + 377:./include/lib_AT91SAM7.h **** + 378:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:./include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:./include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:./include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:./include/lib_AT91SAM7.h **** + 390:./include/lib_AT91SAM7.h **** { + 391:./include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:./include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:./include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:./include/lib_AT91SAM7.h **** } + 395:./include/lib_AT91SAM7.h **** + 396:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:./include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:./include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:./include/lib_AT91SAM7.h **** { + 404:./include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:./include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:./include/lib_AT91SAM7.h **** } + 407:./include/lib_AT91SAM7.h **** + 408:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:./include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:./include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:./include/lib_AT91SAM7.h **** { + 416:./include/lib_AT91SAM7.h **** // Disable output + 417:./include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:./include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:./include/lib_AT91SAM7.h **** } + 420:./include/lib_AT91SAM7.h **** + 421:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:./include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:./include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:./include/lib_AT91SAM7.h **** { + 429:./include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:./include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:./include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:./include/lib_AT91SAM7.h **** } + 433:./include/lib_AT91SAM7.h **** + 434:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:./include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:./include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:./include/lib_AT91SAM7.h **** { + 442:./include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:./include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:./include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:./include/lib_AT91SAM7.h **** } + 446:./include/lib_AT91SAM7.h **** + 447:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:./include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:./include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:./include/lib_AT91SAM7.h **** + 455:./include/lib_AT91SAM7.h **** { + 456:./include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:./include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:./include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:./include/lib_AT91SAM7.h **** } + 460:./include/lib_AT91SAM7.h **** + 461:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:./include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:./include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:./include/lib_AT91SAM7.h **** + 469:./include/lib_AT91SAM7.h **** { + 470:./include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:./include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:./include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:./include/lib_AT91SAM7.h **** } + 474:./include/lib_AT91SAM7.h **** + 475:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:./include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:./include/lib_AT91SAM7.h **** { + 482:./include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:./include/lib_AT91SAM7.h **** } + 484:./include/lib_AT91SAM7.h **** + 485:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:./include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:./include/lib_AT91SAM7.h **** { + 493:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:./include/lib_AT91SAM7.h **** } + 495:./include/lib_AT91SAM7.h **** + 496:./include/lib_AT91SAM7.h **** + 497:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:./include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:./include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:./include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:./include/lib_AT91SAM7.h **** { + 505:./include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:./include/lib_AT91SAM7.h **** } + 507:./include/lib_AT91SAM7.h **** + 508:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:./include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:./include/lib_AT91SAM7.h **** { + 516:./include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:./include/lib_AT91SAM7.h **** } + 518:./include/lib_AT91SAM7.h **** + 519:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:./include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:./include/lib_AT91SAM7.h **** { + 527:./include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:./include/lib_AT91SAM7.h **** } + 529:./include/lib_AT91SAM7.h **** + 530:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:./include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:./include/lib_AT91SAM7.h **** { + 538:./include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:./include/lib_AT91SAM7.h **** } + 540:./include/lib_AT91SAM7.h **** + 541:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:./include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:./include/lib_AT91SAM7.h **** { + 549:./include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:./include/lib_AT91SAM7.h **** } + 551:./include/lib_AT91SAM7.h **** + 552:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:./include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:./include/lib_AT91SAM7.h **** { + 559:./include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:./include/lib_AT91SAM7.h **** } + 561:./include/lib_AT91SAM7.h **** + 562:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:./include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:./include/lib_AT91SAM7.h **** { + 570:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:./include/lib_AT91SAM7.h **** } + 572:./include/lib_AT91SAM7.h **** + 573:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:./include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:./include/lib_AT91SAM7.h **** { + 581:./include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:./include/lib_AT91SAM7.h **** } + 583:./include/lib_AT91SAM7.h **** + 584:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:./include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:./include/lib_AT91SAM7.h **** { + 592:./include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:./include/lib_AT91SAM7.h **** } + 594:./include/lib_AT91SAM7.h **** + 595:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:./include/lib_AT91SAM7.h **** { + 602:./include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:./include/lib_AT91SAM7.h **** } + 604:./include/lib_AT91SAM7.h **** + 605:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:./include/lib_AT91SAM7.h **** { + 613:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:./include/lib_AT91SAM7.h **** } + 615:./include/lib_AT91SAM7.h **** + 616:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:./include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:./include/lib_AT91SAM7.h **** { + 624:./include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:./include/lib_AT91SAM7.h **** } + 626:./include/lib_AT91SAM7.h **** + 627:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:./include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:./include/lib_AT91SAM7.h **** { + 635:./include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:./include/lib_AT91SAM7.h **** } + 637:./include/lib_AT91SAM7.h **** + 638:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:./include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:./include/lib_AT91SAM7.h **** { + 645:./include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:./include/lib_AT91SAM7.h **** } + 647:./include/lib_AT91SAM7.h **** + 648:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:./include/lib_AT91SAM7.h **** { + 656:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:./include/lib_AT91SAM7.h **** } + 658:./include/lib_AT91SAM7.h **** + 659:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:./include/lib_AT91SAM7.h **** { + 666:./include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:./include/lib_AT91SAM7.h **** } + 668:./include/lib_AT91SAM7.h **** + 669:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:./include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:./include/lib_AT91SAM7.h **** { + 677:./include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:./include/lib_AT91SAM7.h **** } + 679:./include/lib_AT91SAM7.h **** + 680:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:./include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:./include/lib_AT91SAM7.h **** { + 688:./include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:./include/lib_AT91SAM7.h **** } + 690:./include/lib_AT91SAM7.h **** + 691:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:./include/lib_AT91SAM7.h **** { + 698:./include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:./include/lib_AT91SAM7.h **** } + 700:./include/lib_AT91SAM7.h **** + 701:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:./include/lib_AT91SAM7.h **** { + 708:./include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:./include/lib_AT91SAM7.h **** } + 710:./include/lib_AT91SAM7.h **** + 711:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:./include/lib_AT91SAM7.h **** { + 719:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:./include/lib_AT91SAM7.h **** } + 721:./include/lib_AT91SAM7.h **** + 722:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:./include/lib_AT91SAM7.h **** { + 730:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:./include/lib_AT91SAM7.h **** } + 732:./include/lib_AT91SAM7.h **** + 733:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:./include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:./include/lib_AT91SAM7.h **** { + 741:./include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:./include/lib_AT91SAM7.h **** } + 743:./include/lib_AT91SAM7.h **** + 744:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:./include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:./include/lib_AT91SAM7.h **** { + 752:./include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:./include/lib_AT91SAM7.h **** } + 754:./include/lib_AT91SAM7.h **** + 755:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:./include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:./include/lib_AT91SAM7.h **** { + 762:./include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:./include/lib_AT91SAM7.h **** } + 764:./include/lib_AT91SAM7.h **** + 765:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:./include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:./include/lib_AT91SAM7.h **** { + 773:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:./include/lib_AT91SAM7.h **** } + 775:./include/lib_AT91SAM7.h **** + 776:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:./include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:./include/lib_AT91SAM7.h **** { + 784:./include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:./include/lib_AT91SAM7.h **** } + 786:./include/lib_AT91SAM7.h **** + 787:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:./include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:./include/lib_AT91SAM7.h **** { + 795:./include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:./include/lib_AT91SAM7.h **** } + 797:./include/lib_AT91SAM7.h **** + 798:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:./include/lib_AT91SAM7.h **** { + 805:./include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:./include/lib_AT91SAM7.h **** } + 807:./include/lib_AT91SAM7.h **** + 808:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:./include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:./include/lib_AT91SAM7.h **** { + 816:./include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:./include/lib_AT91SAM7.h **** } + 818:./include/lib_AT91SAM7.h **** + 819:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:./include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:./include/lib_AT91SAM7.h **** { + 827:./include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:./include/lib_AT91SAM7.h **** } + 829:./include/lib_AT91SAM7.h **** + 830:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:./include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:./include/lib_AT91SAM7.h **** { + 838:./include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:./include/lib_AT91SAM7.h **** } + 840:./include/lib_AT91SAM7.h **** + 841:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:./include/lib_AT91SAM7.h **** { + 848:./include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:./include/lib_AT91SAM7.h **** } + 850:./include/lib_AT91SAM7.h **** + 851:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:./include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:./include/lib_AT91SAM7.h **** { + 859:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:./include/lib_AT91SAM7.h **** } + 861:./include/lib_AT91SAM7.h **** + 862:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:./include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:./include/lib_AT91SAM7.h **** { + 869:./include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:./include/lib_AT91SAM7.h **** } + 871:./include/lib_AT91SAM7.h **** + 872:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:./include/lib_AT91SAM7.h **** { + 880:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:./include/lib_AT91SAM7.h **** } + 882:./include/lib_AT91SAM7.h **** + 883:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:./include/lib_AT91SAM7.h **** { + 891:./include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:./include/lib_AT91SAM7.h **** } + 893:./include/lib_AT91SAM7.h **** + 894:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:./include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:./include/lib_AT91SAM7.h **** unsigned int mode) + 904:./include/lib_AT91SAM7.h **** { + 905:./include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:./include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:./include/lib_AT91SAM7.h **** } + 908:./include/lib_AT91SAM7.h **** + 909:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:./include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:./include/lib_AT91SAM7.h **** unsigned int mode) + 916:./include/lib_AT91SAM7.h **** { + 917:./include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:./include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:./include/lib_AT91SAM7.h **** } + 920:./include/lib_AT91SAM7.h **** + 921:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:./include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:./include/lib_AT91SAM7.h **** ) + 928:./include/lib_AT91SAM7.h **** { + 929:./include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:./include/lib_AT91SAM7.h **** } + 931:./include/lib_AT91SAM7.h **** + 932:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:./include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:./include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:./include/lib_AT91SAM7.h **** { + 940:./include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:./include/lib_AT91SAM7.h **** } + 942:./include/lib_AT91SAM7.h **** + 943:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:./include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:./include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:./include/lib_AT91SAM7.h **** { + 951:./include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:./include/lib_AT91SAM7.h **** } + 953:./include/lib_AT91SAM7.h **** + 954:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:./include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:./include/lib_AT91SAM7.h **** { + 961:./include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:./include/lib_AT91SAM7.h **** } + 963:./include/lib_AT91SAM7.h **** + 964:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:./include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:./include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:./include/lib_AT91SAM7.h **** unsigned int mode) + 971:./include/lib_AT91SAM7.h **** { + 972:./include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:./include/lib_AT91SAM7.h **** } + 974:./include/lib_AT91SAM7.h **** + 975:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:./include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:./include/lib_AT91SAM7.h **** { + 982:./include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:./include/lib_AT91SAM7.h **** } + 984:./include/lib_AT91SAM7.h **** + 985:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:./include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:./include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:./include/lib_AT91SAM7.h **** { + 992:./include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:./include/lib_AT91SAM7.h **** } + 994:./include/lib_AT91SAM7.h **** + 995:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:./include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:./include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:./include/lib_AT91SAM7.h **** { +1002:./include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:./include/lib_AT91SAM7.h **** } +1004:./include/lib_AT91SAM7.h **** +1005:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:./include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:./include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:./include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:./include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:./include/lib_AT91SAM7.h **** { +1014:./include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:./include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:./include/lib_AT91SAM7.h **** } +1017:./include/lib_AT91SAM7.h **** +1018:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:./include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:./include/lib_AT91SAM7.h **** { +1025:./include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:./include/lib_AT91SAM7.h **** } +1027:./include/lib_AT91SAM7.h **** +1028:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:./include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:./include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:./include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:./include/lib_AT91SAM7.h **** { + 144 .loc 1 1035 0 + 145 .cfi_startproc + 146 @ Function supports interworking. + 147 @ args = 0, pretend = 0, frame = 0 + 148 @ frame_needed = 0, uses_anonymous_args = 0 + 149 @ link register save eliminated. + 150 .LVL6: +1036:./include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; + 151 .loc 1 1036 0 + 152 0048 040090E5 ldr r0, [r0, #4] + 153 .LVL7: + 154 004c 0008A0E1 mov r0, r0, asl #16 + 155 0050 2008A0E1 mov r0, r0, lsr #16 + 156 0054 910000E0 mul r0, r1, r0 +1037:./include/lib_AT91SAM7.h **** } + 157 .loc 1 1037 0 + 158 0058 2002A0E1 mov r0, r0, lsr #4 + 159 005c 1EFF2FE1 bx lr + 160 .cfi_endproc + 161 .LFE81: + 163 .align 2 + 164 .global AT91F_AIC_ConfigureIt + 166 AT91F_AIC_ConfigureIt: + 167 .LFB273: + 168 .file 2 "lib/lib_AT91SAM7.c" + 1:lib/lib_AT91SAM7.c **** //* ---------------------------------------------------------------------------- + 2:lib/lib_AT91SAM7.c **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:lib/lib_AT91SAM7.c **** //* ---------------------------------------------------------------------------- + 4:lib/lib_AT91SAM7.c **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:lib/lib_AT91SAM7.c **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:lib/lib_AT91SAM7.c **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:lib/lib_AT91SAM7.c **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:lib/lib_AT91SAM7.c **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:lib/lib_AT91SAM7.c **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:lib/lib_AT91SAM7.c **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:lib/lib_AT91SAM7.c **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:lib/lib_AT91SAM7.c **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:lib/lib_AT91SAM7.c **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:lib/lib_AT91SAM7.c **** //* ---------------------------------------------------------------------------- + 15:lib/lib_AT91SAM7.c **** //* File Name : lib_AT91SAM7S64.h + 16:lib/lib_AT91SAM7.c **** //* Object : AT91SAM7S64 inlined functions + 17:lib/lib_AT91SAM7.c **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:lib/lib_AT91SAM7.c **** //* + 19:lib/lib_AT91SAM7.c **** + 20:lib/lib_AT91SAM7.c **** #include + 21:lib/lib_AT91SAM7.c **** #include + 22:lib/lib_AT91SAM7.c **** #include + 23:lib/lib_AT91SAM7.c **** + 24:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 25:lib/lib_AT91SAM7.c **** //* \fn AT91F_AIC_ConfigureIt + 26:lib/lib_AT91SAM7.c **** //* \brief Interrupt Handler Initialization + 27:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 28:lib/lib_AT91SAM7.c **** unsigned int AT91F_AIC_ConfigureIt ( + 29:lib/lib_AT91SAM7.c **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 30:lib/lib_AT91SAM7.c **** unsigned int irq_id, // \arg interrupt number to initialize + 31:lib/lib_AT91SAM7.c **** unsigned int priority, // \arg priority to give to the interrupt + 32:lib/lib_AT91SAM7.c **** unsigned int src_type, // \arg activation and sense of activation + 33:lib/lib_AT91SAM7.c **** void (*newHandler) () ) // \arg address of the interrupt handler + 34:lib/lib_AT91SAM7.c **** { + 169 .loc 2 34 0 + 170 .cfi_startproc + 171 @ Function supports interworking. + 172 @ args = 4, pretend = 0, frame = 0 + 173 @ frame_needed = 0, uses_anonymous_args = 0 + 174 @ link register save eliminated. + 175 .LVL8: + 35:lib/lib_AT91SAM7.c **** unsigned int oldHandler; + 36:lib/lib_AT91SAM7.c **** unsigned int mask ; + 37:lib/lib_AT91SAM7.c **** + 38:lib/lib_AT91SAM7.c **** oldHandler = pAic->AIC_SVR[irq_id]; + 39:lib/lib_AT91SAM7.c **** + 40:lib/lib_AT91SAM7.c **** mask = 0x1 << irq_id ; + 176 .loc 2 40 0 + 177 0060 01C0A0E3 mov ip, #1 + 178 0064 1CC1A0E1 mov ip, ip, asl r1 + 34:lib/lib_AT91SAM7.c **** { + 179 .loc 2 34 0 + 180 0068 70002DE9 stmfd sp!, {r4, r5, r6} + 181 .LCFI0: + 182 .cfi_def_cfa_offset 12 + 38:lib/lib_AT91SAM7.c **** oldHandler = pAic->AIC_SVR[irq_id]; + 183 .loc 2 38 0 + 184 006c 204081E2 add r4, r1, #32 + 185 .cfi_offset 6, -4 + 186 .cfi_offset 5, -8 + 187 .cfi_offset 4, -12 + 188 0070 045190E7 ldr r5, [r0, r4, asl #2] + 189 .LVL9: + 41:lib/lib_AT91SAM7.c **** //* Disable the interrupt on the interrupt controller + 42:lib/lib_AT91SAM7.c **** pAic->AIC_IDCR = mask ; + 43:lib/lib_AT91SAM7.c **** //* Save the interrupt handler routine pointer and the interrupt priority + 44:lib/lib_AT91SAM7.c **** pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 190 .loc 2 44 0 + 191 0074 0C609DE5 ldr r6, [sp, #12] + 45:lib/lib_AT91SAM7.c **** //* Store the Source Mode Register + 46:lib/lib_AT91SAM7.c **** pAic->AIC_SMR[irq_id] = src_type | priority ; + 192 .loc 2 46 0 + 193 0078 023083E1 orr r3, r3, r2 + 194 .LVL10: + 42:lib/lib_AT91SAM7.c **** pAic->AIC_IDCR = mask ; + 195 .loc 2 42 0 + 196 007c 24C180E5 str ip, [r0, #292] + 44:lib/lib_AT91SAM7.c **** pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 197 .loc 2 44 0 + 198 0080 046180E7 str r6, [r0, r4, asl #2] + 199 .loc 2 46 0 + 200 0084 013180E7 str r3, [r0, r1, asl #2] + 47:lib/lib_AT91SAM7.c **** //* Clear the interrupt on the interrupt controller + 48:lib/lib_AT91SAM7.c **** pAic->AIC_ICCR = mask ; + 201 .loc 2 48 0 + 202 0088 28C180E5 str ip, [r0, #296] + 49:lib/lib_AT91SAM7.c **** + 50:lib/lib_AT91SAM7.c **** return oldHandler; + 51:lib/lib_AT91SAM7.c **** } + 203 .loc 2 51 0 + 204 008c 0500A0E1 mov r0, r5 + 205 .LVL11: + 206 0090 7000BDE8 ldmfd sp!, {r4, r5, r6} + 207 0094 1EFF2FE1 bx lr + 208 .cfi_endproc + 209 .LFE273: + 211 .align 2 + 212 .global AT91F_AIC_SetExceptionVector + 214 AT91F_AIC_SetExceptionVector: + 215 .LFB274: + 52:lib/lib_AT91SAM7.c **** + 53:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 54:lib/lib_AT91SAM7.c **** //* \fn AT91F_AIC_SetExceptionVector + 55:lib/lib_AT91SAM7.c **** //* \brief Configure vector handler + 56:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 57:lib/lib_AT91SAM7.c **** unsigned int AT91F_AIC_SetExceptionVector ( + 58:lib/lib_AT91SAM7.c **** unsigned int *pVector, // \arg pointer to the AIC registers + 59:lib/lib_AT91SAM7.c **** void (*Handler) () ) // \arg Interrupt Handler + 60:lib/lib_AT91SAM7.c **** { + 216 .loc 2 60 0 + 217 .cfi_startproc + 218 @ Function supports interworking. + 219 @ args = 0, pretend = 0, frame = 0 + 220 @ frame_needed = 0, uses_anonymous_args = 0 + 221 @ link register save eliminated. + 222 .LVL12: + 61:lib/lib_AT91SAM7.c **** unsigned int oldVector = *pVector; + 62:lib/lib_AT91SAM7.c **** + 63:lib/lib_AT91SAM7.c **** if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 223 .loc 2 63 0 + 224 0098 28209FE5 ldr r2, .L12 + 60:lib/lib_AT91SAM7.c **** { + 225 .loc 2 60 0 + 226 009c 0030A0E1 mov r3, r0 + 227 .loc 2 63 0 + 228 00a0 020051E1 cmp r1, r2 + 64:lib/lib_AT91SAM7.c **** *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + 65:lib/lib_AT91SAM7.c **** else + 66:lib/lib_AT91SAM7.c **** *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0x + 229 .loc 2 66 0 + 230 00a4 01206310 rsbne r2, r3, r1 + 231 00a8 08204212 subne r2, r2, #8 + 232 00ac 2221A011 movne r2, r2, lsr #2 + 233 00b0 FF24C213 bicne r2, r2, #-16777216 + 234 00b4 EA248213 orrne r2, r2, #-369098752 + 61:lib/lib_AT91SAM7.c **** unsigned int oldVector = *pVector; + 235 .loc 2 61 0 + 236 00b8 000090E5 ldr r0, [r0, #0] + 237 .LVL13: + 64:lib/lib_AT91SAM7.c **** *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + 238 .loc 2 64 0 + 239 00bc 00108305 streq r1, [r3, #0] + 240 .loc 2 66 0 + 241 00c0 00208315 strne r2, [r3, #0] + 67:lib/lib_AT91SAM7.c **** + 68:lib/lib_AT91SAM7.c **** return oldVector; + 69:lib/lib_AT91SAM7.c **** } + 242 .loc 2 69 0 + 243 00c4 1EFF2FE1 bx lr + 244 .L13: + 245 .align 2 + 246 .L12: + 247 00c8 20FF1FE5 .word -450887904 + 248 .cfi_endproc + 249 .LFE274: + 251 .align 2 + 252 .global AT91F_AIC_Open + 254 AT91F_AIC_Open: + 255 .LFB275: + 70:lib/lib_AT91SAM7.c **** + 71:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 72:lib/lib_AT91SAM7.c **** //* \fn AT91F_AIC_Open + 73:lib/lib_AT91SAM7.c **** //* \brief Set exception vectors and AIC registers to default values + 74:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 75:lib/lib_AT91SAM7.c **** void AT91F_AIC_Open( + 76:lib/lib_AT91SAM7.c **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 77:lib/lib_AT91SAM7.c **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 78:lib/lib_AT91SAM7.c **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 79:lib/lib_AT91SAM7.c **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 80:lib/lib_AT91SAM7.c **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 81:lib/lib_AT91SAM7.c **** unsigned int protectMode) // \arg Debug Control Register + 82:lib/lib_AT91SAM7.c **** { + 256 .loc 2 82 0 + 257 .cfi_startproc + 258 @ Function supports interworking. + 259 @ args = 8, pretend = 0, frame = 0 + 260 @ frame_needed = 0, uses_anonymous_args = 0 + 261 .LVL14: + 262 00cc F3412DE9 stmfd sp!, {r0, r1, r4, r5, r6, r7, r8, lr} + 263 .LCFI1: + 264 .cfi_def_cfa_offset 32 + 265 .loc 2 82 0 + 266 00d0 0040A0E1 mov r4, r0 + 267 .cfi_offset 14, -4 + 268 .cfi_offset 8, -8 + 269 .cfi_offset 7, -12 + 270 .cfi_offset 6, -16 + 271 .cfi_offset 5, -20 + 272 .cfi_offset 4, -24 + 273 .cfi_offset 1, -28 + 274 .cfi_offset 0, -32 + 275 00d4 0160A0E1 mov r6, r1 + 276 00d8 0280A0E1 mov r8, r2 + 277 00dc 0370A0E1 mov r7, r3 + 83:lib/lib_AT91SAM7.c **** int i; + 84:lib/lib_AT91SAM7.c **** + 85:lib/lib_AT91SAM7.c **** // Disable all interrupts and set IVR to the default handler + 86:lib/lib_AT91SAM7.c **** for (i = 0; i < 32; ++i) { + 278 .loc 2 86 0 + 279 00e0 0050A0E3 mov r5, #0 + 280 .LVL15: + 281 .L15: + 282 .LBB4: + 283 .LBB6: + 81:./include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 284 .loc 1 81 0 discriminator 2 + 285 00e4 0130A0E3 mov r3, #1 + 286 00e8 1335A0E1 mov r3, r3, asl r5 + 287 .LVL16: + 288 .LBE6: + 289 .LBE4: + 87:lib/lib_AT91SAM7.c **** AT91F_AIC_DisableIt(pAic, i); + 88:lib/lib_AT91SAM7.c **** AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandl + 290 .loc 2 88 0 discriminator 2 + 291 00ec 0510A0E1 mov r1, r5 + 292 .LBB8: + 293 .LBB5: + 83:./include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 294 .loc 1 83 0 discriminator 2 + 295 00f0 243184E5 str r3, [r4, #292] + 296 .LBE5: + 297 .LBE8: + 298 .loc 2 88 0 discriminator 2 + 299 00f4 0400A0E1 mov r0, r4 + 300 .LBB9: + 301 .LBB7: + 85:./include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 302 .loc 1 85 0 discriminator 2 + 303 00f8 283184E5 str r3, [r4, #296] + 304 .LBE7: + 305 .LBE9: + 306 .loc 2 88 0 discriminator 2 + 307 00fc 0020A0E3 mov r2, #0 + 308 0100 4030A0E3 mov r3, #64 + 309 .LVL17: + 86:lib/lib_AT91SAM7.c **** for (i = 0; i < 32; ++i) { + 310 .loc 2 86 0 discriminator 2 + 311 0104 015085E2 add r5, r5, #1 + 312 .LVL18: + 313 .loc 2 88 0 discriminator 2 + 314 0108 00708DE5 str r7, [sp, #0] + 315 010c FEFFFFEB bl AT91F_AIC_ConfigureIt + 316 .LVL19: + 86:lib/lib_AT91SAM7.c **** for (i = 0; i < 32; ++i) { + 317 .loc 2 86 0 discriminator 2 + 318 0110 200055E3 cmp r5, #32 + 319 0114 F2FFFF1A bne .L15 + 89:lib/lib_AT91SAM7.c **** } + 90:lib/lib_AT91SAM7.c **** + 91:lib/lib_AT91SAM7.c **** // Set the IRQ exception vector + 92:lib/lib_AT91SAM7.c **** AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); + 320 .loc 2 92 0 + 321 0118 0610A0E1 mov r1, r6 + 322 011c 1800A0E3 mov r0, #24 + 323 0120 FEFFFFEB bl AT91F_AIC_SetExceptionVector + 93:lib/lib_AT91SAM7.c **** // Set the Fast Interrupt exception vector + 94:lib/lib_AT91SAM7.c **** AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); + 324 .loc 2 94 0 + 325 0124 1C00A0E3 mov r0, #28 + 326 0128 0810A0E1 mov r1, r8 + 327 012c FEFFFFEB bl AT91F_AIC_SetExceptionVector + 95:lib/lib_AT91SAM7.c **** + 96:lib/lib_AT91SAM7.c **** pAic->AIC_SPU = (unsigned int) SpuriousHandler; + 328 .loc 2 96 0 + 329 0130 20309DE5 ldr r3, [sp, #32] + 330 0134 343184E5 str r3, [r4, #308] + 97:lib/lib_AT91SAM7.c **** pAic->AIC_DCR = protectMode; + 331 .loc 2 97 0 + 332 0138 24309DE5 ldr r3, [sp, #36] + 333 013c 383184E5 str r3, [r4, #312] + 98:lib/lib_AT91SAM7.c **** } + 334 .loc 2 98 0 + 335 0140 FC41BDE8 ldmfd sp!, {r2, r3, r4, r5, r6, r7, r8, lr} + 336 0144 1EFF2FE1 bx lr + 337 .cfi_endproc + 338 .LFE275: + 340 .align 2 + 341 .global AT91F_PDC_Open + 343 AT91F_PDC_Open: + 344 .LFB276: + 99:lib/lib_AT91SAM7.c **** + 100:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 101:lib/lib_AT91SAM7.c **** //* \fn AT91F_PDC_Open + 102:lib/lib_AT91SAM7.c **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 103:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 104:lib/lib_AT91SAM7.c **** void AT91F_PDC_Open(AT91PS_PDC pPDC) // \arg pointer to a PDC controller + 105:lib/lib_AT91SAM7.c **** { + 345 .loc 2 105 0 + 346 .cfi_startproc + 347 @ Function supports interworking. + 348 @ args = 0, pretend = 0, frame = 0 + 349 @ frame_needed = 0, uses_anonymous_args = 0 + 350 .LVL20: + 351 0148 10402DE9 stmfd sp!, {r4, lr} + 352 .LCFI2: + 353 .cfi_def_cfa_offset 8 + 354 .loc 2 105 0 + 355 014c 0040A0E1 mov r4, r0 + 356 .cfi_offset 14, -4 + 357 .cfi_offset 4, -8 + 106:lib/lib_AT91SAM7.c **** //* Disable the RX and TX PDC transfer requests + 107:lib/lib_AT91SAM7.c **** AT91F_PDC_DisableRx(pPDC); + 358 .loc 2 107 0 + 359 0150 B9FFFFEB bl AT91F_PDC_DisableRx + 360 .LVL21: + 108:lib/lib_AT91SAM7.c **** AT91F_PDC_DisableTx(pPDC); + 361 .loc 2 108 0 + 362 0154 0400A0E1 mov r0, r4 + 363 0158 B4FFFFEB bl AT91F_PDC_DisableTx + 109:lib/lib_AT91SAM7.c **** + 110:lib/lib_AT91SAM7.c **** //* Reset all Counter register Next buffer first + 111:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextTx(pPDC, NULL, 0); + 364 .loc 2 111 0 + 365 015c 0010A0E3 mov r1, #0 + 366 0160 0120A0E1 mov r2, r1 + 367 0164 0400A0E1 mov r0, r4 + 368 0168 A7FFFFEB bl AT91F_PDC_SetNextTx + 112:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextRx(pPDC, NULL, 0); + 369 .loc 2 112 0 + 370 016c 0010A0E3 mov r1, #0 + 371 0170 0120A0E1 mov r2, r1 + 372 0174 0400A0E1 mov r0, r4 + 373 0178 A0FFFFEB bl AT91F_PDC_SetNextRx + 113:lib/lib_AT91SAM7.c **** AT91F_PDC_SetTx(pPDC, NULL, 0); + 374 .loc 2 113 0 + 375 017c 0010A0E3 mov r1, #0 + 376 0180 0120A0E1 mov r2, r1 + 377 0184 0400A0E1 mov r0, r4 + 378 0188 A5FFFFEB bl AT91F_PDC_SetTx + 114:lib/lib_AT91SAM7.c **** AT91F_PDC_SetRx(pPDC, NULL, 0); + 379 .loc 2 114 0 + 380 018c 0010A0E3 mov r1, #0 + 381 0190 0400A0E1 mov r0, r4 + 382 0194 0120A0E1 mov r2, r1 + 383 0198 9EFFFFEB bl AT91F_PDC_SetRx + 384 .LVL22: + 385 .LBB14: + 386 .LBB15: + 235:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 387 .loc 1 235 0 + 388 019c 0130A0E3 mov r3, #1 + 389 01a0 203084E5 str r3, [r4, #32] + 390 .LVL23: + 391 .LBE15: + 392 .LBE14: + 393 .LBB16: + 394 .LBB17: + 225:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 395 .loc 1 225 0 + 396 01a4 FF3083E2 add r3, r3, #255 + 397 01a8 203084E5 str r3, [r4, #32] + 398 .LBE17: + 399 .LBE16: + 115:lib/lib_AT91SAM7.c **** + 116:lib/lib_AT91SAM7.c **** //* Enable the RX and TX PDC transfer requests + 117:lib/lib_AT91SAM7.c **** AT91F_PDC_EnableRx(pPDC); + 118:lib/lib_AT91SAM7.c **** AT91F_PDC_EnableTx(pPDC); + 119:lib/lib_AT91SAM7.c **** } + 400 .loc 2 119 0 + 401 01ac 1040BDE8 ldmfd sp!, {r4, lr} + 402 01b0 1EFF2FE1 bx lr + 403 .cfi_endproc + 404 .LFE276: + 406 .align 2 + 407 .global AT91F_PDC_Close + 409 AT91F_PDC_Close: + 410 .LFB277: + 120:lib/lib_AT91SAM7.c **** + 121:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 122:lib/lib_AT91SAM7.c **** //* \fn AT91F_PDC_Close + 123:lib/lib_AT91SAM7.c **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 124:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 125:lib/lib_AT91SAM7.c **** void AT91F_PDC_Close(AT91PS_PDC pPDC) // \arg pointer to a PDC controller + 126:lib/lib_AT91SAM7.c **** { + 411 .loc 2 126 0 + 412 .cfi_startproc + 413 @ Function supports interworking. + 414 @ args = 0, pretend = 0, frame = 0 + 415 @ frame_needed = 0, uses_anonymous_args = 0 + 416 .LVL24: + 417 01b4 10402DE9 stmfd sp!, {r4, lr} + 418 .LCFI3: + 419 .cfi_def_cfa_offset 8 + 420 .loc 2 126 0 + 421 01b8 0040A0E1 mov r4, r0 + 422 .cfi_offset 14, -4 + 423 .cfi_offset 4, -8 + 127:lib/lib_AT91SAM7.c **** //* Disable the RX and TX PDC transfer requests + 128:lib/lib_AT91SAM7.c **** AT91F_PDC_DisableRx(pPDC); + 424 .loc 2 128 0 + 425 01bc 9EFFFFEB bl AT91F_PDC_DisableRx + 426 .LVL25: + 129:lib/lib_AT91SAM7.c **** AT91F_PDC_DisableTx(pPDC); + 427 .loc 2 129 0 + 428 01c0 0400A0E1 mov r0, r4 + 429 01c4 99FFFFEB bl AT91F_PDC_DisableTx + 130:lib/lib_AT91SAM7.c **** + 131:lib/lib_AT91SAM7.c **** //* Reset all Counter register Next buffer first + 132:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextTx(pPDC, NULL, 0); + 430 .loc 2 132 0 + 431 01c8 0010A0E3 mov r1, #0 + 432 01cc 0400A0E1 mov r0, r4 + 433 01d0 0120A0E1 mov r2, r1 + 434 01d4 8CFFFFEB bl AT91F_PDC_SetNextTx + 133:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextRx(pPDC, NULL, 0); + 435 .loc 2 133 0 + 436 01d8 0010A0E3 mov r1, #0 + 437 01dc 0400A0E1 mov r0, r4 + 438 01e0 0120A0E1 mov r2, r1 + 439 01e4 85FFFFEB bl AT91F_PDC_SetNextRx + 134:lib/lib_AT91SAM7.c **** AT91F_PDC_SetTx(pPDC, NULL, 0); + 440 .loc 2 134 0 + 441 01e8 0010A0E3 mov r1, #0 + 442 01ec 0400A0E1 mov r0, r4 + 443 01f0 0120A0E1 mov r2, r1 + 444 01f4 8AFFFFEB bl AT91F_PDC_SetTx + 135:lib/lib_AT91SAM7.c **** AT91F_PDC_SetRx(pPDC, NULL, 0); + 445 .loc 2 135 0 + 446 01f8 0010A0E3 mov r1, #0 + 447 01fc 0400A0E1 mov r0, r4 + 448 0200 0120A0E1 mov r2, r1 + 136:lib/lib_AT91SAM7.c **** + 137:lib/lib_AT91SAM7.c **** } + 449 .loc 2 137 0 + 450 0204 1040BDE8 ldmfd sp!, {r4, lr} + 135:lib/lib_AT91SAM7.c **** AT91F_PDC_SetRx(pPDC, NULL, 0); + 451 .loc 2 135 0 + 452 0208 82FFFFEA b AT91F_PDC_SetRx + 453 .cfi_endproc + 454 .LFE277: + 456 .align 2 + 457 .global AT91F_PDC_SendFrame + 459 AT91F_PDC_SendFrame: + 460 .LFB278: + 138:lib/lib_AT91SAM7.c **** + 139:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 140:lib/lib_AT91SAM7.c **** //* \fn AT91F_PDC_SendFrame + 141:lib/lib_AT91SAM7.c **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 142:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 143:lib/lib_AT91SAM7.c **** unsigned int AT91F_PDC_SendFrame( + 144:lib/lib_AT91SAM7.c **** AT91PS_PDC pPDC, + 145:lib/lib_AT91SAM7.c **** const unsigned char *pBuffer, + 146:lib/lib_AT91SAM7.c **** unsigned int szBuffer, + 147:lib/lib_AT91SAM7.c **** const unsigned char *pNextBuffer, + 148:lib/lib_AT91SAM7.c **** unsigned int szNextBuffer ) + 149:lib/lib_AT91SAM7.c **** { + 461 .loc 2 149 0 + 462 .cfi_startproc + 463 @ Function supports interworking. + 464 @ args = 4, pretend = 0, frame = 0 + 465 @ frame_needed = 0, uses_anonymous_args = 0 + 466 .LVL26: + 467 020c 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 468 .LCFI4: + 469 .cfi_def_cfa_offset 16 + 470 .loc 2 149 0 + 471 0210 0350A0E1 mov r5, r3 + 472 .cfi_offset 14, -4 + 473 .cfi_offset 5, -8 + 474 .cfi_offset 4, -12 + 475 .cfi_offset 3, -16 + 476 .LBB22: + 477 .LBB23: + 265:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 478 .loc 1 265 0 + 479 0214 0C3090E5 ldr r3, [r0, #12] + 480 .LVL27: + 481 .LBE23: + 482 .LBE22: + 150:lib/lib_AT91SAM7.c **** if (AT91F_PDC_IsTxEmpty(pPDC)) { + 483 .loc 2 150 0 + 484 0218 000053E3 cmp r3, #0 + 149:lib/lib_AT91SAM7.c **** { + 485 .loc 2 149 0 + 486 021c 0040A0E1 mov r4, r0 + 487 .loc 2 150 0 + 488 0220 0600001A bne .L19 + 489 .LVL28: + 151:lib/lib_AT91SAM7.c **** //* Buffer and next buffer can be initialized + 152:lib/lib_AT91SAM7.c **** AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + 490 .loc 2 152 0 + 491 0224 7EFFFFEB bl AT91F_PDC_SetTx + 492 .LVL29: + 153:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + 493 .loc 2 153 0 + 494 0228 0400A0E1 mov r0, r4 + 495 022c 0510A0E1 mov r1, r5 + 496 0230 10209DE5 ldr r2, [sp, #16] + 497 0234 74FFFFEB bl AT91F_PDC_SetNextTx + 154:lib/lib_AT91SAM7.c **** return 2; + 498 .loc 2 154 0 + 499 0238 0200A0E3 mov r0, #2 + 500 023c 050000EA b .L20 + 501 .LVL30: + 502 .L19: + 503 .LBB24: + 504 .LBB25: + 275:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 505 .loc 1 275 0 + 506 0240 1C3090E5 ldr r3, [r0, #28] + 507 .LBE25: + 508 .LBE24: + 155:lib/lib_AT91SAM7.c **** } + 156:lib/lib_AT91SAM7.c **** else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + 509 .loc 2 156 0 + 510 0244 000053E3 cmp r3, #0 + 157:lib/lib_AT91SAM7.c **** //* Only one buffer can be initialized + 158:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + 159:lib/lib_AT91SAM7.c **** return 1; + 160:lib/lib_AT91SAM7.c **** } + 161:lib/lib_AT91SAM7.c **** else { + 162:lib/lib_AT91SAM7.c **** //* All buffer are in use... + 163:lib/lib_AT91SAM7.c **** return 0; + 511 .loc 2 163 0 + 512 0248 0000A013 movne r0, #0 + 156:lib/lib_AT91SAM7.c **** else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + 513 .loc 2 156 0 + 514 024c 0100001A bne .L20 + 158:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + 515 .loc 2 158 0 + 516 0250 6DFFFFEB bl AT91F_PDC_SetNextTx + 517 .LVL31: + 159:lib/lib_AT91SAM7.c **** return 1; + 518 .loc 2 159 0 + 519 0254 0100A0E3 mov r0, #1 + 520 .LVL32: + 521 .L20: + 164:lib/lib_AT91SAM7.c **** } + 165:lib/lib_AT91SAM7.c **** } + 522 .loc 2 165 0 + 523 0258 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 524 025c 1EFF2FE1 bx lr + 525 .cfi_endproc + 526 .LFE278: + 528 .align 2 + 529 .global AT91F_PDC_ReceiveFrame + 531 AT91F_PDC_ReceiveFrame: + 532 .LFB279: + 166:lib/lib_AT91SAM7.c **** + 167:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 168:lib/lib_AT91SAM7.c **** //* \fn AT91F_PDC_ReceiveFrame + 169:lib/lib_AT91SAM7.c **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 170:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 171:lib/lib_AT91SAM7.c **** unsigned int AT91F_PDC_ReceiveFrame ( + 172:lib/lib_AT91SAM7.c **** AT91PS_PDC pPDC, + 173:lib/lib_AT91SAM7.c **** unsigned char *pBuffer, + 174:lib/lib_AT91SAM7.c **** unsigned int szBuffer, + 175:lib/lib_AT91SAM7.c **** unsigned char *pNextBuffer, + 176:lib/lib_AT91SAM7.c **** unsigned int szNextBuffer ) + 177:lib/lib_AT91SAM7.c **** { + 533 .loc 2 177 0 + 534 .cfi_startproc + 535 @ Function supports interworking. + 536 @ args = 4, pretend = 0, frame = 0 + 537 @ frame_needed = 0, uses_anonymous_args = 0 + 538 .LVL33: + 539 0260 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 540 .LCFI5: + 541 .cfi_def_cfa_offset 16 + 542 .loc 2 177 0 + 543 0264 0350A0E1 mov r5, r3 + 544 .cfi_offset 14, -4 + 545 .cfi_offset 5, -8 + 546 .cfi_offset 4, -12 + 547 .cfi_offset 3, -16 + 548 .LBB30: + 549 .LBB31: + 285:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 550 .loc 1 285 0 + 551 0268 043090E5 ldr r3, [r0, #4] + 552 .LVL34: + 553 .LBE31: + 554 .LBE30: + 178:lib/lib_AT91SAM7.c **** if (AT91F_PDC_IsRxEmpty(pPDC)) { + 555 .loc 2 178 0 + 556 026c 000053E3 cmp r3, #0 + 177:lib/lib_AT91SAM7.c **** { + 557 .loc 2 177 0 + 558 0270 0040A0E1 mov r4, r0 + 559 .loc 2 178 0 + 560 0274 0600001A bne .L23 + 561 .LVL35: + 179:lib/lib_AT91SAM7.c **** //* Buffer and next buffer can be initialized + 180:lib/lib_AT91SAM7.c **** AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + 562 .loc 2 180 0 + 563 0278 66FFFFEB bl AT91F_PDC_SetRx + 564 .LVL36: + 181:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + 565 .loc 2 181 0 + 566 027c 0400A0E1 mov r0, r4 + 567 0280 0510A0E1 mov r1, r5 + 568 0284 10209DE5 ldr r2, [sp, #16] + 569 0288 5CFFFFEB bl AT91F_PDC_SetNextRx + 182:lib/lib_AT91SAM7.c **** return 2; + 570 .loc 2 182 0 + 571 028c 0200A0E3 mov r0, #2 + 572 0290 050000EA b .L24 + 573 .LVL37: + 574 .L23: + 575 .LBB32: + 576 .LBB33: + 295:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 577 .loc 1 295 0 + 578 0294 143090E5 ldr r3, [r0, #20] + 579 .LBE33: + 580 .LBE32: + 183:lib/lib_AT91SAM7.c **** } + 184:lib/lib_AT91SAM7.c **** else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + 581 .loc 2 184 0 + 582 0298 000053E3 cmp r3, #0 + 185:lib/lib_AT91SAM7.c **** //* Only one buffer can be initialized + 186:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + 187:lib/lib_AT91SAM7.c **** return 1; + 188:lib/lib_AT91SAM7.c **** } + 189:lib/lib_AT91SAM7.c **** else { + 190:lib/lib_AT91SAM7.c **** //* All buffer are in use... + 191:lib/lib_AT91SAM7.c **** return 0; + 583 .loc 2 191 0 + 584 029c 0000A013 movne r0, #0 + 184:lib/lib_AT91SAM7.c **** else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + 585 .loc 2 184 0 + 586 02a0 0100001A bne .L24 + 186:lib/lib_AT91SAM7.c **** AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + 587 .loc 2 186 0 + 588 02a4 55FFFFEB bl AT91F_PDC_SetNextRx + 589 .LVL38: + 187:lib/lib_AT91SAM7.c **** return 1; + 590 .loc 2 187 0 + 591 02a8 0100A0E3 mov r0, #1 + 592 .LVL39: + 593 .L24: + 192:lib/lib_AT91SAM7.c **** } + 193:lib/lib_AT91SAM7.c **** } + 594 .loc 2 193 0 + 595 02ac 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 596 02b0 1EFF2FE1 bx lr + 597 .cfi_endproc + 598 .LFE279: + 600 .global __aeabi_uidiv + 601 .align 2 + 602 .global AT91F_PMC_GetMasterClock + 604 AT91F_PMC_GetMasterClock: + 605 .LFB280: + 194:lib/lib_AT91SAM7.c **** + 195:lib/lib_AT91SAM7.c **** //*------------------------------------------------------------------------------ + 196:lib/lib_AT91SAM7.c **** //* \fn AT91F_PMC_GetMasterClock + 197:lib/lib_AT91SAM7.c **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 + 198:lib/lib_AT91SAM7.c **** //*------------------------------------------------------------------------------ + 199:lib/lib_AT91SAM7.c **** unsigned int AT91F_PMC_GetMasterClock ( + 200:lib/lib_AT91SAM7.c **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 201:lib/lib_AT91SAM7.c **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 202:lib/lib_AT91SAM7.c **** unsigned int slowClock) // \arg slowClock in Hz + 203:lib/lib_AT91SAM7.c **** { + 606 .loc 2 203 0 + 607 .cfi_startproc + 608 @ Function supports interworking. + 609 @ args = 0, pretend = 0, frame = 0 + 610 @ frame_needed = 0, uses_anonymous_args = 0 + 611 .LVL40: + 612 02b4 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 613 .LCFI6: + 614 .cfi_def_cfa_offset 16 + 615 .loc 2 203 0 + 616 02b8 0030A0E1 mov r3, r0 + 617 .cfi_offset 14, -4 + 618 .cfi_offset 5, -8 + 619 .cfi_offset 4, -12 + 620 .cfi_offset 3, -16 + 204:lib/lib_AT91SAM7.c **** unsigned int reg = pPMC->PMC_MCKR; + 621 .loc 2 204 0 + 622 02bc 303093E5 ldr r3, [r3, #48] + 623 .LVL41: + 203:lib/lib_AT91SAM7.c **** { + 624 .loc 2 203 0 + 625 02c0 0100A0E1 mov r0, r1 + 626 .LVL42: + 205:lib/lib_AT91SAM7.c **** unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 627 .loc 2 205 0 + 628 02c4 1C4003E2 and r4, r3, #28 + 629 02c8 0110A0E3 mov r1, #1 + 630 .LVL43: + 206:lib/lib_AT91SAM7.c **** unsigned int pllDivider, pllMultiplier; + 207:lib/lib_AT91SAM7.c **** + 208:lib/lib_AT91SAM7.c **** switch (reg & AT91C_PMC_CSS) { + 631 .loc 2 208 0 + 632 02cc 033003E2 and r3, r3, #3 + 633 .LVL44: + 205:lib/lib_AT91SAM7.c **** unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 634 .loc 2 205 0 + 635 02d0 2441A0E1 mov r4, r4, lsr #2 + 636 .loc 2 208 0 + 637 02d4 010053E1 cmp r3, r1 + 205:lib/lib_AT91SAM7.c **** unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 638 .loc 2 205 0 + 639 02d8 1144A0E1 mov r4, r1, asl r4 + 640 .LVL45: + 641 .loc 2 208 0 + 642 02dc 0500000A beq .L29 + 209:lib/lib_AT91SAM7.c **** case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + 210:lib/lib_AT91SAM7.c **** return slowClock / prescaler; + 643 .loc 2 210 0 + 644 02e0 0200A031 movcc r0, r2 + 645 .LVL46: + 208:lib/lib_AT91SAM7.c **** switch (reg & AT91C_PMC_CSS) { + 646 .loc 2 208 0 + 647 02e4 1000003A bcc .L33 + 648 02e8 030053E3 cmp r3, #3 + 211:lib/lib_AT91SAM7.c **** case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + 212:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + 213:lib/lib_AT91SAM7.c **** case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + 214:lib/lib_AT91SAM7.c **** reg = pCKGR->CKGR_PLLR; + 215:lib/lib_AT91SAM7.c **** pllDivider = (reg & AT91C_CKGR_DIV); + 216:lib/lib_AT91SAM7.c **** pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + 217:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 218:lib/lib_AT91SAM7.c **** } + 219:lib/lib_AT91SAM7.c **** return 0; + 649 .loc 2 219 0 + 650 02ec 0000A013 movne r0, #0 + 208:lib/lib_AT91SAM7.c **** switch (reg & AT91C_PMC_CSS) { + 651 .loc 2 208 0 + 652 02f0 0F00001A bne .L27 + 653 02f4 020000EA b .L34 + 654 .LVL47: + 655 .L29: + 212:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + 656 .loc 2 212 0 + 657 02f8 0210A0E1 mov r1, r2 + 658 02fc 51FFFFEB bl AT91F_CKGR_GetMainClock + 659 .LVL48: + 660 0300 090000EA b .L33 + 661 .LVL49: + 662 .L34: + 214:lib/lib_AT91SAM7.c **** reg = pCKGR->CKGR_PLLR; + 663 .loc 2 214 0 + 664 0304 0C5090E5 ldr r5, [r0, #12] + 665 .LVL50: + 217:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 666 .loc 2 217 0 + 667 0308 0210A0E1 mov r1, r2 + 668 030c 4DFFFFEB bl AT91F_CKGR_GetMainClock + 669 .LVL51: + 215:lib/lib_AT91SAM7.c **** pllDivider = (reg & AT91C_CKGR_DIV); + 670 .loc 2 215 0 + 671 0310 FF1005E2 and r1, r5, #255 + 217:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 672 .loc 2 217 0 + 673 0314 FEFFFFEB bl __aeabi_uidiv + 216:lib/lib_AT91SAM7.c **** pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + 674 .loc 2 216 0 + 675 0318 1C309FE5 ldr r3, .L35 + 676 031c 033005E0 and r3, r5, r3 + 677 0320 2338A0E1 mov r3, r3, lsr #16 + 678 0324 013083E2 add r3, r3, #1 + 217:lib/lib_AT91SAM7.c **** return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 679 .loc 2 217 0 + 680 0328 930000E0 mul r0, r3, r0 + 681 .LVL52: + 682 .L33: + 683 032c 0410A0E1 mov r1, r4 + 684 0330 FEFFFFEB bl __aeabi_uidiv + 685 .L27: + 220:lib/lib_AT91SAM7.c **** } + 686 .loc 2 220 0 + 687 0334 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 688 0338 1EFF2FE1 bx lr + 689 .L36: + 690 .align 2 + 691 .L35: + 692 033c 0000FF07 .word 134152192 + 693 .cfi_endproc + 694 .LFE280: + 696 .align 2 + 697 .global AT91F_RTTReadValue + 699 AT91F_RTTReadValue: + 700 .LFB281: + 221:lib/lib_AT91SAM7.c **** + 222:lib/lib_AT91SAM7.c **** //*-------------------------------------------------------------------------------------- + 223:lib/lib_AT91SAM7.c **** //* \fn AT91F_RTT_ReadValue() + 224:lib/lib_AT91SAM7.c **** //* \brief Read the RTT value + 225:lib/lib_AT91SAM7.c **** //*-------------------------------------------------------------------------------------- + 226:lib/lib_AT91SAM7.c **** unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC) + 227:lib/lib_AT91SAM7.c **** { + 701 .loc 2 227 0 + 702 .cfi_startproc + 703 @ Function supports interworking. + 704 @ args = 0, pretend = 0, frame = 8 + 705 @ frame_needed = 0, uses_anonymous_args = 0 + 706 @ link register save eliminated. + 707 .LVL53: + 708 0340 08D04DE2 sub sp, sp, #8 + 709 .LCFI7: + 710 .cfi_def_cfa_offset 8 + 711 .LVL54: + 712 .L38: + 228:lib/lib_AT91SAM7.c **** register volatile unsigned int val1,val2; + 229:lib/lib_AT91SAM7.c **** do + 230:lib/lib_AT91SAM7.c **** { + 231:lib/lib_AT91SAM7.c **** val1 = pRTTC->RTTC_RTVR; + 713 .loc 2 231 0 discriminator 1 + 714 0344 083090E5 ldr r3, [r0, #8] + 715 .LVL55: + 716 0348 04308DE5 str r3, [sp, #4] + 232:lib/lib_AT91SAM7.c **** val2 = pRTTC->RTTC_RTVR; + 717 .loc 2 232 0 discriminator 1 + 718 034c 083090E5 ldr r3, [r0, #8] + 719 .LVL56: + 720 0350 00308DE5 str r3, [sp, #0] + 233:lib/lib_AT91SAM7.c **** } + 234:lib/lib_AT91SAM7.c **** while(val1 != val2); + 721 .loc 2 234 0 discriminator 1 + 722 0354 04209DE5 ldr r2, [sp, #4] + 723 0358 00309DE5 ldr r3, [sp, #0] + 724 .LVL57: + 725 035c 030052E1 cmp r2, r3 + 726 0360 F7FFFF1A bne .L38 + 235:lib/lib_AT91SAM7.c **** return(val1); + 727 .loc 2 235 0 + 728 0364 04009DE5 ldr r0, [sp, #4] + 729 .LVL58: + 236:lib/lib_AT91SAM7.c **** } + 730 .loc 2 236 0 + 731 0368 08D08DE2 add sp, sp, #8 + 732 036c 1EFF2FE1 bx lr + 733 .cfi_endproc + 734 .LFE281: + 736 .align 2 + 737 .global AT91F_SPI_Close + 739 AT91F_SPI_Close: + 740 .LFB282: + 237:lib/lib_AT91SAM7.c **** + 238:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 239:lib/lib_AT91SAM7.c **** //* \fn AT91F_SPI_Close + 240:lib/lib_AT91SAM7.c **** //* \brief Close SPI: disable IT disable transfert, close PDC + 241:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 242:lib/lib_AT91SAM7.c **** void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller + 243:lib/lib_AT91SAM7.c **** { + 741 .loc 2 243 0 + 742 .cfi_startproc + 743 @ Function supports interworking. + 744 @ args = 0, pretend = 0, frame = 0 + 745 @ frame_needed = 0, uses_anonymous_args = 0 + 746 .LVL59: + 244:lib/lib_AT91SAM7.c **** //* Reset all the Chip Select register + 245:lib/lib_AT91SAM7.c **** pSPI->SPI_CSR[0] = 0 ; + 747 .loc 2 245 0 + 748 0370 0030A0E3 mov r3, #0 + 243:lib/lib_AT91SAM7.c **** { + 749 .loc 2 243 0 + 750 0374 10402DE9 stmfd sp!, {r4, lr} + 751 .LCFI8: + 752 .cfi_def_cfa_offset 8 + 753 .loc 2 245 0 + 754 0378 303080E5 str r3, [r0, #48] + 246:lib/lib_AT91SAM7.c **** pSPI->SPI_CSR[1] = 0 ; + 755 .loc 2 246 0 + 756 037c 343080E5 str r3, [r0, #52] + 247:lib/lib_AT91SAM7.c **** pSPI->SPI_CSR[2] = 0 ; + 757 .loc 2 247 0 + 758 0380 383080E5 str r3, [r0, #56] + 248:lib/lib_AT91SAM7.c **** pSPI->SPI_CSR[3] = 0 ; + 759 .loc 2 248 0 + 760 0384 3C3080E5 str r3, [r0, #60] + 249:lib/lib_AT91SAM7.c **** + 250:lib/lib_AT91SAM7.c **** //* Reset the SPI mode + 251:lib/lib_AT91SAM7.c **** pSPI->SPI_MR = 0 ; + 761 .loc 2 251 0 + 762 0388 043080E5 str r3, [r0, #4] + 252:lib/lib_AT91SAM7.c **** + 253:lib/lib_AT91SAM7.c **** //* Disable all interrupts + 254:lib/lib_AT91SAM7.c **** pSPI->SPI_IDR = 0xFFFFFFFF ; + 763 .loc 2 254 0 + 764 038c 0030E0E3 mvn r3, #0 + 765 0390 183080E5 str r3, [r0, #24] + 243:lib/lib_AT91SAM7.c **** { + 766 .loc 2 243 0 + 767 0394 0040A0E1 mov r4, r0 + 768 .cfi_offset 14, -4 + 769 .cfi_offset 4, -8 + 255:lib/lib_AT91SAM7.c **** + 256:lib/lib_AT91SAM7.c **** //* Abort the Peripheral Data Transfers + 257:lib/lib_AT91SAM7.c **** AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); + 770 .loc 2 257 0 + 771 0398 010C80E2 add r0, r0, #256 + 772 .LVL60: + 773 039c FEFFFFEB bl AT91F_PDC_Close + 258:lib/lib_AT91SAM7.c **** + 259:lib/lib_AT91SAM7.c **** //* Disable receiver and transmitter and stop any activity immediately + 260:lib/lib_AT91SAM7.c **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; + 774 .loc 2 260 0 + 775 03a0 0230A0E3 mov r3, #2 + 776 03a4 003084E5 str r3, [r4, #0] + 261:lib/lib_AT91SAM7.c **** } + 777 .loc 2 261 0 + 778 03a8 1040BDE8 ldmfd sp!, {r4, lr} + 779 03ac 1EFF2FE1 bx lr + 780 .cfi_endproc + 781 .LFE282: + 783 .align 2 + 784 .global AT91F_ADC_CfgTimings + 786 AT91F_ADC_CfgTimings: + 787 .LFB283: + 262:lib/lib_AT91SAM7.c **** + 263:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 264:lib/lib_AT91SAM7.c **** //* \fn AT91F_ADC_CfgTimings + 265:lib/lib_AT91SAM7.c **** //* \brief Configure the different necessary timings of the ADC controller + 266:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 267:lib/lib_AT91SAM7.c **** void AT91F_ADC_CfgTimings ( + 268:lib/lib_AT91SAM7.c **** AT91PS_ADC pADC, // pointer to a ADC controller + 269:lib/lib_AT91SAM7.c **** unsigned int mck_clock, // in MHz + 270:lib/lib_AT91SAM7.c **** unsigned int adc_clock, // in MHz + 271:lib/lib_AT91SAM7.c **** unsigned int startup_time, // in us + 272:lib/lib_AT91SAM7.c **** unsigned int sample_and_hold_time) // in ns + 273:lib/lib_AT91SAM7.c **** { + 788 .loc 2 273 0 + 789 .cfi_startproc + 790 @ Function supports interworking. + 791 @ args = 4, pretend = 0, frame = 0 + 792 @ frame_needed = 0, uses_anonymous_args = 0 + 793 .LVL61: + 794 03b0 F8402DE9 stmfd sp!, {r3, r4, r5, r6, r7, lr} + 795 .LCFI9: + 796 .cfi_def_cfa_offset 24 + 797 .loc 2 273 0 + 798 03b4 0040A0E1 mov r4, r0 + 799 .cfi_offset 14, -4 + 800 .cfi_offset 7, -8 + 801 .cfi_offset 6, -12 + 802 .cfi_offset 5, -16 + 803 .cfi_offset 4, -20 + 804 .cfi_offset 3, -24 + 274:lib/lib_AT91SAM7.c **** unsigned int prescal,startup,shtim; + 275:lib/lib_AT91SAM7.c **** + 276:lib/lib_AT91SAM7.c **** prescal = mck_clock/(2*adc_clock) - 1; + 805 .loc 2 276 0 + 806 03b8 0100A0E1 mov r0, r1 + 807 .LVL62: + 808 03bc 8210A0E1 mov r1, r2, asl #1 + 809 .LVL63: + 277:lib/lib_AT91SAM7.c **** startup = adc_clock*startup_time/8 - 1; + 810 .loc 2 277 0 + 811 03c0 920307E0 mul r7, r2, r3 + 273:lib/lib_AT91SAM7.c **** { + 812 .loc 2 273 0 + 813 03c4 0250A0E1 mov r5, r2 + 276:lib/lib_AT91SAM7.c **** prescal = mck_clock/(2*adc_clock) - 1; + 814 .loc 2 276 0 + 815 03c8 FEFFFFEB bl __aeabi_uidiv + 816 .LVL64: + 817 03cc 016040E2 sub r6, r0, #1 + 278:lib/lib_AT91SAM7.c **** shtim = adc_clock*sample_and_hold_time/1000 - 1; + 818 .loc 2 278 0 + 819 03d0 18009DE5 ldr r0, [sp, #24] + 820 03d4 FA1FA0E3 mov r1, #1000 + 821 03d8 950000E0 mul r0, r5, r0 + 822 03dc FEFFFFEB bl __aeabi_uidiv + 277:lib/lib_AT91SAM7.c **** startup = adc_clock*startup_time/8 - 1; + 823 .loc 2 277 0 + 824 03e0 A771A0E1 mov r7, r7, lsr #3 + 825 03e4 017047E2 sub r7, r7, #1 + 826 .LVL65: + 279:lib/lib_AT91SAM7.c **** + 280:lib/lib_AT91SAM7.c **** //* Write to the MR register + 281:lib/lib_AT91SAM7.c **** pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (sht + 827 .loc 2 281 0 + 828 03e8 0778A0E1 mov r7, r7, asl #16 + 829 .LVL66: + 830 03ec 0664A0E1 mov r6, r6, asl #8 + 278:lib/lib_AT91SAM7.c **** shtim = adc_clock*sample_and_hold_time/1000 - 1; + 831 .loc 2 278 0 + 832 03f0 013040E2 sub r3, r0, #1 + 833 .loc 2 281 0 + 834 03f4 1F7807E2 and r7, r7, #2031616 + 835 03f8 3F6C06E2 and r6, r6, #16128 + 836 03fc 033CA0E1 mov r3, r3, asl #24 + 837 0400 066087E1 orr r6, r7, r6 + 838 0404 0F3403E2 and r3, r3, #251658240 + 839 0408 036086E1 orr r6, r6, r3 + 840 040c 046084E5 str r6, [r4, #4] + 282:lib/lib_AT91SAM7.c **** } + 841 .loc 2 282 0 + 842 0410 F840BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, lr} + 843 0414 1EFF2FE1 bx lr + 844 .cfi_endproc + 845 .LFE283: + 847 .global __aeabi_uidivmod + 848 .align 2 + 849 .global AT91F_SSC_SetBaudrate + 851 AT91F_SSC_SetBaudrate: + 852 .LFB284: + 283:lib/lib_AT91SAM7.c **** + 284:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 285:lib/lib_AT91SAM7.c **** //* \fn AT91F_SSC_SetBaudrate + 286:lib/lib_AT91SAM7.c **** //* \brief Set the baudrate according to the CPU clock + 287:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 288:lib/lib_AT91SAM7.c **** void AT91F_SSC_SetBaudrate ( + 289:lib/lib_AT91SAM7.c **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller + 290:lib/lib_AT91SAM7.c **** unsigned int mainClock, // \arg peripheral clock + 291:lib/lib_AT91SAM7.c **** unsigned int speed) // \arg SSC baudrate + 292:lib/lib_AT91SAM7.c **** { + 853 .loc 2 292 0 + 854 .cfi_startproc + 855 @ Function supports interworking. + 856 @ args = 0, pretend = 0, frame = 0 + 857 @ frame_needed = 0, uses_anonymous_args = 0 + 858 .LVL67: + 293:lib/lib_AT91SAM7.c **** unsigned int baud_value; + 294:lib/lib_AT91SAM7.c **** //* Define the baud rate divisor register + 295:lib/lib_AT91SAM7.c **** if (speed == 0) + 859 .loc 2 295 0 + 860 0418 000052E3 cmp r2, #0 + 292:lib/lib_AT91SAM7.c **** { + 861 .loc 2 292 0 + 862 041c 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 863 .LCFI10: + 864 .cfi_def_cfa_offset 16 + 292:lib/lib_AT91SAM7.c **** { + 865 .loc 2 292 0 + 866 0420 0040A0E1 mov r4, r0 + 867 .cfi_offset 14, -4 + 868 .cfi_offset 6, -8 + 869 .cfi_offset 5, -12 + 870 .cfi_offset 4, -16 + 296:lib/lib_AT91SAM7.c **** baud_value = 0; + 871 .loc 2 296 0 + 872 0424 0200A001 moveq r0, r2 + 873 .LVL68: + 295:lib/lib_AT91SAM7.c **** if (speed == 0) + 874 .loc 2 295 0 + 875 0428 1000000A beq .L42 + 297:lib/lib_AT91SAM7.c **** else + 298:lib/lib_AT91SAM7.c **** { + 299:lib/lib_AT91SAM7.c **** baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 876 .loc 2 299 0 + 877 042c 0A50A0E3 mov r5, #10 + 878 0430 950100E0 mul r0, r5, r1 + 879 0434 8210A0E1 mov r1, r2, asl #1 + 880 .LVL69: + 881 0438 FEFFFFEB bl __aeabi_uidiv + 882 .LVL70: + 300:lib/lib_AT91SAM7.c **** if ((baud_value % 10) >= 5) + 883 .loc 2 300 0 + 884 043c 0510A0E1 mov r1, r5 + 299:lib/lib_AT91SAM7.c **** baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 885 .loc 2 299 0 + 886 0440 0060A0E1 mov r6, r0 + 887 .LVL71: + 888 .loc 2 300 0 + 889 0444 FEFFFFEB bl __aeabi_uidivmod + 890 .LVL72: + 891 0448 040051E3 cmp r1, #4 + 892 044c 0400009A bls .L43 + 301:lib/lib_AT91SAM7.c **** baud_value = (baud_value / 10) + 1; + 893 .loc 2 301 0 + 894 0450 0600A0E1 mov r0, r6 + 895 0454 0510A0E1 mov r1, r5 + 896 0458 FEFFFFEB bl __aeabi_uidiv + 897 045c 010080E2 add r0, r0, #1 + 898 .LVL73: + 899 0460 020000EA b .L42 + 900 .LVL74: + 901 .L43: + 302:lib/lib_AT91SAM7.c **** else + 303:lib/lib_AT91SAM7.c **** baud_value /= 10; + 902 .loc 2 303 0 + 903 0464 0600A0E1 mov r0, r6 + 904 0468 0510A0E1 mov r1, r5 + 905 046c FEFFFFEB bl __aeabi_uidiv + 906 .LVL75: + 907 .L42: + 304:lib/lib_AT91SAM7.c **** } + 305:lib/lib_AT91SAM7.c **** + 306:lib/lib_AT91SAM7.c **** pSSC->SSC_CMR = baud_value; + 908 .loc 2 306 0 + 909 0470 040084E5 str r0, [r4, #4] + 307:lib/lib_AT91SAM7.c **** } + 910 .loc 2 307 0 + 911 0474 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 912 0478 1EFF2FE1 bx lr + 913 .cfi_endproc + 914 .LFE284: + 916 .align 2 + 917 .global AT91F_SSC_Configure + 919 AT91F_SSC_Configure: + 920 .LFB285: + 308:lib/lib_AT91SAM7.c **** + 309:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 310:lib/lib_AT91SAM7.c **** //* \fn AT91F_SSC_Configure + 311:lib/lib_AT91SAM7.c **** //* \brief Configure SSC + 312:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 313:lib/lib_AT91SAM7.c **** void AT91F_SSC_Configure ( + 314:lib/lib_AT91SAM7.c **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller + 315:lib/lib_AT91SAM7.c **** unsigned int syst_clock, // \arg System Clock Frequency + 316:lib/lib_AT91SAM7.c **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency + 317:lib/lib_AT91SAM7.c **** unsigned int clock_rx, // \arg Receiver Clock Parameters + 318:lib/lib_AT91SAM7.c **** unsigned int mode_rx, // \arg mode Register to be programmed + 319:lib/lib_AT91SAM7.c **** unsigned int clock_tx, // \arg Transmitter Clock Parameters + 320:lib/lib_AT91SAM7.c **** unsigned int mode_tx) // \arg mode Register to be programmed + 321:lib/lib_AT91SAM7.c **** { + 921 .loc 2 321 0 + 922 .cfi_startproc + 923 @ Function supports interworking. + 924 @ args = 12, pretend = 0, frame = 0 + 925 @ frame_needed = 0, uses_anonymous_args = 0 + 926 .LVL76: + 927 047c F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 928 .LCFI11: + 929 .cfi_def_cfa_offset 24 + 930 .loc 2 321 0 + 931 0480 0380A0E1 mov r8, r3 + 932 .cfi_offset 14, -4 + 933 .cfi_offset 8, -8 + 934 .cfi_offset 7, -12 + 935 .cfi_offset 6, -16 + 936 .cfi_offset 5, -20 + 937 .cfi_offset 4, -24 + 322:lib/lib_AT91SAM7.c **** //* Disable interrupts + 323:lib/lib_AT91SAM7.c **** pSSC->SSC_IDR = (unsigned int) -1; + 938 .loc 2 323 0 + 939 0484 0030E0E3 mvn r3, #0 + 940 .LVL77: + 941 0488 483080E5 str r3, [r0, #72] + 324:lib/lib_AT91SAM7.c **** + 325:lib/lib_AT91SAM7.c **** //* Reset receiver and transmitter + 326:lib/lib_AT91SAM7.c **** pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + 942 .loc 2 326 0 + 943 048c 30309FE5 ldr r3, .L46 + 944 0490 003080E5 str r3, [r0, #0] + 321:lib/lib_AT91SAM7.c **** { + 945 .loc 2 321 0 + 946 0494 0040A0E1 mov r4, r0 + 947 0498 18608DE2 add r6, sp, #24 + 948 049c C00096E8 ldmia r6, {r6, r7} @ phole ldm + 949 04a0 20509DE5 ldr r5, [sp, #32] + 327:lib/lib_AT91SAM7.c **** + 328:lib/lib_AT91SAM7.c **** //* Define the Clock Mode Register + 329:lib/lib_AT91SAM7.c **** AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); + 950 .loc 2 329 0 + 951 04a4 FEFFFFEB bl AT91F_SSC_SetBaudrate + 952 .LVL78: + 330:lib/lib_AT91SAM7.c **** + 331:lib/lib_AT91SAM7.c **** //* Write the Receive Clock Mode Register + 332:lib/lib_AT91SAM7.c **** pSSC->SSC_RCMR = clock_rx; + 333:lib/lib_AT91SAM7.c **** + 334:lib/lib_AT91SAM7.c **** //* Write the Transmit Clock Mode Register + 335:lib/lib_AT91SAM7.c **** pSSC->SSC_TCMR = clock_tx; + 336:lib/lib_AT91SAM7.c **** + 337:lib/lib_AT91SAM7.c **** //* Write the Receive Frame Mode Register + 338:lib/lib_AT91SAM7.c **** pSSC->SSC_RFMR = mode_rx; + 339:lib/lib_AT91SAM7.c **** + 340:lib/lib_AT91SAM7.c **** //* Write the Transmit Frame Mode Register + 341:lib/lib_AT91SAM7.c **** pSSC->SSC_TFMR = mode_tx; + 342:lib/lib_AT91SAM7.c **** + 343:lib/lib_AT91SAM7.c **** //* Clear Transmit and Receive Counters + 344:lib/lib_AT91SAM7.c **** AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + 953 .loc 2 344 0 + 954 04a8 010C84E2 add r0, r4, #256 + 332:lib/lib_AT91SAM7.c **** pSSC->SSC_RCMR = clock_rx; + 955 .loc 2 332 0 + 956 04ac 108084E5 str r8, [r4, #16] + 335:lib/lib_AT91SAM7.c **** pSSC->SSC_TCMR = clock_tx; + 957 .loc 2 335 0 + 958 04b0 187084E5 str r7, [r4, #24] + 338:lib/lib_AT91SAM7.c **** pSSC->SSC_RFMR = mode_rx; + 959 .loc 2 338 0 + 960 04b4 146084E5 str r6, [r4, #20] + 341:lib/lib_AT91SAM7.c **** pSSC->SSC_TFMR = mode_tx; + 961 .loc 2 341 0 + 962 04b8 1C5084E5 str r5, [r4, #28] + 345:lib/lib_AT91SAM7.c **** + 346:lib/lib_AT91SAM7.c **** + 347:lib/lib_AT91SAM7.c **** } + 963 .loc 2 347 0 + 964 04bc F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 344:lib/lib_AT91SAM7.c **** AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + 965 .loc 2 344 0 + 966 04c0 FEFFFFEA b AT91F_PDC_Open + 967 .L47: + 968 .align 2 + 969 .L46: + 970 04c4 02820000 .word 33282 + 971 .cfi_endproc + 972 .LFE285: + 974 .align 2 + 975 .global AT91F_US_Configure + 977 AT91F_US_Configure: + 978 .LFB286: + 348:lib/lib_AT91SAM7.c **** + 349:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 350:lib/lib_AT91SAM7.c **** //* \fn AT91F_US_Configure + 351:lib/lib_AT91SAM7.c **** //* \brief Configure USART + 352:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 353:lib/lib_AT91SAM7.c **** void AT91F_US_Configure ( + 354:lib/lib_AT91SAM7.c **** AT91PS_USART pUSART, // \arg pointer to a USART controller + 355:lib/lib_AT91SAM7.c **** unsigned int mainClock, // \arg peripheral clock + 356:lib/lib_AT91SAM7.c **** unsigned int mode , // \arg mode Register to be programmed + 357:lib/lib_AT91SAM7.c **** unsigned int baudRate , // \arg baudrate to be programmed + 358:lib/lib_AT91SAM7.c **** unsigned int timeguard ) // \arg timeguard to be programmed + 359:lib/lib_AT91SAM7.c **** { + 979 .loc 2 359 0 + 980 .cfi_startproc + 981 @ Function supports interworking. + 982 @ args = 4, pretend = 0, frame = 0 + 983 @ frame_needed = 0, uses_anonymous_args = 0 + 984 .LVL79: + 985 04c8 F8402DE9 stmfd sp!, {r3, r4, r5, r6, r7, lr} + 986 .LCFI12: + 987 .cfi_def_cfa_offset 24 + 988 .loc 2 359 0 + 989 04cc 0260A0E1 mov r6, r2 + 990 .cfi_offset 14, -4 + 991 .cfi_offset 7, -8 + 992 .cfi_offset 6, -12 + 993 .cfi_offset 5, -16 + 994 .cfi_offset 4, -20 + 995 .cfi_offset 3, -24 + 360:lib/lib_AT91SAM7.c **** //* Disable interrupts + 361:lib/lib_AT91SAM7.c **** pUSART->US_IDR = (unsigned int) -1; + 996 .loc 2 361 0 + 997 04d0 0020E0E3 mvn r2, #0 + 998 .LVL80: + 999 04d4 0C2080E5 str r2, [r0, #12] + 1000 .LBB40: + 1001 .LBB42: + 1002 .LBB44: + 1003 .LBB45: +1038:./include/lib_AT91SAM7.h **** +1039:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:./include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:./include/lib_AT91SAM7.h **** unsigned int mode) +1046:./include/lib_AT91SAM7.h **** { +1047:./include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:./include/lib_AT91SAM7.h **** } +1049:./include/lib_AT91SAM7.h **** +1050:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:./include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:./include/lib_AT91SAM7.h **** { +1057:./include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:./include/lib_AT91SAM7.h **** } +1059:./include/lib_AT91SAM7.h **** +1060:./include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:./include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:./include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:./include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:./include/lib_AT91SAM7.h **** +1069:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:./include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:./include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:./include/lib_AT91SAM7.h **** unsigned int mode) +1077:./include/lib_AT91SAM7.h **** { +1078:./include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:./include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:./include/lib_AT91SAM7.h **** } +1081:./include/lib_AT91SAM7.h **** +1082:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:./include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:./include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:./include/lib_AT91SAM7.h **** { +1090:./include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:./include/lib_AT91SAM7.h **** } +1092:./include/lib_AT91SAM7.h **** +1093:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:./include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:./include/lib_AT91SAM7.h **** { +1101:./include/lib_AT91SAM7.h **** //* Write to the IER register +1102:./include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:./include/lib_AT91SAM7.h **** } +1104:./include/lib_AT91SAM7.h **** +1105:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:./include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:./include/lib_AT91SAM7.h **** { +1113:./include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:./include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:./include/lib_AT91SAM7.h **** } +1116:./include/lib_AT91SAM7.h **** +1117:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:./include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:./include/lib_AT91SAM7.h **** { +1124:./include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:./include/lib_AT91SAM7.h **** } +1126:./include/lib_AT91SAM7.h **** +1127:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:./include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:./include/lib_AT91SAM7.h **** { +1134:./include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:./include/lib_AT91SAM7.h **** } +1136:./include/lib_AT91SAM7.h **** +1137:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:./include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:./include/lib_AT91SAM7.h **** { +1145:./include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:./include/lib_AT91SAM7.h **** } +1147:./include/lib_AT91SAM7.h **** +1148:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:./include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:./include/lib_AT91SAM7.h **** { +1156:./include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:./include/lib_AT91SAM7.h **** } +1158:./include/lib_AT91SAM7.h **** +1159:./include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:./include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:./include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:./include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:./include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:./include/lib_AT91SAM7.h **** unsigned int mode) +1166:./include/lib_AT91SAM7.h **** { +1167:./include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:./include/lib_AT91SAM7.h **** } +1169:./include/lib_AT91SAM7.h **** +1170:./include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:./include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:./include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:./include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:./include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:./include/lib_AT91SAM7.h **** { +1177:./include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:./include/lib_AT91SAM7.h **** } +1179:./include/lib_AT91SAM7.h **** +1180:./include/lib_AT91SAM7.h **** +1181:./include/lib_AT91SAM7.h **** +1182:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:./include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:./include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:./include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:./include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:./include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:./include/lib_AT91SAM7.h **** unsigned int reset) +1192:./include/lib_AT91SAM7.h **** { +1193:./include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:./include/lib_AT91SAM7.h **** } +1195:./include/lib_AT91SAM7.h **** +1196:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:./include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:./include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:./include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:./include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:./include/lib_AT91SAM7.h **** unsigned int mode) +1203:./include/lib_AT91SAM7.h **** { +1204:./include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:./include/lib_AT91SAM7.h **** } +1206:./include/lib_AT91SAM7.h **** +1207:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:./include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:./include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:./include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:./include/lib_AT91SAM7.h **** { +1214:./include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:./include/lib_AT91SAM7.h **** } +1216:./include/lib_AT91SAM7.h **** +1217:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:./include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:./include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:./include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:./include/lib_AT91SAM7.h **** { +1224:./include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:./include/lib_AT91SAM7.h **** } +1226:./include/lib_AT91SAM7.h **** +1227:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:./include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:./include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:./include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:./include/lib_AT91SAM7.h **** { +1234:./include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:./include/lib_AT91SAM7.h **** } +1236:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:./include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:./include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:./include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:./include/lib_AT91SAM7.h **** unsigned int ms) +1246:./include/lib_AT91SAM7.h **** { +1247:./include/lib_AT91SAM7.h **** if (ms > 2000) +1248:./include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:./include/lib_AT91SAM7.h **** return 0; +1252:./include/lib_AT91SAM7.h **** } +1253:./include/lib_AT91SAM7.h **** +1254:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:./include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:./include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:./include/lib_AT91SAM7.h **** { +1262:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:./include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:./include/lib_AT91SAM7.h **** } +1266:./include/lib_AT91SAM7.h **** +1267:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:./include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:./include/lib_AT91SAM7.h **** { +1274:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:./include/lib_AT91SAM7.h **** } +1276:./include/lib_AT91SAM7.h **** +1277:./include/lib_AT91SAM7.h **** +1278:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:./include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:./include/lib_AT91SAM7.h **** { +1285:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:./include/lib_AT91SAM7.h **** } +1287:./include/lib_AT91SAM7.h **** +1288:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:./include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:./include/lib_AT91SAM7.h **** { +1295:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:./include/lib_AT91SAM7.h **** } +1297:./include/lib_AT91SAM7.h **** +1298:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:./include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:./include/lib_AT91SAM7.h **** { +1305:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:./include/lib_AT91SAM7.h **** } +1307:./include/lib_AT91SAM7.h **** +1308:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:./include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:./include/lib_AT91SAM7.h **** { +1315:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:./include/lib_AT91SAM7.h **** } +1317:./include/lib_AT91SAM7.h **** +1318:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:./include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:./include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:./include/lib_AT91SAM7.h **** { +1325:./include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:./include/lib_AT91SAM7.h **** } +1327:./include/lib_AT91SAM7.h **** +1328:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:./include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:./include/lib_AT91SAM7.h **** { +1335:./include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:./include/lib_AT91SAM7.h **** } +1337:./include/lib_AT91SAM7.h **** +1338:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:./include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:./include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:./include/lib_AT91SAM7.h **** { +1345:./include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:./include/lib_AT91SAM7.h **** } +1347:./include/lib_AT91SAM7.h **** +1348:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:./include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:./include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:./include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:./include/lib_AT91SAM7.h **** +1354:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:./include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:./include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:./include/lib_AT91SAM7.h **** unsigned int period, +1364:./include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:./include/lib_AT91SAM7.h **** { +1366:./include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:./include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:./include/lib_AT91SAM7.h **** } +1369:./include/lib_AT91SAM7.h **** +1370:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:./include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:./include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:./include/lib_AT91SAM7.h **** unsigned int piv) +1377:./include/lib_AT91SAM7.h **** { +1378:./include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:./include/lib_AT91SAM7.h **** } +1380:./include/lib_AT91SAM7.h **** +1381:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:./include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:./include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:./include/lib_AT91SAM7.h **** { +1388:./include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:./include/lib_AT91SAM7.h **** } +1390:./include/lib_AT91SAM7.h **** +1391:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:./include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:./include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:./include/lib_AT91SAM7.h **** { +1398:./include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:./include/lib_AT91SAM7.h **** } +1400:./include/lib_AT91SAM7.h **** +1401:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:./include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:./include/lib_AT91SAM7.h **** { +1408:./include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:./include/lib_AT91SAM7.h **** } +1410:./include/lib_AT91SAM7.h **** +1411:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:./include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:./include/lib_AT91SAM7.h **** { +1418:./include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:./include/lib_AT91SAM7.h **** } +1420:./include/lib_AT91SAM7.h **** +1421:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:./include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:./include/lib_AT91SAM7.h **** { +1428:./include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:./include/lib_AT91SAM7.h **** } +1430:./include/lib_AT91SAM7.h **** +1431:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:./include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:./include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:./include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:./include/lib_AT91SAM7.h **** { +1438:./include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:./include/lib_AT91SAM7.h **** } +1440:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:./include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:./include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:./include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:./include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:./include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:./include/lib_AT91SAM7.h **** unsigned int Mode) +1450:./include/lib_AT91SAM7.h **** { +1451:./include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:./include/lib_AT91SAM7.h **** } +1453:./include/lib_AT91SAM7.h **** +1454:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:./include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:./include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:./include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:./include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:./include/lib_AT91SAM7.h **** { +1461:./include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:./include/lib_AT91SAM7.h **** } +1463:./include/lib_AT91SAM7.h **** +1464:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:./include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:./include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:./include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:./include/lib_AT91SAM7.h **** { +1471:./include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:./include/lib_AT91SAM7.h **** } +1473:./include/lib_AT91SAM7.h **** +1474:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:./include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:./include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:./include/lib_AT91SAM7.h **** { +1480:./include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:./include/lib_AT91SAM7.h **** return 0; +1482:./include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:./include/lib_AT91SAM7.h **** } +1484:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:./include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:./include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:./include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:./include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:./include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:./include/lib_AT91SAM7.h **** { +1494:./include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:./include/lib_AT91SAM7.h **** } +1496:./include/lib_AT91SAM7.h **** +1497:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:./include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:./include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:./include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:./include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:./include/lib_AT91SAM7.h **** { +1504:./include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:./include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:./include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:./include/lib_AT91SAM7.h **** +1509:./include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:./include/lib_AT91SAM7.h **** +1511:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:./include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:./include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:./include/lib_AT91SAM7.h **** { +1517:./include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:./include/lib_AT91SAM7.h **** +1519:./include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:./include/lib_AT91SAM7.h **** } +1521:./include/lib_AT91SAM7.h **** +1522:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:./include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:./include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:./include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:./include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:./include/lib_AT91SAM7.h **** { +1530:./include/lib_AT91SAM7.h **** // Write to the FMR register +1531:./include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:./include/lib_AT91SAM7.h **** } +1533:./include/lib_AT91SAM7.h **** +1534:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:./include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:./include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:./include/lib_AT91SAM7.h **** { +1541:./include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:./include/lib_AT91SAM7.h **** } +1543:./include/lib_AT91SAM7.h **** +1544:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:./include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:./include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:./include/lib_AT91SAM7.h **** { +1551:./include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:./include/lib_AT91SAM7.h **** } +1553:./include/lib_AT91SAM7.h **** +1554:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:./include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:./include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:./include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:./include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:./include/lib_AT91SAM7.h **** { +1562:./include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:./include/lib_AT91SAM7.h **** } +1564:./include/lib_AT91SAM7.h **** +1565:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:./include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:./include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:./include/lib_AT91SAM7.h **** { +1572:./include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:./include/lib_AT91SAM7.h **** } +1574:./include/lib_AT91SAM7.h **** +1575:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:./include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:./include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:./include/lib_AT91SAM7.h **** { +1583:./include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:./include/lib_AT91SAM7.h **** } +1585:./include/lib_AT91SAM7.h **** +1586:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:./include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:./include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:./include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:./include/lib_AT91SAM7.h **** { +1594:./include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:./include/lib_AT91SAM7.h **** } +1596:./include/lib_AT91SAM7.h **** +1597:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:./include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:./include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:./include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:./include/lib_AT91SAM7.h **** int val) // chip select register +1608:./include/lib_AT91SAM7.h **** { +1609:./include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:./include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:./include/lib_AT91SAM7.h **** } +1612:./include/lib_AT91SAM7.h **** +1613:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:./include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:./include/lib_AT91SAM7.h **** { +1621:./include/lib_AT91SAM7.h **** //* Write to the IER register +1622:./include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:./include/lib_AT91SAM7.h **** } +1624:./include/lib_AT91SAM7.h **** +1625:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:./include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:./include/lib_AT91SAM7.h **** { +1633:./include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:./include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:./include/lib_AT91SAM7.h **** } +1636:./include/lib_AT91SAM7.h **** +1637:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:./include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:./include/lib_AT91SAM7.h **** ) +1644:./include/lib_AT91SAM7.h **** { +1645:./include/lib_AT91SAM7.h **** //* Write to the CR register +1646:./include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:./include/lib_AT91SAM7.h **** } +1648:./include/lib_AT91SAM7.h **** +1649:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:./include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:./include/lib_AT91SAM7.h **** ) +1656:./include/lib_AT91SAM7.h **** { +1657:./include/lib_AT91SAM7.h **** //* Write to the CR register +1658:./include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:./include/lib_AT91SAM7.h **** } +1660:./include/lib_AT91SAM7.h **** +1661:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:./include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:./include/lib_AT91SAM7.h **** ) +1668:./include/lib_AT91SAM7.h **** { +1669:./include/lib_AT91SAM7.h **** //* Write to the CR register +1670:./include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:./include/lib_AT91SAM7.h **** } +1672:./include/lib_AT91SAM7.h **** +1673:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:./include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:./include/lib_AT91SAM7.h **** int mode) // mode register +1680:./include/lib_AT91SAM7.h **** { +1681:./include/lib_AT91SAM7.h **** //* Write to the MR register +1682:./include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:./include/lib_AT91SAM7.h **** } +1684:./include/lib_AT91SAM7.h **** +1685:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:./include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:./include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:./include/lib_AT91SAM7.h **** { +1693:./include/lib_AT91SAM7.h **** //* Write to the MR register +1694:./include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:./include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:./include/lib_AT91SAM7.h **** } +1697:./include/lib_AT91SAM7.h **** +1698:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:./include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:./include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:./include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:./include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:./include/lib_AT91SAM7.h **** { +1709:./include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +1710:./include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:./include/lib_AT91SAM7.h **** pBuffer, +1712:./include/lib_AT91SAM7.h **** szBuffer, +1713:./include/lib_AT91SAM7.h **** pNextBuffer, +1714:./include/lib_AT91SAM7.h **** szNextBuffer); +1715:./include/lib_AT91SAM7.h **** } +1716:./include/lib_AT91SAM7.h **** +1717:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:./include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:./include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:./include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:./include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:./include/lib_AT91SAM7.h **** { +1728:./include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +1729:./include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1730:./include/lib_AT91SAM7.h **** pBuffer, +1731:./include/lib_AT91SAM7.h **** szBuffer, +1732:./include/lib_AT91SAM7.h **** pNextBuffer, +1733:./include/lib_AT91SAM7.h **** szNextBuffer); +1734:./include/lib_AT91SAM7.h **** } +1735:./include/lib_AT91SAM7.h **** +1736:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1737:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Close +1738:./include/lib_AT91SAM7.h **** //* \brief Close SPI: disable IT disable transfert, close PDC +1739:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1740:./include/lib_AT91SAM7.h **** extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller +1741:./include/lib_AT91SAM7.h **** +1742:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1743:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_PutChar +1744:./include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +1745:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1746:./include/lib_AT91SAM7.h **** static inline void AT91F_SPI_PutChar ( +1747:./include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1748:./include/lib_AT91SAM7.h **** unsigned int character, +1749:./include/lib_AT91SAM7.h **** unsigned int cs_number ) +1750:./include/lib_AT91SAM7.h **** { +1751:./include/lib_AT91SAM7.h **** unsigned int value_for_cs; +1752:./include/lib_AT91SAM7.h **** value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +1753:./include/lib_AT91SAM7.h **** pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +1754:./include/lib_AT91SAM7.h **** } +1755:./include/lib_AT91SAM7.h **** +1756:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1757:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetChar +1758:./include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +1759:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1760:./include/lib_AT91SAM7.h **** static inline int AT91F_SPI_GetChar ( +1761:./include/lib_AT91SAM7.h **** const AT91PS_SPI pSPI) +1762:./include/lib_AT91SAM7.h **** { +1763:./include/lib_AT91SAM7.h **** return((pSPI->SPI_RDR) & 0xFFFF); +1764:./include/lib_AT91SAM7.h **** } +1765:./include/lib_AT91SAM7.h **** +1766:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1767:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetInterruptMaskStatus +1768:./include/lib_AT91SAM7.h **** //* \brief Return SPI Interrupt Mask Status +1769:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1770:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +1771:./include/lib_AT91SAM7.h **** AT91PS_SPI pSpi) // \arg pointer to a SPI controller +1772:./include/lib_AT91SAM7.h **** { +1773:./include/lib_AT91SAM7.h **** return pSpi->SPI_IMR; +1774:./include/lib_AT91SAM7.h **** } +1775:./include/lib_AT91SAM7.h **** +1776:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1777:./include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_IsInterruptMasked +1778:./include/lib_AT91SAM7.h **** //* \brief Test if SPI Interrupt is Masked +1779:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1780:./include/lib_AT91SAM7.h **** static inline int AT91F_SPI_IsInterruptMasked( +1781:./include/lib_AT91SAM7.h **** AT91PS_SPI pSpi, // \arg pointer to a SPI controller +1782:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1783:./include/lib_AT91SAM7.h **** { +1784:./include/lib_AT91SAM7.h **** return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +1785:./include/lib_AT91SAM7.h **** } +1786:./include/lib_AT91SAM7.h **** +1787:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +1788:./include/lib_AT91SAM7.h **** SOFTWARE API FOR ADC +1789:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +1790:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1791:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableIt +1792:./include/lib_AT91SAM7.h **** //* \brief Enable ADC interrupt +1793:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1794:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableIt ( +1795:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1796:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1797:./include/lib_AT91SAM7.h **** { +1798:./include/lib_AT91SAM7.h **** //* Write to the IER register +1799:./include/lib_AT91SAM7.h **** pADC->ADC_IER = flag; +1800:./include/lib_AT91SAM7.h **** } +1801:./include/lib_AT91SAM7.h **** +1802:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1803:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableIt +1804:./include/lib_AT91SAM7.h **** //* \brief Disable ADC interrupt +1805:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1806:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableIt ( +1807:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1808:./include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1809:./include/lib_AT91SAM7.h **** { +1810:./include/lib_AT91SAM7.h **** //* Write to the IDR register +1811:./include/lib_AT91SAM7.h **** pADC->ADC_IDR = flag; +1812:./include/lib_AT91SAM7.h **** } +1813:./include/lib_AT91SAM7.h **** +1814:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1815:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetStatus +1816:./include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Status +1817:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1818:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +1819:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1820:./include/lib_AT91SAM7.h **** { +1821:./include/lib_AT91SAM7.h **** return pADC->ADC_SR; +1822:./include/lib_AT91SAM7.h **** } +1823:./include/lib_AT91SAM7.h **** +1824:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1825:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetInterruptMaskStatus +1826:./include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Mask Status +1827:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1828:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +1829:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1830:./include/lib_AT91SAM7.h **** { +1831:./include/lib_AT91SAM7.h **** return pADC->ADC_IMR; +1832:./include/lib_AT91SAM7.h **** } +1833:./include/lib_AT91SAM7.h **** +1834:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1835:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsInterruptMasked +1836:./include/lib_AT91SAM7.h **** //* \brief Test if ADC Interrupt is Masked +1837:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1838:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsInterruptMasked( +1839:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1840:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1841:./include/lib_AT91SAM7.h **** { +1842:./include/lib_AT91SAM7.h **** return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +1843:./include/lib_AT91SAM7.h **** } +1844:./include/lib_AT91SAM7.h **** +1845:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1846:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsStatusSet +1847:./include/lib_AT91SAM7.h **** //* \brief Test if ADC Status is Set +1848:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1849:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsStatusSet( +1850:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1851:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1852:./include/lib_AT91SAM7.h **** { +1853:./include/lib_AT91SAM7.h **** return (AT91F_ADC_GetStatus(pADC) & flag); +1854:./include/lib_AT91SAM7.h **** } +1855:./include/lib_AT91SAM7.h **** +1856:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1857:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgModeReg +1858:./include/lib_AT91SAM7.h **** //* \brief Configure the Mode Register of the ADC controller +1859:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1860:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_CfgModeReg ( +1861:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1862:./include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1863:./include/lib_AT91SAM7.h **** { +1864:./include/lib_AT91SAM7.h **** //* Write to the MR register +1865:./include/lib_AT91SAM7.h **** pADC->ADC_MR = mode; +1866:./include/lib_AT91SAM7.h **** } +1867:./include/lib_AT91SAM7.h **** +1868:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1869:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetModeReg +1870:./include/lib_AT91SAM7.h **** //* \brief Return the Mode Register of the ADC controller value +1871:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1872:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetModeReg ( +1873:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1874:./include/lib_AT91SAM7.h **** ) +1875:./include/lib_AT91SAM7.h **** { +1876:./include/lib_AT91SAM7.h **** return pADC->ADC_MR; +1877:./include/lib_AT91SAM7.h **** } +1878:./include/lib_AT91SAM7.h **** +1879:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1880:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgTimings +1881:./include/lib_AT91SAM7.h **** //* \brief Configure the different necessary timings of the ADC controller +1882:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1883:./include/lib_AT91SAM7.h **** extern void AT91F_ADC_CfgTimings ( +1884:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1885:./include/lib_AT91SAM7.h **** unsigned int mck_clock, // in MHz +1886:./include/lib_AT91SAM7.h **** unsigned int adc_clock, // in MHz +1887:./include/lib_AT91SAM7.h **** unsigned int startup_time, // in us +1888:./include/lib_AT91SAM7.h **** unsigned int sample_and_hold_time); // in ns +1889:./include/lib_AT91SAM7.h **** +1890:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1891:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableChannel +1892:./include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1893:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1894:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableChannel ( +1895:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1896:./include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1897:./include/lib_AT91SAM7.h **** { +1898:./include/lib_AT91SAM7.h **** //* Write to the CHER register +1899:./include/lib_AT91SAM7.h **** pADC->ADC_CHER = channel; +1900:./include/lib_AT91SAM7.h **** } +1901:./include/lib_AT91SAM7.h **** +1902:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1903:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableChannel +1904:./include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1905:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1906:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableChannel ( +1907:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1908:./include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1909:./include/lib_AT91SAM7.h **** { +1910:./include/lib_AT91SAM7.h **** //* Write to the CHDR register +1911:./include/lib_AT91SAM7.h **** pADC->ADC_CHDR = channel; +1912:./include/lib_AT91SAM7.h **** } +1913:./include/lib_AT91SAM7.h **** +1914:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1915:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetChannelStatus +1916:./include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1917:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1918:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetChannelStatus ( +1919:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1920:./include/lib_AT91SAM7.h **** ) +1921:./include/lib_AT91SAM7.h **** { +1922:./include/lib_AT91SAM7.h **** return pADC->ADC_CHSR; +1923:./include/lib_AT91SAM7.h **** } +1924:./include/lib_AT91SAM7.h **** +1925:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1926:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_StartConversion +1927:./include/lib_AT91SAM7.h **** //* \brief Software request for a analog to digital conversion +1928:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1929:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_StartConversion ( +1930:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1931:./include/lib_AT91SAM7.h **** ) +1932:./include/lib_AT91SAM7.h **** { +1933:./include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_START; +1934:./include/lib_AT91SAM7.h **** } +1935:./include/lib_AT91SAM7.h **** +1936:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1937:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_SoftReset +1938:./include/lib_AT91SAM7.h **** //* \brief Software reset +1939:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1940:./include/lib_AT91SAM7.h **** static inline void AT91F_ADC_SoftReset ( +1941:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1942:./include/lib_AT91SAM7.h **** ) +1943:./include/lib_AT91SAM7.h **** { +1944:./include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_SWRST; +1945:./include/lib_AT91SAM7.h **** } +1946:./include/lib_AT91SAM7.h **** +1947:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1948:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetLastConvertedData +1949:./include/lib_AT91SAM7.h **** //* \brief Return the Last Converted Data +1950:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1951:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetLastConvertedData ( +1952:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1953:./include/lib_AT91SAM7.h **** ) +1954:./include/lib_AT91SAM7.h **** { +1955:./include/lib_AT91SAM7.h **** return pADC->ADC_LCDR; +1956:./include/lib_AT91SAM7.h **** } +1957:./include/lib_AT91SAM7.h **** +1958:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1959:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH0 +1960:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 0 Converted Data +1961:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1962:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +1963:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1964:./include/lib_AT91SAM7.h **** ) +1965:./include/lib_AT91SAM7.h **** { +1966:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR0; +1967:./include/lib_AT91SAM7.h **** } +1968:./include/lib_AT91SAM7.h **** +1969:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1970:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH1 +1971:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 1 Converted Data +1972:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1973:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +1974:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1975:./include/lib_AT91SAM7.h **** ) +1976:./include/lib_AT91SAM7.h **** { +1977:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR1; +1978:./include/lib_AT91SAM7.h **** } +1979:./include/lib_AT91SAM7.h **** +1980:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1981:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH2 +1982:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 2 Converted Data +1983:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1984:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +1985:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1986:./include/lib_AT91SAM7.h **** ) +1987:./include/lib_AT91SAM7.h **** { +1988:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR2; +1989:./include/lib_AT91SAM7.h **** } +1990:./include/lib_AT91SAM7.h **** +1991:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1992:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH3 +1993:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 3 Converted Data +1994:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1995:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +1996:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1997:./include/lib_AT91SAM7.h **** ) +1998:./include/lib_AT91SAM7.h **** { +1999:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR3; +2000:./include/lib_AT91SAM7.h **** } +2001:./include/lib_AT91SAM7.h **** +2002:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2003:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH4 +2004:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 4 Converted Data +2005:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2006:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +2007:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2008:./include/lib_AT91SAM7.h **** ) +2009:./include/lib_AT91SAM7.h **** { +2010:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR4; +2011:./include/lib_AT91SAM7.h **** } +2012:./include/lib_AT91SAM7.h **** +2013:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2014:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH5 +2015:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 5 Converted Data +2016:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2017:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +2018:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2019:./include/lib_AT91SAM7.h **** ) +2020:./include/lib_AT91SAM7.h **** { +2021:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR5; +2022:./include/lib_AT91SAM7.h **** } +2023:./include/lib_AT91SAM7.h **** +2024:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2025:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH6 +2026:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 6 Converted Data +2027:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2028:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +2029:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2030:./include/lib_AT91SAM7.h **** ) +2031:./include/lib_AT91SAM7.h **** { +2032:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR6; +2033:./include/lib_AT91SAM7.h **** } +2034:./include/lib_AT91SAM7.h **** +2035:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2036:./include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH7 +2037:./include/lib_AT91SAM7.h **** //* \brief Return the Channel 7 Converted Data +2038:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2039:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +2040:./include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2041:./include/lib_AT91SAM7.h **** ) +2042:./include/lib_AT91SAM7.h **** { +2043:./include/lib_AT91SAM7.h **** return pADC->ADC_CDR7; +2044:./include/lib_AT91SAM7.h **** } +2045:./include/lib_AT91SAM7.h **** +2046:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +2047:./include/lib_AT91SAM7.h **** SOFTWARE API FOR SSC +2048:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +2049:./include/lib_AT91SAM7.h **** //* Define the standard I2S mode configuration +2050:./include/lib_AT91SAM7.h **** +2051:./include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Clock Mode Register +2052:./include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2053:./include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2054:./include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2055:./include/lib_AT91SAM7.h **** AT91C_SSC_CKS_DIV +\ +2056:./include/lib_AT91SAM7.h **** AT91C_SSC_CKO_CONTINOUS +\ +2057:./include/lib_AT91SAM7.h **** AT91C_SSC_CKG_NONE +\ +2058:./include/lib_AT91SAM7.h **** AT91C_SSC_START_FALL_RF +\ +2059:./include/lib_AT91SAM7.h **** AT91C_SSC_STTOUT +\ +2060:./include/lib_AT91SAM7.h **** ((1<<16) & AT91C_SSC_STTDLY) +\ +2061:./include/lib_AT91SAM7.h **** ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +2062:./include/lib_AT91SAM7.h **** +2063:./include/lib_AT91SAM7.h **** +2064:./include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Frame Mode Register +2065:./include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2066:./include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2067:./include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2068:./include/lib_AT91SAM7.h **** (nb_bit_by_slot-1) +\ +2069:./include/lib_AT91SAM7.h **** AT91C_SSC_MSBF +\ +2070:./include/lib_AT91SAM7.h **** (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +2071:./include/lib_AT91SAM7.h **** (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +2072:./include/lib_AT91SAM7.h **** AT91C_SSC_FSOS_NEGATIVE) +2073:./include/lib_AT91SAM7.h **** +2074:./include/lib_AT91SAM7.h **** +2075:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2076:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SetBaudrate +2077:./include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2078:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2079:./include/lib_AT91SAM7.h **** extern void AT91F_SSC_SetBaudrate ( +2080:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2081:./include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2082:./include/lib_AT91SAM7.h **** unsigned int speed); // \arg SSC baudrate +2083:./include/lib_AT91SAM7.h **** +2084:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2085:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_Configure +2086:./include/lib_AT91SAM7.h **** //* \brief Configure SSC +2087:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2088:./include/lib_AT91SAM7.h **** extern void AT91F_SSC_Configure ( +2089:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2090:./include/lib_AT91SAM7.h **** unsigned int syst_clock, // \arg System Clock Frequency +2091:./include/lib_AT91SAM7.h **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency +2092:./include/lib_AT91SAM7.h **** unsigned int clock_rx, // \arg Receiver Clock Parameters +2093:./include/lib_AT91SAM7.h **** unsigned int mode_rx, // \arg mode Register to be programmed +2094:./include/lib_AT91SAM7.h **** unsigned int clock_tx, // \arg Transmitter Clock Parameters +2095:./include/lib_AT91SAM7.h **** unsigned int mode_tx); // \arg mode Register to be programmed +2096:./include/lib_AT91SAM7.h **** +2097:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2098:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableRx +2099:./include/lib_AT91SAM7.h **** //* \brief Enable receiving datas +2100:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2101:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableRx ( +2102:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2103:./include/lib_AT91SAM7.h **** { +2104:./include/lib_AT91SAM7.h **** //* Enable receiver +2105:./include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXEN; +2106:./include/lib_AT91SAM7.h **** } +2107:./include/lib_AT91SAM7.h **** +2108:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2109:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableRx +2110:./include/lib_AT91SAM7.h **** //* \brief Disable receiving datas +2111:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2112:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableRx ( +2113:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2114:./include/lib_AT91SAM7.h **** { +2115:./include/lib_AT91SAM7.h **** //* Disable receiver +2116:./include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXDIS; +2117:./include/lib_AT91SAM7.h **** } +2118:./include/lib_AT91SAM7.h **** +2119:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2120:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableTx +2121:./include/lib_AT91SAM7.h **** //* \brief Enable sending datas +2122:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2123:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableTx ( +2124:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2125:./include/lib_AT91SAM7.h **** { +2126:./include/lib_AT91SAM7.h **** //* Enable transmitter +2127:./include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXEN; +2128:./include/lib_AT91SAM7.h **** } +2129:./include/lib_AT91SAM7.h **** +2130:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2131:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableTx +2132:./include/lib_AT91SAM7.h **** //* \brief Disable sending datas +2133:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2134:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableTx ( +2135:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2136:./include/lib_AT91SAM7.h **** { +2137:./include/lib_AT91SAM7.h **** //* Disable transmitter +2138:./include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXDIS; +2139:./include/lib_AT91SAM7.h **** } +2140:./include/lib_AT91SAM7.h **** +2141:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2142:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableIt +2143:./include/lib_AT91SAM7.h **** //* \brief Enable SSC IT +2144:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2145:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableIt ( +2146:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2147:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2148:./include/lib_AT91SAM7.h **** { +2149:./include/lib_AT91SAM7.h **** //* Write to the IER register +2150:./include/lib_AT91SAM7.h **** pSSC->SSC_IER = flag; +2151:./include/lib_AT91SAM7.h **** } +2152:./include/lib_AT91SAM7.h **** +2153:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2154:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableIt +2155:./include/lib_AT91SAM7.h **** //* \brief Disable SSC IT +2156:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2157:./include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableIt ( +2158:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2159:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2160:./include/lib_AT91SAM7.h **** { +2161:./include/lib_AT91SAM7.h **** //* Write to the IDR register +2162:./include/lib_AT91SAM7.h **** pSSC->SSC_IDR = flag; +2163:./include/lib_AT91SAM7.h **** } +2164:./include/lib_AT91SAM7.h **** +2165:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2166:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_ReceiveFrame +2167:./include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2168:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2169:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_ReceiveFrame ( +2170:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2171:./include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2172:./include/lib_AT91SAM7.h **** unsigned int szBuffer, +2173:./include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2174:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2175:./include/lib_AT91SAM7.h **** { +2176:./include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2177:./include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2178:./include/lib_AT91SAM7.h **** pBuffer, +2179:./include/lib_AT91SAM7.h **** szBuffer, +2180:./include/lib_AT91SAM7.h **** pNextBuffer, +2181:./include/lib_AT91SAM7.h **** szNextBuffer); +2182:./include/lib_AT91SAM7.h **** } +2183:./include/lib_AT91SAM7.h **** +2184:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2185:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SendFrame +2186:./include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2187:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2188:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_SendFrame( +2189:./include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2190:./include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2191:./include/lib_AT91SAM7.h **** unsigned int szBuffer, +2192:./include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2193:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2194:./include/lib_AT91SAM7.h **** { +2195:./include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2196:./include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2197:./include/lib_AT91SAM7.h **** pBuffer, +2198:./include/lib_AT91SAM7.h **** szBuffer, +2199:./include/lib_AT91SAM7.h **** pNextBuffer, +2200:./include/lib_AT91SAM7.h **** szNextBuffer); +2201:./include/lib_AT91SAM7.h **** } +2202:./include/lib_AT91SAM7.h **** +2203:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2204:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_GetInterruptMaskStatus +2205:./include/lib_AT91SAM7.h **** //* \brief Return SSC Interrupt Mask Status +2206:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2207:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +2208:./include/lib_AT91SAM7.h **** AT91PS_SSC pSsc) // \arg pointer to a SSC controller +2209:./include/lib_AT91SAM7.h **** { +2210:./include/lib_AT91SAM7.h **** return pSsc->SSC_IMR; +2211:./include/lib_AT91SAM7.h **** } +2212:./include/lib_AT91SAM7.h **** +2213:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2214:./include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_IsInterruptMasked +2215:./include/lib_AT91SAM7.h **** //* \brief Test if SSC Interrupt is Masked +2216:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2217:./include/lib_AT91SAM7.h **** static inline int AT91F_SSC_IsInterruptMasked( +2218:./include/lib_AT91SAM7.h **** AT91PS_SSC pSsc, // \arg pointer to a SSC controller +2219:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2220:./include/lib_AT91SAM7.h **** { +2221:./include/lib_AT91SAM7.h **** return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +2222:./include/lib_AT91SAM7.h **** } +2223:./include/lib_AT91SAM7.h **** +2224:./include/lib_AT91SAM7.h **** /* ***************************************************************************** +2225:./include/lib_AT91SAM7.h **** SOFTWARE API FOR USART +2226:./include/lib_AT91SAM7.h **** ***************************************************************************** */ +2227:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2228:./include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2229:./include/lib_AT91SAM7.h **** //* \brief Calculate the baudrate +2230:./include/lib_AT91SAM7.h **** //* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +2231:./include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +2232:./include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2233:./include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2234:./include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2235:./include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2236:./include/lib_AT91SAM7.h **** +2237:./include/lib_AT91SAM7.h **** //* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +2238:./include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +2239:./include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2240:./include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2241:./include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2242:./include/lib_AT91SAM7.h **** AT91C_US_CLKS_EXT ) +2243:./include/lib_AT91SAM7.h **** +2244:./include/lib_AT91SAM7.h **** //* Standard Synchronous Mode : 8 bits , 1 stop , no parity +2245:./include/lib_AT91SAM7.h **** #define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +2246:./include/lib_AT91SAM7.h **** AT91C_US_USMODE_NORMAL + \ +2247:./include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2248:./include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2249:./include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2250:./include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2251:./include/lib_AT91SAM7.h **** +2252:./include/lib_AT91SAM7.h **** //* SCK used Label +2253:./include/lib_AT91SAM7.h **** #define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +2254:./include/lib_AT91SAM7.h **** +2255:./include/lib_AT91SAM7.h **** //* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +2256:./include/lib_AT91SAM7.h **** #define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +2257:./include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK +\ +2258:./include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2259:./include/lib_AT91SAM7.h **** AT91C_US_PAR_EVEN + \ +2260:./include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2261:./include/lib_AT91SAM7.h **** AT91C_US_CKLO +\ +2262:./include/lib_AT91SAM7.h **** AT91C_US_OVER) +2263:./include/lib_AT91SAM7.h **** +2264:./include/lib_AT91SAM7.h **** //* Standard IRDA mode +2265:./include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +2266:./include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2267:./include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2268:./include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2269:./include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2270:./include/lib_AT91SAM7.h **** +2271:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2272:./include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2273:./include/lib_AT91SAM7.h **** //* \brief Caluculate baud_value according to the main clock and the baud rate +2274:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2275:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Baudrate ( +2276:./include/lib_AT91SAM7.h **** const unsigned int main_clock, // \arg peripheral clock +2277:./include/lib_AT91SAM7.h **** const unsigned int baud_rate) // \arg UART baudrate +2278:./include/lib_AT91SAM7.h **** { +2279:./include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + 1004 .loc 1 2279 0 + 1005 04d8 0A50A0E3 mov r5, #10 + 1006 .LBE45: + 1007 .LBE44: + 1008 .LBE42: + 1009 .LBE40: + 362:lib/lib_AT91SAM7.c **** + 363:lib/lib_AT91SAM7.c **** //* Reset receiver and transmitter + 364:lib/lib_AT91SAM7.c **** pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; + 1010 .loc 2 364 0 + 1011 04dc AD2082E2 add r2, r2, #173 + 1012 04e0 002080E5 str r2, [r0, #0] + 359:lib/lib_AT91SAM7.c **** { + 1013 .loc 2 359 0 + 1014 04e4 0040A0E1 mov r4, r0 + 1015 .LVL81: + 1016 .LBB48: + 1017 .LBB41: + 1018 .LBB43: + 1019 .LBB46: + 1020 .loc 1 2279 0 + 1021 04e8 950100E0 mul r0, r5, r1 + 1022 .LVL82: + 1023 04ec 0312A0E1 mov r1, r3, asl #4 + 1024 .LVL83: + 1025 04f0 FEFFFFEB bl __aeabi_uidiv + 1026 .LVL84: +2280:./include/lib_AT91SAM7.h **** if ((baud_value % 10) >= 5) + 1027 .loc 1 2280 0 + 1028 04f4 0510A0E1 mov r1, r5 +2279:./include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + 1029 .loc 1 2279 0 + 1030 04f8 0070A0E1 mov r7, r0 + 1031 .LVL85: + 1032 .loc 1 2280 0 + 1033 04fc FEFFFFEB bl __aeabi_uidivmod + 1034 .LVL86: + 1035 0500 040051E3 cmp r1, #4 + 1036 0504 0400009A bls .L49 +2281:./include/lib_AT91SAM7.h **** baud_value = (baud_value / 10) + 1; + 1037 .loc 1 2281 0 + 1038 0508 0700A0E1 mov r0, r7 + 1039 050c 0510A0E1 mov r1, r5 + 1040 0510 FEFFFFEB bl __aeabi_uidiv + 1041 0514 010080E2 add r0, r0, #1 + 1042 .LVL87: + 1043 0518 020000EA b .L50 + 1044 .LVL88: + 1045 .L49: +2282:./include/lib_AT91SAM7.h **** else +2283:./include/lib_AT91SAM7.h **** baud_value /= 10; + 1046 .loc 1 2283 0 + 1047 051c 0700A0E1 mov r0, r7 + 1048 0520 0510A0E1 mov r1, r5 + 1049 0524 FEFFFFEB bl __aeabi_uidiv + 1050 .LVL89: + 1051 .L50: + 1052 .LBE46: + 1053 .LBE43: + 1054 .LBE41: + 1055 .LBE48: + 1056 .LBB49: + 1057 .LBB50: +2284:./include/lib_AT91SAM7.h **** return baud_value; +2285:./include/lib_AT91SAM7.h **** } +2286:./include/lib_AT91SAM7.h **** +2287:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2288:./include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetBaudrate +2289:./include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2290:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2291:./include/lib_AT91SAM7.h **** static inline void AT91F_US_SetBaudrate ( +2292:./include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2293:./include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2294:./include/lib_AT91SAM7.h **** unsigned int speed) // \arg UART baudrate +2295:./include/lib_AT91SAM7.h **** { +2296:./include/lib_AT91SAM7.h **** //* Define the baud rate divisor register +2297:./include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +2298:./include/lib_AT91SAM7.h **** } +2299:./include/lib_AT91SAM7.h **** +2300:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2301:./include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetTimeguard +2302:./include/lib_AT91SAM7.h **** //* \brief Set USART timeguard +2303:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2304:./include/lib_AT91SAM7.h **** static inline void AT91F_US_SetTimeguard ( +2305:./include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2306:./include/lib_AT91SAM7.h **** unsigned int timeguard) // \arg timeguard value +2307:./include/lib_AT91SAM7.h **** { +2308:./include/lib_AT91SAM7.h **** //* Write the Timeguard Register +2309:./include/lib_AT91SAM7.h **** pUSART->US_TTGR = timeguard ; + 1058 .loc 1 2309 0 + 1059 0528 18309DE5 ldr r3, [sp, #24] + 1060 .LBE50: + 1061 .LBE49: + 1062 .LBB52: + 1063 .LBB47: +2297:./include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); + 1064 .loc 1 2297 0 + 1065 052c 200084E5 str r0, [r4, #32] + 1066 .LVL90: + 1067 .LBE47: + 1068 .LBE52: + 1069 .LBB53: + 1070 .LBB51: + 1071 .loc 1 2309 0 + 1072 0530 283084E5 str r3, [r4, #40] + 1073 .LBE51: + 1074 .LBE53: + 365:lib/lib_AT91SAM7.c **** + 366:lib/lib_AT91SAM7.c **** //* Define the baud rate divisor register + 367:lib/lib_AT91SAM7.c **** AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); + 368:lib/lib_AT91SAM7.c **** + 369:lib/lib_AT91SAM7.c **** //* Write the Timeguard Register + 370:lib/lib_AT91SAM7.c **** AT91F_US_SetTimeguard(pUSART, timeguard); + 371:lib/lib_AT91SAM7.c **** + 372:lib/lib_AT91SAM7.c **** //* Clear Transmit and Receive Counters + 373:lib/lib_AT91SAM7.c **** AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); + 1075 .loc 2 373 0 + 1076 0534 010C84E2 add r0, r4, #256 + 1077 .LVL91: + 1078 0538 FEFFFFEB bl AT91F_PDC_Open + 1079 .LVL92: + 374:lib/lib_AT91SAM7.c **** + 375:lib/lib_AT91SAM7.c **** //* Define the USART mode + 376:lib/lib_AT91SAM7.c **** pUSART->US_MR = mode ; + 1080 .loc 2 376 0 + 1081 053c 046084E5 str r6, [r4, #4] + 377:lib/lib_AT91SAM7.c **** + 378:lib/lib_AT91SAM7.c **** } + 1082 .loc 2 378 0 + 1083 0540 F840BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, lr} + 1084 0544 1EFF2FE1 bx lr + 1085 .cfi_endproc + 1086 .LFE286: + 1088 .align 2 + 1089 .global AT91F_US_Close + 1091 AT91F_US_Close: + 1092 .LFB287: + 379:lib/lib_AT91SAM7.c **** + 380:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 381:lib/lib_AT91SAM7.c **** //* \fn AT91F_US_Close + 382:lib/lib_AT91SAM7.c **** //* \brief Close USART: disable IT disable receiver and transmitter, close PDC + 383:lib/lib_AT91SAM7.c **** //*---------------------------------------------------------------------------- + 384:lib/lib_AT91SAM7.c **** void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller + 385:lib/lib_AT91SAM7.c **** { + 1093 .loc 2 385 0 + 1094 .cfi_startproc + 1095 @ Function supports interworking. + 1096 @ args = 0, pretend = 0, frame = 0 + 1097 @ frame_needed = 0, uses_anonymous_args = 0 + 1098 .LVL93: + 386:lib/lib_AT91SAM7.c **** //* Reset the baud rate divisor register + 387:lib/lib_AT91SAM7.c **** pUSART->US_BRGR = 0 ; + 1099 .loc 2 387 0 + 1100 0548 0030A0E3 mov r3, #0 + 385:lib/lib_AT91SAM7.c **** { + 1101 .loc 2 385 0 + 1102 054c 10402DE9 stmfd sp!, {r4, lr} + 1103 .LCFI13: + 1104 .cfi_def_cfa_offset 8 + 1105 .loc 2 387 0 + 1106 0550 203080E5 str r3, [r0, #32] + 388:lib/lib_AT91SAM7.c **** + 389:lib/lib_AT91SAM7.c **** //* Reset the USART mode + 390:lib/lib_AT91SAM7.c **** pUSART->US_MR = 0 ; + 1107 .loc 2 390 0 + 1108 0554 043080E5 str r3, [r0, #4] + 391:lib/lib_AT91SAM7.c **** + 392:lib/lib_AT91SAM7.c **** //* Reset the Timeguard Register + 393:lib/lib_AT91SAM7.c **** pUSART->US_TTGR = 0; + 1109 .loc 2 393 0 + 1110 0558 283080E5 str r3, [r0, #40] + 394:lib/lib_AT91SAM7.c **** + 395:lib/lib_AT91SAM7.c **** //* Disable all interrupts + 396:lib/lib_AT91SAM7.c **** pUSART->US_IDR = 0xFFFFFFFF ; + 1111 .loc 2 396 0 + 1112 055c 0030E0E3 mvn r3, #0 + 1113 0560 0C3080E5 str r3, [r0, #12] + 385:lib/lib_AT91SAM7.c **** { + 1114 .loc 2 385 0 + 1115 0564 0040A0E1 mov r4, r0 + 1116 .cfi_offset 14, -4 + 1117 .cfi_offset 4, -8 + 397:lib/lib_AT91SAM7.c **** + 398:lib/lib_AT91SAM7.c **** //* Abort the Peripheral Data Transfers + 399:lib/lib_AT91SAM7.c **** AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); + 1118 .loc 2 399 0 + 1119 0568 010C80E2 add r0, r0, #256 + 1120 .LVL94: + 1121 056c FEFFFFEB bl AT91F_PDC_Close + 400:lib/lib_AT91SAM7.c **** + 401:lib/lib_AT91SAM7.c **** //* Disable receiver and transmitter and stop any activity immediately + 402:lib/lib_AT91SAM7.c **** pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; + 1122 .loc 2 402 0 + 1123 0570 AC30A0E3 mov r3, #172 + 1124 0574 003084E5 str r3, [r4, #0] + 403:lib/lib_AT91SAM7.c **** } + 1125 .loc 2 403 0 + 1126 0578 1040BDE8 ldmfd sp!, {r4, lr} + 1127 057c 1EFF2FE1 bx lr + 1128 .cfi_endproc + 1129 .LFE287: + 1131 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 lib_AT91SAM7.c +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:23 .text:00000000 AT91F_PDC_SetNextRx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:44 .text:0000000c AT91F_PDC_SetNextTx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:64 .text:00000018 AT91F_PDC_SetRx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:84 .text:00000024 AT91F_PDC_SetTx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:104 .text:00000030 AT91F_PDC_DisableTx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:123 .text:0000003c AT91F_PDC_DisableRx +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:142 .text:00000048 AT91F_CKGR_GetMainClock +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:166 .text:00000060 AT91F_AIC_ConfigureIt +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:214 .text:00000098 AT91F_AIC_SetExceptionVector +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:247 .text:000000c8 $d +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:251 .text:000000cc $a +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:254 .text:000000cc AT91F_AIC_Open +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:343 .text:00000148 AT91F_PDC_Open +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:409 .text:000001b4 AT91F_PDC_Close +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:459 .text:0000020c AT91F_PDC_SendFrame +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:531 .text:00000260 AT91F_PDC_ReceiveFrame +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:604 .text:000002b4 AT91F_PMC_GetMasterClock +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:692 .text:0000033c $d +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:696 .text:00000340 $a +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:699 .text:00000340 AT91F_RTTReadValue +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:739 .text:00000370 AT91F_SPI_Close +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:786 .text:000003b0 AT91F_ADC_CfgTimings +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:851 .text:00000418 AT91F_SSC_SetBaudrate +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:919 .text:0000047c AT91F_SSC_Configure +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:970 .text:000004c4 $d +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:974 .text:000004c8 $a +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:977 .text:000004c8 AT91F_US_Configure +C:\Users\netz\AppData\Local\Temp\ccjk3Igv.s:1091 .text:00000548 AT91F_US_Close + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +__aeabi_uidiv +__aeabi_uidivmod diff --git a/firmware/lib/memcpy.S b/firmware/lib/memcpy.S new file mode 100644 index 0000000..2bbd569 --- /dev/null +++ b/firmware/lib/memcpy.S @@ -0,0 +1,59 @@ +/* + * linux/arch/arm/lib/memcpy.S + * + * Author: Nicolas Pitre + * Created: Sep 28, 2005 + * Copyright: MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include + + .macro ldr1w ptr reg abort + ldr \reg, [\ptr], #4 + .endm + + .macro ldr4w ptr reg1 reg2 reg3 reg4 abort + ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4} + .endm + + .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort + ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8} + .endm + + .macro ldr1b ptr reg cond=al abort + ldr\cond\()b \reg, [\ptr], #1 + .endm + + .macro str1w ptr reg abort + str \reg, [\ptr], #4 + .endm + + .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort + stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8} + .endm + + .macro str1b ptr reg cond=al abort + str\cond\()b \reg, [\ptr], #1 + .endm + + .macro enter reg1 reg2 + stmdb sp!, {r0, \reg1, \reg2} + .endm + + .macro exit reg1 reg2 + ldmfd sp!, {r0, \reg1, \reg2} + .endm + + .text + +/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ + +ENTRY(memcpy) + +#include "copy_template.S" + diff --git a/firmware/lib/memset.S b/firmware/lib/memset.S new file mode 100644 index 0000000..04e254a --- /dev/null +++ b/firmware/lib/memset.S @@ -0,0 +1,80 @@ +/* + * linux/arch/arm/lib/memset.S + * + * Copyright (C) 1995-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ASM optimised string functions + */ +#include +#include + + .text + .align 5 + .word 0 + +1: subs r2, r2, #4 @ 1 do we have enough + blt 5f @ 1 bytes to align with? + cmp r3, #2 @ 1 + strltb r1, [r0], #1 @ 1 + strleb r1, [r0], #1 @ 1 + strb r1, [r0], #1 @ 1 + add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) +/* + * The pointer is now aligned and the length is adjusted. Try doing the + * memzero again. + */ + +ENTRY(memset) + ands r3, r0, #3 @ 1 unaligned? + bne 1b @ 1 +/* + * we know that the pointer in r0 is aligned to a word boundary. + */ + orr r1, r1, r1, lsl #8 + orr r1, r1, r1, lsl #16 + mov r3, r1 + cmp r2, #16 + blt 4f +/* + * We need an extra register for this loop - save the return address and + * use the LR + */ + str lr, [sp, #-4]! + mov ip, r1 + mov lr, r1 + +2: subs r2, r2, #64 + stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time. + stmgeia r0!, {r1, r3, ip, lr} + stmgeia r0!, {r1, r3, ip, lr} + stmgeia r0!, {r1, r3, ip, lr} + bgt 2b + LOADREGS(eqfd, sp!, {pc}) @ Now <64 bytes to go. +/* + * No need to correct the count; we're only testing bits from now on + */ + tst r2, #32 + stmneia r0!, {r1, r3, ip, lr} + stmneia r0!, {r1, r3, ip, lr} + tst r2, #16 + stmneia r0!, {r1, r3, ip, lr} + ldr lr, [sp], #4 + +4: tst r2, #8 + stmneia r0!, {r1, r3} + tst r2, #4 + strne r1, [r0], #4 +/* + * When we get here, we've got less than 4 bytes to zero. We + * may have an unaligned pointer as well. + */ +5: tst r2, #2 + strneb r1, [r0], #1 + strneb r1, [r0], #1 + tst r2, #1 + strneb r1, [r0], #1 + RETINSTR(mov,pc,lr) diff --git a/firmware/lib/setbit.S b/firmware/lib/setbit.S new file mode 100644 index 0000000..9009bc1 --- /dev/null +++ b/firmware/lib/setbit.S @@ -0,0 +1,22 @@ +/* + * linux/arch/arm/lib/setbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +/* + * Purpose : Function to set a bit + * Prototype: int set_bit(int bit, void *addr) + */ +ENTRY(_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_set_bit_le) + bitop orr diff --git a/firmware/lib/setbit.lst b/firmware/lib/setbit.lst new file mode 100644 index 0000000..5303f5c --- /dev/null +++ b/firmware/lib/setbit.lst @@ -0,0 +1,170 @@ + 1 # 1 "lib/setbit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/setbit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 /* + 16 * Purpose : Function to set a bit + 17 * Prototype: int set_bit(int bit, void *addr) + 18 */ + 19 ENTRY(_set_bit_be) + 20 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 21 ENTRY(_set_bit_le) + 22 0004 072000E2 bitop orr + 22 0130A0E3 + 22 1332A0E1 + 22 00C00FE1 + 22 93F021E3 +DEFINED SYMBOLS + lib/setbit.S:19 .text:00000000 _set_bit_be + lib/setbit.S:19 .text:00000000 $a + lib/setbit.S:21 .text:00000004 _set_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/string.c b/firmware/lib/string.c new file mode 100644 index 0000000..4158bca --- /dev/null +++ b/firmware/lib/string.c @@ -0,0 +1,41 @@ +/* + * linux/lib/string.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* + * stupid library routines.. The optimized versions should generally be found + * as inline code in + * + * These are buggy as well.. + * + * * Fri Jun 25 1999, Ingo Oeser + * - Added strsep() which will replace strtok() soon (because strsep() is + * reentrant and should be faster). Use only strsep() in new code, please. + * + * * Sat Feb 09 2002, Jason Thomas , + * Matthew Hawkins + * - Kissed strtok() goodbye + */ + +#include +#include +#include + + +#ifndef __HAVE_ARCH_STRNLEN +/** + * strnlen - Find the length of a length-limited string + * @s: The string to be sized + * @count: The maximum number of bytes to search + */ +size_t strnlen(const char *s, size_t count) +{ + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + /* nothing */; + return sc - s; +} +#endif diff --git a/firmware/lib/string.lst b/firmware/lib/string.lst new file mode 100644 index 0000000..860b5d9 --- /dev/null +++ b/firmware/lib/string.lst @@ -0,0 +1,94 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "string.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global strnlen + 24 strnlen: + 25 .LFB2: + 26 .file 1 "lib/string.c" + 1:lib/string.c **** /* + 2:lib/string.c **** * linux/lib/string.c + 3:lib/string.c **** * + 4:lib/string.c **** * Copyright (C) 1991, 1992 Linus Torvalds + 5:lib/string.c **** */ + 6:lib/string.c **** + 7:lib/string.c **** /* + 8:lib/string.c **** * stupid library routines.. The optimized versions should generally be found + 9:lib/string.c **** * as inline code in + 10:lib/string.c **** * + 11:lib/string.c **** * These are buggy as well.. + 12:lib/string.c **** * + 13:lib/string.c **** * * Fri Jun 25 1999, Ingo Oeser + 14:lib/string.c **** * - Added strsep() which will replace strtok() soon (because strsep() is + 15:lib/string.c **** * reentrant and should be faster). Use only strsep() in new code, please. + 16:lib/string.c **** * + 17:lib/string.c **** * * Sat Feb 09 2002, Jason Thomas , + 18:lib/string.c **** * Matthew Hawkins + 19:lib/string.c **** * - Kissed strtok() goodbye + 20:lib/string.c **** */ + 21:lib/string.c **** + 22:lib/string.c **** #include + 23:lib/string.c **** #include + 24:lib/string.c **** #include + 25:lib/string.c **** + 26:lib/string.c **** + 27:lib/string.c **** #ifndef __HAVE_ARCH_STRNLEN + 28:lib/string.c **** /** + 29:lib/string.c **** * strnlen - Find the length of a length-limited string + 30:lib/string.c **** * @s: The string to be sized + 31:lib/string.c **** * @count: The maximum number of bytes to search + 32:lib/string.c **** */ + 33:lib/string.c **** size_t strnlen(const char *s, size_t count) + 34:lib/string.c **** { + 27 .loc 1 34 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 34 .loc 1 34 0 + 35 0000 0030A0E1 mov r3, r0 + 36 .LVL1: + 37 .L3: + 35:lib/string.c **** const char *sc; + 36:lib/string.c **** + 37:lib/string.c **** for (sc = s; count-- && *sc != '\0'; ++sc) + 38 .loc 1 37 0 discriminator 1 + 39 0004 011051E2 subs r1, r1, #1 + 40 0008 0320A0E1 mov r2, r3 + 41 .LVL2: + 42 000c 0200003A bcc .L2 + 43 .loc 1 37 0 is_stmt 0 discriminator 2 + 44 0010 01C0D3E4 ldrb ip, [r3], #1 @ zero_extendqisi2 + 45 .LVL3: + 46 0014 00005CE3 cmp ip, #0 + 47 0018 F9FFFF1A bne .L3 + 48 .L2: + 38:lib/string.c **** /* nothing */; + 39:lib/string.c **** return sc - s; + 40:lib/string.c **** } + 49 .loc 1 40 0 is_stmt 1 + 50 001c 020060E0 rsb r0, r0, r2 + 51 .LVL4: + 52 0020 1EFF2FE1 bx lr + 53 .cfi_endproc + 54 .LFE2: + 56 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 string.c +C:\Users\netz\AppData\Local\Temp\cc4Ne3c1.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cc4Ne3c1.s:24 .text:00000000 strnlen + .debug_frame:00000010 $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/testchangebit.S b/firmware/lib/testchangebit.S new file mode 100644 index 0000000..37c303e --- /dev/null +++ b/firmware/lib/testchangebit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testchangebit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_change_bit_le) + testop eor, strb diff --git a/firmware/lib/testchangebit.lst b/firmware/lib/testchangebit.lst new file mode 100644 index 0000000..0b95997 --- /dev/null +++ b/firmware/lib/testchangebit.lst @@ -0,0 +1,166 @@ + 1 # 1 "lib/testchangebit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/testchangebit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 ENTRY(_test_and_change_bit_be) + 16 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 17 ENTRY(_test_and_change_bit_le) + 18 0004 A01181E0 testop eor, strb + 18 073000E2 + 18 0100A0E3 + 18 00C00FE1 + 18 93F021E3 +DEFINED SYMBOLS + lib/testchangebit.S:15 .text:00000000 _test_and_change_bit_be + lib/testchangebit.S:15 .text:00000000 $a + lib/testchangebit.S:17 .text:00000004 _test_and_change_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/testclearbit.S b/firmware/lib/testclearbit.S new file mode 100644 index 0000000..985c399 --- /dev/null +++ b/firmware/lib/testclearbit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testclearbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_clear_bit_le) + testop bicne, strneb diff --git a/firmware/lib/testclearbit.lst b/firmware/lib/testclearbit.lst new file mode 100644 index 0000000..395c140 --- /dev/null +++ b/firmware/lib/testclearbit.lst @@ -0,0 +1,166 @@ + 1 # 1 "lib/testclearbit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/testclearbit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 ENTRY(_test_and_clear_bit_be) + 16 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 17 ENTRY(_test_and_clear_bit_le) + 18 0004 A01181E0 testop bicne, strneb + 18 073000E2 + 18 0100A0E3 + 18 00C00FE1 + 18 93F021E3 +DEFINED SYMBOLS + lib/testclearbit.S:15 .text:00000000 _test_and_clear_bit_be + lib/testclearbit.S:15 .text:00000000 $a + lib/testclearbit.S:17 .text:00000004 _test_and_clear_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/testsetbit.S b/firmware/lib/testsetbit.S new file mode 100644 index 0000000..4a8a164 --- /dev/null +++ b/firmware/lib/testsetbit.S @@ -0,0 +1,18 @@ +/* + * linux/arch/arm/lib/testsetbit.S + * + * Copyright (C) 1995-1996 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include "bitops.h" + .text + +ENTRY(_test_and_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering +ENTRY(_test_and_set_bit_le) + testop orreq, streqb diff --git a/firmware/lib/testsetbit.lst b/firmware/lib/testsetbit.lst new file mode 100644 index 0000000..485769c --- /dev/null +++ b/firmware/lib/testsetbit.lst @@ -0,0 +1,166 @@ + 1 # 1 "lib/testsetbit.S" + 1 /* + 0 + 0 + 2 * linux/arch/arm/lib/testsetbit.S + 3 * + 4 * Copyright (C) 1995-1996 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 */ + 10 #include + 1 #ifndef __ASM_LINKAGE_H + 11 #include + 1 /* + 2 * linux/include/asm-arm/assembler.h + 3 * + 4 * Copyright (C) 1996-2000 Russell King + 5 * + 6 * This program is free software; you can redistribute it and/or modify + 7 * it under the terms of the GNU General Public License version 2 as + 8 * published by the Free Software Foundation. + 9 * + 10 * This file contains arm architecture specific defines + 11 * for the different processors. + 12 * + 13 * Do not include any C declarations in this file - it is included by + 14 * assembler source. + 15 */ + 16 #ifndef __ASSEMBLY__ + 17 #error "Only include this from assembly code" + 18 #endif + 19 + 20 #include + 1 /* + 21 + 22 #define pull lsl + 23 #define push lsr + 24 #define get_byte_0 lsr #24 + 25 #define get_byte_1 lsr #16 + 26 #define get_byte_2 lsr #8 + 27 #define get_byte_3 lsl #0 + 28 #define put_byte_0 lsl #24 + 29 #define put_byte_1 lsl #16 + 30 #define put_byte_2 lsl #8 + 31 #define put_byte_3 lsl #0 + 32 + 33 #define PLD(code...) + 34 + 35 #define MODE_USR USR_MODE + 36 #define MODE_FIQ FIQ_MODE + 37 #define MODE_IRQ IRQ_MODE + 38 #define MODE_SVC SVC_MODE + 39 + 40 #define DEFAULT_FIQ MODE_FIQ + 41 + 42 /* + 43 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc}) + 44 */ + 45 #ifdef __STDC__ + 46 #define LOADREGS(cond, base, reglist...)\ + 47 ldm##cond base,reglist + 48 #else + 49 #define LOADREGS(cond, base, reglist...)\ + 50 ldm/**/cond base,reglist + 51 #endif + 52 + 53 /* + 54 * Build a return instruction for this processor type. + 55 */ + 56 #define RETINSTR(instr, regs...)\ + 57 instr regs + 58 + 59 /* + 60 * Enable and disable interrupts + 61 */ + 62 .macro disable_irq + 63 msr cpsr_c, #PSR_I_BIT | SVC_MODE + 64 .endm + 65 + 66 .macro enable_irq + 67 msr cpsr_c, #SVC_MODE + 68 .endm + 69 + 70 /* + 71 * Save the current IRQ state and disable IRQs. Note that this macro + 72 * assumes FIQs are enabled, and that the processor is in SVC mode. + 73 */ + 74 .macro save_and_disable_irqs, oldcpsr + 75 mrs \oldcpsr, cpsr + 76 disable_irq + 77 .endm + 78 + 79 /* + 80 * Restore interrupt state previously stored in a register. We don't + 81 * guarantee that this will preserve the flags. + 82 */ + 83 .macro restore_irqs, oldcpsr + 84 msr cpsr_c, \oldcpsr + 85 .endm + 86 + 87 /* + 88 * These two are used to save LR/restore PC over a user-based access. + 89 * The old 26-bit architecture requires that we do. On 32-bit + 90 * architecture, we can safely ignore this requirement. + 91 */ + 92 .macro save_lr + 93 .endm + 94 + 95 .macro restore_pc + 96 mov pc, lr + 97 .endm + 98 ... + 12 #include "bitops.h" + 1 .macro bitop, instr + 2 and r2, r0, #7 + 3 mov r3, #1 + 4 mov r3, r3, lsl r2 + 5 save_and_disable_irqs ip + 6 ldrb r2, [r1, r0, lsr #3] + 7 \instr r2, r2, r3 + 8 strb r2, [r1, r0, lsr #3] + 9 restore_irqs ip + 10 mov pc, lr + 11 .endm + 12 + 13 /** + 14 * testop - implement a test_and_xxx_bit operation. + 15 * @instr: operational instruction + 16 * @store: store instruction + 17 * + 18 * Note: we can trivially conditionalise the store instruction + 19 * to avoid dirting the data cache. + 20 */ + 21 .macro testop, instr, store + 22 add r1, r1, r0, lsr #3 + 23 and r3, r0, #7 + 24 mov r0, #1 + 25 save_and_disable_irqs ip + 26 ldrb r2, [r1] + 27 tst r2, r0, lsl r3 + 28 \instr r2, r2, r0, lsl r3 + 29 \store r2, [r1] + 30 restore_irqs ip + 31 moveq r0, #0 + 32 mov pc, lr + 33 .endm + 34 ... + 13 .text + 14 + 15 ENTRY(_test_and_set_bit_be) + 16 0000 180020E2 eor r0, r0, #0x18 @ big endian byte ordering + 17 ENTRY(_test_and_set_bit_le) + 18 0004 A01181E0 testop orreq, streqb + 18 073000E2 + 18 0100A0E3 + 18 00C00FE1 + 18 93F021E3 +DEFINED SYMBOLS + lib/testsetbit.S:15 .text:00000000 _test_and_set_bit_be + lib/testsetbit.S:15 .text:00000000 $a + lib/testsetbit.S:17 .text:00000004 _test_and_set_bit_le + .debug_aranges:0000000c $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/lib/vsprintf.c b/firmware/lib/vsprintf.c new file mode 100644 index 0000000..5f5c530 --- /dev/null +++ b/firmware/lib/vsprintf.c @@ -0,0 +1,831 @@ +/* + * linux/lib/vsprintf.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ +/* + * Wirzenius wrote this portably, Torvalds fucked it up :-) + */ + +/* + * Fri Jul 13 2001 Crutcher Dunnavant + * - changed to provide snprintf and vsnprintf functions + * So Feb 1 16:51:32 CET 2004 Juergen Quade + * - scnprintf and vscnprintf + */ + +#include +#include +#include +#include + +#include +#include + +/** + * simple_strtoul - convert a string to an unsigned long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) +{ + unsigned long result = 0,value; + + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + *endp = (char *)cp; + return result; +} + + +/** + * simple_strtol - convert a string to a signed long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +long simple_strtol(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoul(cp+1,endp,base); + return simple_strtoul(cp,endp,base); +} + + +/** + * simple_strtoull - convert a string to an unsigned long long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + unsigned long long result = 0,value; + + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + *endp = (char *)cp; + return result; +} + + +/** + * simple_strtoll - convert a string to a signed long long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +long long simple_strtoll(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoull(cp+1,endp,base); + return simple_strtoull(cp,endp,base); +} + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + return i; +} + +#define ZEROPAD 1 /* pad with zero */ +#define SIGN 2 /* unsigned/signed long */ +#define PLUS 4 /* show plus */ +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) +{ + char c,sign,tmp[66]; + const char *digits; + static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + sign = '-'; + num = - (signed long long) num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + else if (base == 8) + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) { + if (buf <= end) + *buf = sign; + ++buf; + } + if (type & SPECIAL) { + if (base==8) { + if (buf <= end) + *buf = '0'; + ++buf; + } else if (base==16) { + if (buf <= end) + *buf = '0'; + ++buf; + if (buf <= end) + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + return buf; +} + +/** + * vsnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * The return value is the number of characters which would + * be generated for the given input, excluding the trailing + * '\0', as per ISO C99. If you want to have the exact + * number of characters written into @buf as return value + * (not including the trailing '\0'), use vscnprintf. If the + * return is greater than or equal to @size, the resulting + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + int len; + unsigned long long num; + int i, base; + char *str, *end, c; + const char *s; + + int flags; /* flags to number() */ + + int field_width; /* width of output field */ + int precision; /* min. # of digits for integers; max + number of chars for from string */ + int qualifier; /* 'h', 'l', or 'L' for integer fields */ + /* 'z' support added 23/7/1999 S.H. */ + /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ + + /* Reject out-of-range values early */ + if ((int) size < 0) { + return 0; + } + + str = buf; + end = buf + size - 1; + + if (end < buf - 1) { + end = ((void *) -1); + size = end - buf + 1; + } + + for (; *fmt ; ++fmt) { + if (*fmt != '%') { + if (str <= end) + *str = *fmt; + ++str; + continue; + } + + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + ++fmt; + if (qualifier == 'l' && *fmt == 'l') { + qualifier = 'L'; + ++fmt; + } + } + + /* default base */ + base = 10; + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } + continue; + + case 's': + s = va_arg(args, char *); + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + if (str <= end) + *str = ' '; + ++str; + } + continue; + + case 'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + str = number(str, end, + (unsigned long) va_arg(args, void *), + 16, field_width, precision, flags); + continue; + + + case 'n': + /* FIXME: + * What does C99 say about the overflow case here? */ + if (qualifier == 'l') { + long * ip = va_arg(args, long *); + *ip = (str - buf); + } else if (qualifier == 'Z' || qualifier == 'z') { + size_t * ip = va_arg(args, size_t *); + *ip = (str - buf); + } else { + int * ip = va_arg(args, int *); + *ip = (str - buf); + } + continue; + + case '%': + if (str <= end) + *str = '%'; + ++str; + continue; + + /* integer number formats - set up the flags and "break" */ + case 'o': + base = 8; + break; + + case 'X': + flags |= LARGE; + case 'x': + base = 16; + break; + + case 'd': + case 'i': + flags |= SIGN; + case 'u': + break; + + default: + if (str <= end) + *str = '%'; + ++str; + if (*fmt) { + if (str <= end) + *str = *fmt; + ++str; + } else { + --fmt; + } + continue; + } + if (qualifier == 'L') + num = va_arg(args, long long); + else if (qualifier == 'l') { + num = va_arg(args, unsigned long); + if (flags & SIGN) + num = (signed long) num; + } else if (qualifier == 'Z' || qualifier == 'z') { + num = va_arg(args, size_t); + } else if (qualifier == 't') { + num = va_arg(args, ptrdiff_t); + } else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); + if (flags & SIGN) + num = (signed short) num; + } else { + num = va_arg(args, unsigned int); + if (flags & SIGN) + num = (signed int) num; + } + str = number(str, end, num, base, + field_width, precision, flags); + } + if (str <= end) + *str = '\0'; + else if (size > 0) + /* don't write out a null byte if the buf size is zero */ + *end = '\0'; + /* the trailing null byte doesn't count towards the total + * ++str; + */ + return str-buf; +} + + +/** + * vscnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * The return value is the number of characters which have been written into + * the @buf not including the trailing '\0'. If @size is <= 0 the function + * returns 0. + * + * Call this function if you are already dealing with a va_list. + * You probably want scnprintf instead. + */ +int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + unsigned int i; + + i=vsnprintf(buf,size,fmt,args); + return (i >= size) ? (size - 1) : i; +} + + +/** + * snprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @...: Arguments for the format string + * + * The return value is the number of characters which would be + * generated for the given input, excluding the trailing null, + * as per ISO C99. If the return is greater than or equal to + * @size, the resulting string is truncated. + */ +int snprintf(char * buf, size_t size, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + i=vsnprintf(buf,size,fmt,args); + va_end(args); + return i; +} + + +/** + * scnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @...: Arguments for the format string + * + * The return value is the number of characters written into @buf not including + * the trailing '\0'. If @size is <= 0 the function returns 0. If the return is + * greater than or equal to @size, the resulting string is truncated. + */ + +int scnprintf(char * buf, size_t size, const char *fmt, ...) +{ + va_list args; + unsigned int i; + + va_start(args, fmt); + i = vsnprintf(buf, size, fmt, args); + va_end(args); + return (i >= size) ? (size - 1) : i; +} + +/** + * vsprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @fmt: The format string to use + * @args: Arguments for the format string + * + * The function returns the number of characters written + * into @buf. Use vsnprintf or vscnprintf in order to avoid + * buffer overflows. + * + * Call this function if you are already dealing with a va_list. + * You probably want sprintf instead. + */ +int vsprintf(char *buf, const char *fmt, va_list args) +{ + return vsnprintf(buf, INT_MAX, fmt, args); +} + + +/** + * sprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @fmt: The format string to use + * @...: Arguments for the format string + * + * The function returns the number of characters written + * into @buf. Use snprintf or scnprintf in order to avoid + * buffer overflows. + */ +int sprintf(char * buf, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + i=vsnprintf(buf, INT_MAX, fmt, args); + va_end(args); + return i; +} + + +/** + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) +{ + const char *str = buf; + char *next; + char digit; + int num = 0; + int qualifier; + int base; + int field_width; + int is_sign = 0; + + while(*fmt && *str) { + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + while (isspace(*fmt)) + ++fmt; + while (isspace(*str)) + ++str; + } + + /* anything that is not a conversion must match exactly */ + if (*fmt != '%' && *fmt) { + if (*fmt++ != *str++) + break; + continue; + } + + if (!*fmt) + break; + ++fmt; + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + while (!isspace(*fmt) && *fmt) + fmt++; + while (!isspace(*str) && *str) + str++; + continue; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + + /* get conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt == 'Z' || *fmt == 'z') { + qualifier = *fmt++; + if (qualifier == *fmt) { + if (qualifier == 'h') { + qualifier = 'H'; + fmt++; + } else if (qualifier == 'l') { + qualifier = 'L'; + fmt++; + } + } + } + base = 10; + is_sign = 0; + + if (!*fmt || !*str) + break; + + switch(*fmt++) { + case 'c': + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + } while (--field_width > 0 && *str); + num++; + } + continue; + case 's': + { + char *s = (char *) va_arg(args, char *); + if(field_width == -1) + field_width = INT_MAX; + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + *s++ = *str++; + } + *s = '\0'; + num++; + } + continue; + case 'n': + /* return number of characters read so far */ + { + int *i = (int *)va_arg(args,int*); + *i = str - buf; + } + continue; + case 'o': + base = 8; + break; + case 'x': + case 'X': + base = 16; + break; + case 'i': + base = 0; + case 'd': + is_sign = 1; + case 'u': + break; + case '%': + /* looking for '%' in str */ + if (*str++ != '%') + return num; + continue; + default: + /* invalid format; stop here */ + return num; + } + + /* have some sort of integer conversion. + * first, skip white space in buffer. + */ + while (isspace(*str)) + str++; + + digit = *str; + if (is_sign && digit == '-') + digit = *(str + 1); + + if (!digit + || (base == 16 && !isxdigit(digit)) + || (base == 10 && !isdigit(digit)) + || (base == 8 && (!isdigit(digit) || digit > '7')) + || (base == 0 && !isdigit(digit))) + break; + + switch(qualifier) { + case 'H': /* that's 'hh' in format */ + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + *s = (signed char) simple_strtol(str,&next,base); + } else { + unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + *s = (unsigned char) simple_strtoul(str, &next, base); + } + break; + case 'h': + if (is_sign) { + short *s = (short *) va_arg(args,short *); + *s = (short) simple_strtol(str,&next,base); + } else { + unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + *s = (unsigned short) simple_strtoul(str, &next, base); + } + break; + case 'l': + if (is_sign) { + long *l = (long *) va_arg(args,long *); + *l = simple_strtol(str,&next,base); + } else { + unsigned long *l = (unsigned long*) va_arg(args,unsigned long*); + *l = simple_strtoul(str,&next,base); + } + break; + case 'L': + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + *l = simple_strtoll(str,&next,base); + } else { + unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + *l = simple_strtoull(str,&next,base); + } + break; + case 'Z': + case 'z': + { + size_t *s = (size_t*) va_arg(args,size_t*); + *s = (size_t) simple_strtoul(str,&next,base); + } + break; + default: + if (is_sign) { + int *i = (int *) va_arg(args, int*); + *i = (int) simple_strtol(str,&next,base); + } else { + unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + *i = (unsigned int) simple_strtoul(str,&next,base); + } + break; + } + num++; + + if (!next) + break; + str = next; + } + return num; +} + + +/** + * sscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: formatting of buffer + * @...: resulting arguments + */ +int sscanf(const char * buf, const char * fmt, ...) +{ + va_list args; + int i; + + va_start(args,fmt); + i = vsscanf(buf,fmt,args); + va_end(args); + return i; +} + diff --git a/firmware/lib/vsprintf.lst b/firmware/lib/vsprintf.lst new file mode 100644 index 0000000..af00f78 --- /dev/null +++ b/firmware/lib/vsprintf.lst @@ -0,0 +1,3471 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "vsprintf.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 __toupper: + 24 .LFB1: + 25 .file 1 "include/asm/ctype.h" + 1:include/asm/ctype.h **** #ifndef _LINUX_CTYPE_H + 2:include/asm/ctype.h **** #define _LINUX_CTYPE_H + 3:include/asm/ctype.h **** + 4:include/asm/ctype.h **** /* + 5:include/asm/ctype.h **** * NOTE! This ctype does not handle EOF like the standard C + 6:include/asm/ctype.h **** * library is required to. + 7:include/asm/ctype.h **** */ + 8:include/asm/ctype.h **** + 9:include/asm/ctype.h **** #define _U 0x01 /* upper */ + 10:include/asm/ctype.h **** #define _L 0x02 /* lower */ + 11:include/asm/ctype.h **** #define _D 0x04 /* digit */ + 12:include/asm/ctype.h **** #define _C 0x08 /* cntrl */ + 13:include/asm/ctype.h **** #define _P 0x10 /* punct */ + 14:include/asm/ctype.h **** #define _S 0x20 /* white space (space/lf/tab) */ + 15:include/asm/ctype.h **** #define _X 0x40 /* hex digit */ + 16:include/asm/ctype.h **** #define _SP 0x80 /* hard space (0x20) */ + 17:include/asm/ctype.h **** + 18:include/asm/ctype.h **** extern unsigned char _ctype[]; + 19:include/asm/ctype.h **** + 20:include/asm/ctype.h **** #define __ismask(x) (_ctype[(int)(unsigned char)(x)]) + 21:include/asm/ctype.h **** + 22:include/asm/ctype.h **** #define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0) + 23:include/asm/ctype.h **** #define isalpha(c) ((__ismask(c)&(_U|_L)) != 0) + 24:include/asm/ctype.h **** #define iscntrl(c) ((__ismask(c)&(_C)) != 0) + 25:include/asm/ctype.h **** #define isdigit(c) ((__ismask(c)&(_D)) != 0) + 26:include/asm/ctype.h **** #define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0) + 27:include/asm/ctype.h **** #define islower(c) ((__ismask(c)&(_L)) != 0) + 28:include/asm/ctype.h **** #define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0) + 29:include/asm/ctype.h **** #define ispunct(c) ((__ismask(c)&(_P)) != 0) + 30:include/asm/ctype.h **** #define isspace(c) ((__ismask(c)&(_S)) != 0) + 31:include/asm/ctype.h **** #define isupper(c) ((__ismask(c)&(_U)) != 0) + 32:include/asm/ctype.h **** #define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0) + 33:include/asm/ctype.h **** + 34:include/asm/ctype.h **** #define isascii(c) (((unsigned char)(c))<=0x7f) + 35:include/asm/ctype.h **** #define toascii(c) (((unsigned char)(c))&0x7f) + 36:include/asm/ctype.h **** + 37:include/asm/ctype.h **** static inline unsigned char __tolower(unsigned char c) + 38:include/asm/ctype.h **** { + 39:include/asm/ctype.h **** if (isupper(c)) + 40:include/asm/ctype.h **** c -= 'A'-'a'; + 41:include/asm/ctype.h **** return c; + 42:include/asm/ctype.h **** } + 43:include/asm/ctype.h **** + 44:include/asm/ctype.h **** static inline unsigned char __toupper(unsigned char c) + 45:include/asm/ctype.h **** { + 26 .loc 1 45 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 32 .LVL0: + 46:include/asm/ctype.h **** if (islower(c)) + 33 .loc 1 46 0 + 34 0000 10309FE5 ldr r3, .L3 + 35 0004 0030D3E7 ldrb r3, [r3, r0] @ zero_extendqisi2 + 36 0008 020013E3 tst r3, #2 + 47:include/asm/ctype.h **** c -= 'a'-'A'; + 37 .loc 1 47 0 + 38 000c 20004012 subne r0, r0, #32 + 39 .LVL1: + 40 0010 FF000012 andne r0, r0, #255 + 41 .LVL2: + 48:include/asm/ctype.h **** return c; + 49:include/asm/ctype.h **** } + 42 .loc 1 49 0 + 43 0014 1EFF2FE1 bx lr + 44 .L4: + 45 .align 2 + 46 .L3: + 47 0018 00000000 .word _ctype + 48 .cfi_endproc + 49 .LFE1: + 51 .align 2 + 53 skip_atoi: + 54 .LFB6: + 55 .file 2 "lib/vsprintf.c" + 1:lib/vsprintf.c **** /* + 2:lib/vsprintf.c **** * linux/lib/vsprintf.c + 3:lib/vsprintf.c **** * + 4:lib/vsprintf.c **** * Copyright (C) 1991, 1992 Linus Torvalds + 5:lib/vsprintf.c **** */ + 6:lib/vsprintf.c **** + 7:lib/vsprintf.c **** /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ + 8:lib/vsprintf.c **** /* + 9:lib/vsprintf.c **** * Wirzenius wrote this portably, Torvalds fucked it up :-) + 10:lib/vsprintf.c **** */ + 11:lib/vsprintf.c **** + 12:lib/vsprintf.c **** /* + 13:lib/vsprintf.c **** * Fri Jul 13 2001 Crutcher Dunnavant + 14:lib/vsprintf.c **** * - changed to provide snprintf and vsnprintf functions + 15:lib/vsprintf.c **** * So Feb 1 16:51:32 CET 2004 Juergen Quade + 16:lib/vsprintf.c **** * - scnprintf and vscnprintf + 17:lib/vsprintf.c **** */ + 18:lib/vsprintf.c **** + 19:lib/vsprintf.c **** #include + 20:lib/vsprintf.c **** #include + 21:lib/vsprintf.c **** #include + 22:lib/vsprintf.c **** #include + 23:lib/vsprintf.c **** + 24:lib/vsprintf.c **** #include + 25:lib/vsprintf.c **** #include + 26:lib/vsprintf.c **** + 27:lib/vsprintf.c **** /** + 28:lib/vsprintf.c **** * simple_strtoul - convert a string to an unsigned long + 29:lib/vsprintf.c **** * @cp: The start of the string + 30:lib/vsprintf.c **** * @endp: A pointer to the end of the parsed string will be placed here + 31:lib/vsprintf.c **** * @base: The number base to use + 32:lib/vsprintf.c **** */ + 33:lib/vsprintf.c **** unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) + 34:lib/vsprintf.c **** { + 35:lib/vsprintf.c **** unsigned long result = 0,value; + 36:lib/vsprintf.c **** + 37:lib/vsprintf.c **** if (!base) { + 38:lib/vsprintf.c **** base = 10; + 39:lib/vsprintf.c **** if (*cp == '0') { + 40:lib/vsprintf.c **** base = 8; + 41:lib/vsprintf.c **** cp++; + 42:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 43:lib/vsprintf.c **** cp++; + 44:lib/vsprintf.c **** base = 16; + 45:lib/vsprintf.c **** } + 46:lib/vsprintf.c **** } + 47:lib/vsprintf.c **** } else if (base == 16) { + 48:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 49:lib/vsprintf.c **** cp += 2; + 50:lib/vsprintf.c **** } + 51:lib/vsprintf.c **** while (isxdigit(*cp) && + 52:lib/vsprintf.c **** (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + 53:lib/vsprintf.c **** result = result*base + value; + 54:lib/vsprintf.c **** cp++; + 55:lib/vsprintf.c **** } + 56:lib/vsprintf.c **** if (endp) + 57:lib/vsprintf.c **** *endp = (char *)cp; + 58:lib/vsprintf.c **** return result; + 59:lib/vsprintf.c **** } + 60:lib/vsprintf.c **** + 61:lib/vsprintf.c **** + 62:lib/vsprintf.c **** /** + 63:lib/vsprintf.c **** * simple_strtol - convert a string to a signed long + 64:lib/vsprintf.c **** * @cp: The start of the string + 65:lib/vsprintf.c **** * @endp: A pointer to the end of the parsed string will be placed here + 66:lib/vsprintf.c **** * @base: The number base to use + 67:lib/vsprintf.c **** */ + 68:lib/vsprintf.c **** long simple_strtol(const char *cp,char **endp,unsigned int base) + 69:lib/vsprintf.c **** { + 70:lib/vsprintf.c **** if(*cp=='-') + 71:lib/vsprintf.c **** return -simple_strtoul(cp+1,endp,base); + 72:lib/vsprintf.c **** return simple_strtoul(cp,endp,base); + 73:lib/vsprintf.c **** } + 74:lib/vsprintf.c **** + 75:lib/vsprintf.c **** + 76:lib/vsprintf.c **** /** + 77:lib/vsprintf.c **** * simple_strtoull - convert a string to an unsigned long long + 78:lib/vsprintf.c **** * @cp: The start of the string + 79:lib/vsprintf.c **** * @endp: A pointer to the end of the parsed string will be placed here + 80:lib/vsprintf.c **** * @base: The number base to use + 81:lib/vsprintf.c **** */ + 82:lib/vsprintf.c **** unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) + 83:lib/vsprintf.c **** { + 84:lib/vsprintf.c **** unsigned long long result = 0,value; + 85:lib/vsprintf.c **** + 86:lib/vsprintf.c **** if (!base) { + 87:lib/vsprintf.c **** base = 10; + 88:lib/vsprintf.c **** if (*cp == '0') { + 89:lib/vsprintf.c **** base = 8; + 90:lib/vsprintf.c **** cp++; + 91:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 92:lib/vsprintf.c **** cp++; + 93:lib/vsprintf.c **** base = 16; + 94:lib/vsprintf.c **** } + 95:lib/vsprintf.c **** } + 96:lib/vsprintf.c **** } else if (base == 16) { + 97:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 98:lib/vsprintf.c **** cp += 2; + 99:lib/vsprintf.c **** } + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 101:lib/vsprintf.c **** ? toupper(*cp) : *cp)-'A'+10) < base) { + 102:lib/vsprintf.c **** result = result*base + value; + 103:lib/vsprintf.c **** cp++; + 104:lib/vsprintf.c **** } + 105:lib/vsprintf.c **** if (endp) + 106:lib/vsprintf.c **** *endp = (char *)cp; + 107:lib/vsprintf.c **** return result; + 108:lib/vsprintf.c **** } + 109:lib/vsprintf.c **** + 110:lib/vsprintf.c **** + 111:lib/vsprintf.c **** /** + 112:lib/vsprintf.c **** * simple_strtoll - convert a string to a signed long long + 113:lib/vsprintf.c **** * @cp: The start of the string + 114:lib/vsprintf.c **** * @endp: A pointer to the end of the parsed string will be placed here + 115:lib/vsprintf.c **** * @base: The number base to use + 116:lib/vsprintf.c **** */ + 117:lib/vsprintf.c **** long long simple_strtoll(const char *cp,char **endp,unsigned int base) + 118:lib/vsprintf.c **** { + 119:lib/vsprintf.c **** if(*cp=='-') + 120:lib/vsprintf.c **** return -simple_strtoull(cp+1,endp,base); + 121:lib/vsprintf.c **** return simple_strtoull(cp,endp,base); + 122:lib/vsprintf.c **** } + 123:lib/vsprintf.c **** + 124:lib/vsprintf.c **** static int skip_atoi(const char **s) + 125:lib/vsprintf.c **** { + 56 .loc 2 125 0 + 57 .cfi_startproc + 58 @ Function supports interworking. + 59 @ args = 0, pretend = 0, frame = 0 + 60 @ frame_needed = 0, uses_anonymous_args = 0 + 61 @ link register save eliminated. + 62 .LVL3: + 126:lib/vsprintf.c **** int i=0; + 63 .loc 2 126 0 + 64 001c 0030A0E3 mov r3, #0 + 127:lib/vsprintf.c **** + 128:lib/vsprintf.c **** while (isdigit(**s)) + 65 .loc 2 128 0 + 66 0020 040000EA b .L6 + 67 .LVL4: + 68 .L7: + 129:lib/vsprintf.c **** i = i*10 + *((*s)++) - '0'; + 69 .loc 2 129 0 + 70 0024 302042E2 sub r2, r2, #48 + 71 0028 0AC0A0E3 mov ip, #10 + 72 002c 9C2323E0 mla r3, ip, r3, r2 + 73 .LVL5: + 74 0030 011081E2 add r1, r1, #1 + 75 0034 001080E5 str r1, [r0, #0] + 76 .LVL6: + 77 .L6: + 128:lib/vsprintf.c **** while (isdigit(**s)) + 78 .loc 2 128 0 discriminator 1 + 79 0038 001090E5 ldr r1, [r0, #0] + 80 003c 14C09FE5 ldr ip, .L8 + 81 0040 0020D1E5 ldrb r2, [r1, #0] @ zero_extendqisi2 + 82 0044 02C0DCE7 ldrb ip, [ip, r2] @ zero_extendqisi2 + 83 0048 04001CE3 tst ip, #4 + 84 004c F4FFFF1A bne .L7 + 130:lib/vsprintf.c **** return i; + 131:lib/vsprintf.c **** } + 85 .loc 2 131 0 + 86 0050 0300A0E1 mov r0, r3 + 87 .LVL7: + 88 0054 1EFF2FE1 bx lr + 89 .L9: + 90 .align 2 + 91 .L8: + 92 0058 00000000 .word _ctype + 93 .cfi_endproc + 94 .LFE6: + 96 .align 2 + 98 number: + 99 .LFB7: + 132:lib/vsprintf.c **** + 133:lib/vsprintf.c **** #define ZEROPAD 1 /* pad with zero */ + 134:lib/vsprintf.c **** #define SIGN 2 /* unsigned/signed long */ + 135:lib/vsprintf.c **** #define PLUS 4 /* show plus */ + 136:lib/vsprintf.c **** #define SPACE 8 /* space if plus */ + 137:lib/vsprintf.c **** #define LEFT 16 /* left justified */ + 138:lib/vsprintf.c **** #define SPECIAL 32 /* 0x */ + 139:lib/vsprintf.c **** #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + 140:lib/vsprintf.c **** + 141:lib/vsprintf.c **** static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precis + 142:lib/vsprintf.c **** { + 100 .loc 2 142 0 + 101 .cfi_startproc + 102 @ Function supports interworking. + 103 @ args = 16, pretend = 0, frame = 88 + 104 @ frame_needed = 0, uses_anonymous_args = 0 + 105 .LVL8: + 106 005c F04F2DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 107 .LCFI0: + 108 .cfi_def_cfa_offset 36 + 109 0060 5CD04DE2 sub sp, sp, #92 + 110 .LCFI1: + 111 .cfi_def_cfa_offset 128 + 112 .loc 2 142 0 + 113 0064 8C709DE5 ldr r7, [sp, #140] + 114 .cfi_offset 14, -4 + 115 .cfi_offset 11, -8 + 116 .cfi_offset 10, -12 + 117 .cfi_offset 9, -16 + 118 .cfi_offset 8, -20 + 119 .cfi_offset 7, -24 + 120 .cfi_offset 6, -28 + 121 .cfi_offset 5, -32 + 122 .cfi_offset 4, -36 + 123 0068 01A0A0E1 mov sl, r1 + 143:lib/vsprintf.c **** char c,sign,tmp[66]; + 144:lib/vsprintf.c **** const char *digits; + 145:lib/vsprintf.c **** static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + 146:lib/vsprintf.c **** static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + 147:lib/vsprintf.c **** int i; + 148:lib/vsprintf.c **** + 149:lib/vsprintf.c **** digits = (type & LARGE) ? large_digits : small_digits; + 124 .loc 2 149 0 + 125 006c 30129FE5 ldr r1, .L51 + 126 .LVL9: + 127 0070 400017E3 tst r7, #64 + 142:lib/vsprintf.c **** { + 128 .loc 2 142 0 + 129 0074 0050A0E1 mov r5, r0 + 130 0078 80B09DE5 ldr fp, [sp, #128] + 131 .loc 2 149 0 + 132 007c 250081E2 add r0, r1, #37 + 133 .LVL10: + 134 0080 0010A001 moveq r1, r0 + 135 0084 04108DE5 str r1, [sp, #4] + 136 .LVL11: + 150:lib/vsprintf.c **** if (type & LEFT) + 137 .loc 2 150 0 + 138 0088 100017E3 tst r7, #16 + 151:lib/vsprintf.c **** type &= ~ZEROPAD; + 152:lib/vsprintf.c **** if (base < 2 || base > 36) + 139 .loc 2 152 0 + 140 008c 02104BE2 sub r1, fp, #2 + 141 .LVL12: + 151:lib/vsprintf.c **** type &= ~ZEROPAD; + 142 .loc 2 151 0 + 143 0090 0170C713 bicne r7, r7, #1 + 144 .LVL13: + 145 .loc 2 152 0 + 146 0094 220051E3 cmp r1, #34 + 142:lib/vsprintf.c **** { + 147 .loc 2 142 0 + 148 0098 84609DE5 ldr r6, [sp, #132] + 149 .loc 2 152 0 + 150 009c 7B00008A bhi .L47 + 153:lib/vsprintf.c **** return NULL; + 154:lib/vsprintf.c **** c = (type & ZEROPAD) ? '0' : ' '; + 151 .loc 2 154 0 + 152 00a0 010017E3 tst r7, #1 + 153 00a4 2000A003 moveq r0, #32 + 154 00a8 3000A013 movne r0, #48 + 155:lib/vsprintf.c **** sign = 0; + 156:lib/vsprintf.c **** if (type & SIGN) { + 155 .loc 2 156 0 + 156 00ac 029017E2 ands r9, r7, #2 + 154:lib/vsprintf.c **** c = (type & ZEROPAD) ? '0' : ' '; + 157 .loc 2 154 0 + 158 00b0 08008DE5 str r0, [sp, #8] + 159 .LVL14: + 160 .loc 2 156 0 + 161 00b4 0E00000A beq .L15 + 157:lib/vsprintf.c **** if ((signed long long) num < 0) { + 162 .loc 2 157 0 + 163 00b8 000052E3 cmp r2, #0 + 164 00bc 0010D3E2 sbcs r1, r3, #0 + 165 00c0 040000AA bge .L16 + 166 .LVL15: + 158:lib/vsprintf.c **** sign = '-'; + 159:lib/vsprintf.c **** num = - (signed long long) num; + 167 .loc 2 159 0 + 168 00c4 002072E2 rsbs r2, r2, #0 + 169 00c8 0030E3E2 rsc r3, r3, #0 + 170 .LVL16: + 160:lib/vsprintf.c **** size--; + 171 .loc 2 160 0 + 172 00cc 016046E2 sub r6, r6, #1 + 173 .LVL17: + 158:lib/vsprintf.c **** sign = '-'; + 174 .loc 2 158 0 + 175 00d0 2D90A0E3 mov r9, #45 + 176 00d4 060000EA b .L15 + 177 .LVL18: + 178 .L16: + 161:lib/vsprintf.c **** } else if (type & PLUS) { + 179 .loc 2 161 0 + 180 00d8 040017E3 tst r7, #4 + 162:lib/vsprintf.c **** sign = '+'; + 163:lib/vsprintf.c **** size--; + 181 .loc 2 163 0 + 182 00dc 01604612 subne r6, r6, #1 + 183 .LVL19: + 162:lib/vsprintf.c **** sign = '+'; + 184 .loc 2 162 0 + 185 00e0 2B90A013 movne r9, #43 + 161:lib/vsprintf.c **** } else if (type & PLUS) { + 186 .loc 2 161 0 + 187 00e4 0200001A bne .L15 + 164:lib/vsprintf.c **** } else if (type & SPACE) { + 188 .loc 2 164 0 + 189 00e8 089017E2 ands r9, r7, #8 + 190 .LVL20: + 165:lib/vsprintf.c **** sign = ' '; + 166:lib/vsprintf.c **** size--; + 191 .loc 2 166 0 + 192 00ec 01604612 subne r6, r6, #1 + 193 .LVL21: + 165:lib/vsprintf.c **** sign = ' '; + 194 .loc 2 165 0 + 195 00f0 2090A013 movne r9, #32 + 196 .LVL22: + 197 .L15: + 167:lib/vsprintf.c **** } + 168:lib/vsprintf.c **** } + 169:lib/vsprintf.c **** if (type & SPECIAL) { + 198 .loc 2 169 0 + 199 00f4 20C017E2 ands ip, r7, #32 + 200 00f8 0CC08DE5 str ip, [sp, #12] + 201 00fc 0400000A beq .L18 + 170:lib/vsprintf.c **** if (base == 16) + 202 .loc 2 170 0 + 203 0100 10005BE3 cmp fp, #16 + 171:lib/vsprintf.c **** size -= 2; + 204 .loc 2 171 0 + 205 0104 02604602 subeq r6, r6, #2 + 206 .LVL23: + 170:lib/vsprintf.c **** if (base == 16) + 207 .loc 2 170 0 + 208 0108 0100000A beq .L18 + 172:lib/vsprintf.c **** else if (base == 8) + 209 .loc 2 172 0 + 210 010c 08005BE3 cmp fp, #8 + 173:lib/vsprintf.c **** size--; + 211 .loc 2 173 0 + 212 0110 01604602 subeq r6, r6, #1 + 213 .LVL24: + 214 .L18: + 174:lib/vsprintf.c **** } + 175:lib/vsprintf.c **** i = 0; + 176:lib/vsprintf.c **** if (num == 0) + 215 .loc 2 176 0 + 216 0114 030092E1 orrs r0, r2, r3 + 177:lib/vsprintf.c **** tmp[i++]='0'; + 217 .loc 2 177 0 + 218 0118 3030A003 moveq r3, #48 + 219 011c 1430CD05 streqb r3, [sp, #20] + 220 .LVL25: + 221 0120 0180A003 moveq r8, #1 + 176:lib/vsprintf.c **** if (num == 0) + 222 .loc 2 176 0 + 223 0124 0B00000A beq .L21 + 224 0128 0080A0E3 mov r8, #0 + 225 .LVL26: + 226 .L22: + 227 .LBB2: + 178:lib/vsprintf.c **** else while (num != 0) + 179:lib/vsprintf.c **** tmp[i++] = digits[do_div(num,base)]; + 228 .loc 2 179 0 + 229 012c 0200A0E1 mov r0, r2 + 230 .LVL27: + 231 0130 0B40A0E1 mov r4, fp + 232 .LVL28: + 233 0134 0310A0E1 mov r1, r3 + 234 @ 179 "lib/vsprintf.c" 1 + 235 .ifnc r1,r1 ; .err ; .endif + 236 .ifnc r2,r2 ; .err ; .endif + 237 .ifnc r0,r0 ; .err ; .endif + 238 .ifnc r4,r4 ; .err ; .endif + 239 0138 FEFFFFEB bl __do_div64 + 240 @ 0 "" 2 + 241 .LVL29: + 242 .LBE2: + 243 013c 04C09DE5 ldr ip, [sp, #4] + 244 0140 0100DCE7 ldrb r0, [ip, r1] @ zero_extendqisi2 + 245 .LVL30: + 246 0144 14108DE2 add r1, sp, #20 + 247 .LVL31: + 248 0148 0800C1E7 strb r0, [r1, r8] + 178:lib/vsprintf.c **** else while (num != 0) + 249 .loc 2 178 0 + 250 014c 030092E1 orrs r0, r2, r3 + 251 .loc 2 179 0 + 252 0150 018088E2 add r8, r8, #1 + 253 .LVL32: + 178:lib/vsprintf.c **** else while (num != 0) + 254 .loc 2 178 0 + 255 0154 F4FFFF1A bne .L22 + 256 .LVL33: + 257 .L21: + 258 0158 88309DE5 ldr r3, [sp, #136] + 259 015c 030058E1 cmp r8, r3 + 260 0160 0830A0A1 movge r3, r8 + 261 0164 0330A0B1 movlt r3, r3 + 262 .LVL34: + 180:lib/vsprintf.c **** if (i > precision) + 181:lib/vsprintf.c **** precision = i; + 182:lib/vsprintf.c **** size -= precision; + 183:lib/vsprintf.c **** if (!(type&(ZEROPAD+LEFT))) { + 263 .loc 2 183 0 + 264 0168 110017E3 tst r7, #17 + 182:lib/vsprintf.c **** size -= precision; + 265 .loc 2 182 0 + 266 016c 066063E0 rsb r6, r3, r6 + 267 .LVL35: + 268 .loc 2 183 0 + 269 0170 0800001A bne .L23 + 270 0174 030000EA b .L24 + 271 .LVL36: + 272 .L26: + 184:lib/vsprintf.c **** while(size-->0) { + 185:lib/vsprintf.c **** if (buf <= end) + 273 .loc 2 185 0 + 274 0178 0A0055E1 cmp r5, sl + 186:lib/vsprintf.c **** *buf = ' '; + 275 .loc 2 186 0 + 276 017c 2020A093 movls r2, #32 + 277 0180 0020C595 strlsb r2, [r5, #0] + 187:lib/vsprintf.c **** ++buf; + 278 .loc 2 187 0 + 279 0184 015085E2 add r5, r5, #1 + 280 .LVL37: + 281 .L24: + 184:lib/vsprintf.c **** while(size-->0) { + 282 .loc 2 184 0 discriminator 1 + 283 0188 016046E2 sub r6, r6, #1 + 284 .LVL38: + 141:lib/vsprintf.c **** static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precis + 285 .loc 2 141 0 discriminator 1 + 286 018c 012086E2 add r2, r6, #1 + 184:lib/vsprintf.c **** while(size-->0) { + 287 .loc 2 184 0 discriminator 1 + 288 0190 000052E3 cmp r2, #0 + 289 0194 F7FFFFCA bgt .L26 + 290 .L23: + 188:lib/vsprintf.c **** } + 189:lib/vsprintf.c **** } + 190:lib/vsprintf.c **** if (sign) { + 291 .loc 2 190 0 + 292 0198 000059E3 cmp r9, #0 + 293 019c 0200000A beq .L27 + 191:lib/vsprintf.c **** if (buf <= end) + 294 .loc 2 191 0 + 295 01a0 0A0055E1 cmp r5, sl + 192:lib/vsprintf.c **** *buf = sign; + 296 .loc 2 192 0 + 297 01a4 0090C595 strlsb r9, [r5, #0] + 193:lib/vsprintf.c **** ++buf; + 298 .loc 2 193 0 + 299 01a8 015085E2 add r5, r5, #1 + 300 .LVL39: + 301 .L27: + 194:lib/vsprintf.c **** } + 195:lib/vsprintf.c **** if (type & SPECIAL) { + 302 .loc 2 195 0 + 303 01ac 0C109DE5 ldr r1, [sp, #12] + 304 01b0 000051E3 cmp r1, #0 + 305 01b4 1100000A beq .L29 + 196:lib/vsprintf.c **** if (base==8) { + 306 .loc 2 196 0 + 307 01b8 08005BE3 cmp fp, #8 + 308 01bc 0400001A bne .L30 + 197:lib/vsprintf.c **** if (buf <= end) + 309 .loc 2 197 0 + 310 01c0 0A0055E1 cmp r5, sl + 198:lib/vsprintf.c **** *buf = '0'; + 311 .loc 2 198 0 + 312 01c4 3020A093 movls r2, #48 + 313 01c8 0020C595 strlsb r2, [r5, #0] + 199:lib/vsprintf.c **** ++buf; + 314 .loc 2 199 0 + 315 01cc 015085E2 add r5, r5, #1 + 316 .LVL40: + 317 01d0 0A0000EA b .L29 + 318 .L30: + 200:lib/vsprintf.c **** } else if (base==16) { + 319 .loc 2 200 0 + 320 01d4 10005BE3 cmp fp, #16 + 321 01d8 0800001A bne .L29 + 201:lib/vsprintf.c **** if (buf <= end) + 322 .loc 2 201 0 + 323 01dc 0A0055E1 cmp r5, sl + 202:lib/vsprintf.c **** *buf = '0'; + 324 .loc 2 202 0 + 325 01e0 3020A093 movls r2, #48 + 326 01e4 0020C595 strlsb r2, [r5, #0] + 203:lib/vsprintf.c **** ++buf; + 327 .loc 2 203 0 + 328 01e8 012085E2 add r2, r5, #1 + 329 .LVL41: + 204:lib/vsprintf.c **** if (buf <= end) + 330 .loc 2 204 0 + 331 01ec 0A0052E1 cmp r2, sl + 205:lib/vsprintf.c **** *buf = digits[33]; + 332 .loc 2 205 0 + 333 01f0 04C09D95 ldrls ip, [sp, #4] + 334 01f4 2110DC95 ldrlsb r1, [ip, #33] @ zero_extendqisi2 + 335 01f8 0110C595 strlsb r1, [r5, #1] + 206:lib/vsprintf.c **** ++buf; + 336 .loc 2 206 0 + 337 01fc 015082E2 add r5, r2, #1 + 338 .LVL42: + 339 .L29: + 207:lib/vsprintf.c **** } + 208:lib/vsprintf.c **** } + 209:lib/vsprintf.c **** if (!(type & LEFT)) { + 340 .loc 2 209 0 + 341 0200 100017E3 tst r7, #16 + 342 0204 0E00001A bne .L38 + 343 0208 030000EA b .L35 + 344 .L37: + 210:lib/vsprintf.c **** while (size-- > 0) { + 211:lib/vsprintf.c **** if (buf <= end) + 345 .loc 2 211 0 + 346 020c 0A0055E1 cmp r5, sl + 212:lib/vsprintf.c **** *buf = c; + 347 .loc 2 212 0 + 348 0210 08009D95 ldrls r0, [sp, #8] + 349 0214 0000C595 strlsb r0, [r5, #0] + 213:lib/vsprintf.c **** ++buf; + 350 .loc 2 213 0 + 351 0218 015085E2 add r5, r5, #1 + 352 .LVL43: + 353 .L35: + 210:lib/vsprintf.c **** while (size-- > 0) { + 354 .loc 2 210 0 discriminator 1 + 355 021c 016046E2 sub r6, r6, #1 + 356 .LVL44: + 141:lib/vsprintf.c **** static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precis + 357 .loc 2 141 0 discriminator 1 + 358 0220 012086E2 add r2, r6, #1 + 210:lib/vsprintf.c **** while (size-- > 0) { + 359 .loc 2 210 0 discriminator 1 + 360 0224 000052E3 cmp r2, #0 + 361 0228 F7FFFFCA bgt .L37 + 362 022c 040000EA b .L38 + 363 .LVL45: + 364 .L40: + 214:lib/vsprintf.c **** } + 215:lib/vsprintf.c **** } + 216:lib/vsprintf.c **** while (i < precision--) { + 217:lib/vsprintf.c **** if (buf <= end) + 365 .loc 2 217 0 + 366 0230 0A0055E1 cmp r5, sl + 218:lib/vsprintf.c **** *buf = '0'; + 367 .loc 2 218 0 + 368 0234 3020A093 movls r2, #48 + 369 0238 0020C595 strlsb r2, [r5, #0] + 219:lib/vsprintf.c **** ++buf; + 370 .loc 2 219 0 + 371 023c 013043E2 sub r3, r3, #1 + 372 0240 015085E2 add r5, r5, #1 + 373 .LVL46: + 374 .L38: + 216:lib/vsprintf.c **** while (i < precision--) { + 375 .loc 2 216 0 discriminator 1 + 376 0244 030058E1 cmp r8, r3 + 377 0248 F8FFFFBA blt .L40 + 378 .LVL47: + 379 .L42: + 220:lib/vsprintf.c **** } + 221:lib/vsprintf.c **** while (i-- > 0) { + 222:lib/vsprintf.c **** if (buf <= end) + 380 .loc 2 222 0 + 381 024c 0A0055E1 cmp r5, sl + 223:lib/vsprintf.c **** *buf = tmp[i]; + 382 .loc 2 223 0 + 383 0250 14308D92 addls r3, sp, #20 + 221:lib/vsprintf.c **** while (i-- > 0) { + 384 .loc 2 221 0 + 385 0254 018048E2 sub r8, r8, #1 + 386 .loc 2 223 0 + 387 0258 0830D397 ldrlsb r3, [r3, r8] @ zero_extendqisi2 + 388 025c 0030C595 strlsb r3, [r5, #0] + 221:lib/vsprintf.c **** while (i-- > 0) { + 389 .loc 2 221 0 + 390 0260 000058E3 cmp r8, #0 + 224:lib/vsprintf.c **** ++buf; + 391 .loc 2 224 0 + 392 0264 015085E2 add r5, r5, #1 + 393 .LVL48: + 221:lib/vsprintf.c **** while (i-- > 0) { + 394 .loc 2 221 0 + 395 0268 F7FFFFCA bgt .L42 + 396 026c 040000EA b .L43 + 397 .LVL49: + 398 .L45: + 225:lib/vsprintf.c **** } + 226:lib/vsprintf.c **** while (size-- > 0) { + 227:lib/vsprintf.c **** if (buf <= end) + 399 .loc 2 227 0 + 400 0270 0A0055E1 cmp r5, sl + 228:lib/vsprintf.c **** *buf = ' '; + 401 .loc 2 228 0 + 402 0274 2030A093 movls r3, #32 + 403 0278 0030C595 strlsb r3, [r5, #0] + 229:lib/vsprintf.c **** ++buf; + 404 .loc 2 229 0 + 405 027c 016046E2 sub r6, r6, #1 + 406 0280 015085E2 add r5, r5, #1 + 407 .LVL50: + 408 .L43: + 226:lib/vsprintf.c **** while (size-- > 0) { + 409 .loc 2 226 0 discriminator 1 + 410 0284 000056E3 cmp r6, #0 + 411 0288 F8FFFFCA bgt .L45 + 412 028c 000000EA b .L13 + 413 .LVL51: + 414 .L47: + 153:lib/vsprintf.c **** return NULL; + 415 .loc 2 153 0 + 416 0290 0050A0E3 mov r5, #0 + 417 .LVL52: + 418 .L13: + 230:lib/vsprintf.c **** } + 231:lib/vsprintf.c **** return buf; + 232:lib/vsprintf.c **** } + 419 .loc 2 232 0 + 420 0294 0500A0E1 mov r0, r5 + 421 0298 5CD08DE2 add sp, sp, #92 + 422 029c F04FBDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 423 02a0 1EFF2FE1 bx lr + 424 .L52: + 425 .align 2 + 426 .L51: + 427 02a4 00000000 .word .LANCHOR0 + 428 .cfi_endproc + 429 .LFE7: + 431 .align 2 + 432 .global simple_strtoul + 434 simple_strtoul: + 435 .LFB2: + 34:lib/vsprintf.c **** { + 436 .loc 2 34 0 + 437 .cfi_startproc + 438 @ Function supports interworking. + 439 @ args = 0, pretend = 0, frame = 0 + 440 @ frame_needed = 0, uses_anonymous_args = 0 + 441 .LVL53: + 442 02a8 F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 443 .LCFI2: + 444 .cfi_def_cfa_offset 24 + 37:lib/vsprintf.c **** if (!base) { + 445 .loc 2 37 0 + 446 02ac 006052E2 subs r6, r2, #0 + 447 .cfi_offset 14, -4 + 448 .cfi_offset 8, -8 + 449 .cfi_offset 7, -12 + 450 .cfi_offset 6, -16 + 451 .cfi_offset 5, -20 + 452 .cfi_offset 4, -24 + 34:lib/vsprintf.c **** { + 453 .loc 2 34 0 + 454 02b0 0040A0E1 mov r4, r0 + 455 02b4 0150A0E1 mov r5, r1 + 37:lib/vsprintf.c **** if (!base) { + 456 .loc 2 37 0 + 457 02b8 1100001A bne .L54 + 458 .LVL54: + 39:lib/vsprintf.c **** if (*cp == '0') { + 459 .loc 2 39 0 + 460 02bc 0030D0E5 ldrb r3, [r0, #0] @ zero_extendqisi2 + 461 02c0 300053E3 cmp r3, #48 + 38:lib/vsprintf.c **** base = 10; + 462 .loc 2 38 0 + 463 02c4 0A60A013 movne r6, #10 + 39:lib/vsprintf.c **** if (*cp == '0') { + 464 .loc 2 39 0 + 465 02c8 1600001A bne .L55 + 466 .LVL55: + 42:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 467 .loc 2 42 0 + 468 02cc 0100F4E5 ldrb r0, [r4, #1]! @ zero_extendqisi2 + 469 .LVL56: + 470 02d0 4AFFFFEB bl __toupper + 471 .LVL57: + 472 02d4 580050E3 cmp r0, #88 + 40:lib/vsprintf.c **** base = 8; + 473 .loc 2 40 0 + 474 02d8 0860A013 movne r6, #8 + 42:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 475 .loc 2 42 0 + 476 02dc 1100001A bne .L55 + 42:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 477 .loc 2 42 0 is_stmt 0 discriminator 1 + 478 02e0 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 479 02e4 90209FE5 ldr r2, .L65 + 480 02e8 0330D2E7 ldrb r3, [r2, r3] @ zero_extendqisi2 + 481 02ec 443003E2 and r3, r3, #68 + 482 02f0 000053E3 cmp r3, #0 + 40:lib/vsprintf.c **** base = 8; + 483 .loc 2 40 0 is_stmt 1 discriminator 1 + 484 02f4 1060A013 movne r6, #16 + 485 02f8 0860A003 moveq r6, #8 + 486 02fc 01408412 addne r4, r4, #1 + 487 .LVL58: + 488 0300 080000EA b .L55 + 489 .LVL59: + 490 .L54: + 47:lib/vsprintf.c **** } else if (base == 16) { + 491 .loc 2 47 0 + 492 0304 100056E3 cmp r6, #16 + 493 0308 0600001A bne .L55 + 48:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 494 .loc 2 48 0 + 495 030c 0030D0E5 ldrb r3, [r0, #0] @ zero_extendqisi2 + 496 0310 300053E3 cmp r3, #48 + 497 0314 0300001A bne .L55 + 48:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 498 .loc 2 48 0 is_stmt 0 discriminator 1 + 499 0318 0100D0E5 ldrb r0, [r0, #1] @ zero_extendqisi2 + 500 .LVL60: + 501 031c 37FFFFEB bl __toupper + 502 .LVL61: + 503 0320 580050E3 cmp r0, #88 + 49:lib/vsprintf.c **** cp += 2; + 504 .loc 2 49 0 is_stmt 1 discriminator 1 + 505 0324 02408402 addeq r4, r4, #2 + 506 .LVL62: + 507 .L55: + 38:lib/vsprintf.c **** base = 10; + 508 .loc 2 38 0 discriminator 1 + 509 0328 0070A0E3 mov r7, #0 + 510 032c 000000EA b .L56 + 511 .LVL63: + 512 .L60: + 53:lib/vsprintf.c **** result = result*base + value; + 513 .loc 2 53 0 + 514 0330 960727E0 mla r7, r6, r7, r0 + 515 .LVL64: + 516 .L56: + 53:lib/vsprintf.c **** result = result*base + value; + 517 .loc 2 53 0 is_stmt 0 discriminator 1 + 518 0334 0480A0E1 mov r8, r4 + 519 .LVL65: + 51:lib/vsprintf.c **** while (isxdigit(*cp) && + 520 .loc 2 51 0 is_stmt 1 discriminator 1 + 521 0338 3C309FE5 ldr r3, .L65 + 522 033c 0100D4E4 ldrb r0, [r4], #1 @ zero_extendqisi2 + 523 .LVL66: + 524 0340 0030D3E7 ldrb r3, [r3, r0] @ zero_extendqisi2 + 525 0344 440013E3 tst r3, #68 + 526 0348 0600000A beq .L57 + 52:lib/vsprintf.c **** (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + 527 .loc 2 52 0 + 528 034c 040013E3 tst r3, #4 + 529 0350 30004012 subne r0, r0, #48 + 530 0354 0100001A bne .L59 + 52:lib/vsprintf.c **** (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + 531 .loc 2 52 0 is_stmt 0 discriminator 2 + 532 0358 28FFFFEB bl __toupper + 533 035c 370040E2 sub r0, r0, #55 + 534 .L59: + 535 .LVL67: + 51:lib/vsprintf.c **** while (isxdigit(*cp) && + 536 .loc 2 51 0 is_stmt 1 discriminator 3 + 537 0360 060050E1 cmp r0, r6 + 538 0364 F1FFFF3A bcc .L60 + 539 .LVL68: + 540 .L57: + 56:lib/vsprintf.c **** if (endp) + 541 .loc 2 56 0 + 542 0368 000055E3 cmp r5, #0 + 57:lib/vsprintf.c **** *endp = (char *)cp; + 543 .loc 2 57 0 + 544 036c 00808515 strne r8, [r5, #0] + 59:lib/vsprintf.c **** } + 545 .loc 2 59 0 + 546 0370 0700A0E1 mov r0, r7 + 547 0374 F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 548 0378 1EFF2FE1 bx lr + 549 .L66: + 550 .align 2 + 551 .L65: + 552 037c 00000000 .word _ctype + 553 .cfi_endproc + 554 .LFE2: + 556 .align 2 + 557 .global simple_strtol + 559 simple_strtol: + 560 .LFB3: + 69:lib/vsprintf.c **** { + 561 .loc 2 69 0 + 562 .cfi_startproc + 563 @ Function supports interworking. + 564 @ args = 0, pretend = 0, frame = 0 + 565 @ frame_needed = 0, uses_anonymous_args = 0 + 566 .LVL69: + 567 0380 10402DE9 stmfd sp!, {r4, lr} + 568 .LCFI3: + 569 .cfi_def_cfa_offset 8 + 70:lib/vsprintf.c **** if(*cp=='-') + 570 .loc 2 70 0 + 571 0384 00C0D0E5 ldrb ip, [r0, #0] @ zero_extendqisi2 + 572 0388 2D005CE3 cmp ip, #45 + 573 038c 0400001A bne .L68 + 574 .cfi_offset 14, -4 + 575 .cfi_offset 4, -8 + 71:lib/vsprintf.c **** return -simple_strtoul(cp+1,endp,base); + 576 .loc 2 71 0 + 577 0390 010080E2 add r0, r0, #1 + 578 .LVL70: + 579 0394 FEFFFFEB bl simple_strtoul + 580 .LVL71: + 73:lib/vsprintf.c **** } + 581 .loc 2 73 0 + 582 0398 000060E2 rsb r0, r0, #0 + 583 039c 1040BDE8 ldmfd sp!, {r4, lr} + 584 03a0 1EFF2FE1 bx lr + 585 .LVL72: + 586 .L68: + 587 03a4 1040BDE8 ldmfd sp!, {r4, lr} + 72:lib/vsprintf.c **** return simple_strtoul(cp,endp,base); + 588 .loc 2 72 0 + 589 03a8 FEFFFFEA b simple_strtoul + 590 .cfi_endproc + 591 .LFE3: + 593 .align 2 + 594 .global simple_strtoull + 596 simple_strtoull: + 597 .LFB4: + 83:lib/vsprintf.c **** { + 598 .loc 2 83 0 + 599 .cfi_startproc + 600 @ Function supports interworking. + 601 @ args = 0, pretend = 0, frame = 0 + 602 @ frame_needed = 0, uses_anonymous_args = 0 + 603 .LVL73: + 604 03ac F8452DE9 stmfd sp!, {r3, r4, r5, r6, r7, r8, sl, lr} + 605 .LCFI4: + 606 .cfi_def_cfa_offset 32 + 86:lib/vsprintf.c **** if (!base) { + 607 .loc 2 86 0 + 608 03b0 006052E2 subs r6, r2, #0 + 609 .cfi_offset 14, -4 + 610 .cfi_offset 10, -8 + 611 .cfi_offset 8, -12 + 612 .cfi_offset 7, -16 + 613 .cfi_offset 6, -20 + 614 .cfi_offset 5, -24 + 615 .cfi_offset 4, -28 + 616 .cfi_offset 3, -32 + 83:lib/vsprintf.c **** { + 617 .loc 2 83 0 + 618 03b4 0040A0E1 mov r4, r0 + 619 03b8 0150A0E1 mov r5, r1 + 86:lib/vsprintf.c **** if (!base) { + 620 .loc 2 86 0 + 621 03bc 1100001A bne .L71 + 622 .LVL74: + 88:lib/vsprintf.c **** if (*cp == '0') { + 623 .loc 2 88 0 + 624 03c0 0030D0E5 ldrb r3, [r0, #0] @ zero_extendqisi2 + 625 03c4 300053E3 cmp r3, #48 + 87:lib/vsprintf.c **** base = 10; + 626 .loc 2 87 0 + 627 03c8 0A60A013 movne r6, #10 + 88:lib/vsprintf.c **** if (*cp == '0') { + 628 .loc 2 88 0 + 629 03cc 1600001A bne .L72 + 630 .LVL75: + 91:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 631 .loc 2 91 0 + 632 03d0 0100F4E5 ldrb r0, [r4, #1]! @ zero_extendqisi2 + 633 .LVL76: + 634 03d4 09FFFFEB bl __toupper + 635 .LVL77: + 636 03d8 580050E3 cmp r0, #88 + 89:lib/vsprintf.c **** base = 8; + 637 .loc 2 89 0 + 638 03dc 0860A013 movne r6, #8 + 91:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 639 .loc 2 91 0 + 640 03e0 1100001A bne .L72 + 91:lib/vsprintf.c **** if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 641 .loc 2 91 0 is_stmt 0 discriminator 1 + 642 03e4 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 643 03e8 B8209FE5 ldr r2, .L83 + 644 03ec 0330D2E7 ldrb r3, [r2, r3] @ zero_extendqisi2 + 645 03f0 443003E2 and r3, r3, #68 + 646 03f4 000053E3 cmp r3, #0 + 89:lib/vsprintf.c **** base = 8; + 647 .loc 2 89 0 is_stmt 1 discriminator 1 + 648 03f8 1060A013 movne r6, #16 + 649 03fc 0860A003 moveq r6, #8 + 650 0400 01408412 addne r4, r4, #1 + 651 .LVL78: + 652 0404 080000EA b .L72 + 653 .LVL79: + 654 .L71: + 96:lib/vsprintf.c **** } else if (base == 16) { + 655 .loc 2 96 0 + 656 0408 100056E3 cmp r6, #16 + 657 040c 0600001A bne .L72 + 97:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 658 .loc 2 97 0 + 659 0410 0030D0E5 ldrb r3, [r0, #0] @ zero_extendqisi2 + 660 0414 300053E3 cmp r3, #48 + 661 0418 0300001A bne .L72 + 97:lib/vsprintf.c **** if (cp[0] == '0' && toupper(cp[1]) == 'X') + 662 .loc 2 97 0 is_stmt 0 discriminator 1 + 663 041c 0100D0E5 ldrb r0, [r0, #1] @ zero_extendqisi2 + 664 .LVL80: + 665 0420 F6FEFFEB bl __toupper + 666 .LVL81: + 667 0424 580050E3 cmp r0, #88 + 98:lib/vsprintf.c **** cp += 2; + 668 .loc 2 98 0 is_stmt 1 discriminator 1 + 669 0428 02408402 addeq r4, r4, #2 + 670 .LVL82: + 671 .L72: + 87:lib/vsprintf.c **** base = 10; + 672 .loc 2 87 0 discriminator 1 + 673 042c 0070A0E3 mov r7, #0 + 674 0430 0080A0E3 mov r8, #0 + 675 0434 030000EA b .L73 + 676 .LVL83: + 677 .L78: + 102:lib/vsprintf.c **** result = result*base + value; + 678 .loc 2 102 0 + 679 0438 972683E0 umull r2, r3, r7, r6 + 680 043c 963823E0 mla r3, r6, r8, r3 + 681 0440 027090E0 adds r7, r0, r2 + 682 .LVL84: + 683 0444 0380A1E0 adc r8, r1, r3 + 684 .LVL85: + 685 .L73: + 102:lib/vsprintf.c **** result = result*base + value; + 686 .loc 2 102 0 is_stmt 0 discriminator 1 + 687 0448 04A0A0E1 mov sl, r4 + 688 .LVL86: + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 689 .loc 2 100 0 is_stmt 1 discriminator 1 + 690 044c 54309FE5 ldr r3, .L83 + 691 0450 0100D4E4 ldrb r0, [r4], #1 @ zero_extendqisi2 + 692 .LVL87: + 693 0454 0030D3E7 ldrb r3, [r3, r0] @ zero_extendqisi2 + 694 0458 440013E3 tst r3, #68 + 695 045c 0B00000A beq .L74 + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 696 .loc 2 100 0 is_stmt 0 discriminator 2 + 697 0460 040013E3 tst r3, #4 + 698 0464 30004012 subne r0, r0, #48 + 699 0468 0200001A bne .L76 + 700 046c 020013E3 tst r3, #2 + 101:lib/vsprintf.c **** ? toupper(*cp) : *cp)-'A'+10) < base) { + 701 .loc 2 101 0 is_stmt 1 + 702 0470 E2FEFF1B blne __toupper + 703 .L77: + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 704 .loc 2 100 0 discriminator 3 + 705 0474 370040E2 sub r0, r0, #55 + 706 .L76: + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 707 .loc 2 100 0 is_stmt 0 discriminator 5 + 708 0478 C01FA0E1 mov r1, r0, asr #31 + 709 .LVL88: + 101:lib/vsprintf.c **** ? toupper(*cp) : *cp)-'A'+10) < base) { + 710 .loc 2 101 0 is_stmt 1 discriminator 5 + 711 047c 0620A0E1 mov r2, r6 + 712 0480 0030A0E3 mov r3, #0 + 100:lib/vsprintf.c **** while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 713 .loc 2 100 0 discriminator 5 + 714 0484 030051E1 cmp r1, r3 + 715 0488 02005001 cmpeq r0, r2 + 716 048c E9FFFF3A bcc .L78 + 717 .LVL89: + 718 .L74: + 105:lib/vsprintf.c **** if (endp) + 719 .loc 2 105 0 + 720 0490 000055E3 cmp r5, #0 + 106:lib/vsprintf.c **** *endp = (char *)cp; + 721 .loc 2 106 0 + 722 0494 00A08515 strne sl, [r5, #0] + 108:lib/vsprintf.c **** } + 723 .loc 2 108 0 + 724 0498 0700A0E1 mov r0, r7 + 725 049c 0810A0E1 mov r1, r8 + 726 04a0 F845BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, r8, sl, lr} + 727 04a4 1EFF2FE1 bx lr + 728 .L84: + 729 .align 2 + 730 .L83: + 731 04a8 00000000 .word _ctype + 732 .cfi_endproc + 733 .LFE4: + 735 .align 2 + 736 .global simple_strtoll + 738 simple_strtoll: + 739 .LFB5: + 118:lib/vsprintf.c **** { + 740 .loc 2 118 0 + 741 .cfi_startproc + 742 @ Function supports interworking. + 743 @ args = 0, pretend = 0, frame = 0 + 744 @ frame_needed = 0, uses_anonymous_args = 0 + 745 .LVL90: + 746 04ac 10402DE9 stmfd sp!, {r4, lr} + 747 .LCFI5: + 748 .cfi_def_cfa_offset 8 + 119:lib/vsprintf.c **** if(*cp=='-') + 749 .loc 2 119 0 + 750 04b0 00C0D0E5 ldrb ip, [r0, #0] @ zero_extendqisi2 + 751 04b4 2D005CE3 cmp ip, #45 + 752 04b8 0700001A bne .L86 + 753 .cfi_offset 14, -4 + 754 .cfi_offset 4, -8 + 120:lib/vsprintf.c **** return -simple_strtoull(cp+1,endp,base); + 755 .loc 2 120 0 + 756 04bc 010080E2 add r0, r0, #1 + 757 .LVL91: + 758 04c0 FEFFFFEB bl simple_strtoull + 759 .LVL92: + 760 04c4 003070E2 rsbs r3, r0, #0 + 761 04c8 0040E1E2 rsc r4, r1, #0 + 122:lib/vsprintf.c **** } + 762 .loc 2 122 0 + 763 04cc 0300A0E1 mov r0, r3 + 764 04d0 0410A0E1 mov r1, r4 + 765 04d4 1040BDE8 ldmfd sp!, {r4, lr} + 766 04d8 1EFF2FE1 bx lr + 767 .LVL93: + 768 .L86: + 769 04dc 1040BDE8 ldmfd sp!, {r4, lr} + 121:lib/vsprintf.c **** return simple_strtoull(cp,endp,base); + 770 .loc 2 121 0 + 771 04e0 FEFFFFEA b simple_strtoull + 772 .cfi_endproc + 773 .LFE5: + 775 .align 2 + 776 .global vsnprintf + 778 vsnprintf: + 779 .LFB8: + 233:lib/vsprintf.c **** + 234:lib/vsprintf.c **** /** + 235:lib/vsprintf.c **** * vsnprintf - Format a string and place it in a buffer + 236:lib/vsprintf.c **** * @buf: The buffer to place the result into + 237:lib/vsprintf.c **** * @size: The size of the buffer, including the trailing null space + 238:lib/vsprintf.c **** * @fmt: The format string to use + 239:lib/vsprintf.c **** * @args: Arguments for the format string + 240:lib/vsprintf.c **** * + 241:lib/vsprintf.c **** * The return value is the number of characters which would + 242:lib/vsprintf.c **** * be generated for the given input, excluding the trailing + 243:lib/vsprintf.c **** * '\0', as per ISO C99. If you want to have the exact + 244:lib/vsprintf.c **** * number of characters written into @buf as return value + 245:lib/vsprintf.c **** * (not including the trailing '\0'), use vscnprintf. If the + 246:lib/vsprintf.c **** * return is greater than or equal to @size, the resulting + 247:lib/vsprintf.c **** * string is truncated. + 248:lib/vsprintf.c **** * + 249:lib/vsprintf.c **** * Call this function if you are already dealing with a va_list. + 250:lib/vsprintf.c **** * You probably want snprintf instead. + 251:lib/vsprintf.c **** */ + 252:lib/vsprintf.c **** int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 253:lib/vsprintf.c **** { + 780 .loc 2 253 0 + 781 .cfi_startproc + 782 @ Function supports interworking. + 783 @ args = 0, pretend = 0, frame = 8 + 784 @ frame_needed = 0, uses_anonymous_args = 0 + 785 .LVL94: + 786 04e4 F04F2DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 787 .LCFI6: + 788 .cfi_def_cfa_offset 36 + 254:lib/vsprintf.c **** int len; + 255:lib/vsprintf.c **** unsigned long long num; + 256:lib/vsprintf.c **** int i, base; + 257:lib/vsprintf.c **** char *str, *end, c; + 258:lib/vsprintf.c **** const char *s; + 259:lib/vsprintf.c **** + 260:lib/vsprintf.c **** int flags; /* flags to number() */ + 261:lib/vsprintf.c **** + 262:lib/vsprintf.c **** int field_width; /* width of output field */ + 263:lib/vsprintf.c **** int precision; /* min. # of digits for integers; max + 264:lib/vsprintf.c **** number of chars for from string */ + 265:lib/vsprintf.c **** int qualifier; /* 'h', 'l', or 'L' for integer fields */ + 266:lib/vsprintf.c **** /* 'z' support added 23/7/1999 S.H. */ + 267:lib/vsprintf.c **** /* 'z' changed to 'Z' --davidm 1/25/99 */ + 268:lib/vsprintf.c **** /* 't' added for ptrdiff_t */ + 269:lib/vsprintf.c **** + 270:lib/vsprintf.c **** /* Reject out-of-range values early */ + 271:lib/vsprintf.c **** if ((int) size < 0) { + 789 .loc 2 271 0 + 790 04e8 007051E2 subs r7, r1, #0 + 791 .cfi_offset 14, -4 + 792 .cfi_offset 11, -8 + 793 .cfi_offset 10, -12 + 794 .cfi_offset 9, -16 + 795 .cfi_offset 8, -20 + 796 .cfi_offset 7, -24 + 797 .cfi_offset 6, -28 + 798 .cfi_offset 5, -32 + 799 .cfi_offset 4, -36 + 253:lib/vsprintf.c **** { + 800 .loc 2 253 0 + 801 04ec 1CD04DE2 sub sp, sp, #28 + 802 .LCFI7: + 803 .cfi_def_cfa_offset 64 + 253:lib/vsprintf.c **** { + 804 .loc 2 253 0 + 805 04f0 0050A0E1 mov r5, r0 + 806 04f4 14208DE5 str r2, [sp, #20] + 807 04f8 0360A0E1 mov r6, r3 + 272:lib/vsprintf.c **** return 0; + 808 .loc 2 272 0 + 809 04fc 0000A0B3 movlt r0, #0 + 810 .LVL95: + 271:lib/vsprintf.c **** if ((int) size < 0) { + 811 .loc 2 271 0 + 812 0500 350100BA blt .L89 + 813 .LVL96: + 273:lib/vsprintf.c **** } + 274:lib/vsprintf.c **** + 275:lib/vsprintf.c **** str = buf; + 276:lib/vsprintf.c **** end = buf + size - 1; + 814 .loc 2 276 0 + 815 0504 014047E2 sub r4, r7, #1 + 816 0508 044080E0 add r4, r0, r4 + 817 .LVL97: + 277:lib/vsprintf.c **** + 278:lib/vsprintf.c **** if (end < buf - 1) { + 818 .loc 2 278 0 + 819 050c 013040E2 sub r3, r0, #1 + 820 .LVL98: + 821 0510 030054E1 cmp r4, r3 + 822 .LVL99: + 279:lib/vsprintf.c **** end = ((void *) -1); + 280:lib/vsprintf.c **** size = end - buf + 1; + 823 .loc 2 280 0 + 824 0514 00706032 rsbcc r7, r0, #0 + 825 .LVL100: + 279:lib/vsprintf.c **** end = ((void *) -1); + 826 .loc 2 279 0 + 827 0518 0040E033 mvncc r4, #0 + 828 .LBB3: + 281:lib/vsprintf.c **** } + 282:lib/vsprintf.c **** + 283:lib/vsprintf.c **** for (; *fmt ; ++fmt) { + 284:lib/vsprintf.c **** if (*fmt != '%') { + 285:lib/vsprintf.c **** if (str <= end) + 286:lib/vsprintf.c **** *str = *fmt; + 287:lib/vsprintf.c **** ++str; + 288:lib/vsprintf.c **** continue; + 289:lib/vsprintf.c **** } + 290:lib/vsprintf.c **** + 291:lib/vsprintf.c **** /* process flags */ + 292:lib/vsprintf.c **** flags = 0; + 293:lib/vsprintf.c **** repeat: + 294:lib/vsprintf.c **** ++fmt; /* this also skips first '%' */ + 295:lib/vsprintf.c **** switch (*fmt) { + 296:lib/vsprintf.c **** case '-': flags |= LEFT; goto repeat; + 297:lib/vsprintf.c **** case '+': flags |= PLUS; goto repeat; + 298:lib/vsprintf.c **** case ' ': flags |= SPACE; goto repeat; + 299:lib/vsprintf.c **** case '#': flags |= SPECIAL; goto repeat; + 300:lib/vsprintf.c **** case '0': flags |= ZEROPAD; goto repeat; + 301:lib/vsprintf.c **** } + 302:lib/vsprintf.c **** + 303:lib/vsprintf.c **** /* get field width */ + 304:lib/vsprintf.c **** field_width = -1; + 305:lib/vsprintf.c **** if (isdigit(*fmt)) + 306:lib/vsprintf.c **** field_width = skip_atoi(&fmt); + 307:lib/vsprintf.c **** else if (*fmt == '*') { + 308:lib/vsprintf.c **** ++fmt; + 309:lib/vsprintf.c **** /* it's the next argument */ + 310:lib/vsprintf.c **** field_width = va_arg(args, int); + 311:lib/vsprintf.c **** if (field_width < 0) { + 312:lib/vsprintf.c **** field_width = -field_width; + 313:lib/vsprintf.c **** flags |= LEFT; + 314:lib/vsprintf.c **** } + 315:lib/vsprintf.c **** } + 316:lib/vsprintf.c **** + 317:lib/vsprintf.c **** /* get the precision */ + 318:lib/vsprintf.c **** precision = -1; + 319:lib/vsprintf.c **** if (*fmt == '.') { + 320:lib/vsprintf.c **** ++fmt; + 321:lib/vsprintf.c **** if (isdigit(*fmt)) + 322:lib/vsprintf.c **** precision = skip_atoi(&fmt); + 323:lib/vsprintf.c **** else if (*fmt == '*') { + 324:lib/vsprintf.c **** ++fmt; + 325:lib/vsprintf.c **** /* it's the next argument */ + 326:lib/vsprintf.c **** precision = va_arg(args, int); + 327:lib/vsprintf.c **** } + 328:lib/vsprintf.c **** if (precision < 0) + 329:lib/vsprintf.c **** precision = 0; + 330:lib/vsprintf.c **** } + 331:lib/vsprintf.c **** + 332:lib/vsprintf.c **** /* get the conversion qualifier */ + 333:lib/vsprintf.c **** qualifier = -1; + 334:lib/vsprintf.c **** if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 335:lib/vsprintf.c **** *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + 336:lib/vsprintf.c **** qualifier = *fmt; + 337:lib/vsprintf.c **** ++fmt; + 338:lib/vsprintf.c **** if (qualifier == 'l' && *fmt == 'l') { + 339:lib/vsprintf.c **** qualifier = 'L'; + 340:lib/vsprintf.c **** ++fmt; + 341:lib/vsprintf.c **** } + 342:lib/vsprintf.c **** } + 343:lib/vsprintf.c **** + 344:lib/vsprintf.c **** /* default base */ + 345:lib/vsprintf.c **** base = 10; + 346:lib/vsprintf.c **** + 347:lib/vsprintf.c **** switch (*fmt) { + 348:lib/vsprintf.c **** case 'c': + 349:lib/vsprintf.c **** if (!(flags & LEFT)) { + 350:lib/vsprintf.c **** while (--field_width > 0) { + 351:lib/vsprintf.c **** if (str <= end) + 352:lib/vsprintf.c **** *str = ' '; + 353:lib/vsprintf.c **** ++str; + 354:lib/vsprintf.c **** } + 355:lib/vsprintf.c **** } + 356:lib/vsprintf.c **** c = (unsigned char) va_arg(args, int); + 357:lib/vsprintf.c **** if (str <= end) + 358:lib/vsprintf.c **** *str = c; + 359:lib/vsprintf.c **** ++str; + 360:lib/vsprintf.c **** while (--field_width > 0) { + 361:lib/vsprintf.c **** if (str <= end) + 362:lib/vsprintf.c **** *str = ' '; + 363:lib/vsprintf.c **** ++str; + 364:lib/vsprintf.c **** } + 365:lib/vsprintf.c **** continue; + 366:lib/vsprintf.c **** + 367:lib/vsprintf.c **** case 's': + 368:lib/vsprintf.c **** s = va_arg(args, char *); + 369:lib/vsprintf.c **** + 370:lib/vsprintf.c **** len = strnlen(s, precision); + 371:lib/vsprintf.c **** + 372:lib/vsprintf.c **** if (!(flags & LEFT)) { + 373:lib/vsprintf.c **** while (len < field_width--) { + 374:lib/vsprintf.c **** if (str <= end) + 375:lib/vsprintf.c **** *str = ' '; + 376:lib/vsprintf.c **** ++str; + 377:lib/vsprintf.c **** } + 378:lib/vsprintf.c **** } + 379:lib/vsprintf.c **** for (i = 0; i < len; ++i) { + 380:lib/vsprintf.c **** if (str <= end) + 381:lib/vsprintf.c **** *str = *s; + 382:lib/vsprintf.c **** ++str; ++s; + 383:lib/vsprintf.c **** } + 384:lib/vsprintf.c **** while (len < field_width--) { + 385:lib/vsprintf.c **** if (str <= end) + 386:lib/vsprintf.c **** *str = ' '; + 387:lib/vsprintf.c **** ++str; + 388:lib/vsprintf.c **** } + 389:lib/vsprintf.c **** continue; + 390:lib/vsprintf.c **** + 391:lib/vsprintf.c **** case 'p': + 392:lib/vsprintf.c **** if (field_width == -1) { + 393:lib/vsprintf.c **** field_width = 2*sizeof(void *); + 394:lib/vsprintf.c **** flags |= ZEROPAD; + 395:lib/vsprintf.c **** } + 396:lib/vsprintf.c **** str = number(str, end, + 397:lib/vsprintf.c **** (unsigned long) va_arg(args, void *), + 398:lib/vsprintf.c **** 16, field_width, precision, flags); + 399:lib/vsprintf.c **** continue; + 400:lib/vsprintf.c **** + 401:lib/vsprintf.c **** + 402:lib/vsprintf.c **** case 'n': + 403:lib/vsprintf.c **** /* FIXME: + 404:lib/vsprintf.c **** * What does C99 say about the overflow case here? */ + 405:lib/vsprintf.c **** if (qualifier == 'l') { + 406:lib/vsprintf.c **** long * ip = va_arg(args, long *); + 407:lib/vsprintf.c **** *ip = (str - buf); + 408:lib/vsprintf.c **** } else if (qualifier == 'Z' || qualifier == 'z') { + 409:lib/vsprintf.c **** size_t * ip = va_arg(args, size_t *); + 410:lib/vsprintf.c **** *ip = (str - buf); + 411:lib/vsprintf.c **** } else { + 412:lib/vsprintf.c **** int * ip = va_arg(args, int *); + 829 .loc 2 412 0 + 830 051c 0580A0E1 mov r8, r5 + 831 0520 230100EA b .L91 + 832 .LVL101: + 833 .L157: + 834 .LBE3: + 284:lib/vsprintf.c **** if (*fmt != '%') { + 835 .loc 2 284 0 + 836 0524 250053E3 cmp r3, #37 + 837 0528 00A0A003 moveq sl, #0 + 838 052c 0300000A beq .L167 + 285:lib/vsprintf.c **** if (str <= end) + 839 .loc 2 285 0 + 840 0530 040058E1 cmp r8, r4 + 286:lib/vsprintf.c **** *str = *fmt; + 841 .loc 2 286 0 + 842 0534 0030C895 strlsb r3, [r8, #0] + 287:lib/vsprintf.c **** ++str; + 843 .loc 2 287 0 + 844 0538 018088E2 add r8, r8, #1 + 845 .LVL102: + 846 053c 170100EA b .L172 + 847 .L167: + 848 .LVL103: + 294:lib/vsprintf.c **** ++fmt; /* this also skips first '%' */ + 849 .loc 2 294 0 + 850 0540 14309DE5 ldr r3, [sp, #20] + 851 0544 012083E2 add r2, r3, #1 + 852 .LVL104: + 853 0548 14208DE5 str r2, [sp, #20] + 295:lib/vsprintf.c **** switch (*fmt) { + 854 .loc 2 295 0 + 855 054c 0130D3E5 ldrb r3, [r3, #1] @ zero_extendqisi2 + 856 0550 2B0053E3 cmp r3, #43 + 857 0554 0C00000A beq .L99 + 858 0558 0400008A bhi .L102 + 859 055c 200053E3 cmp r3, #32 + 860 0560 0B00000A beq .L97 + 861 0564 230053E3 cmp r3, #35 + 862 0568 0F00001A bne .L96 + 863 056c 0A0000EA b .L177 + 864 .L102: + 865 0570 2D0053E3 cmp r3, #45 + 866 0574 0200000A beq .L100 + 867 0578 300053E3 cmp r3, #48 + 868 057c 0A00001A bne .L96 + 869 0580 070000EA b .L178 + 870 .L100: + 296:lib/vsprintf.c **** case '-': flags |= LEFT; goto repeat; + 871 .loc 2 296 0 + 872 0584 10A08AE3 orr sl, sl, #16 + 873 .LVL105: + 874 0588 ECFFFFEA b .L167 + 875 .L99: + 297:lib/vsprintf.c **** case '+': flags |= PLUS; goto repeat; + 876 .loc 2 297 0 + 877 058c 04A08AE3 orr sl, sl, #4 + 878 .LVL106: + 879 0590 EAFFFFEA b .L167 + 880 .L97: + 298:lib/vsprintf.c **** case ' ': flags |= SPACE; goto repeat; + 881 .loc 2 298 0 + 882 0594 08A08AE3 orr sl, sl, #8 + 883 .LVL107: + 884 0598 E8FFFFEA b .L167 + 885 .L177: + 299:lib/vsprintf.c **** case '#': flags |= SPECIAL; goto repeat; + 886 .loc 2 299 0 + 887 059c 20A08AE3 orr sl, sl, #32 + 888 .LVL108: + 889 05a0 E6FFFFEA b .L167 + 890 .L178: + 300:lib/vsprintf.c **** case '0': flags |= ZEROPAD; goto repeat; + 891 .loc 2 300 0 + 892 05a4 01A08AE3 orr sl, sl, #1 + 893 .LVL109: + 894 05a8 E4FFFFEA b .L167 + 895 .L96: + 896 .LVL110: + 305:lib/vsprintf.c **** if (isdigit(*fmt)) + 897 .loc 2 305 0 + 898 05ac 34149FE5 ldr r1, .L181 + 899 05b0 0310D1E7 ldrb r1, [r1, r3] @ zero_extendqisi2 + 900 05b4 040011E3 tst r1, #4 + 901 05b8 0400000A beq .L104 + 306:lib/vsprintf.c **** field_width = skip_atoi(&fmt); + 902 .loc 2 306 0 + 903 05bc 14008DE2 add r0, sp, #20 + 904 05c0 95FEFFEB bl skip_atoi + 905 05c4 0620A0E1 mov r2, r6 + 906 05c8 0090A0E1 mov r9, r0 + 907 .LVL111: + 908 05cc 0A0000EA b .L105 + 909 .LVL112: + 910 .L104: + 307:lib/vsprintf.c **** else if (*fmt == '*') { + 911 .loc 2 307 0 + 912 05d0 2A0053E3 cmp r3, #42 + 913 05d4 0620A011 movne r2, r6 + 304:lib/vsprintf.c **** field_width = -1; + 914 .loc 2 304 0 + 915 05d8 0090E013 mvnne r9, #0 + 307:lib/vsprintf.c **** else if (*fmt == '*') { + 916 .loc 2 307 0 + 917 05dc 0600001A bne .L105 + 310:lib/vsprintf.c **** field_width = va_arg(args, int); + 918 .loc 2 310 0 + 919 05e0 009096E5 ldr r9, [r6, #0] + 308:lib/vsprintf.c **** ++fmt; + 920 .loc 2 308 0 + 921 05e4 012082E2 add r2, r2, #1 + 311:lib/vsprintf.c **** if (field_width < 0) { + 922 .loc 2 311 0 + 923 05e8 000059E3 cmp r9, #0 + 308:lib/vsprintf.c **** ++fmt; + 924 .loc 2 308 0 + 925 05ec 14208DE5 str r2, [sp, #20] + 312:lib/vsprintf.c **** field_width = -field_width; + 926 .loc 2 312 0 + 927 05f0 009069B2 rsblt r9, r9, #0 + 310:lib/vsprintf.c **** field_width = va_arg(args, int); + 928 .loc 2 310 0 + 929 05f4 042086E2 add r2, r6, #4 + 930 .LVL113: + 313:lib/vsprintf.c **** flags |= LEFT; + 931 .loc 2 313 0 + 932 05f8 10A08AB3 orrlt sl, sl, #16 + 933 .LVL114: + 934 .L105: + 319:lib/vsprintf.c **** if (*fmt == '.') { + 935 .loc 2 319 0 + 936 05fc 14309DE5 ldr r3, [sp, #20] + 937 0600 0010D3E5 ldrb r1, [r3, #0] @ zero_extendqisi2 + 938 0604 2E0051E3 cmp r1, #46 + 318:lib/vsprintf.c **** precision = -1; + 939 .loc 2 318 0 + 940 0608 0010E013 mvnne r1, #0 + 319:lib/vsprintf.c **** if (*fmt == '.') { + 941 .loc 2 319 0 + 942 060c 1300001A bne .L106 + 320:lib/vsprintf.c **** ++fmt; + 943 .loc 2 320 0 + 944 0610 010083E2 add r0, r3, #1 + 945 0614 14008DE5 str r0, [sp, #20] + 321:lib/vsprintf.c **** if (isdigit(*fmt)) + 946 .loc 2 321 0 + 947 0618 C8139FE5 ldr r1, .L181 + 948 061c 0130D3E5 ldrb r3, [r3, #1] @ zero_extendqisi2 + 949 0620 0310D1E7 ldrb r1, [r1, r3] @ zero_extendqisi2 + 950 0624 041011E2 ands r1, r1, #4 + 951 0628 0500000A beq .L107 + 322:lib/vsprintf.c **** precision = skip_atoi(&fmt); + 952 .loc 2 322 0 + 953 062c 14008DE2 add r0, sp, #20 + 954 0630 10208DE5 str r2, [sp, #16] + 955 0634 78FEFFEB bl skip_atoi + 956 0638 10209DE5 ldr r2, [sp, #16] + 957 063c 0010A0E1 mov r1, r0 + 958 .LVL115: + 959 0640 050000EA b .L108 + 960 .LVL116: + 961 .L107: + 323:lib/vsprintf.c **** else if (*fmt == '*') { + 962 .loc 2 323 0 + 963 0644 2A0053E3 cmp r3, #42 + 964 0648 0400001A bne .L106 + 324:lib/vsprintf.c **** ++fmt; + 965 .loc 2 324 0 + 966 064c 010080E2 add r0, r0, #1 + 967 0650 14008DE5 str r0, [sp, #20] + 326:lib/vsprintf.c **** precision = va_arg(args, int); + 968 .loc 2 326 0 + 969 0654 001092E5 ldr r1, [r2, #0] + 970 .LVL117: + 971 0658 042082E2 add r2, r2, #4 + 972 .LVL118: + 973 .L108: + 329:lib/vsprintf.c **** precision = 0; + 974 .loc 2 329 0 + 975 065c C11FC1E1 bic r1, r1, r1, asr #31 + 976 .LVL119: + 977 .L106: + 334:lib/vsprintf.c **** if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 978 .loc 2 334 0 + 979 0660 14009DE5 ldr r0, [sp, #20] + 980 0664 0030D0E5 ldrb r3, [r0, #0] @ zero_extendqisi2 + 981 0668 680053E3 cmp r3, #104 + 982 066c 6C005313 cmpne r3, #108 + 983 0670 0900000A beq .L109 + 334:lib/vsprintf.c **** if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 984 .loc 2 334 0 is_stmt 0 discriminator 1 + 985 0674 5A0053E3 cmp r3, #90 + 986 0678 0700000A beq .L109 + 987 067c 0100008A bhi .L111 + 988 0680 4C0053E3 cmp r3, #76 + 989 0684 020000EA b .L169 + 990 .L111: + 991 0688 740053E3 cmp r3, #116 + 992 068c 0200000A beq .L109 + 993 0690 7A0053E3 cmp r3, #122 + 994 .L169: + 333:lib/vsprintf.c **** qualifier = -1; + 995 .loc 2 333 0 is_stmt 1 discriminator 1 + 996 0694 0030E013 mvnne r3, #0 + 334:lib/vsprintf.c **** if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 997 .loc 2 334 0 discriminator 1 + 998 0698 0800001A bne .L110 + 999 .L109: + 1000 .LVL120: + 337:lib/vsprintf.c **** ++fmt; + 1001 .loc 2 337 0 + 1002 069c 01C080E2 add ip, r0, #1 + 338:lib/vsprintf.c **** if (qualifier == 'l' && *fmt == 'l') { + 1003 .loc 2 338 0 + 1004 06a0 6C0053E3 cmp r3, #108 + 337:lib/vsprintf.c **** ++fmt; + 1005 .loc 2 337 0 + 1006 06a4 14C08DE5 str ip, [sp, #20] + 338:lib/vsprintf.c **** if (qualifier == 'l' && *fmt == 'l') { + 1007 .loc 2 338 0 + 1008 06a8 0400001A bne .L110 + 338:lib/vsprintf.c **** if (qualifier == 'l' && *fmt == 'l') { + 1009 .loc 2 338 0 is_stmt 0 discriminator 1 + 1010 06ac 0100D0E5 ldrb r0, [r0, #1] @ zero_extendqisi2 + 1011 06b0 6C0050E3 cmp r0, #108 + 1012 .LVL121: + 340:lib/vsprintf.c **** ++fmt; + 1013 .loc 2 340 0 is_stmt 1 discriminator 1 + 1014 06b4 01C08C02 addeq ip, ip, #1 + 1015 06b8 14C08D05 streq ip, [sp, #20] + 339:lib/vsprintf.c **** qualifier = 'L'; + 1016 .loc 2 339 0 discriminator 1 + 1017 06bc 4C30A003 moveq r3, #76 + 1018 .LVL122: + 1019 .L110: + 347:lib/vsprintf.c **** switch (*fmt) { + 1020 .loc 2 347 0 + 1021 06c0 14009DE5 ldr r0, [sp, #20] + 1022 06c4 0000D0E5 ldrb r0, [r0, #0] @ zero_extendqisi2 + 1023 06c8 6E0050E3 cmp r0, #110 + 1024 06cc 6400000A beq .L117 + 1025 06d0 0C00008A bhi .L123 + 1026 06d4 630050E3 cmp r0, #99 + 1027 06d8 1700000A beq .L115 + 1028 06dc 0400008A bhi .L124 + 1029 06e0 250050E3 cmp r0, #37 + 1030 06e4 6A00000A beq .L113 + 1031 06e8 580050E3 cmp r0, #88 + 1032 06ec 7100001A bne .L112 + 1033 06f0 6C0000EA b .L179 + 1034 .L124: + 1035 06f4 640050E3 cmp r0, #100 + 1036 06f8 6C00000A beq .L116 + 1037 06fc 690050E3 cmp r0, #105 + 1038 0700 6C00001A bne .L112 + 1039 0704 690000EA b .L116 + 1040 .L123: + 1041 0708 730050E3 cmp r0, #115 + 1042 070c 2200000A beq .L120 + 1043 0710 0400008A bhi .L125 + 1044 0714 6F0050E3 cmp r0, #111 + 1045 0718 6000000A beq .L118 + 1046 071c 700050E3 cmp r0, #112 + 1047 0720 6400001A bne .L112 + 1048 0724 400000EA b .L180 + 1049 .L125: + 1050 0728 750050E3 cmp r0, #117 + 1051 072c 6F00000A beq .L121 + 1052 0730 780050E3 cmp r0, #120 + 1053 0734 5F00001A bne .L112 + 1054 0738 6E0000EA b .L166 + 1055 .L115: + 349:lib/vsprintf.c **** if (!(flags & LEFT)) { + 1056 .loc 2 349 0 + 1057 073c 10001AE3 tst sl, #16 + 1058 0740 0700001A bne .L126 + 1059 0744 030000EA b .L127 + 1060 .LVL123: + 1061 .L129: + 351:lib/vsprintf.c **** if (str <= end) + 1062 .loc 2 351 0 + 1063 0748 040058E1 cmp r8, r4 + 352:lib/vsprintf.c **** *str = ' '; + 1064 .loc 2 352 0 + 1065 074c 2030A093 movls r3, #32 + 1066 0750 0030C895 strlsb r3, [r8, #0] + 353:lib/vsprintf.c **** ++str; + 1067 .loc 2 353 0 + 1068 0754 018088E2 add r8, r8, #1 + 1069 .LVL124: + 1070 .L127: + 350:lib/vsprintf.c **** while (--field_width > 0) { + 1071 .loc 2 350 0 discriminator 1 + 1072 0758 019049E2 sub r9, r9, #1 + 1073 .LVL125: + 1074 075c 000059E3 cmp r9, #0 + 1075 0760 F8FFFFCA bgt .L129 + 1076 .L126: + 357:lib/vsprintf.c **** if (str <= end) + 1077 .loc 2 357 0 + 1078 0764 040058E1 cmp r8, r4 + 356:lib/vsprintf.c **** c = (unsigned char) va_arg(args, int); + 1079 .loc 2 356 0 + 1080 0768 043082E2 add r3, r2, #4 + 1081 076c 002092E5 ldr r2, [r2, #0] + 1082 .LVL126: + 357:lib/vsprintf.c **** if (str <= end) + 1083 .loc 2 357 0 + 1084 0770 0400008A bhi .L132 + 1085 0774 020000EA b .L173 + 1086 .L133: + 361:lib/vsprintf.c **** if (str <= end) + 1087 .loc 2 361 0 + 1088 0778 040058E1 cmp r8, r4 + 1089 077c 0100008A bhi .L132 + 362:lib/vsprintf.c **** *str = ' '; + 1090 .loc 2 362 0 + 1091 0780 2020A0E3 mov r2, #32 + 1092 .L173: + 1093 0784 0020C8E5 strb r2, [r8, #0] + 1094 .L132: + 360:lib/vsprintf.c **** while (--field_width > 0) { + 1095 .loc 2 360 0 + 1096 0788 019049E2 sub r9, r9, #1 + 1097 .LVL127: + 1098 078c 000059E3 cmp r9, #0 + 363:lib/vsprintf.c **** ++str; + 1099 .loc 2 363 0 + 1100 0790 018088E2 add r8, r8, #1 + 1101 .LVL128: + 360:lib/vsprintf.c **** while (--field_width > 0) { + 1102 .loc 2 360 0 + 1103 0794 F7FFFFCA bgt .L133 + 1104 0798 3B0000EA b .L171 + 1105 .LVL129: + 1106 .L120: + 368:lib/vsprintf.c **** s = va_arg(args, char *); + 1107 .loc 2 368 0 + 1108 079c 006092E5 ldr r6, [r2, #0] + 370:lib/vsprintf.c **** len = strnlen(s, precision); + 1109 .loc 2 370 0 + 1110 07a0 0600A0E1 mov r0, r6 + 368:lib/vsprintf.c **** s = va_arg(args, char *); + 1111 .loc 2 368 0 + 1112 07a4 04B082E2 add fp, r2, #4 + 1113 .LVL130: + 370:lib/vsprintf.c **** len = strnlen(s, precision); + 1114 .loc 2 370 0 + 1115 07a8 FEFFFFEB bl strnlen + 1116 .LVL131: + 372:lib/vsprintf.c **** if (!(flags & LEFT)) { + 1117 .loc 2 372 0 + 1118 07ac 10001AE3 tst sl, #16 + 1119 07b0 0800001A bne .L134 + 1120 07b4 030000EA b .L135 + 1121 .L137: + 374:lib/vsprintf.c **** if (str <= end) + 1122 .loc 2 374 0 + 1123 07b8 040058E1 cmp r8, r4 + 375:lib/vsprintf.c **** *str = ' '; + 1124 .loc 2 375 0 + 1125 07bc 2030A093 movls r3, #32 + 1126 07c0 0030C895 strlsb r3, [r8, #0] + 376:lib/vsprintf.c **** ++str; + 1127 .loc 2 376 0 + 1128 07c4 018088E2 add r8, r8, #1 + 1129 .LVL132: + 1130 .L135: + 373:lib/vsprintf.c **** while (len < field_width--) { + 1131 .loc 2 373 0 discriminator 1 + 1132 07c8 019049E2 sub r9, r9, #1 + 1133 .LVL133: + 252:lib/vsprintf.c **** int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1134 .loc 2 252 0 discriminator 1 + 1135 07cc 013089E2 add r3, r9, #1 + 373:lib/vsprintf.c **** while (len < field_width--) { + 1136 .loc 2 373 0 discriminator 1 + 1137 07d0 030050E1 cmp r0, r3 + 1138 07d4 F7FFFFBA blt .L137 + 1139 .L134: + 1140 .LVL134: + 379:lib/vsprintf.c **** for (i = 0; i < len; ++i) { + 1141 .loc 2 379 0 + 1142 07d8 0820A0E1 mov r2, r8 + 1143 07dc 0030A0E3 mov r3, #0 + 1144 07e0 040000EA b .L138 + 1145 .LVL135: + 1146 .L140: + 380:lib/vsprintf.c **** if (str <= end) + 1147 .loc 2 380 0 + 1148 07e4 040052E1 cmp r2, r4 + 381:lib/vsprintf.c **** *str = *s; + 1149 .loc 2 381 0 + 1150 07e8 0310D697 ldrlsb r1, [r6, r3] @ zero_extendqisi2 + 382:lib/vsprintf.c **** ++str; ++s; + 1151 .loc 2 382 0 + 1152 07ec 012082E2 add r2, r2, #1 + 1153 .LVL136: + 381:lib/vsprintf.c **** *str = *s; + 1154 .loc 2 381 0 + 1155 07f0 0310C897 strlsb r1, [r8, r3] + 379:lib/vsprintf.c **** for (i = 0; i < len; ++i) { + 1156 .loc 2 379 0 + 1157 07f4 013083E2 add r3, r3, #1 + 1158 .LVL137: + 1159 .L138: + 379:lib/vsprintf.c **** for (i = 0; i < len; ++i) { + 1160 .loc 2 379 0 is_stmt 0 discriminator 1 + 1161 07f8 000053E1 cmp r3, r0 + 1162 07fc F8FFFFBA blt .L140 + 379:lib/vsprintf.c **** for (i = 0; i < len; ++i) { + 1163 .loc 2 379 0 + 1164 0800 0280A0E1 mov r8, r2 + 1165 0804 040000EA b .L141 + 1166 .LVL138: + 1167 .L143: + 385:lib/vsprintf.c **** if (str <= end) + 1168 .loc 2 385 0 is_stmt 1 + 1169 0808 040058E1 cmp r8, r4 + 386:lib/vsprintf.c **** *str = ' '; + 1170 .loc 2 386 0 + 1171 080c 2030A093 movls r3, #32 + 1172 0810 0030C895 strlsb r3, [r8, #0] + 387:lib/vsprintf.c **** ++str; + 1173 .loc 2 387 0 + 1174 0814 019049E2 sub r9, r9, #1 + 1175 0818 018088E2 add r8, r8, #1 + 1176 .LVL139: + 1177 .L141: + 384:lib/vsprintf.c **** while (len < field_width--) { + 1178 .loc 2 384 0 discriminator 1 + 1179 081c 090050E1 cmp r0, r9 + 1180 0820 F8FFFFBA blt .L143 + 368:lib/vsprintf.c **** s = va_arg(args, char *); + 1181 .loc 2 368 0 + 1182 0824 0B20A0E1 mov r2, fp + 1183 0828 5D0000EA b .L95 + 1184 .LVL140: + 1185 .L180: + 392:lib/vsprintf.c **** if (field_width == -1) { + 1186 .loc 2 392 0 + 1187 082c 010079E3 cmn r9, #1 + 1188 .LVL141: + 396:lib/vsprintf.c **** str = number(str, end, + 1189 .loc 2 396 0 + 1190 0830 1030A0E3 mov r3, #16 + 1191 .LVL142: + 394:lib/vsprintf.c **** flags |= ZEROPAD; + 1192 .loc 2 394 0 + 1193 0834 01A08A03 orreq sl, sl, #1 + 1194 .LVL143: + 393:lib/vsprintf.c **** field_width = 2*sizeof(void *); + 1195 .loc 2 393 0 + 1196 0838 09908902 addeq r9, r9, #9 + 1197 .LVL144: + 397:lib/vsprintf.c **** (unsigned long) va_arg(args, void *), + 1198 .loc 2 397 0 + 1199 083c 046082E2 add r6, r2, #4 + 396:lib/vsprintf.c **** str = number(str, end, + 1200 .loc 2 396 0 + 1201 0840 0800A0E1 mov r0, r8 + 1202 0844 002092E5 ldr r2, [r2, #0] + 1203 0848 00308DE5 str r3, [sp, #0] + 1204 084c 08108DE5 str r1, [sp, #8] + 1205 0850 04908DE5 str r9, [sp, #4] + 1206 0854 0CA08DE5 str sl, [sp, #12] + 1207 0858 0410A0E1 mov r1, r4 + 1208 .LVL145: + 1209 085c 0030A0E3 mov r3, #0 + 1210 0860 4C0000EA b .L176 + 1211 .LVL146: + 1212 .L117: + 405:lib/vsprintf.c **** if (qualifier == 'l') { + 1213 .loc 2 405 0 + 1214 0864 6C0053E3 cmp r3, #108 + 1215 .LVL147: + 1216 .LBB4: + 407:lib/vsprintf.c **** *ip = (str - buf); + 1217 .loc 2 407 0 + 1218 0868 00309205 ldreq r3, [r2, #0] + 1219 .LVL148: + 1220 086c 08106500 rsbeq r1, r5, r8 + 1221 .LVL149: + 1222 0870 00108305 streq r1, [r3, #0] + 406:lib/vsprintf.c **** long * ip = va_arg(args, long *); + 1223 .loc 2 406 0 + 1224 0874 04208202 addeq r2, r2, #4 + 1225 .LVL150: + 1226 0878 4900000A beq .L95 + 1227 .LVL151: + 1228 .L145: + 1229 087c 043082E2 add r3, r2, #4 + 1230 .LVL152: + 1231 .LBE4: + 1232 .LBB5: + 410:lib/vsprintf.c **** *ip = (str - buf); + 1233 .loc 2 410 0 + 1234 0880 002092E5 ldr r2, [r2, #0] + 1235 0884 081065E0 rsb r1, r5, r8 + 1236 .LVL153: + 1237 0888 001082E5 str r1, [r2, #0] + 1238 .L171: + 409:lib/vsprintf.c **** size_t * ip = va_arg(args, size_t *); + 1239 .loc 2 409 0 + 1240 088c 0320A0E1 mov r2, r3 + 1241 0890 430000EA b .L95 + 1242 .LVL154: + 1243 .L113: + 1244 .LBE5: + 413:lib/vsprintf.c **** *ip = (str - buf); + 414:lib/vsprintf.c **** } + 415:lib/vsprintf.c **** continue; + 416:lib/vsprintf.c **** + 417:lib/vsprintf.c **** case '%': + 418:lib/vsprintf.c **** if (str <= end) + 1245 .loc 2 418 0 + 1246 0894 040058E1 cmp r8, r4 + 419:lib/vsprintf.c **** *str = '%'; + 1247 .loc 2 419 0 + 1248 0898 0000C895 strlsb r0, [r8, #0] + 1249 089c 110000EA b .L150 + 1250 .L118: + 1251 .LVL155: + 420:lib/vsprintf.c **** ++str; + 421:lib/vsprintf.c **** continue; + 422:lib/vsprintf.c **** + 423:lib/vsprintf.c **** /* integer number formats - set up the flags and "break" */ + 424:lib/vsprintf.c **** case 'o': + 425:lib/vsprintf.c **** base = 8; + 1252 .loc 2 425 0 + 1253 08a0 0800A0E3 mov r0, #8 + 426:lib/vsprintf.c **** break; + 1254 .loc 2 426 0 + 1255 08a4 140000EA b .L122 + 1256 .LVL156: + 1257 .L179: + 427:lib/vsprintf.c **** + 428:lib/vsprintf.c **** case 'X': + 429:lib/vsprintf.c **** flags |= LARGE; + 1258 .loc 2 429 0 + 1259 08a8 40A08AE3 orr sl, sl, #64 + 1260 .LVL157: + 1261 08ac 110000EA b .L166 + 1262 .L116: + 430:lib/vsprintf.c **** case 'x': + 431:lib/vsprintf.c **** base = 16; + 432:lib/vsprintf.c **** break; + 433:lib/vsprintf.c **** + 434:lib/vsprintf.c **** case 'd': + 435:lib/vsprintf.c **** case 'i': + 436:lib/vsprintf.c **** flags |= SIGN; + 1263 .loc 2 436 0 + 1264 08b0 02A08AE3 orr sl, sl, #2 + 1265 .LVL158: + 1266 08b4 0D0000EA b .L121 + 1267 .L112: + 437:lib/vsprintf.c **** case 'u': + 438:lib/vsprintf.c **** break; + 439:lib/vsprintf.c **** + 440:lib/vsprintf.c **** default: + 441:lib/vsprintf.c **** if (str <= end) + 1268 .loc 2 441 0 + 1269 08b8 040058E1 cmp r8, r4 + 442:lib/vsprintf.c **** *str = '%'; + 1270 .loc 2 442 0 + 1271 08bc 2530A093 movls r3, #37 + 1272 .LVL159: + 1273 08c0 0030C895 strlsb r3, [r8, #0] + 443:lib/vsprintf.c **** ++str; + 444:lib/vsprintf.c **** if (*fmt) { + 1274 .loc 2 444 0 + 1275 08c4 14309DE5 ldr r3, [sp, #20] + 1276 08c8 0010D3E5 ldrb r1, [r3, #0] @ zero_extendqisi2 + 1277 .LVL160: + 1278 08cc 000051E3 cmp r1, #0 + 445:lib/vsprintf.c **** if (str <= end) + 446:lib/vsprintf.c **** *str = *fmt; + 447:lib/vsprintf.c **** ++str; + 448:lib/vsprintf.c **** } else { + 449:lib/vsprintf.c **** --fmt; + 1279 .loc 2 449 0 + 1280 08d0 01304302 subeq r3, r3, #1 + 443:lib/vsprintf.c **** ++str; + 1281 .loc 2 443 0 + 1282 08d4 018088E2 add r8, r8, #1 + 1283 .LVL161: + 1284 .loc 2 449 0 + 1285 08d8 14308D05 streq r3, [sp, #20] + 444:lib/vsprintf.c **** if (*fmt) { + 1286 .loc 2 444 0 + 1287 08dc 3000000A beq .L95 + 445:lib/vsprintf.c **** if (str <= end) + 1288 .loc 2 445 0 + 1289 08e0 040058E1 cmp r8, r4 + 446:lib/vsprintf.c **** *str = *fmt; + 1290 .loc 2 446 0 + 1291 08e4 0010C895 strlsb r1, [r8, #0] + 1292 .L150: + 447:lib/vsprintf.c **** ++str; + 1293 .loc 2 447 0 + 1294 08e8 018088E2 add r8, r8, #1 + 1295 .LVL162: + 1296 08ec 2C0000EA b .L95 + 1297 .LVL163: + 1298 .L121: + 345:lib/vsprintf.c **** base = 10; + 1299 .loc 2 345 0 + 1300 08f0 0A00A0E3 mov r0, #10 + 1301 08f4 000000EA b .L122 + 1302 .L166: + 431:lib/vsprintf.c **** base = 16; + 1303 .loc 2 431 0 + 1304 08f8 1000A0E3 mov r0, #16 + 1305 .LVL164: + 1306 .L122: + 450:lib/vsprintf.c **** } + 451:lib/vsprintf.c **** continue; + 452:lib/vsprintf.c **** } + 453:lib/vsprintf.c **** if (qualifier == 'L') + 1307 .loc 2 453 0 + 1308 08fc 4C0053E3 cmp r3, #76 + 454:lib/vsprintf.c **** num = va_arg(args, long long); + 1309 .loc 2 454 0 + 1310 0900 07208202 addeq r2, r2, #7 + 1311 0904 0720C203 biceq r2, r2, #7 + 1312 0908 08608202 addeq r6, r2, #8 + 1313 090c 0C009208 ldmeqia r2, {r2-r3} + 1314 .LVL165: + 1315 0910 1A00000A beq .L152 + 1316 .LVL166: + 1317 .L151: + 455:lib/vsprintf.c **** else if (qualifier == 'l') { + 1318 .loc 2 455 0 + 1319 0914 6C0053E3 cmp r3, #108 + 456:lib/vsprintf.c **** num = va_arg(args, unsigned long); + 1320 .loc 2 456 0 + 1321 0918 04608202 addeq r6, r2, #4 + 1322 091c 00209205 ldreq r2, [r2, #0] + 455:lib/vsprintf.c **** else if (qualifier == 'l') { + 1323 .loc 2 455 0 + 1324 0920 1200000A beq .L156 + 1325 0924 046082E2 add r6, r2, #4 + 1326 0928 002092E5 ldr r2, [r2, #0] + 457:lib/vsprintf.c **** if (flags & SIGN) + 458:lib/vsprintf.c **** num = (signed long) num; + 459:lib/vsprintf.c **** } else if (qualifier == 'Z' || qualifier == 'z') { + 1327 .loc 2 459 0 + 1328 092c 5A0053E3 cmp r3, #90 + 1329 0930 7A005313 cmpne r3, #122 + 460:lib/vsprintf.c **** num = va_arg(args, size_t); + 1330 .loc 2 460 0 + 1331 0934 0030A003 moveq r3, #0 + 459:lib/vsprintf.c **** } else if (qualifier == 'Z' || qualifier == 'z') { + 1332 .loc 2 459 0 + 1333 0938 1000000A beq .L152 + 461:lib/vsprintf.c **** } else if (qualifier == 't') { + 1334 .loc 2 461 0 + 1335 093c 740053E3 cmp r3, #116 + 1336 0940 0D00000A beq .L170 + 1337 .L155: + 462:lib/vsprintf.c **** num = va_arg(args, ptrdiff_t); + 463:lib/vsprintf.c **** } else if (qualifier == 'h') { + 1338 .loc 2 463 0 + 1339 0944 680053E3 cmp r3, #104 + 1340 0948 0800001A bne .L156 + 464:lib/vsprintf.c **** num = (unsigned short) va_arg(args, int); + 1341 .loc 2 464 0 + 1342 094c 0228A0E1 mov r2, r2, asl #16 + 1343 0950 22C8A0E1 mov ip, r2, lsr #16 + 465:lib/vsprintf.c **** if (flags & SIGN) + 1344 .loc 2 465 0 + 1345 0954 02001AE3 tst sl, #2 + 464:lib/vsprintf.c **** num = (unsigned short) va_arg(args, int); + 1346 .loc 2 464 0 + 1347 0958 0C20A0E1 mov r2, ip + 1348 095c 0030A0E3 mov r3, #0 + 1349 .LVL167: + 466:lib/vsprintf.c **** num = (signed short) num; + 1350 .loc 2 466 0 + 1351 0960 0C28A011 movne r2, ip, asl #16 + 1352 .LVL168: + 1353 0964 4228A011 movne r2, r2, asr #16 + 465:lib/vsprintf.c **** if (flags & SIGN) + 1354 .loc 2 465 0 + 1355 0968 0300001A bne .L170 + 1356 096c 030000EA b .L152 + 1357 .LVL169: + 1358 .L156: + 467:lib/vsprintf.c **** } else { + 468:lib/vsprintf.c **** num = va_arg(args, unsigned int); + 469:lib/vsprintf.c **** if (flags & SIGN) + 1359 .loc 2 469 0 + 1360 0970 02001AE3 tst sl, #2 + 468:lib/vsprintf.c **** num = va_arg(args, unsigned int); + 1361 .loc 2 468 0 + 1362 0974 0030A0E3 mov r3, #0 + 1363 .LVL170: + 1364 .loc 2 469 0 + 1365 0978 0000000A beq .L152 + 1366 .LVL171: + 1367 .L170: + 470:lib/vsprintf.c **** num = (signed int) num; + 1368 .loc 2 470 0 + 1369 097c C23FA0E1 mov r3, r2, asr #31 + 1370 .LVL172: + 1371 .L152: + 471:lib/vsprintf.c **** } + 472:lib/vsprintf.c **** str = number(str, end, num, base, + 1372 .loc 2 472 0 + 1373 0980 04908DE5 str r9, [sp, #4] + 1374 0984 0CA08DE5 str sl, [sp, #12] + 1375 0988 00008DE5 str r0, [sp, #0] + 1376 098c 08108DE5 str r1, [sp, #8] + 1377 0990 0800A0E1 mov r0, r8 + 1378 .LVL173: + 1379 0994 0410A0E1 mov r1, r4 + 1380 .LVL174: + 1381 .L176: + 1382 0998 AFFDFFEB bl number + 1383 .LVL175: + 1384 099c 0080A0E1 mov r8, r0 + 1385 .LVL176: + 1386 .L172: + 1387 09a0 0620A0E1 mov r2, r6 + 1388 .L95: + 283:lib/vsprintf.c **** for (; *fmt ; ++fmt) { + 1389 .loc 2 283 0 + 1390 09a4 14309DE5 ldr r3, [sp, #20] + 1391 09a8 013083E2 add r3, r3, #1 + 1392 09ac 14308DE5 str r3, [sp, #20] + 1393 09b0 0260A0E1 mov r6, r2 + 1394 .LVL177: + 1395 .L91: + 283:lib/vsprintf.c **** for (; *fmt ; ++fmt) { + 1396 .loc 2 283 0 is_stmt 0 discriminator 1 + 1397 09b4 14309DE5 ldr r3, [sp, #20] + 1398 09b8 0030D3E5 ldrb r3, [r3, #0] @ zero_extendqisi2 + 1399 09bc 000053E3 cmp r3, #0 + 1400 09c0 D7FEFF1A bne .L157 + 473:lib/vsprintf.c **** field_width, precision, flags); + 474:lib/vsprintf.c **** } + 475:lib/vsprintf.c **** if (str <= end) + 1401 .loc 2 475 0 is_stmt 1 + 1402 09c4 040058E1 cmp r8, r4 + 476:lib/vsprintf.c **** *str = '\0'; + 1403 .loc 2 476 0 + 1404 09c8 0030C895 strlsb r3, [r8, #0] + 475:lib/vsprintf.c **** if (str <= end) + 1405 .loc 2 475 0 + 1406 09cc 0100009A bls .L159 + 477:lib/vsprintf.c **** else if (size > 0) + 1407 .loc 2 477 0 + 1408 09d0 000057E3 cmp r7, #0 + 478:lib/vsprintf.c **** /* don't write out a null byte if the buf size is zero */ + 479:lib/vsprintf.c **** *end = '\0'; + 1409 .loc 2 479 0 + 1410 09d4 0030C415 strneb r3, [r4, #0] + 1411 .L159: + 480:lib/vsprintf.c **** /* the trailing null byte doesn't count towards the total + 481:lib/vsprintf.c **** * ++str; + 482:lib/vsprintf.c **** */ + 483:lib/vsprintf.c **** return str-buf; + 1412 .loc 2 483 0 + 1413 09d8 080065E0 rsb r0, r5, r8 + 1414 .LVL178: + 1415 .L89: + 484:lib/vsprintf.c **** } + 1416 .loc 2 484 0 + 1417 09dc 1CD08DE2 add sp, sp, #28 + 1418 09e0 F04FBDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 1419 09e4 1EFF2FE1 bx lr + 1420 .L182: + 1421 .align 2 + 1422 .L181: + 1423 09e8 00000000 .word _ctype + 1424 .cfi_endproc + 1425 .LFE8: + 1427 .align 2 + 1428 .global vscnprintf + 1430 vscnprintf: + 1431 .LFB9: + 485:lib/vsprintf.c **** + 486:lib/vsprintf.c **** + 487:lib/vsprintf.c **** /** + 488:lib/vsprintf.c **** * vscnprintf - Format a string and place it in a buffer + 489:lib/vsprintf.c **** * @buf: The buffer to place the result into + 490:lib/vsprintf.c **** * @size: The size of the buffer, including the trailing null space + 491:lib/vsprintf.c **** * @fmt: The format string to use + 492:lib/vsprintf.c **** * @args: Arguments for the format string + 493:lib/vsprintf.c **** * + 494:lib/vsprintf.c **** * The return value is the number of characters which have been written into + 495:lib/vsprintf.c **** * the @buf not including the trailing '\0'. If @size is <= 0 the function + 496:lib/vsprintf.c **** * returns 0. + 497:lib/vsprintf.c **** * + 498:lib/vsprintf.c **** * Call this function if you are already dealing with a va_list. + 499:lib/vsprintf.c **** * You probably want scnprintf instead. + 500:lib/vsprintf.c **** */ + 501:lib/vsprintf.c **** int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) + 502:lib/vsprintf.c **** { + 1432 .loc 2 502 0 + 1433 .cfi_startproc + 1434 @ Function supports interworking. + 1435 @ args = 0, pretend = 0, frame = 0 + 1436 @ frame_needed = 0, uses_anonymous_args = 0 + 1437 .LVL179: + 1438 09ec 10402DE9 stmfd sp!, {r4, lr} + 1439 .LCFI8: + 1440 .cfi_def_cfa_offset 8 + 1441 .loc 2 502 0 + 1442 09f0 0140A0E1 mov r4, r1 + 1443 .cfi_offset 14, -4 + 1444 .cfi_offset 4, -8 + 503:lib/vsprintf.c **** unsigned int i; + 504:lib/vsprintf.c **** + 505:lib/vsprintf.c **** i=vsnprintf(buf,size,fmt,args); + 1445 .loc 2 505 0 + 1446 09f4 FEFFFFEB bl vsnprintf + 1447 .LVL180: + 506:lib/vsprintf.c **** return (i >= size) ? (size - 1) : i; + 1448 .loc 2 506 0 + 1449 09f8 040050E1 cmp r0, r4 + 1450 09fc 01004422 subcs r0, r4, #1 + 1451 .LVL181: + 507:lib/vsprintf.c **** } + 1452 .loc 2 507 0 + 1453 0a00 1040BDE8 ldmfd sp!, {r4, lr} + 1454 0a04 1EFF2FE1 bx lr + 1455 .cfi_endproc + 1456 .LFE9: + 1458 .align 2 + 1459 .global snprintf + 1461 snprintf: + 1462 .LFB10: + 508:lib/vsprintf.c **** + 509:lib/vsprintf.c **** + 510:lib/vsprintf.c **** /** + 511:lib/vsprintf.c **** * snprintf - Format a string and place it in a buffer + 512:lib/vsprintf.c **** * @buf: The buffer to place the result into + 513:lib/vsprintf.c **** * @size: The size of the buffer, including the trailing null space + 514:lib/vsprintf.c **** * @fmt: The format string to use + 515:lib/vsprintf.c **** * @...: Arguments for the format string + 516:lib/vsprintf.c **** * + 517:lib/vsprintf.c **** * The return value is the number of characters which would be + 518:lib/vsprintf.c **** * generated for the given input, excluding the trailing null, + 519:lib/vsprintf.c **** * as per ISO C99. If the return is greater than or equal to + 520:lib/vsprintf.c **** * @size, the resulting string is truncated. + 521:lib/vsprintf.c **** */ + 522:lib/vsprintf.c **** int snprintf(char * buf, size_t size, const char *fmt, ...) + 523:lib/vsprintf.c **** { + 1463 .loc 2 523 0 + 1464 .cfi_startproc + 1465 @ Function supports interworking. + 1466 @ args = 4, pretend = 8, frame = 8 + 1467 @ frame_needed = 0, uses_anonymous_args = 1 + 1468 .LVL182: + 1469 0a08 0C002DE9 stmfd sp!, {r2, r3} + 1470 .LCFI9: + 1471 .cfi_def_cfa_offset 8 + 1472 0a0c 07402DE9 stmfd sp!, {r0, r1, r2, lr} + 1473 .LCFI10: + 1474 .cfi_def_cfa_offset 24 + 524:lib/vsprintf.c **** va_list args; + 525:lib/vsprintf.c **** int i; + 526:lib/vsprintf.c **** + 527:lib/vsprintf.c **** va_start(args, fmt); + 528:lib/vsprintf.c **** i=vsnprintf(buf,size,fmt,args); + 1475 .loc 2 528 0 + 1476 0a10 10209DE5 ldr r2, [sp, #16] + 1477 .cfi_offset 14, -12 + 1478 .cfi_offset 1, -20 + 1479 .cfi_offset 0, -24 + 1480 .cfi_offset 3, -4 + 1481 .cfi_offset 2, -16 + 527:lib/vsprintf.c **** va_start(args, fmt); + 1482 .loc 2 527 0 + 1483 0a14 14308DE2 add r3, sp, #20 + 1484 0a18 04308DE5 str r3, [sp, #4] + 1485 .loc 2 528 0 + 1486 0a1c FEFFFFEB bl vsnprintf + 1487 .LVL183: + 529:lib/vsprintf.c **** va_end(args); + 530:lib/vsprintf.c **** return i; + 531:lib/vsprintf.c **** } + 1488 .loc 2 531 0 + 1489 0a20 0E40BDE8 ldmfd sp!, {r1, r2, r3, lr} + 1490 0a24 08D08DE2 add sp, sp, #8 + 1491 0a28 1EFF2FE1 bx lr + 1492 .cfi_endproc + 1493 .LFE10: + 1495 .align 2 + 1496 .global scnprintf + 1498 scnprintf: + 1499 .LFB11: + 532:lib/vsprintf.c **** + 533:lib/vsprintf.c **** + 534:lib/vsprintf.c **** /** + 535:lib/vsprintf.c **** * scnprintf - Format a string and place it in a buffer + 536:lib/vsprintf.c **** * @buf: The buffer to place the result into + 537:lib/vsprintf.c **** * @size: The size of the buffer, including the trailing null space + 538:lib/vsprintf.c **** * @fmt: The format string to use + 539:lib/vsprintf.c **** * @...: Arguments for the format string + 540:lib/vsprintf.c **** * + 541:lib/vsprintf.c **** * The return value is the number of characters written into @buf not including + 542:lib/vsprintf.c **** * the trailing '\0'. If @size is <= 0 the function returns 0. If the return is + 543:lib/vsprintf.c **** * greater than or equal to @size, the resulting string is truncated. + 544:lib/vsprintf.c **** */ + 545:lib/vsprintf.c **** + 546:lib/vsprintf.c **** int scnprintf(char * buf, size_t size, const char *fmt, ...) + 547:lib/vsprintf.c **** { + 1500 .loc 2 547 0 + 1501 .cfi_startproc + 1502 @ Function supports interworking. + 1503 @ args = 4, pretend = 8, frame = 8 + 1504 @ frame_needed = 0, uses_anonymous_args = 1 + 1505 .LVL184: + 1506 0a2c 0C002DE9 stmfd sp!, {r2, r3} + 1507 .LCFI11: + 1508 .cfi_def_cfa_offset 8 + 1509 0a30 13402DE9 stmfd sp!, {r0, r1, r4, lr} + 1510 .LCFI12: + 1511 .cfi_def_cfa_offset 24 + 548:lib/vsprintf.c **** va_list args; + 549:lib/vsprintf.c **** unsigned int i; + 550:lib/vsprintf.c **** + 551:lib/vsprintf.c **** va_start(args, fmt); + 552:lib/vsprintf.c **** i = vsnprintf(buf, size, fmt, args); + 1512 .loc 2 552 0 + 1513 0a34 10209DE5 ldr r2, [sp, #16] + 1514 .cfi_offset 14, -12 + 1515 .cfi_offset 4, -16 + 1516 .cfi_offset 1, -20 + 1517 .cfi_offset 0, -24 + 1518 .cfi_offset 3, -4 + 1519 .cfi_offset 2, -8 + 551:lib/vsprintf.c **** va_start(args, fmt); + 1520 .loc 2 551 0 + 1521 0a38 14308DE2 add r3, sp, #20 + 547:lib/vsprintf.c **** { + 1522 .loc 2 547 0 + 1523 0a3c 0140A0E1 mov r4, r1 + 551:lib/vsprintf.c **** va_start(args, fmt); + 1524 .loc 2 551 0 + 1525 0a40 04308DE5 str r3, [sp, #4] + 1526 .loc 2 552 0 + 1527 0a44 FEFFFFEB bl vsnprintf + 1528 .LVL185: + 553:lib/vsprintf.c **** va_end(args); + 554:lib/vsprintf.c **** return (i >= size) ? (size - 1) : i; + 1529 .loc 2 554 0 + 1530 0a48 040050E1 cmp r0, r4 + 1531 0a4c 01004422 subcs r0, r4, #1 + 1532 .LVL186: + 555:lib/vsprintf.c **** } + 1533 .loc 2 555 0 + 1534 0a50 1C40BDE8 ldmfd sp!, {r2, r3, r4, lr} + 1535 0a54 08D08DE2 add sp, sp, #8 + 1536 0a58 1EFF2FE1 bx lr + 1537 .cfi_endproc + 1538 .LFE11: + 1540 .align 2 + 1541 .global vsprintf + 1543 vsprintf: + 1544 .LFB12: + 556:lib/vsprintf.c **** + 557:lib/vsprintf.c **** /** + 558:lib/vsprintf.c **** * vsprintf - Format a string and place it in a buffer + 559:lib/vsprintf.c **** * @buf: The buffer to place the result into + 560:lib/vsprintf.c **** * @fmt: The format string to use + 561:lib/vsprintf.c **** * @args: Arguments for the format string + 562:lib/vsprintf.c **** * + 563:lib/vsprintf.c **** * The function returns the number of characters written + 564:lib/vsprintf.c **** * into @buf. Use vsnprintf or vscnprintf in order to avoid + 565:lib/vsprintf.c **** * buffer overflows. + 566:lib/vsprintf.c **** * + 567:lib/vsprintf.c **** * Call this function if you are already dealing with a va_list. + 568:lib/vsprintf.c **** * You probably want sprintf instead. + 569:lib/vsprintf.c **** */ + 570:lib/vsprintf.c **** int vsprintf(char *buf, const char *fmt, va_list args) + 571:lib/vsprintf.c **** { + 1545 .loc 2 571 0 + 1546 .cfi_startproc + 1547 @ Function supports interworking. + 1548 @ args = 0, pretend = 0, frame = 0 + 1549 @ frame_needed = 0, uses_anonymous_args = 0 + 1550 @ link register save eliminated. + 1551 .LVL187: + 1552 .loc 2 571 0 + 1553 0a5c 01C0A0E1 mov ip, r1 + 1554 0a60 0230A0E1 mov r3, r2 + 572:lib/vsprintf.c **** return vsnprintf(buf, INT_MAX, fmt, args); + 1555 .loc 2 572 0 + 1556 0a64 0211E0E3 mvn r1, #-2147483648 + 1557 .LVL188: + 1558 0a68 0C20A0E1 mov r2, ip + 1559 .LVL189: + 573:lib/vsprintf.c **** } + 1560 .loc 2 573 0 + 572:lib/vsprintf.c **** return vsnprintf(buf, INT_MAX, fmt, args); + 1561 .loc 2 572 0 + 1562 0a6c FEFFFFEA b vsnprintf + 1563 .cfi_endproc + 1564 .LFE12: + 1566 .align 2 + 1567 .global sprintf + 1569 sprintf: + 1570 .LFB13: + 574:lib/vsprintf.c **** + 575:lib/vsprintf.c **** + 576:lib/vsprintf.c **** /** + 577:lib/vsprintf.c **** * sprintf - Format a string and place it in a buffer + 578:lib/vsprintf.c **** * @buf: The buffer to place the result into + 579:lib/vsprintf.c **** * @fmt: The format string to use + 580:lib/vsprintf.c **** * @...: Arguments for the format string + 581:lib/vsprintf.c **** * + 582:lib/vsprintf.c **** * The function returns the number of characters written + 583:lib/vsprintf.c **** * into @buf. Use snprintf or scnprintf in order to avoid + 584:lib/vsprintf.c **** * buffer overflows. + 585:lib/vsprintf.c **** */ + 586:lib/vsprintf.c **** int sprintf(char * buf, const char *fmt, ...) + 587:lib/vsprintf.c **** { + 1571 .loc 2 587 0 + 1572 .cfi_startproc + 1573 @ Function supports interworking. + 1574 @ args = 4, pretend = 12, frame = 8 + 1575 @ frame_needed = 0, uses_anonymous_args = 1 + 1576 .LVL190: + 1577 0a70 0E002DE9 stmfd sp!, {r1, r2, r3} + 1578 .LCFI13: + 1579 .cfi_def_cfa_offset 12 + 1580 0a74 03402DE9 stmfd sp!, {r0, r1, lr} + 1581 .LCFI14: + 1582 .cfi_def_cfa_offset 24 + 588:lib/vsprintf.c **** va_list args; + 589:lib/vsprintf.c **** int i; + 590:lib/vsprintf.c **** + 591:lib/vsprintf.c **** va_start(args, fmt); + 592:lib/vsprintf.c **** i=vsnprintf(buf, INT_MAX, fmt, args); + 1583 .loc 2 592 0 + 1584 0a78 0C209DE5 ldr r2, [sp, #12] + 1585 .cfi_offset 14, -16 + 1586 .cfi_offset 0, -24 + 1587 .cfi_offset 3, -4 + 1588 .cfi_offset 2, -8 + 1589 .cfi_offset 1, -20 + 591:lib/vsprintf.c **** va_start(args, fmt); + 1590 .loc 2 591 0 + 1591 0a7c 10308DE2 add r3, sp, #16 + 1592 .loc 2 592 0 + 1593 0a80 0211E0E3 mvn r1, #-2147483648 + 591:lib/vsprintf.c **** va_start(args, fmt); + 1594 .loc 2 591 0 + 1595 0a84 04308DE5 str r3, [sp, #4] + 1596 .loc 2 592 0 + 1597 0a88 FEFFFFEB bl vsnprintf + 1598 .LVL191: + 593:lib/vsprintf.c **** va_end(args); + 594:lib/vsprintf.c **** return i; + 595:lib/vsprintf.c **** } + 1599 .loc 2 595 0 + 1600 0a8c 0C40BDE8 ldmfd sp!, {r2, r3, lr} + 1601 0a90 0CD08DE2 add sp, sp, #12 + 1602 0a94 1EFF2FE1 bx lr + 1603 .cfi_endproc + 1604 .LFE13: + 1606 .align 2 + 1607 .global vsscanf + 1609 vsscanf: + 1610 .LFB14: + 596:lib/vsprintf.c **** + 597:lib/vsprintf.c **** + 598:lib/vsprintf.c **** /** + 599:lib/vsprintf.c **** * vsscanf - Unformat a buffer into a list of arguments + 600:lib/vsprintf.c **** * @buf: input buffer + 601:lib/vsprintf.c **** * @fmt: format of buffer + 602:lib/vsprintf.c **** * @args: arguments + 603:lib/vsprintf.c **** */ + 604:lib/vsprintf.c **** int vsscanf(const char * buf, const char * fmt, va_list args) + 605:lib/vsprintf.c **** { + 1611 .loc 2 605 0 + 1612 .cfi_startproc + 1613 @ Function supports interworking. + 1614 @ args = 0, pretend = 0, frame = 16 + 1615 @ frame_needed = 0, uses_anonymous_args = 0 + 1616 .LVL192: + 1617 0a98 FF412DE9 stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr} + 1618 .LCFI15: + 1619 .cfi_def_cfa_offset 40 + 1620 .LVL193: + 1621 .loc 2 605 0 + 1622 0a9c 0050A0E1 mov r5, r0 + 1623 .cfi_offset 14, -4 + 1624 .cfi_offset 8, -8 + 1625 .cfi_offset 7, -12 + 1626 .cfi_offset 6, -16 + 1627 .cfi_offset 5, -20 + 1628 .cfi_offset 4, -24 + 1629 .cfi_offset 3, -28 + 1630 .cfi_offset 2, -32 + 1631 .cfi_offset 1, -36 + 1632 .cfi_offset 0, -40 + 1633 .LVL194: + 1634 0aa0 04108DE5 str r1, [sp, #4] + 1635 .LVL195: + 1636 0aa4 0270A0E1 mov r7, r2 + 1637 .LVL196: + 606:lib/vsprintf.c **** const char *str = buf; + 1638 .loc 2 606 0 + 1639 0aa8 0060A0E1 mov r6, r0 + 607:lib/vsprintf.c **** char *next; + 608:lib/vsprintf.c **** char digit; + 609:lib/vsprintf.c **** int num = 0; + 1640 .loc 2 609 0 + 1641 0aac 0040A0E3 mov r4, #0 + 610:lib/vsprintf.c **** int qualifier; + 611:lib/vsprintf.c **** int base; + 612:lib/vsprintf.c **** int field_width; + 613:lib/vsprintf.c **** int is_sign = 0; + 614:lib/vsprintf.c **** + 615:lib/vsprintf.c **** while(*fmt && *str) { + 1642 .loc 2 615 0 + 1643 0ab0 300100EA b .L255 + 1644 .LVL197: + 1645 .L248: + 616:lib/vsprintf.c **** /* skip any white space in format */ + 617:lib/vsprintf.c **** /* white space in format matchs any amount of + 618:lib/vsprintf.c **** * white space, including none, in the input. + 619:lib/vsprintf.c **** */ + 620:lib/vsprintf.c **** if (isspace(*fmt)) { + 1646 .loc 2 620 0 + 1647 0ab4 E8249FE5 ldr r2, .L278 + 1648 0ab8 0330D2E7 ldrb r3, [r2, r3] @ zero_extendqisi2 + 1649 0abc 200013E3 tst r3, #32 + 1650 0ac0 0200001A bne .L192 + 1651 0ac4 0E0000EA b .L193 + 1652 .LVL198: + 1653 .L194: + 621:lib/vsprintf.c **** while (isspace(*fmt)) + 622:lib/vsprintf.c **** ++fmt; + 1654 .loc 2 622 0 + 1655 0ac8 013083E2 add r3, r3, #1 + 1656 0acc 04308DE5 str r3, [sp, #4] + 1657 .L192: + 621:lib/vsprintf.c **** while (isspace(*fmt)) + 1658 .loc 2 621 0 discriminator 1 + 1659 0ad0 04309DE5 ldr r3, [sp, #4] + 1660 0ad4 C8149FE5 ldr r1, .L278 + 1661 0ad8 0020D3E5 ldrb r2, [r3, #0] @ zero_extendqisi2 + 1662 0adc 0220D1E7 ldrb r2, [r1, r2] @ zero_extendqisi2 + 1663 0ae0 200012E3 tst r2, #32 + 1664 0ae4 F7FFFF1A bne .L194 + 621:lib/vsprintf.c **** while (isspace(*fmt)) + 1665 .loc 2 621 0 is_stmt 0 + 1666 0ae8 0630A0E1 mov r3, r6 + 1667 .L195: + 621:lib/vsprintf.c **** while (isspace(*fmt)) + 1668 .loc 2 621 0 discriminator 1 + 1669 0aec 0360A0E1 mov r6, r3 + 1670 .LVL199: + 623:lib/vsprintf.c **** while (isspace(*str)) + 1671 .loc 2 623 0 is_stmt 1 discriminator 1 + 1672 0af0 AC149FE5 ldr r1, .L278 + 1673 0af4 0120D3E4 ldrb r2, [r3], #1 @ zero_extendqisi2 + 1674 .LVL200: + 1675 0af8 0220D1E7 ldrb r2, [r1, r2] @ zero_extendqisi2 + 1676 0afc 200012E3 tst r2, #32 + 1677 0b00 F9FFFF1A bne .L195 + 1678 .L193: + 624:lib/vsprintf.c **** ++str; + 625:lib/vsprintf.c **** } + 626:lib/vsprintf.c **** + 627:lib/vsprintf.c **** /* anything that is not a conversion must match exactly */ + 628:lib/vsprintf.c **** if (*fmt != '%' && *fmt) { + 1679 .loc 2 628 0 + 1680 0b04 04309DE5 ldr r3, [sp, #4] + 1681 0b08 0020D3E5 ldrb r2, [r3, #0] @ zero_extendqisi2 + 1682 0b0c 000052E3 cmp r2, #0 + 1683 0b10 25005213 cmpne r2, #37 + 1684 0b14 0400000A beq .L196 + 629:lib/vsprintf.c **** if (*fmt++ != *str++) + 1685 .loc 2 629 0 + 1686 0b18 0010D6E5 ldrb r1, [r6, #0] @ zero_extendqisi2 + 1687 0b1c 013083E2 add r3, r3, #1 + 1688 0b20 04308DE5 str r3, [sp, #4] + 1689 .LVL201: + 1690 0b24 010052E1 cmp r2, r1 + 1691 0b28 A10000EA b .L266 + 1692 .LVL202: + 1693 .L196: + 630:lib/vsprintf.c **** break; + 631:lib/vsprintf.c **** continue; + 632:lib/vsprintf.c **** } + 633:lib/vsprintf.c **** + 634:lib/vsprintf.c **** if (!*fmt) + 1694 .loc 2 634 0 + 1695 0b2c 000052E3 cmp r2, #0 + 1696 0b30 1701000A beq .L197 + 635:lib/vsprintf.c **** break; + 636:lib/vsprintf.c **** ++fmt; + 1697 .loc 2 636 0 + 1698 0b34 012083E2 add r2, r3, #1 + 1699 0b38 04208DE5 str r2, [sp, #4] + 637:lib/vsprintf.c **** + 638:lib/vsprintf.c **** /* skip this conversion. + 639:lib/vsprintf.c **** * advance both strings to next white space + 640:lib/vsprintf.c **** */ + 641:lib/vsprintf.c **** if (*fmt == '*') { + 1700 .loc 2 641 0 + 1701 0b3c 0130D3E5 ldrb r3, [r3, #1] @ zero_extendqisi2 + 1702 0b40 2A0053E3 cmp r3, #42 + 1703 0b44 1600001A bne .L256 + 1704 0b48 010000EA b .L199 + 1705 .L203: + 642:lib/vsprintf.c **** while (!isspace(*fmt) && *fmt) + 643:lib/vsprintf.c **** fmt++; + 1706 .loc 2 643 0 + 1707 0b4c 012082E2 add r2, r2, #1 + 1708 0b50 04208DE5 str r2, [sp, #4] + 1709 .L199: + 642:lib/vsprintf.c **** while (!isspace(*fmt) && *fmt) + 1710 .loc 2 642 0 discriminator 1 + 1711 0b54 04209DE5 ldr r2, [sp, #4] + 1712 0b58 44149FE5 ldr r1, .L278 + 1713 0b5c 0030D2E5 ldrb r3, [r2, #0] @ zero_extendqisi2 + 1714 0b60 0310D1E7 ldrb r1, [r1, r3] @ zero_extendqisi2 + 1715 0b64 200011E3 tst r1, #32 + 1716 0b68 0100000A beq .L201 + 1717 .L204: + 1718 0b6c 0630A0E1 mov r3, r6 + 1719 0b70 020000EA b .L202 + 1720 .L201: + 642:lib/vsprintf.c **** while (!isspace(*fmt) && *fmt) + 1721 .loc 2 642 0 is_stmt 0 discriminator 2 + 1722 0b74 000053E3 cmp r3, #0 + 1723 0b78 F3FFFF1A bne .L203 + 1724 0b7c FAFFFFEA b .L204 + 1725 .L202: + 642:lib/vsprintf.c **** while (!isspace(*fmt) && *fmt) + 1726 .loc 2 642 0 discriminator 1 + 1727 0b80 0360A0E1 mov r6, r3 + 1728 .LVL203: + 644:lib/vsprintf.c **** while (!isspace(*str) && *str) + 1729 .loc 2 644 0 is_stmt 1 discriminator 1 + 1730 0b84 18149FE5 ldr r1, .L278 + 1731 0b88 0120D3E4 ldrb r2, [r3], #1 @ zero_extendqisi2 + 1732 .LVL204: + 1733 0b8c 0210D1E7 ldrb r1, [r1, r2] @ zero_extendqisi2 + 1734 0b90 200011E3 tst r1, #32 + 1735 0b94 F700001A bne .L255 + 1736 .loc 2 644 0 is_stmt 0 discriminator 2 + 1737 0b98 000052E3 cmp r2, #0 + 1738 0b9c F7FFFF1A bne .L202 + 1739 0ba0 F40000EA b .L255 + 1740 .L256: + 1741 .LVL205: + 645:lib/vsprintf.c **** str++; + 646:lib/vsprintf.c **** continue; + 647:lib/vsprintf.c **** } + 648:lib/vsprintf.c **** + 649:lib/vsprintf.c **** /* get field width */ + 650:lib/vsprintf.c **** field_width = -1; + 651:lib/vsprintf.c **** if (isdigit(*fmt)) + 1742 .loc 2 651 0 is_stmt 1 + 1743 0ba4 F8239FE5 ldr r2, .L278 + 1744 0ba8 0330D2E7 ldrb r3, [r2, r3] @ zero_extendqisi2 + 1745 0bac 040013E3 tst r3, #4 + 650:lib/vsprintf.c **** field_width = -1; + 1746 .loc 2 650 0 + 1747 0bb0 0000E003 mvneq r0, #0 + 1748 .loc 2 651 0 + 652:lib/vsprintf.c **** field_width = skip_atoi(&fmt); + 1749 .loc 2 652 0 + 1750 0bb4 04008D12 addne r0, sp, #4 + 1751 0bb8 17FDFF1B blne skip_atoi + 1752 .LVL206: + 1753 .L205: + 653:lib/vsprintf.c **** + 654:lib/vsprintf.c **** /* get conversion qualifier */ + 655:lib/vsprintf.c **** qualifier = -1; + 656:lib/vsprintf.c **** if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 1754 .loc 2 656 0 + 1755 0bbc 04109DE5 ldr r1, [sp, #4] + 1756 0bc0 0030D1E5 ldrb r3, [r1, #0] @ zero_extendqisi2 + 1757 0bc4 680053E3 cmp r3, #104 + 1758 0bc8 6C005313 cmpne r3, #108 + 1759 0bcc 0600000A beq .L206 + 1760 .loc 2 656 0 is_stmt 0 discriminator 1 + 1761 0bd0 5A0053E3 cmp r3, #90 + 1762 0bd4 0400000A beq .L206 + 1763 0bd8 7A0053E3 cmp r3, #122 + 1764 0bdc 0200000A beq .L206 + 1765 0be0 4C0053E3 cmp r3, #76 + 655:lib/vsprintf.c **** qualifier = -1; + 1766 .loc 2 655 0 is_stmt 1 discriminator 1 + 1767 0be4 0030E013 mvnne r3, #0 + 1768 .loc 2 656 0 discriminator 1 + 1769 0be8 0D00001A bne .L207 + 1770 .L206: + 1771 .LVL207: + 657:lib/vsprintf.c **** *fmt == 'Z' || *fmt == 'z') { + 658:lib/vsprintf.c **** qualifier = *fmt++; + 1772 .loc 2 658 0 + 1773 0bec 012081E2 add r2, r1, #1 + 1774 0bf0 04208DE5 str r2, [sp, #4] + 659:lib/vsprintf.c **** if (qualifier == *fmt) { + 1775 .loc 2 659 0 + 1776 0bf4 0110D1E5 ldrb r1, [r1, #1] @ zero_extendqisi2 + 1777 0bf8 010053E1 cmp r3, r1 + 1778 0bfc 0800001A bne .L207 + 660:lib/vsprintf.c **** if (qualifier == 'h') { + 1779 .loc 2 660 0 + 1780 0c00 680053E3 cmp r3, #104 + 661:lib/vsprintf.c **** qualifier = 'H'; + 662:lib/vsprintf.c **** fmt++; + 1781 .loc 2 662 0 + 1782 0c04 01208202 addeq r2, r2, #1 + 1783 0c08 04208D05 streq r2, [sp, #4] + 661:lib/vsprintf.c **** qualifier = 'H'; + 1784 .loc 2 661 0 + 1785 0c0c 4830A003 moveq r3, #72 + 1786 .LVL208: + 660:lib/vsprintf.c **** if (qualifier == 'h') { + 1787 .loc 2 660 0 + 1788 0c10 0300000A beq .L207 + 663:lib/vsprintf.c **** } else if (qualifier == 'l') { + 1789 .loc 2 663 0 + 1790 0c14 6C0053E3 cmp r3, #108 + 1791 .LVL209: + 664:lib/vsprintf.c **** qualifier = 'L'; + 665:lib/vsprintf.c **** fmt++; + 1792 .loc 2 665 0 + 1793 0c18 01208202 addeq r2, r2, #1 + 1794 0c1c 04208D05 streq r2, [sp, #4] + 664:lib/vsprintf.c **** qualifier = 'L'; + 1795 .loc 2 664 0 + 1796 0c20 4C30A003 moveq r3, #76 + 1797 .LVL210: + 1798 .L207: + 666:lib/vsprintf.c **** } + 667:lib/vsprintf.c **** } + 668:lib/vsprintf.c **** } + 669:lib/vsprintf.c **** base = 10; + 670:lib/vsprintf.c **** is_sign = 0; + 671:lib/vsprintf.c **** + 672:lib/vsprintf.c **** if (!*fmt || !*str) + 1799 .loc 2 672 0 + 1800 0c24 04109DE5 ldr r1, [sp, #4] + 1801 0c28 0020D1E5 ldrb r2, [r1, #0] @ zero_extendqisi2 + 1802 0c2c 000052E3 cmp r2, #0 + 1803 0c30 D700000A beq .L197 + 1804 .loc 2 672 0 is_stmt 0 discriminator 1 + 1805 0c34 00C0D6E5 ldrb ip, [r6, #0] @ zero_extendqisi2 + 1806 0c38 00005CE3 cmp ip, #0 + 1807 0c3c D400000A beq .L197 + 673:lib/vsprintf.c **** break; + 674:lib/vsprintf.c **** + 675:lib/vsprintf.c **** switch(*fmt++) { + 1808 .loc 2 675 0 is_stmt 1 + 1809 0c40 011081E2 add r1, r1, #1 + 1810 0c44 6E0052E3 cmp r2, #110 + 1811 0c48 04108DE5 str r1, [sp, #4] + 1812 0c4c 4800000A beq .L214 + 1813 0c50 0B00008A bhi .L218 + 1814 0c54 630052E3 cmp r2, #99 + 1815 0c58 1900000A beq .L211 + 1816 0c5c 0300008A bhi .L219 + 1817 0c60 250052E3 cmp r2, #37 + 1818 0c64 5000000A beq .L209 + 1819 0c68 580052E3 cmp r2, #88 + 1820 0c6c 0D0000EA b .L259 + 1821 .L219: + 1822 0c70 640052E3 cmp r2, #100 + 1823 0c74 0F00000A beq .L251 + 1824 0c78 690052E3 cmp r2, #105 + 1825 0c7c C400001A bne .L197 + 1826 0c80 460000EA b .L273 + 1827 .L218: + 1828 0c84 730052E3 cmp r2, #115 + 1829 0c88 1D00000A beq .L216 + 1830 0c8c 0200008A bhi .L220 + 1831 0c90 6F0052E3 cmp r2, #111 + 1832 0c94 BE00001A bne .L197 + 1833 0c98 3A0000EA b .L274 + 1834 .L220: + 1835 0c9c 750052E3 cmp r2, #117 + 1836 0ca0 0200000A beq .L217 + 1837 0ca4 780052E3 cmp r2, #120 + 1838 .L259: + 1839 0ca8 B900001A bne .L197 + 1840 0cac 380000EA b .L275 + 1841 .L217: + 670:lib/vsprintf.c **** is_sign = 0; + 1842 .loc 2 670 0 + 1843 0cb0 0010A0E3 mov r1, #0 + 1844 0cb4 000000EA b .L260 + 1845 .L251: + 676:lib/vsprintf.c **** case 'c': + 677:lib/vsprintf.c **** { + 678:lib/vsprintf.c **** char *s = (char *) va_arg(args,char*); + 679:lib/vsprintf.c **** if (field_width == -1) + 680:lib/vsprintf.c **** field_width = 1; + 681:lib/vsprintf.c **** do { + 682:lib/vsprintf.c **** *s++ = *str++; + 683:lib/vsprintf.c **** } while (--field_width > 0 && *str); + 684:lib/vsprintf.c **** num++; + 685:lib/vsprintf.c **** } + 686:lib/vsprintf.c **** continue; + 687:lib/vsprintf.c **** case 's': + 688:lib/vsprintf.c **** { + 689:lib/vsprintf.c **** char *s = (char *) va_arg(args, char *); + 690:lib/vsprintf.c **** if(field_width == -1) + 691:lib/vsprintf.c **** field_width = INT_MAX; + 692:lib/vsprintf.c **** /* first, skip leading white space in buffer */ + 693:lib/vsprintf.c **** while (isspace(*str)) + 694:lib/vsprintf.c **** str++; + 695:lib/vsprintf.c **** + 696:lib/vsprintf.c **** /* now copy until next white space */ + 697:lib/vsprintf.c **** while (*str && !isspace(*str) && field_width--) { + 698:lib/vsprintf.c **** *s++ = *str++; + 699:lib/vsprintf.c **** } + 700:lib/vsprintf.c **** *s = '\0'; + 701:lib/vsprintf.c **** num++; + 702:lib/vsprintf.c **** } + 703:lib/vsprintf.c **** continue; + 704:lib/vsprintf.c **** case 'n': + 705:lib/vsprintf.c **** /* return number of characters read so far */ + 706:lib/vsprintf.c **** { + 707:lib/vsprintf.c **** int *i = (int *)va_arg(args,int*); + 708:lib/vsprintf.c **** *i = str - buf; + 709:lib/vsprintf.c **** } + 710:lib/vsprintf.c **** continue; + 711:lib/vsprintf.c **** case 'o': + 712:lib/vsprintf.c **** base = 8; + 713:lib/vsprintf.c **** break; + 714:lib/vsprintf.c **** case 'x': + 715:lib/vsprintf.c **** case 'X': + 716:lib/vsprintf.c **** base = 16; + 717:lib/vsprintf.c **** break; + 718:lib/vsprintf.c **** case 'i': + 719:lib/vsprintf.c **** base = 0; + 720:lib/vsprintf.c **** case 'd': + 721:lib/vsprintf.c **** is_sign = 1; + 1846 .loc 2 721 0 + 1847 0cb8 0110A0E3 mov r1, #1 + 1848 .L260: + 669:lib/vsprintf.c **** base = 10; + 1849 .loc 2 669 0 + 1850 0cbc 0A20A0E3 mov r2, #10 + 1851 0cc0 3E0000EA b .L221 + 1852 .L211: + 1853 .LBB6: + 680:lib/vsprintf.c **** field_width = 1; + 1854 .loc 2 680 0 + 1855 0cc4 010070E3 cmn r0, #1 + 678:lib/vsprintf.c **** char *s = (char *) va_arg(args,char*); + 1856 .loc 2 678 0 + 1857 0cc8 001097E5 ldr r1, [r7, #0] + 1858 0ccc 04C087E2 add ip, r7, #4 + 1859 .LVL211: + 680:lib/vsprintf.c **** field_width = 1; + 1860 .loc 2 680 0 + 1861 0cd0 0100A003 moveq r0, #1 + 1862 .LVL212: + 679:lib/vsprintf.c **** if (field_width == -1) + 1863 .loc 2 679 0 + 1864 0cd4 0620A0E1 mov r2, r6 + 680:lib/vsprintf.c **** field_width = 1; + 1865 .loc 2 680 0 + 1866 0cd8 0630A0E1 mov r3, r6 + 1867 .LVL213: + 1868 .L224: + 682:lib/vsprintf.c **** *s++ = *str++; + 1869 .loc 2 682 0 discriminator 1 + 1870 0cdc 0160D3E4 ldrb r6, [r3], #1 @ zero_extendqisi2 + 683:lib/vsprintf.c **** } while (--field_width > 0 && *str); + 1871 .loc 2 683 0 discriminator 1 + 1872 0ce0 010040E2 sub r0, r0, #1 + 1873 .LVL214: + 1874 0ce4 000050E3 cmp r0, #0 + 682:lib/vsprintf.c **** *s++ = *str++; + 1875 .loc 2 682 0 discriminator 1 + 1876 0ce8 0160C1E4 strb r6, [r1], #1 + 1877 .LVL215: + 1878 0cec 0360A0E1 mov r6, r3 + 1879 .LVL216: + 683:lib/vsprintf.c **** } while (--field_width > 0 && *str); + 1880 .loc 2 683 0 discriminator 1 + 1881 0cf0 1C0000DA ble .L265 + 1882 0cf4 0170F2E5 ldrb r7, [r2, #1]! @ zero_extendqisi2 + 1883 0cf8 000057E3 cmp r7, #0 + 1884 0cfc F6FFFF1A bne .L224 + 1885 0d00 180000EA b .L265 + 1886 .LVL217: + 1887 .L216: + 1888 .LBE6: + 1889 .LBB7: + 691:lib/vsprintf.c **** field_width = INT_MAX; + 1890 .loc 2 691 0 + 1891 0d04 010070E3 cmn r0, #1 + 689:lib/vsprintf.c **** char *s = (char *) va_arg(args, char *); + 1892 .loc 2 689 0 + 1893 0d08 003097E5 ldr r3, [r7, #0] + 1894 .LVL218: + 1895 0d0c 04C087E2 add ip, r7, #4 + 1896 .LVL219: + 691:lib/vsprintf.c **** field_width = INT_MAX; + 1897 .loc 2 691 0 + 1898 0d10 0201E003 mvneq r0, #-2147483648 + 1899 .LVL220: + 1900 .L226: + 690:lib/vsprintf.c **** if(field_width == -1) + 1901 .loc 2 690 0 discriminator 1 + 1902 0d14 0620A0E1 mov r2, r6 + 1903 .LVL221: + 693:lib/vsprintf.c **** while (isspace(*str)) + 1904 .loc 2 693 0 discriminator 1 + 1905 0d18 84729FE5 ldr r7, .L278 + 1906 0d1c 0110D6E4 ldrb r1, [r6], #1 @ zero_extendqisi2 + 1907 .LVL222: + 1908 0d20 0110D7E7 ldrb r1, [r7, r1] @ zero_extendqisi2 + 1909 0d24 200011E3 tst r1, #32 + 1910 0d28 F9FFFF1A bne .L226 + 1911 0d2c 010000EA b .L227 + 1912 .LVL223: + 1913 .L229: + 698:lib/vsprintf.c **** *s++ = *str++; + 1914 .loc 2 698 0 + 1915 0d30 0110C3E4 strb r1, [r3], #1 + 1916 .LVL224: + 697:lib/vsprintf.c **** while (*str && !isspace(*str) && field_width--) { + 1917 .loc 2 697 0 + 1918 0d34 010040E2 sub r0, r0, #1 + 1919 .LVL225: + 1920 .L227: + 698:lib/vsprintf.c **** *s++ = *str++; + 1921 .loc 2 698 0 discriminator 1 + 1922 0d38 0260A0E1 mov r6, r2 + 1923 .LVL226: + 697:lib/vsprintf.c **** while (*str && !isspace(*str) && field_width--) { + 1924 .loc 2 697 0 discriminator 1 + 1925 0d3c 0110D2E4 ldrb r1, [r2], #1 @ zero_extendqisi2 + 1926 .LVL227: + 1927 0d40 000051E3 cmp r1, #0 + 1928 0d44 0500000A beq .L228 + 697:lib/vsprintf.c **** while (*str && !isspace(*str) && field_width--) { + 1929 .loc 2 697 0 is_stmt 0 discriminator 2 + 1930 0d48 54729FE5 ldr r7, .L278 + 1931 0d4c 0170D7E7 ldrb r7, [r7, r1] @ zero_extendqisi2 + 1932 0d50 200017E3 tst r7, #32 + 1933 0d54 0100001A bne .L228 + 1934 .LVL228: + 697:lib/vsprintf.c **** while (*str && !isspace(*str) && field_width--) { + 1935 .loc 2 697 0 discriminator 1 + 1936 0d58 000050E3 cmp r0, #0 + 1937 0d5c F3FFFF1A bne .L229 + 1938 .LVL229: + 1939 .L228: + 700:lib/vsprintf.c **** *s = '\0'; + 1940 .loc 2 700 0 is_stmt 1 + 1941 0d60 0020A0E3 mov r2, #0 + 1942 0d64 0020C3E5 strb r2, [r3, #0] + 1943 .LVL230: + 1944 .L265: + 701:lib/vsprintf.c **** num++; + 1945 .loc 2 701 0 + 1946 0d68 014084E2 add r4, r4, #1 + 1947 .LVL231: + 1948 .LBE7: + 689:lib/vsprintf.c **** char *s = (char *) va_arg(args, char *); + 1949 .loc 2 689 0 + 1950 0d6c 0C70A0E1 mov r7, ip + 703:lib/vsprintf.c **** continue; + 1951 .loc 2 703 0 + 1952 0d70 800000EA b .L255 + 1953 .LVL232: + 1954 .L214: + 1955 .LBB8: + 708:lib/vsprintf.c **** *i = str - buf; + 1956 .loc 2 708 0 + 1957 0d74 003097E5 ldr r3, [r7, #0] + 1958 .LVL233: + 1959 0d78 062065E0 rsb r2, r5, r6 + 1960 0d7c 002083E5 str r2, [r3, #0] + 1961 .LBE8: + 707:lib/vsprintf.c **** int *i = (int *)va_arg(args,int*); + 1962 .loc 2 707 0 + 1963 0d80 047087E2 add r7, r7, #4 + 1964 .LVL234: + 710:lib/vsprintf.c **** continue; + 1965 .loc 2 710 0 + 1966 0d84 7B0000EA b .L255 + 1967 .LVL235: + 1968 .L274: + 670:lib/vsprintf.c **** is_sign = 0; + 1969 .loc 2 670 0 + 1970 0d88 0010A0E3 mov r1, #0 + 712:lib/vsprintf.c **** base = 8; + 1971 .loc 2 712 0 + 1972 0d8c 0820A0E3 mov r2, #8 + 713:lib/vsprintf.c **** break; + 1973 .loc 2 713 0 + 1974 0d90 0A0000EA b .L221 + 1975 .LVL236: + 1976 .L275: + 670:lib/vsprintf.c **** is_sign = 0; + 1977 .loc 2 670 0 + 1978 0d94 0010A0E3 mov r1, #0 + 716:lib/vsprintf.c **** base = 16; + 1979 .loc 2 716 0 + 1980 0d98 1020A0E3 mov r2, #16 + 717:lib/vsprintf.c **** break; + 1981 .loc 2 717 0 + 1982 0d9c 070000EA b .L221 + 1983 .LVL237: + 1984 .L273: + 1985 .loc 2 721 0 + 1986 0da0 0110A0E3 mov r1, #1 + 719:lib/vsprintf.c **** base = 0; + 1987 .loc 2 719 0 + 1988 0da4 0020A0E3 mov r2, #0 + 1989 0da8 040000EA b .L221 + 1990 .LVL238: + 1991 .L209: + 722:lib/vsprintf.c **** case 'u': + 723:lib/vsprintf.c **** break; + 724:lib/vsprintf.c **** case '%': + 725:lib/vsprintf.c **** /* looking for '%' in str */ + 726:lib/vsprintf.c **** if (*str++ != '%') + 1992 .loc 2 726 0 + 1993 0dac 0030D6E5 ldrb r3, [r6, #0] @ zero_extendqisi2 + 1994 .LVL239: + 1995 0db0 250053E3 cmp r3, #37 + 1996 .LVL240: + 1997 .L266: + 1998 0db4 7600001A bne .L197 + 1999 0db8 016086E2 add r6, r6, #1 + 2000 0dbc 6D0000EA b .L255 + 2001 .LVL241: + 2002 .L221: + 727:lib/vsprintf.c **** return num; + 728:lib/vsprintf.c **** continue; + 729:lib/vsprintf.c **** default: + 730:lib/vsprintf.c **** /* invalid format; stop here */ + 731:lib/vsprintf.c **** return num; + 732:lib/vsprintf.c **** } + 733:lib/vsprintf.c **** + 734:lib/vsprintf.c **** /* have some sort of integer conversion. + 735:lib/vsprintf.c **** * first, skip white space in buffer. + 736:lib/vsprintf.c **** */ + 737:lib/vsprintf.c **** while (isspace(*str)) + 2003 .loc 2 737 0 discriminator 1 + 2004 0dc0 00C0D6E5 ldrb ip, [r6, #0] @ zero_extendqisi2 + 2005 0dc4 D8819FE5 ldr r8, .L278 + 2006 0dc8 0C80D8E7 ldrb r8, [r8, ip] @ zero_extendqisi2 + 2007 0dcc 200018E3 tst r8, #32 + 726:lib/vsprintf.c **** if (*str++ != '%') + 2008 .loc 2 726 0 discriminator 1 + 2009 0dd0 0600A0E1 mov r0, r6 + 2010 .LVL242: + 2011 .loc 2 737 0 discriminator 1 + 2012 0dd4 016086E2 add r6, r6, #1 + 2013 .LVL243: + 2014 0dd8 F8FFFF1A bne .L221 + 2015 .LVL244: + 738:lib/vsprintf.c **** str++; + 739:lib/vsprintf.c **** + 740:lib/vsprintf.c **** digit = *str; + 741:lib/vsprintf.c **** if (is_sign && digit == '-') + 2016 .loc 2 741 0 + 2017 0ddc 2D005CE3 cmp ip, #45 + 2018 0de0 0060A013 movne r6, #0 + 2019 0de4 01600102 andeq r6, r1, #1 + 2020 0de8 000056E3 cmp r6, #0 + 742:lib/vsprintf.c **** digit = *(str + 1); + 2021 .loc 2 742 0 + 2022 0dec 01C0D015 ldrneb ip, [r0, #1] @ zero_extendqisi2 + 2023 .LVL245: + 743:lib/vsprintf.c **** + 744:lib/vsprintf.c **** if (!digit + 2024 .loc 2 744 0 + 2025 0df0 00005CE3 cmp ip, #0 + 2026 0df4 6600000A beq .L197 + 745:lib/vsprintf.c **** || (base == 16 && !isxdigit(digit)) + 2027 .loc 2 745 0 + 2028 0df8 100052E3 cmp r2, #16 + 2029 0dfc 0300001A bne .L231 + 2030 .loc 2 745 0 is_stmt 0 discriminator 1 + 2031 0e00 9C619FE5 ldr r6, .L278 + 2032 0e04 0CC0D6E7 ldrb ip, [r6, ip] @ zero_extendqisi2 + 2033 .LVL246: + 2034 0e08 44001CE3 tst ip, #68 + 2035 0e0c 130000EA b .L262 + 2036 .LVL247: + 2037 .L231: + 746:lib/vsprintf.c **** || (base == 10 && !isdigit(digit)) + 2038 .loc 2 746 0 is_stmt 1 + 2039 0e10 0A0052E3 cmp r2, #10 + 2040 0e14 0E00000A beq .L261 + 2041 .L233: + 747:lib/vsprintf.c **** || (base == 8 && (!isdigit(digit) || digit > '7')) + 2042 .loc 2 747 0 + 2043 0e18 080052E3 cmp r2, #8 + 2044 0e1c 0A00001A bne .L234 + 2045 .loc 2 747 0 is_stmt 0 discriminator 1 + 2046 0e20 7C619FE5 ldr r6, .L278 + 2047 0e24 0C60D6E7 ldrb r6, [r6, ip] @ zero_extendqisi2 + 2048 0e28 040016E3 tst r6, #4 + 2049 0e2c 0060A013 movne r6, #0 + 2050 0e30 0160A003 moveq r6, #1 + 2051 0e34 37005CE3 cmp ip, #55 + 2052 0e38 06C0A091 movls ip, r6 + 2053 0e3c 01C08683 orrhi ip, r6, #1 + 2054 .LVL248: + 2055 0e40 00005CE3 cmp ip, #0 + 2056 0e44 0600000A beq .L232 + 2057 0e48 510000EA b .L197 + 2058 .LVL249: + 2059 .L234: + 748:lib/vsprintf.c **** || (base == 0 && !isdigit(digit))) + 2060 .loc 2 748 0 is_stmt 1 + 2061 0e4c 000052E3 cmp r2, #0 + 2062 0e50 0300001A bne .L232 + 2063 .L261: + 2064 .loc 2 748 0 is_stmt 0 discriminator 1 + 2065 0e54 48619FE5 ldr r6, .L278 + 2066 0e58 0CC0D6E7 ldrb ip, [r6, ip] @ zero_extendqisi2 + 2067 .LVL250: + 2068 0e5c 04001CE3 tst ip, #4 + 2069 .L262: + 2070 0e60 4B00000A beq .L197 + 2071 .L232: + 749:lib/vsprintf.c **** break; + 750:lib/vsprintf.c **** + 751:lib/vsprintf.c **** switch(qualifier) { + 2072 .loc 2 751 0 is_stmt 1 + 2073 0e64 5A0053E3 cmp r3, #90 + 2074 0e68 3000000A beq .L238 + 2075 0e6c 040000CA bgt .L241 + 2076 0e70 480053E3 cmp r3, #72 + 2077 0e74 0900000A beq .L236 + 2078 0e78 4C0053E3 cmp r3, #76 + 2079 0e7c 2D00001A bne .L235 + 2080 0e80 1E0000EA b .L276 + 2081 .L241: + 2082 0e84 6C0053E3 cmp r3, #108 + 2083 0e88 2A00000A beq .L235 + 2084 0e8c 7A0053E3 cmp r3, #122 + 2085 0e90 2600000A beq .L238 + 2086 0e94 680053E3 cmp r3, #104 + 2087 0e98 2600001A bne .L235 + 2088 0e9c 0B0000EA b .L277 + 2089 .L236: + 752:lib/vsprintf.c **** case 'H': /* that's 'hh' in format */ + 753:lib/vsprintf.c **** if (is_sign) { + 2090 .loc 2 753 0 + 2091 0ea0 000051E3 cmp r1, #0 + 2092 0ea4 046087E2 add r6, r7, #4 + 2093 0ea8 0300000A beq .L242 + 2094 .LBB9: + 754:lib/vsprintf.c **** signed char *s = (signed char *) va_arg(args,signed char *); + 755:lib/vsprintf.c **** *s = (signed char) simple_strtol(str,&next,base); + 2095 .loc 2 755 0 + 2096 0eac 0C108DE2 add r1, sp, #12 + 2097 .LVL251: + 754:lib/vsprintf.c **** signed char *s = (signed char *) va_arg(args,signed char *); + 2098 .loc 2 754 0 + 2099 0eb0 007097E5 ldr r7, [r7, #0] + 2100 .LVL252: + 2101 .loc 2 755 0 + 2102 0eb4 FEFFFFEB bl simple_strtol + 2103 .LVL253: + 2104 0eb8 020000EA b .L267 + 2105 .LVL254: + 2106 .L242: + 2107 .LBE9: + 2108 .LBB10: + 756:lib/vsprintf.c **** } else { + 757:lib/vsprintf.c **** unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + 758:lib/vsprintf.c **** *s = (unsigned char) simple_strtoul(str, &next, base); + 2109 .loc 2 758 0 + 2110 0ebc 0C108DE2 add r1, sp, #12 + 2111 .LVL255: + 757:lib/vsprintf.c **** unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + 2112 .loc 2 757 0 + 2113 0ec0 007097E5 ldr r7, [r7, #0] + 2114 .LVL256: + 2115 .loc 2 758 0 + 2116 0ec4 FEFFFFEB bl simple_strtoul + 2117 .LVL257: + 2118 .L267: + 2119 0ec8 0000C7E5 strb r0, [r7, #0] + 2120 0ecc 240000EA b .L263 + 2121 .LVL258: + 2122 .L277: + 2123 .LBE10: + 759:lib/vsprintf.c **** } + 760:lib/vsprintf.c **** break; + 761:lib/vsprintf.c **** case 'h': + 762:lib/vsprintf.c **** if (is_sign) { + 2124 .loc 2 762 0 + 2125 0ed0 000051E3 cmp r1, #0 + 2126 0ed4 046087E2 add r6, r7, #4 + 2127 0ed8 0300000A beq .L244 + 2128 .LBB11: + 763:lib/vsprintf.c **** short *s = (short *) va_arg(args,short *); + 764:lib/vsprintf.c **** *s = (short) simple_strtol(str,&next,base); + 2129 .loc 2 764 0 + 2130 0edc 0C108DE2 add r1, sp, #12 + 2131 .LVL259: + 763:lib/vsprintf.c **** short *s = (short *) va_arg(args,short *); + 2132 .loc 2 763 0 + 2133 0ee0 007097E5 ldr r7, [r7, #0] + 2134 .LVL260: + 2135 .loc 2 764 0 + 2136 0ee4 FEFFFFEB bl simple_strtol + 2137 .LVL261: + 2138 0ee8 020000EA b .L270 + 2139 .LVL262: + 2140 .L244: + 2141 .LBE11: + 2142 .LBB12: + 765:lib/vsprintf.c **** } else { + 766:lib/vsprintf.c **** unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + 767:lib/vsprintf.c **** *s = (unsigned short) simple_strtoul(str, &next, base); + 2143 .loc 2 767 0 + 2144 0eec 0C108DE2 add r1, sp, #12 + 2145 .LVL263: + 766:lib/vsprintf.c **** unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + 2146 .loc 2 766 0 + 2147 0ef0 007097E5 ldr r7, [r7, #0] + 2148 .LVL264: + 2149 .loc 2 767 0 + 2150 0ef4 FEFFFFEB bl simple_strtoul + 2151 .LVL265: + 2152 .L270: + 2153 0ef8 B000C7E1 strh r0, [r7, #0] @ movhi + 2154 0efc 180000EA b .L263 + 2155 .LVL266: + 2156 .L276: + 2157 .LBE12: + 768:lib/vsprintf.c **** } + 769:lib/vsprintf.c **** break; + 770:lib/vsprintf.c **** case 'l': + 771:lib/vsprintf.c **** if (is_sign) { + 772:lib/vsprintf.c **** long *l = (long *) va_arg(args,long *); + 773:lib/vsprintf.c **** *l = simple_strtol(str,&next,base); + 774:lib/vsprintf.c **** } else { + 775:lib/vsprintf.c **** unsigned long *l = (unsigned long*) va_arg(args,unsigned long*); + 776:lib/vsprintf.c **** *l = simple_strtoul(str,&next,base); + 777:lib/vsprintf.c **** } + 778:lib/vsprintf.c **** break; + 779:lib/vsprintf.c **** case 'L': + 780:lib/vsprintf.c **** if (is_sign) { + 2158 .loc 2 780 0 + 2159 0f00 000051E3 cmp r1, #0 + 2160 0f04 046087E2 add r6, r7, #4 + 2161 0f08 0300000A beq .L246 + 2162 .LBB13: + 781:lib/vsprintf.c **** long long *l = (long long*) va_arg(args,long long *); + 782:lib/vsprintf.c **** *l = simple_strtoll(str,&next,base); + 2163 .loc 2 782 0 + 2164 0f0c 0C108DE2 add r1, sp, #12 + 2165 .LVL267: + 781:lib/vsprintf.c **** long long *l = (long long*) va_arg(args,long long *); + 2166 .loc 2 781 0 + 2167 0f10 007097E5 ldr r7, [r7, #0] + 2168 .LVL268: + 2169 .loc 2 782 0 + 2170 0f14 FEFFFFEB bl simple_strtoll + 2171 .LVL269: + 2172 0f18 020000EA b .L269 + 2173 .LVL270: + 2174 .L246: + 2175 .LBE13: + 2176 .LBB14: + 783:lib/vsprintf.c **** } else { + 784:lib/vsprintf.c **** unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + 785:lib/vsprintf.c **** *l = simple_strtoull(str,&next,base); + 2177 .loc 2 785 0 + 2178 0f1c 0C108DE2 add r1, sp, #12 + 2179 .LVL271: + 784:lib/vsprintf.c **** unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + 2180 .loc 2 784 0 + 2181 0f20 007097E5 ldr r7, [r7, #0] + 2182 .LVL272: + 2183 .loc 2 785 0 + 2184 0f24 FEFFFFEB bl simple_strtoull + 2185 .LVL273: + 2186 .L269: + 2187 0f28 030087E8 stmia r7, {r0-r1} + 2188 0f2c 0C0000EA b .L263 + 2189 .LVL274: + 2190 .L238: + 2191 .LBE14: + 2192 .LBB15: + 786:lib/vsprintf.c **** } + 787:lib/vsprintf.c **** break; + 788:lib/vsprintf.c **** case 'Z': + 789:lib/vsprintf.c **** case 'z': + 790:lib/vsprintf.c **** { + 791:lib/vsprintf.c **** size_t *s = (size_t*) va_arg(args,size_t*); + 2193 .loc 2 791 0 + 2194 0f30 046087E2 add r6, r7, #4 + 2195 0f34 060000EA b .L247 + 2196 .L235: + 2197 .LBE15: + 792:lib/vsprintf.c **** *s = (size_t) simple_strtoul(str,&next,base); + 793:lib/vsprintf.c **** } + 794:lib/vsprintf.c **** break; + 795:lib/vsprintf.c **** default: + 796:lib/vsprintf.c **** if (is_sign) { + 2198 .loc 2 796 0 + 2199 0f38 000051E3 cmp r1, #0 + 2200 0f3c 046087E2 add r6, r7, #4 + 2201 0f40 0300000A beq .L247 + 2202 .LBB16: + 797:lib/vsprintf.c **** int *i = (int *) va_arg(args, int*); + 798:lib/vsprintf.c **** *i = (int) simple_strtol(str,&next,base); + 2203 .loc 2 798 0 + 2204 0f44 0C108DE2 add r1, sp, #12 + 2205 .LVL275: + 797:lib/vsprintf.c **** int *i = (int *) va_arg(args, int*); + 2206 .loc 2 797 0 + 2207 0f48 007097E5 ldr r7, [r7, #0] + 2208 .LVL276: + 2209 .loc 2 798 0 + 2210 0f4c FEFFFFEB bl simple_strtol + 2211 .LVL277: + 2212 0f50 020000EA b .L268 + 2213 .LVL278: + 2214 .L247: + 2215 .LBE16: + 2216 .LBB17: + 799:lib/vsprintf.c **** } else { + 800:lib/vsprintf.c **** unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + 801:lib/vsprintf.c **** *i = (unsigned int) simple_strtoul(str,&next,base); + 2217 .loc 2 801 0 + 2218 0f54 0C108DE2 add r1, sp, #12 + 2219 .LVL279: + 800:lib/vsprintf.c **** unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + 2220 .loc 2 800 0 + 2221 0f58 007097E5 ldr r7, [r7, #0] + 2222 .LVL280: + 2223 .loc 2 801 0 + 2224 0f5c FEFFFFEB bl simple_strtoul + 2225 .LVL281: + 2226 .L268: + 2227 0f60 000087E5 str r0, [r7, #0] + 2228 .L263: + 800:lib/vsprintf.c **** unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + 2229 .loc 2 800 0 + 2230 0f64 0670A0E1 mov r7, r6 + 2231 .LBE17: + 802:lib/vsprintf.c **** } + 803:lib/vsprintf.c **** break; + 804:lib/vsprintf.c **** } + 805:lib/vsprintf.c **** num++; + 806:lib/vsprintf.c **** + 807:lib/vsprintf.c **** if (!next) + 2232 .loc 2 807 0 + 2233 0f68 0C609DE5 ldr r6, [sp, #12] + 2234 0f6c 000056E3 cmp r6, #0 + 805:lib/vsprintf.c **** num++; + 2235 .loc 2 805 0 + 2236 0f70 014084E2 add r4, r4, #1 + 2237 .LVL282: + 2238 .loc 2 807 0 + 2239 0f74 0600000A beq .L197 + 2240 .LVL283: + 2241 .L255: + 615:lib/vsprintf.c **** while(*fmt && *str) { + 2242 .loc 2 615 0 discriminator 1 + 2243 0f78 04309DE5 ldr r3, [sp, #4] + 2244 0f7c 0030D3E5 ldrb r3, [r3, #0] @ zero_extendqisi2 + 2245 0f80 000053E3 cmp r3, #0 + 2246 0f84 0200000A beq .L197 + 615:lib/vsprintf.c **** while(*fmt && *str) { + 2247 .loc 2 615 0 is_stmt 0 discriminator 2 + 2248 0f88 0020D6E5 ldrb r2, [r6, #0] @ zero_extendqisi2 + 2249 .LVL284: + 2250 0f8c 000052E3 cmp r2, #0 + 2251 0f90 C7FEFF1A bne .L248 + 2252 .LVL285: + 2253 .L197: + 808:lib/vsprintf.c **** break; + 809:lib/vsprintf.c **** str = next; + 810:lib/vsprintf.c **** } + 811:lib/vsprintf.c **** return num; + 812:lib/vsprintf.c **** } + 2254 .loc 2 812 0 is_stmt 1 + 2255 0f94 0400A0E1 mov r0, r4 + 2256 0f98 10D08DE2 add sp, sp, #16 + 2257 0f9c F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 2258 0fa0 1EFF2FE1 bx lr + 2259 .L279: + 2260 .align 2 + 2261 .L278: + 2262 0fa4 00000000 .word _ctype + 2263 .cfi_endproc + 2264 .LFE14: + 2266 .align 2 + 2267 .global sscanf + 2269 sscanf: + 2270 .LFB15: + 813:lib/vsprintf.c **** + 814:lib/vsprintf.c **** + 815:lib/vsprintf.c **** /** + 816:lib/vsprintf.c **** * sscanf - Unformat a buffer into a list of arguments + 817:lib/vsprintf.c **** * @buf: input buffer + 818:lib/vsprintf.c **** * @fmt: formatting of buffer + 819:lib/vsprintf.c **** * @...: resulting arguments + 820:lib/vsprintf.c **** */ + 821:lib/vsprintf.c **** int sscanf(const char * buf, const char * fmt, ...) + 822:lib/vsprintf.c **** { + 2271 .loc 2 822 0 + 2272 .cfi_startproc + 2273 @ Function supports interworking. + 2274 @ args = 4, pretend = 12, frame = 8 + 2275 @ frame_needed = 0, uses_anonymous_args = 1 + 2276 .LVL286: + 2277 0fa8 0E002DE9 stmfd sp!, {r1, r2, r3} + 2278 .LCFI16: + 2279 .cfi_def_cfa_offset 12 + 2280 0fac 03402DE9 stmfd sp!, {r0, r1, lr} + 2281 .LCFI17: + 2282 .cfi_def_cfa_offset 24 + 823:lib/vsprintf.c **** va_list args; + 824:lib/vsprintf.c **** int i; + 825:lib/vsprintf.c **** + 826:lib/vsprintf.c **** va_start(args,fmt); + 827:lib/vsprintf.c **** i = vsscanf(buf,fmt,args); + 2283 .loc 2 827 0 + 2284 0fb0 0C109DE5 ldr r1, [sp, #12] + 2285 .cfi_offset 14, -16 + 2286 .cfi_offset 0, -24 + 2287 .cfi_offset 3, -4 + 2288 .cfi_offset 2, -8 + 2289 .cfi_offset 1, -20 + 826:lib/vsprintf.c **** va_start(args,fmt); + 2290 .loc 2 826 0 + 2291 0fb4 10208DE2 add r2, sp, #16 + 2292 0fb8 04208DE5 str r2, [sp, #4] + 2293 .loc 2 827 0 + 2294 0fbc FEFFFFEB bl vsscanf + 2295 .LVL287: + 828:lib/vsprintf.c **** va_end(args); + 829:lib/vsprintf.c **** return i; + 830:lib/vsprintf.c **** } + 2296 .loc 2 830 0 + 2297 0fc0 0C40BDE8 ldmfd sp!, {r2, r3, lr} + 2298 0fc4 0CD08DE2 add sp, sp, #12 + 2299 0fc8 1EFF2FE1 bx lr + 2300 .cfi_endproc + 2301 .LFE15: + 2303 .section .rodata + 2304 .set .LANCHOR0,. + 0 + 2307 large_digits.4362: + 2308 0000 30313233 .ascii "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\000" + 2308 34353637 + 2308 38394142 + 2308 43444546 + 2308 4748494A + 2311 small_digits.4361: + 2312 0025 30313233 .ascii "0123456789abcdefghijklmnopqrstuvwxyz\000" + 2312 34353637 + 2312 38396162 + 2312 63646566 + 2312 6768696A + 2313 .text + 2314 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 vsprintf.c +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:23 .text:00000000 __toupper +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:47 .text:00000018 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:51 .text:0000001c $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:53 .text:0000001c skip_atoi +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:92 .text:00000058 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:96 .text:0000005c $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:98 .text:0000005c number +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:427 .text:000002a4 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:431 .text:000002a8 $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:434 .text:000002a8 simple_strtoul +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:552 .text:0000037c $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:556 .text:00000380 $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:559 .text:00000380 simple_strtol +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:596 .text:000003ac simple_strtoull +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:731 .text:000004a8 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:735 .text:000004ac $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:738 .text:000004ac simple_strtoll +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:778 .text:000004e4 vsnprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1423 .text:000009e8 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1427 .text:000009ec $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1430 .text:000009ec vscnprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1461 .text:00000a08 snprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1498 .text:00000a2c scnprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1543 .text:00000a5c vsprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1569 .text:00000a70 sprintf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:1609 .text:00000a98 vsscanf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:2262 .text:00000fa4 $d +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:2266 .text:00000fa8 $a +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:2269 .text:00000fa8 sscanf +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:2307 .rodata:00000000 large_digits.4362 +C:\Users\netz\AppData\Local\Temp\ccjL0JzD.s:2311 .rodata:00000025 small_digits.4361 + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +_ctype +__do_div64 +strnlen diff --git a/firmware/link/AT91SAM7S128-ROM-sam7dfu-app.ld b/firmware/link/AT91SAM7S128-ROM-sam7dfu-app.ld new file mode 100644 index 0000000..ebac6d4 --- /dev/null +++ b/firmware/link/AT91SAM7S128-ROM-sam7dfu-app.ld @@ -0,0 +1,96 @@ +/* Memory Definitions */ + +MEMORY +{ + /* reserve 1K config area on top of flash */ + FLASH (rx) : ORIGIN = 0x00104000, LENGTH = (0x00020000 - 0x4000 - 0x400) + DATA (rw) : ORIGIN = 0x00200028, LENGTH = (0x00008000 - 0x28) + STACK (rw) : ORIGIN = 0x00208000, LENGTH = 0x00000000 +} + + +/* Section Definitions */ + +SECTIONS +{ + . = 0x00000000; + /* first section is .text which is used for code */ + .text 0x00104000: AT ( 0x00000000 ) { + src/start/Cstartup_app.o (.text) + * (.text) + * (.rodata*) + . = ALIGN(4); + } >FLASH + + _etext = . ; + PROVIDE (etext = .); + + /* 0x00200000 ... */ + .data 0x00200028: AT ( ADDR(.text) + SIZEOF(.text) - ADDR(.text) ) { + _data = . ; + * (.fastrun) + * (.data) + . = ALIGN(4); + } >DATA + + _edata = . ; + PROVIDE (edata = .); + + /* .bss section which is used for uninitialized data */ + .bss : { + __bss_start = . ; + __bss_start__ = . ; + *(.bss) + *(COMMON) + } >DATA + + . = ALIGN(4); + __bss_end__ = . ; + __bss_end__ = . ; + + PROVIDE (main = .); + + _end = . ; + + . = ALIGN(4); + .int_data : { + *(.internal_ram_top) + } >STACK + + PROVIDE (end = .); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} diff --git a/firmware/link/AT91SAM7S128-ROM-sam7dfu-dfu.ld b/firmware/link/AT91SAM7S128-ROM-sam7dfu-dfu.ld new file mode 100644 index 0000000..a4436a9 --- /dev/null +++ b/firmware/link/AT91SAM7S128-ROM-sam7dfu-dfu.ld @@ -0,0 +1,114 @@ +/* Memory Definitions */ + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00004000 + DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00008000 + STACK (rw) : ORIGIN = 0x00208000, LENGTH = 0x00000000 +} + +/* Section Definitions */ + +SECTIONS +{ + . = 0x00000000; + /* first section is .text which is used for code */ + .text 0x00000000: AT ( 0x00000000 ) { + * (.reset) + * (.text) + * (.rodata*) + /* * (.dfu.functab) */ /* for debugging */ + . = ALIGN(4); + } >FLASH + + _etext = . ; + PROVIDE (etext = .); + + .data.shared (0x00200020): AT (LOADADDR(.text) + SIZEOF(.text)) { + _data_shared = . ; + * (.data.shared) + . = ALIGN(4); + } >DATA + + _edata_shared = . ; + _data_flash = LOADADDR(.data.shared) + SIZEOF(.data.shared); + + /* 0x00200000 ... */ + .data (0x00200000 + SIZEOF(.text)): AT + ( LOADADDR(.text) + SIZEOF(.text) + SIZEOF(.data.shared)) { + _data = . ; + * (.vectram) + * (.data) + . = ALIGN(4); + } >DATA + + _edata = . ; + PROVIDE (edata = .); + + /* dfu.functab addresses are valid as long as DFU is in flash, i.e. + * only while application calls those functions. Once executing in + * DFU mode, we are re-located to ram */ + .dfu.functab 0x00003fd0: AT ( ADDR(.dfu.functab) - ADDR(.text) ) { + *(.dfu.functab) + . = ALIGN(4096); + } >FLASH + + + /* .bss section which is used for uninitialized data */ + .bss : { + __bss_start = . ; + __bss_start__ = . ; + *(.bss) + *(COMMON) + } >DATA + + . = ALIGN(4); + __bss_end__ = . ; + __bss_end__ = . ; + + PROVIDE (main = .); + + _end = . ; + + . = ALIGN(4); + .int_data : { + *(.internal_ram_top) + } >STACK + + PROVIDE (end = .); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} diff --git a/firmware/link/AT91SAM7S256-ROM-sam7dfu-app.ld b/firmware/link/AT91SAM7S256-ROM-sam7dfu-app.ld new file mode 100644 index 0000000..85bf7b8 --- /dev/null +++ b/firmware/link/AT91SAM7S256-ROM-sam7dfu-app.ld @@ -0,0 +1,96 @@ +/* Memory Definitions */ + +MEMORY +{ + /* reserve 1K config area on top of flash */ + FLASH (rx) : ORIGIN = 0x00104000, LENGTH = (0x00040000 - 0x4000 - 0x400) + DATA (rw) : ORIGIN = 0x00200028, LENGTH = (0x00010000 - 0x28) + STACK (rw) : ORIGIN = 0x00210000, LENGTH = 0x00000000 +} + + +/* Section Definitions */ + +SECTIONS +{ + . = 0x00000000; + /* first section is .text which is used for code */ + .text 0x00104000: AT ( 0x00000000 ) { + src/start/Cstartup_app.o (.text) + * (.text) + * (.rodata*) + . = ALIGN(4); + } >FLASH + + _etext = . ; + PROVIDE (etext = .); + + /* 0x00200000 ... */ + .data 0x00200028: AT ( ADDR(.text) + SIZEOF(.text) - ADDR(.text) ) { + _data = . ; + * (.fastrun) + * (.data) + . = ALIGN(4); + } >DATA + + _edata = . ; + PROVIDE (edata = .); + + /* .bss section which is used for uninitialized data */ + .bss : { + __bss_start = . ; + __bss_start__ = . ; + *(.bss) + *(COMMON) + } >DATA + + . = ALIGN(4); + __bss_end__ = . ; + __bss_end__ = . ; + + PROVIDE (main = .); + + _end = . ; + + . = ALIGN(4); + .int_data : { + *(.internal_ram_top) + } >STACK + + PROVIDE (end = .); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} diff --git a/firmware/link/AT91SAM7S256-ROM-sam7dfu-dfu.ld b/firmware/link/AT91SAM7S256-ROM-sam7dfu-dfu.ld new file mode 100644 index 0000000..fcea409 --- /dev/null +++ b/firmware/link/AT91SAM7S256-ROM-sam7dfu-dfu.ld @@ -0,0 +1,114 @@ +/* Memory Definitions */ + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00004000 + DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 + STACK (rw) : ORIGIN = 0x00210000, LENGTH = 0x00000000 +} + + +/* Section Definitions */ + +SECTIONS +{ + . = 0x00000000; + /* first section is .text which is used for code */ + .text 0x00000000: AT ( 0x00000000 ) { + * (.reset) + * (.text) + * (.rodata*) + /* * (.dfu.functab) */ /* for debugging */ + . = ALIGN(4); + } >FLASH + + _etext = . ; + PROVIDE (etext = .); + + .data.shared (0x00200020): AT (LOADADDR(.text) + SIZEOF(.text)) { + _data_shared = . ; + * (.data.shared) + . = ALIGN(4); + } >DATA + + _edata_shared = . ; + _data_flash = LOADADDR(.data.shared) + SIZEOF(.data.shared); + + /* 0x00200000 ... */ + .data (0x00200000 + SIZEOF(.text)): AT ( LOADADDR(.text) + SIZEOF(.text) + SIZEOF(.data.shared)) { + _data = . ; + * (.vectram) + * (.data) + . = ALIGN(4); + } >DATA + + _edata = . ; + PROVIDE (edata = .); + + /* dfu.functab addresses are valid as long as DFU is in flash, i.e. + * only while application calls those functions. Once executing in + * DFU mode, we are re-located to ram */ + .dfu.functab 0x00003fd0: AT ( ADDR(.dfu.functab) - ADDR(.text) ) { + *(.dfu.functab) + . = ALIGN(4096); + } >FLASH + + + /* .bss section which is used for uninitialized data */ + .bss : { + __bss_start = . ; + __bss_start__ = . ; + *(.bss) + *(COMMON) + } >DATA + + . = ALIGN(4); + __bss_end__ = . ; + __bss_end__ = . ; + + PROVIDE (main = .); + + _end = . ; + + . = ALIGN(4); + .int_data : { + *(.internal_ram_top) + } >STACK + + PROVIDE (end = .); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} diff --git a/firmware/main_dumbreader.bin b/firmware/main_dumbreader.bin new file mode 100644 index 0000000..5a32fd3 Binary files /dev/null and b/firmware/main_dumbreader.bin differ diff --git a/firmware/main_dumbreader.elf b/firmware/main_dumbreader.elf new file mode 100644 index 0000000..c92797b Binary files /dev/null and b/firmware/main_dumbreader.elf differ diff --git a/firmware/main_dumbreader.lss b/firmware/main_dumbreader.lss new file mode 100644 index 0000000..abe1452 --- /dev/null +++ b/firmware/main_dumbreader.lss @@ -0,0 +1,18469 @@ + +main_dumbreader.elf: file format elf32-littlearm + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 00006e44 00104000 00000000 00004000 2**2 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .data 000002e4 00200028 00006e44 00010028 2**2 + CONTENTS, ALLOC, LOAD, CODE + 2 .bss 00003840 0020030c 00007128 0001030c 2**2 + ALLOC + 3 .ARM.attributes 0000002e 00000000 00000000 0001030c 2**0 + CONTENTS, READONLY + 4 .comment 0000002a 00000000 00000000 0001033a 2**0 + CONTENTS, READONLY + 5 .debug_aranges 00000458 00000000 00000000 00010368 2**3 + CONTENTS, READONLY, DEBUGGING + 6 .debug_pubnames 00000b4c 00000000 00000000 000107c0 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_info 0000e685 00000000 00000000 0001130c 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_abbrev 00003579 00000000 00000000 0001f991 2**0 + CONTENTS, READONLY, DEBUGGING + 9 .debug_line 00003414 00000000 00000000 00022f0a 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_frame 00001244 00000000 00000000 00026320 2**2 + CONTENTS, READONLY, DEBUGGING + 11 .debug_str 00003811 00000000 00000000 00027564 2**0 + CONTENTS, READONLY, DEBUGGING + 12 .debug_loc 00005011 00000000 00000000 0002ad75 2**0 + CONTENTS, READONLY, DEBUGGING + 13 .debug_ranges 00000f50 00000000 00000000 0002fd88 2**3 + CONTENTS, READONLY, DEBUGGING + 14 .debug_pubtypes 000012b0 00000000 00000000 00030cd8 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00104000 <_startup>: + + .global _startup + .func _startup +_startup: + /* Relocate .data section (copy from Flash to RAM) */ + ldr r1, =_etext + 104000: e59f1054 ldr r1, [pc, #84] ; 10405c + ldr r2, =_data + 104004: e59f2054 ldr r2, [pc, #84] ; 104060 + ldr r3, =_edata + 104008: e59f3054 ldr r3, [pc, #84] ; 104064 + +0010400c : +loop_r: cmp r2, r3 + 10400c: e1520003 cmp r2, r3 + ldrlo r0, [r1], #4 + 104010: 34910004 ldrcc r0, [r1], #4 + strlo r0, [r2], #4 + 104014: 34820004 strcc r0, [r2], #4 + blo loop_r + 104018: 3afffffb bcc 10400c + + /* Clear .bss section (Zero init) */ + mov r0, #0 + 10401c: e3a00000 mov r0, #0 + ldr r1, =__bss_start__ + 104020: e59f1040 ldr r1, [pc, #64] ; 104068 + ldr r2, =__bss_end__ + 104024: e59f2040 ldr r2, [pc, #64] ; 10406c + +00104028 : +loop_z: cmp r1, r2 + 104028: e1510002 cmp r1, r2 + strlo r0, [r1], #4 + 10402c: 34810004 strcc r0, [r1], #4 + blo loop_z + 104030: 3afffffc bcc 104028 + + /* initialize FIQ mode registers */ + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + 104034: e321f0d1 msr CPSR_c, #209 ; 0xd1 + ldr r10, =AT91C_BASE_PIOA + 104038: e59fa030 ldr sl, [pc, #48] ; 104070 + ldr r12, =AT91C_BASE_TC0 + 10403c: e59fc030 ldr ip, [pc, #48] ; 104074 + mov r9, #AT91C_TC_SWTRG + 104040: e3a09004 mov r9, #4 + msr CPSR_c, #ARM_MODE_SVC + 104044: e321f013 msr CPSR_c, #19 + + led1on + + /* prepare C function call to main */ + mov r0, #0 /* argc = 0 */ + 104048: e3a00000 mov r0, #0 + ldr lr, =exit + 10404c: e59fe024 ldr lr, [pc, #36] ; 104078 + ldr r10, =main + 104050: e59fa024 ldr sl, [pc, #36] ; 10407c + + bx r10 + 104054: e12fff1a bx sl + +00104058 : + +/* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + .global exit + .func exit +exit: + b . + 104058: eafffffe b 104058 + 10405c: 0010ae44 .word 0x0010ae44 + 104060: 00200028 .word 0x00200028 + 104064: 0020030c .word 0x0020030c + 104068: 0020030c .word 0x0020030c + 10406c: 00203b4c .word 0x00203b4c + 104070: fffff400 .word 0xfffff400 + 104074: fffa0000 .word 0xfffa0000 + 104078: 00104058 .word 0x00104058 + 10407c: 001080dc .word 0x001080dc + +00104080 <_change_bit_be>: + +/* Purpose : Function to change a bit + * Prototype: int change_bit(int bit, void *addr) + */ +ENTRY(_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 104080: e2200018 eor r0, r0, #24 + +00104084 <_change_bit_le>: +ENTRY(_change_bit_le) + bitop eor + 104084: e2002007 and r2, r0, #7 + 104088: e3a03001 mov r3, #1 + 10408c: e1a03213 lsl r3, r3, r2 + 104090: e10fc000 mrs ip, CPSR + 104094: e321f093 msr CPSR_c, #147 ; 0x93 + 104098: e7d121a0 ldrb r2, [r1, r0, lsr #3] + 10409c: e0222003 eor r2, r2, r3 + 1040a0: e7c121a0 strb r2, [r1, r0, lsr #3] + 1040a4: e121f00c msr CPSR_c, ip + 1040a8: e1a0f00e mov pc, lr + +001040ac <_clear_bit_be>: +/* + * Purpose : Function to clear a bit + * Prototype: int clear_bit(int bit, void *addr) + */ +ENTRY(_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 1040ac: e2200018 eor r0, r0, #24 + +001040b0 <_clear_bit_le>: +ENTRY(_clear_bit_le) + bitop bic + 1040b0: e2002007 and r2, r0, #7 + 1040b4: e3a03001 mov r3, #1 + 1040b8: e1a03213 lsl r3, r3, r2 + 1040bc: e10fc000 mrs ip, CPSR + 1040c0: e321f093 msr CPSR_c, #147 ; 0x93 + 1040c4: e7d121a0 ldrb r2, [r1, r0, lsr #3] + 1040c8: e1c22003 bic r2, r2, r3 + 1040cc: e7c121a0 strb r2, [r1, r0, lsr #3] + 1040d0: e121f00c msr CPSR_c, ip + 1040d4: e1a0f00e mov pc, lr + +001040d8 <_set_bit_be>: +/* + * Purpose : Function to set a bit + * Prototype: int set_bit(int bit, void *addr) + */ +ENTRY(_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 1040d8: e2200018 eor r0, r0, #24 + +001040dc <_set_bit_le>: +ENTRY(_set_bit_le) + bitop orr + 1040dc: e2002007 and r2, r0, #7 + 1040e0: e3a03001 mov r3, #1 + 1040e4: e1a03213 lsl r3, r3, r2 + 1040e8: e10fc000 mrs ip, CPSR + 1040ec: e321f093 msr CPSR_c, #147 ; 0x93 + 1040f0: e7d121a0 ldrb r2, [r1, r0, lsr #3] + 1040f4: e1822003 orr r2, r2, r3 + 1040f8: e7c121a0 strb r2, [r1, r0, lsr #3] + 1040fc: e121f00c msr CPSR_c, ip + 104100: e1a0f00e mov pc, lr + +00104104 <_test_and_change_bit_be>: +#include +#include "bitops.h" + .text + +ENTRY(_test_and_change_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 104104: e2200018 eor r0, r0, #24 + +00104108 <_test_and_change_bit_le>: +ENTRY(_test_and_change_bit_le) + testop eor, strb + 104108: e08111a0 add r1, r1, r0, lsr #3 + 10410c: e2003007 and r3, r0, #7 + 104110: e3a00001 mov r0, #1 + 104114: e10fc000 mrs ip, CPSR + 104118: e321f093 msr CPSR_c, #147 ; 0x93 + 10411c: e5d12000 ldrb r2, [r1] + 104120: e1120310 tst r2, r0, lsl r3 + 104124: e0222310 eor r2, r2, r0, lsl r3 + 104128: e5c12000 strb r2, [r1] + 10412c: e121f00c msr CPSR_c, ip + 104130: 03a00000 moveq r0, #0 + 104134: e1a0f00e mov pc, lr + +00104138 <_test_and_clear_bit_be>: +#include +#include "bitops.h" + .text + +ENTRY(_test_and_clear_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 104138: e2200018 eor r0, r0, #24 + +0010413c <_test_and_clear_bit_le>: +ENTRY(_test_and_clear_bit_le) + testop bicne, strneb + 10413c: e08111a0 add r1, r1, r0, lsr #3 + 104140: e2003007 and r3, r0, #7 + 104144: e3a00001 mov r0, #1 + 104148: e10fc000 mrs ip, CPSR + 10414c: e321f093 msr CPSR_c, #147 ; 0x93 + 104150: e5d12000 ldrb r2, [r1] + 104154: e1120310 tst r2, r0, lsl r3 + 104158: 11c22310 bicne r2, r2, r0, lsl r3 + 10415c: 15c12000 strbne r2, [r1] + 104160: e121f00c msr CPSR_c, ip + 104164: 03a00000 moveq r0, #0 + 104168: e1a0f00e mov pc, lr + +0010416c <_test_and_set_bit_be>: +#include +#include "bitops.h" + .text + +ENTRY(_test_and_set_bit_be) + eor r0, r0, #0x18 @ big endian byte ordering + 10416c: e2200018 eor r0, r0, #24 + +00104170 <_test_and_set_bit_le>: +ENTRY(_test_and_set_bit_le) + testop orreq, streqb + 104170: e08111a0 add r1, r1, r0, lsr #3 + 104174: e2003007 and r3, r0, #7 + 104178: e3a00001 mov r0, #1 + 10417c: e10fc000 mrs ip, CPSR + 104180: e321f093 msr CPSR_c, #147 ; 0x93 + 104184: e5d12000 ldrb r2, [r1] + 104188: e1120310 tst r2, r0, lsl r3 + 10418c: 01822310 orreq r2, r2, r0, lsl r3 + 104190: 05c12000 strbeq r2, [r1] + 104194: e121f00c msr CPSR_c, ip + 104198: 03a00000 moveq r0, #0 + 10419c: e1a0f00e mov pc, lr + +001041a0 <__umodsi3>: + mov pc, lr +*/ + +ENTRY(__umodsi3) + + subs r2, r1, #1 @ compare divisor with 1 + 1041a0: e2512001 subs r2, r1, #1 + bcc Ldiv0 + 1041a4: 3a0000a7 bcc 104448 + cmpne r0, r1 @ compare dividend with divisor + 1041a8: 11500001 cmpne r0, r1 + moveq r0, #0 + 1041ac: 03a00000 moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + 1041b0: 81110002 tsthi r1, r2 + andeq r0, r0, r2 + 1041b4: 00000002 andeq r0, r0, r2 + movls pc, lr + 1041b8: 91a0f00e movls pc, lr + clz \spare, \dividend + sub \order, \order, \spare + mov \divisor, \divisor, lsl \order + +#else + + 1041bc: e3a02000 mov r2, #0 + 1041c0: e3510201 cmp r1, #268435456 ; 0x10000000 + 1041c4: 31510000 cmpcc r1, r0 + 1041c8: 31a01201 lslcc r1, r1, #4 + 1041cc: 32822004 addcc r2, r2, #4 + 1041d0: 3afffffa bcc 1041c0 <__umodsi3+0x20> + 1041d4: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 1041d8: 31510000 cmpcc r1, r0 + 1041dc: 31a01081 lslcc r1, r1, #1 + 1041e0: 32822001 addcc r2, r2, #1 + 1041e4: 3afffffa bcc 1041d4 <__umodsi3+0x34> + 1041e8: e2522003 subs r2, r2, #3 + 1041ec: ba00000e blt 10422c <__umodsi3+0x8c> + 1041f0: e1500001 cmp r0, r1 + 1041f4: 20400001 subcs r0, r0, r1 + 1041f8: e15000a1 cmp r0, r1, lsr #1 + 1041fc: 204000a1 subcs r0, r0, r1, lsr #1 + 104200: e1500121 cmp r0, r1, lsr #2 + 104204: 20400121 subcs r0, r0, r1, lsr #2 + 104208: e15001a1 cmp r0, r1, lsr #3 + 10420c: 204001a1 subcs r0, r0, r1, lsr #3 + 104210: e3500001 cmp r0, #1 + 104214: e1a01221 lsr r1, r1, #4 + 104218: a2522004 subsge r2, r2, #4 + 10421c: aafffff3 bge 1041f0 <__umodsi3+0x50> + 104220: e3120003 tst r2, #3 + 104224: 13300000 teqne r0, #0 + 104228: 0a00000a beq 104258 <__umodsi3+0xb8> + 10422c: e3720002 cmn r2, #2 + 104230: ba000006 blt 104250 <__umodsi3+0xb0> + 104234: 0a000002 beq 104244 <__umodsi3+0xa4> + 104238: e1500001 cmp r0, r1 + 10423c: 20400001 subcs r0, r0, r1 + 104240: e1a010a1 lsr r1, r1, #1 + 104244: e1500001 cmp r0, r1 + 104248: 20400001 subcs r0, r0, r1 + 10424c: e1a010a1 lsr r1, r1, #1 + 104250: e1500001 cmp r0, r1 + 104254: 20400001 subcs r0, r0, r1 + andeq r0, r0, r2 + movls pc, lr + + ARM_MOD_BODY r0, r1, r2, r3 + + mov pc, lr + 104258: e1a0f00e mov pc, lr + +0010425c <__aeabi_idiv>: + + +ENTRY(__divsi3) +ENTRY(__aeabi_idiv) + + cmp r1, #0 + 10425c: e3510000 cmp r1, #0 + eor ip, r0, r1 @ save the sign of the result. + 104260: e020c001 eor ip, r0, r1 + beq Ldiv0 + 104264: 0a000077 beq 104448 + rsbmi r1, r1, #0 @ loops below use unsigned. + 104268: 42611000 rsbmi r1, r1, #0 + subs r2, r1, #1 @ division by 1 or -1 ? + 10426c: e2512001 subs r2, r1, #1 + beq 10f + 104270: 0a000027 beq 104314 <__aeabi_idiv+0xb8> + movs r3, r0 + 104274: e1b03000 movs r3, r0 + rsbmi r3, r0, #0 @ positive dividend value + 104278: 42603000 rsbmi r3, r0, #0 + cmp r3, r1 + 10427c: e1530001 cmp r3, r1 + bls 11f + 104280: 9a000026 bls 104320 <__aeabi_idiv+0xc4> + tst r1, r2 @ divisor is power of 2 ? + 104284: e1110002 tst r1, r2 + beq 12f + 104288: 0a000028 beq 104330 <__aeabi_idiv+0xd4> + mov \divisor, \divisor, lsl \result + mov \curbit, \curbit, lsl \result + mov \result, #0 + +#else + + 10428c: e311020e tst r1, #-536870912 ; 0xe0000000 + 104290: 01a01181 lsleq r1, r1, #3 + 104294: 03a02008 moveq r2, #8 + 104298: 13a02001 movne r2, #1 + 10429c: e3510201 cmp r1, #268435456 ; 0x10000000 + 1042a0: 31510003 cmpcc r1, r3 + 1042a4: 31a01201 lslcc r1, r1, #4 + 1042a8: 31a02202 lslcc r2, r2, #4 + 1042ac: 3afffffa bcc 10429c <__aeabi_idiv+0x40> + 1042b0: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 1042b4: 31510003 cmpcc r1, r3 + 1042b8: 31a01081 lslcc r1, r1, #1 + 1042bc: 31a02082 lslcc r2, r2, #1 + 1042c0: 3afffffa bcc 1042b0 <__aeabi_idiv+0x54> + 1042c4: e3a00000 mov r0, #0 + 1042c8: e1530001 cmp r3, r1 + 1042cc: 20433001 subcs r3, r3, r1 + 1042d0: 21800002 orrcs r0, r0, r2 + 1042d4: e15300a1 cmp r3, r1, lsr #1 + 1042d8: 204330a1 subcs r3, r3, r1, lsr #1 + 1042dc: 218000a2 orrcs r0, r0, r2, lsr #1 + 1042e0: e1530121 cmp r3, r1, lsr #2 + 1042e4: 20433121 subcs r3, r3, r1, lsr #2 + 1042e8: 21800122 orrcs r0, r0, r2, lsr #2 + 1042ec: e15301a1 cmp r3, r1, lsr #3 + 1042f0: 204331a1 subcs r3, r3, r1, lsr #3 + 1042f4: 218001a2 orrcs r0, r0, r2, lsr #3 + 1042f8: e3530000 cmp r3, #0 + 1042fc: 11b02222 lsrsne r2, r2, #4 + 104300: 11a01221 lsrne r1, r1, #4 + 104304: 1affffef bne 1042c8 <__aeabi_idiv+0x6c> + tst r1, r2 @ divisor is power of 2 ? + beq 12f + + ARM_DIV_BODY r3, r1, r0, r2 + + cmp ip, #0 + 104308: e35c0000 cmp ip, #0 + rsbmi r0, r0, #0 + 10430c: 42600000 rsbmi r0, r0, #0 + mov pc, lr + 104310: e1a0f00e mov pc, lr + +10: teq ip, r0 @ same sign ? + 104314: e13c0000 teq ip, r0 + rsbmi r0, r0, #0 + 104318: 42600000 rsbmi r0, r0, #0 + mov pc, lr + 10431c: e1a0f00e mov pc, lr + +11: movlo r0, #0 + 104320: 33a00000 movcc r0, #0 + moveq r0, ip, asr #31 + 104324: 01a00fcc asreq r0, ip, #31 + orreq r0, r0, #1 + 104328: 03800001 orreq r0, r0, #1 + mov pc, lr + 10432c: e1a0f00e mov pc, lr + + clz \order, \divisor + rsb \order, \order, #31 + +#else + + 104330: e3510801 cmp r1, #65536 ; 0x10000 + 104334: 21a01821 lsrcs r1, r1, #16 + 104338: 23a02010 movcs r2, #16 + 10433c: 33a02000 movcc r2, #0 + 104340: e3510c01 cmp r1, #256 ; 0x100 + 104344: 21a01421 lsrcs r1, r1, #8 + 104348: 22822008 addcs r2, r2, #8 + 10434c: e3510010 cmp r1, #16 + 104350: 21a01221 lsrcs r1, r1, #4 + 104354: 22822004 addcs r2, r2, #4 + 104358: e3510004 cmp r1, #4 + 10435c: 82822003 addhi r2, r2, #3 + 104360: 908220a1 addls r2, r2, r1, lsr #1 + orreq r0, r0, #1 + mov pc, lr + +12: ARM_DIV2_ORDER r1, r2 + + cmp ip, #0 + 104364: e35c0000 cmp ip, #0 + mov r0, r3, lsr r2 + 104368: e1a00233 lsr r0, r3, r2 + rsbmi r0, r0, #0 + 10436c: 42600000 rsbmi r0, r0, #0 + mov pc, lr + 104370: e1a0f00e mov pc, lr + +00104374 <__modsi3>: + + +ENTRY(__modsi3) + + cmp r1, #0 + 104374: e3510000 cmp r1, #0 + beq Ldiv0 + 104378: 0a000032 beq 104448 + rsbmi r1, r1, #0 @ loops below use unsigned. + 10437c: 42611000 rsbmi r1, r1, #0 + movs ip, r0 @ preserve sign of dividend + 104380: e1b0c000 movs ip, r0 + rsbmi r0, r0, #0 @ if negative make positive + 104384: 42600000 rsbmi r0, r0, #0 + subs r2, r1, #1 @ compare divisor with 1 + 104388: e2512001 subs r2, r1, #1 + cmpne r0, r1 @ compare dividend with divisor + 10438c: 11500001 cmpne r0, r1 + moveq r0, #0 + 104390: 03a00000 moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + 104394: 81110002 tsthi r1, r2 + andeq r0, r0, r2 + 104398: 00000002 andeq r0, r0, r2 + bls 10f + 10439c: 9a000026 bls 10443c <__modsi3+0xc8> + clz \spare, \dividend + sub \order, \order, \spare + mov \divisor, \divisor, lsl \order + +#else + + 1043a0: e3a02000 mov r2, #0 + 1043a4: e3510201 cmp r1, #268435456 ; 0x10000000 + 1043a8: 31510000 cmpcc r1, r0 + 1043ac: 31a01201 lslcc r1, r1, #4 + 1043b0: 32822004 addcc r2, r2, #4 + 1043b4: 3afffffa bcc 1043a4 <__modsi3+0x30> + 1043b8: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 1043bc: 31510000 cmpcc r1, r0 + 1043c0: 31a01081 lslcc r1, r1, #1 + 1043c4: 32822001 addcc r2, r2, #1 + 1043c8: 3afffffa bcc 1043b8 <__modsi3+0x44> + 1043cc: e2522003 subs r2, r2, #3 + 1043d0: ba00000e blt 104410 <__modsi3+0x9c> + 1043d4: e1500001 cmp r0, r1 + 1043d8: 20400001 subcs r0, r0, r1 + 1043dc: e15000a1 cmp r0, r1, lsr #1 + 1043e0: 204000a1 subcs r0, r0, r1, lsr #1 + 1043e4: e1500121 cmp r0, r1, lsr #2 + 1043e8: 20400121 subcs r0, r0, r1, lsr #2 + 1043ec: e15001a1 cmp r0, r1, lsr #3 + 1043f0: 204001a1 subcs r0, r0, r1, lsr #3 + 1043f4: e3500001 cmp r0, #1 + 1043f8: e1a01221 lsr r1, r1, #4 + 1043fc: a2522004 subsge r2, r2, #4 + 104400: aafffff3 bge 1043d4 <__modsi3+0x60> + 104404: e3120003 tst r2, #3 + 104408: 13300000 teqne r0, #0 + 10440c: 0a00000a beq 10443c <__modsi3+0xc8> + 104410: e3720002 cmn r2, #2 + 104414: ba000006 blt 104434 <__modsi3+0xc0> + 104418: 0a000002 beq 104428 <__modsi3+0xb4> + 10441c: e1500001 cmp r0, r1 + 104420: 20400001 subcs r0, r0, r1 + 104424: e1a010a1 lsr r1, r1, #1 + 104428: e1500001 cmp r0, r1 + 10442c: 20400001 subcs r0, r0, r1 + 104430: e1a010a1 lsr r1, r1, #1 + 104434: e1500001 cmp r0, r1 + 104438: 20400001 subcs r0, r0, r1 + andeq r0, r0, r2 + bls 10f + + ARM_MOD_BODY r0, r1, r2, r3 + +10: cmp ip, #0 + 10443c: e35c0000 cmp ip, #0 + rsbmi r0, r0, #0 + 104440: 42600000 rsbmi r0, r0, #0 + mov pc, lr + 104444: e1a0f00e mov pc, lr + +00104448 : + +#endif + +Ldiv0: + + str lr, [sp, #-8]! + 104448: e52de008 str lr, [sp, #-8]! + bl __div0 + 10444c: eb000001 bl 104458 <__div0> + mov r0, #0 @ About as wrong as it could be. + 104450: e3a00000 mov r0, #0 + ldr pc, [sp], #8 + 104454: e49df008 ldr pc, [sp], #8 + +00104458 <__div0>: + +ENTRY(__div0) + mov pc, lr + 104458: e1a0f00e mov pc, lr + +0010445c <__do_div64>: + */ + +ENTRY(__do_div64) + + @ Test for easy paths first. + subs ip, r4, #1 + 10445c: e254c001 subs ip, r4, #1 + bls 9f @ divisor is 0 or 1 + 104460: 9a00003f bls 104564 <__do_div64+0x108> + tst ip, r4 + 104464: e11c0004 tst ip, r4 + beq 8f @ divisor is power of 2 + 104468: 0a000028 beq 104510 <__do_div64+0xb4> + + @ See if we need to handle upper 32-bit result. + cmp xh, r4 + 10446c: e1510004 cmp r1, r4 + mov yh, #0 + 104470: e3a03000 mov r3, #0 + blo 3f + 104474: 3a00000c bcc 1044ac <__do_div64+0x50> + mov ip, ip, lsl yl + mov yl, r4, lsl yl + +#else + + mov yl, r4 + 104478: e1a02004 mov r2, r4 + mov ip, #1 + 10447c: e3a0c001 mov ip, #1 +1: cmp yl, #0x80000000 + 104480: e3520102 cmp r2, #-2147483648 ; 0x80000000 + cmpcc yl, xh + 104484: 31520001 cmpcc r2, r1 + movcc yl, yl, lsl #1 + 104488: 31a02082 lslcc r2, r2, #1 + movcc ip, ip, lsl #1 + 10448c: 31a0c08c lslcc ip, ip, #1 + bcc 1b + 104490: 3afffffa bcc 104480 <__do_div64+0x24> + +#endif + + @ The division loop for needed upper bit positions. + @ Break out early if dividend reaches 0. +2: cmp xh, yl + 104494: e1510002 cmp r1, r2 + orrcs yh, yh, ip + 104498: 2183300c orrcs r3, r3, ip + subcss xh, xh, yl + 10449c: 20511002 subscs r1, r1, r2 + movnes ip, ip, lsr #1 + 1044a0: 11b0c0ac lsrsne ip, ip, #1 + mov yl, yl, lsr #1 + 1044a4: e1a020a2 lsr r2, r2, #1 + bne 2b + 1044a8: 1afffff9 bne 104494 <__do_div64+0x38> + + @ See if we need to handle lower 32-bit result. +3: cmp xh, #0 + 1044ac: e3510000 cmp r1, #0 + mov yl, #0 + 1044b0: e3a02000 mov r2, #0 + cmpeq xl, r4 + 1044b4: 01500004 cmpeq r0, r4 + movlo xh, xl + 1044b8: 31a01000 movcc r1, r0 + movlo pc, lr + 1044bc: 31a0f00e movcc pc, lr + + @ The division loop for lower bit positions. + @ Here we shift remainer bits leftwards rather than moving the + @ divisor for comparisons, considering the carry-out bit as well. + mov ip, #0x80000000 + 1044c0: e3a0c102 mov ip, #-2147483648 ; 0x80000000 +4: movs xl, xl, lsl #1 + 1044c4: e1b00080 lsls r0, r0, #1 + adcs xh, xh, xh + 1044c8: e0b11001 adcs r1, r1, r1 + beq 6f + 1044cc: 0a000005 beq 1044e8 <__do_div64+0x8c> + cmpcc xh, r4 + 1044d0: 31510004 cmpcc r1, r4 +5: orrcs yl, yl, ip + 1044d4: 2182200c orrcs r2, r2, ip + subcs xh, xh, r4 + 1044d8: 20411004 subcs r1, r1, r4 + movs ip, ip, lsr #1 + 1044dc: e1b0c0ac lsrs ip, ip, #1 + bne 4b + 1044e0: 1afffff7 bne 1044c4 <__do_div64+0x68> + mov pc, lr + 1044e4: e1a0f00e mov pc, lr + + @ The top part of remainder became zero. If carry is set + @ (the 33th bit) this is a false positive so resume the loop. + @ Otherwise, if lower part is also null then we are done. +6: bcs 5b + 1044e8: 2afffff9 bcs 1044d4 <__do_div64+0x78> + cmp xl, #0 + 1044ec: e3500000 cmp r0, #0 + moveq pc, lr + 1044f0: 01a0f00e moveq pc, lr + mov xl, xl, lsl xh + mov ip, ip, lsr xh + +#else + +7: movs xl, xl, lsl #1 + 1044f4: e1b00080 lsls r0, r0, #1 + mov ip, ip, lsr #1 + 1044f8: e1a0c0ac lsr ip, ip, #1 + bcc 7b + 1044fc: 3afffffc bcc 1044f4 <__do_div64+0x98> + + @ Current remainder is now 1. It is worthless to compare with + @ divisor at this point since divisor can not be smaller than 3 here. + @ If possible, branch for another shift in the division loop. + @ If no bit position left then we are done. + movs ip, ip, lsr #1 + 104500: e1b0c0ac lsrs ip, ip, #1 + mov xh, #1 + 104504: e3a01001 mov r1, #1 + bne 4b + 104508: 1affffed bne 1044c4 <__do_div64+0x68> + mov pc, lr + 10450c: e1a0f00e mov pc, lr + clz ip, r4 + rsb ip, ip, #31 + +#else + + mov yl, r4 + 104510: e1a02004 mov r2, r4 + cmp r4, #(1 << 16) + 104514: e3540801 cmp r4, #65536 ; 0x10000 + mov ip, #0 + 104518: e3a0c000 mov ip, #0 + movhs yl, yl, lsr #16 + 10451c: 21a02822 lsrcs r2, r2, #16 + movhs ip, #16 + 104520: 23a0c010 movcs ip, #16 + + cmp yl, #(1 << 8) + 104524: e3520c01 cmp r2, #256 ; 0x100 + movhs yl, yl, lsr #8 + 104528: 21a02422 lsrcs r2, r2, #8 + addhs ip, ip, #8 + 10452c: 228cc008 addcs ip, ip, #8 + + cmp yl, #(1 << 4) + 104530: e3520010 cmp r2, #16 + movhs yl, yl, lsr #4 + 104534: 21a02222 lsrcs r2, r2, #4 + addhs ip, ip, #4 + 104538: 228cc004 addcs ip, ip, #4 + + cmp yl, #(1 << 2) + 10453c: e3520004 cmp r2, #4 + addhi ip, ip, #3 + 104540: 828cc003 addhi ip, ip, #3 + addls ip, ip, yl, lsr #1 + 104544: 908cc0a2 addls ip, ip, r2, lsr #1 + +#endif + + mov yh, xh, lsr ip + 104548: e1a03c31 lsr r3, r1, ip + mov yl, xl, lsr ip + 10454c: e1a02c30 lsr r2, r0, ip + rsb ip, ip, #32 + 104550: e26cc020 rsb ip, ip, #32 + orr yl, yl, xh, lsl ip + 104554: e1822c11 orr r2, r2, r1, lsl ip + mov xh, xl, lsl ip + 104558: e1a01c10 lsl r1, r0, ip + mov xh, xh, lsr ip + 10455c: e1a01c31 lsr r1, r1, ip + mov pc, lr + 104560: e1a0f00e mov pc, lr + + @ eq -> division by 1: obvious enough... +9: moveq yl, xl + 104564: 01a02000 moveq r2, r0 + moveq yh, xh + 104568: 01a03001 moveq r3, r1 + moveq xh, #0 + 10456c: 03a01000 moveq r1, #0 + moveq pc, lr + 104570: 01a0f00e moveq pc, lr + + @ Division by 0: + str lr, [sp, #-8]! + 104574: e52de008 str lr, [sp, #-8]! + bl __div0 + 104578: ebffffb6 bl 104458 <__div0> + + @ as wrong as it could be... + mov yl, #0 + 10457c: e3a02000 mov r2, #0 + mov yh, #0 + 104580: e3a03000 mov r3, #0 + mov xh, #0 + 104584: e3a01000 mov r1, #0 + ldr pc, [sp], #8 + 104588: e49df008 ldr pc, [sp], #8 + +0010458c : + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id, // \arg interrupt number to initialize + unsigned int priority, // \arg priority to give to the interrupt + unsigned int src_type, // \arg activation and sense of activation + void (*newHandler) () ) // \arg address of the interrupt handler +{ + 10458c: e92d0030 push {r4, r5} + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + + mask = 0x1 << irq_id ; + 104590: e3a04001 mov r4, #1 + 104594: e1a04114 lsl r4, r4, r1 + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 104598: e1833002 orr r3, r3, r2 + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 10459c: e59d2008 ldr r2, [sp, #8] + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id, // \arg interrupt number to initialize + unsigned int priority, // \arg priority to give to the interrupt + unsigned int src_type, // \arg activation and sense of activation + void (*newHandler) () ) // \arg address of the interrupt handler +{ + 1045a0: e1a0c000 mov ip, r0 + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + 1045a4: e2815020 add r5, r1, #32 + 1045a8: e7900105 ldr r0, [r0, r5, lsl #2] + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 1045ac: e58c4124 str r4, [ip, #292] ; 0x124 + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 1045b0: e78c2105 str r2, [ip, r5, lsl #2] + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 1045b4: e78c3101 str r3, [ip, r1, lsl #2] + //* Clear the interrupt on the interrupt controller + pAic->AIC_ICCR = mask ; + 1045b8: e58c4128 str r4, [ip, #296] ; 0x128 + + return oldHandler; +} + 1045bc: e8bd0030 pop {r4, r5} + 1045c0: e12fff1e bx lr + +001045c4 : + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 1045c4: e59f2028 ldr r2, [pc, #40] ; 1045f4 +//* \brief Configure vector handler +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + 1045c8: e1a03000 mov r3, r0 + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 1045cc: e1510002 cmp r1, r2 + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 1045d0: 10632001 rsbne r2, r3, r1 + 1045d4: 12422008 subne r2, r2, #8 + 1045d8: 11a02122 lsrne r2, r2, #2 + 1045dc: 13c224ff bicne r2, r2, #-16777216 ; 0xff000000 + 1045e0: 138224ea orrne r2, r2, #-369098752 ; 0xea000000 +//*---------------------------------------------------------------------------- +unsigned int AT91F_AIC_SetExceptionVector ( + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + 1045e4: e5900000 ldr r0, [r0] + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + 1045e8: 05831000 streq r1, [r3] + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 1045ec: 15832000 strne r2, [r3] + + return oldVector; +} + 1045f0: e12fff1e bx lr + 1045f4: e51fff20 .word 0xe51fff20 + +001045f8 : + void (*IrqHandler) (), // \arg Default IRQ vector exception + void (*FiqHandler) (), // \arg Default FIQ vector exception + void (*DefaultHandler) (), // \arg Default Handler set in ISR + void (*SpuriousHandler) (), // \arg Default Spurious Handler + unsigned int protectMode) // \arg Debug Control Register +{ + 1045f8: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl} + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 1045fc: e3a0c000 mov ip, #0 +//*---------------------------------------------------------------------------- +static inline void AT91F_AIC_DisableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + 104600: e3a09001 mov r9, #1 + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 104604: e3a0a040 mov sl, #64 ; 0x40 + 104608: e1a05c19 lsl r5, r9, ip + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 10460c: e28c6001 add r6, ip, #1 + 104610: e1a04619 lsl r4, r9, r6 + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 104614: e5805124 str r5, [r0, #292] ; 0x124 + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; + 104618: e5805128 str r5, [r0, #296] ; 0x128 + void (*newHandler) () ) // \arg address of the interrupt handler +{ + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + 10461c: e28c8020 add r8, ip, #32 + 104620: e7907108 ldr r7, [r0, r8, lsl #2] + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 104624: e5805124 str r5, [r0, #292] ; 0x124 + void (*newHandler) () ) // \arg address of the interrupt handler +{ + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + 104628: e28c7021 add r7, ip, #33 ; 0x21 + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 10462c: e7803108 str r3, [r0, r8, lsl #2] + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 104630: e780a10c str sl, [r0, ip, lsl #2] + //* Clear the interrupt on the interrupt controller + pAic->AIC_ICCR = mask ; + 104634: e5805128 str r5, [r0, #296] ; 0x128 + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 104638: e28cc002 add ip, ip, #2 + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 10463c: e5804124 str r4, [r0, #292] ; 0x124 + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; + 104640: e5804128 str r4, [r0, #296] ; 0x128 + 104644: e35c0020 cmp ip, #32 + void (*newHandler) () ) // \arg address of the interrupt handler +{ + unsigned int oldHandler; + unsigned int mask ; + + oldHandler = pAic->AIC_SVR[irq_id]; + 104648: e7905107 ldr r5, [r0, r7, lsl #2] + + mask = 0x1 << irq_id ; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 10464c: e5804124 str r4, [r0, #292] ; 0x124 + //* Save the interrupt handler routine pointer and the interrupt priority + pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; + 104650: e7803107 str r3, [r0, r7, lsl #2] + //* Store the Source Mode Register + pAic->AIC_SMR[irq_id] = src_type | priority ; + 104654: e780a106 str sl, [r0, r6, lsl #2] + //* Clear the interrupt on the interrupt controller + pAic->AIC_ICCR = mask ; + 104658: e5804128 str r4, [r0, #296] ; 0x128 + unsigned int protectMode) // \arg Debug Control Register +{ + int i; + + // Disable all interrupts and set IVR to the default handler + for (i = 0; i < 32; ++i) { + 10465c: 1affffe9 bne 104608 + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 104660: e59f3050 ldr r3, [pc, #80] ; 1046b8 + 104664: e1510003 cmp r1, r3 + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 104668: 12411020 subne r1, r1, #32 + 10466c: 11a01121 lsrne r1, r1, #2 + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 104670: e59f3040 ldr r3, [pc, #64] ; 1046b8 + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 104674: 13c114ff bicne r1, r1, #-16777216 ; 0xff000000 + 104678: 138114ea orrne r1, r1, #-369098752 ; 0xea000000 + unsigned int *pVector, // \arg pointer to the AIC registers + void (*Handler) () ) // \arg Interrupt Handler +{ + unsigned int oldVector = *pVector; + + if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) + 10467c: e1520003 cmp r2, r3 + *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; + else + *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; + 104680: 12422024 subne r2, r2, #36 ; 0x24 + 104684: 11a02122 lsrne r2, r2, #2 + 104688: e3a0c000 mov ip, #0 + 10468c: 13c224ff bicne r2, r2, #-16777216 ; 0xff000000 + 104690: e58c1018 str r1, [ip, #24] + 104694: 138224ea orrne r2, r2, #-369098752 ; 0xea000000 + 104698: e3a0c000 mov ip, #0 + 10469c: e58c201c str r2, [ip, #28] + // Set the IRQ exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); + // Set the Fast Interrupt exception vector + AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); + + pAic->AIC_SPU = (unsigned int) SpuriousHandler; + 1046a0: e28d101c add r1, sp, #28 + 1046a4: e891000a ldm r1, {r1, r3} + 1046a8: e5801134 str r1, [r0, #308] ; 0x134 + pAic->AIC_DCR = protectMode; + 1046ac: e5803138 str r3, [r0, #312] ; 0x138 +} + 1046b0: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl} + 1046b4: e12fff1e bx lr + 1046b8: e51fff20 .word 0xe51fff20 + +001046bc : +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 1046bc: e3a03002 mov r3, #2 + 1046c0: e5803020 str r3, [r0, #32] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 1046c4: e3a0c000 mov ip, #0 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 1046c8: e3a02c02 mov r2, #512 ; 0x200 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 1046cc: e3a01001 mov r1, #1 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 1046d0: e3a03c01 mov r3, #256 ; 0x100 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 1046d4: e5802020 str r2, [r0, #32] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 1046d8: e580c018 str ip, [r0, #24] + pPDC->PDC_TNCR = bytes; + 1046dc: e580c01c str ip, [r0, #28] +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 1046e0: e580c010 str ip, [r0, #16] + pPDC->PDC_RNCR = bytes; + 1046e4: e580c014 str ip, [r0, #20] +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 1046e8: e580c008 str ip, [r0, #8] + pPDC->PDC_TCR = bytes; + 1046ec: e580c00c str ip, [r0, #12] +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 1046f0: e580c000 str ip, [r0] + pPDC->PDC_RCR = bytes; + 1046f4: e580c004 str ip, [r0, #4] +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 1046f8: e5801020 str r1, [r0, #32] +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 1046fc: e5803020 str r3, [r0, #32] + AT91F_PDC_SetRx(pPDC, NULL, 0); + + //* Enable the RX and TX PDC transfer requests + AT91F_PDC_EnableRx(pPDC); + AT91F_PDC_EnableTx(pPDC); +} + 104700: e12fff1e bx lr + +00104704 : +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104704: e3a03000 mov r3, #0 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104708: e3a01002 mov r1, #2 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 10470c: e3a02c02 mov r2, #512 ; 0x200 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104710: e5801020 str r1, [r0, #32] +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104714: e5802020 str r2, [r0, #32] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104718: e5803018 str r3, [r0, #24] + pPDC->PDC_TNCR = bytes; + 10471c: e580301c str r3, [r0, #28] +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 104720: e5803010 str r3, [r0, #16] + pPDC->PDC_RNCR = bytes; + 104724: e5803014 str r3, [r0, #20] +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 104728: e5803008 str r3, [r0, #8] + pPDC->PDC_TCR = bytes; + 10472c: e580300c str r3, [r0, #12] +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 104730: e5803000 str r3, [r0] + pPDC->PDC_RCR = bytes; + 104734: e5803004 str r3, [r0, #4] + AT91F_PDC_SetNextTx(pPDC, NULL, 0); + AT91F_PDC_SetNextRx(pPDC, NULL, 0); + AT91F_PDC_SetTx(pPDC, NULL, 0); + AT91F_PDC_SetRx(pPDC, NULL, 0); + +} + 104738: e12fff1e bx lr + +0010473c : +//* \brief Test if the current transfer descriptor has been sent +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TCR); + 10473c: e590c00c ldr ip, [r0, #12] + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + if (AT91F_PDC_IsTxEmpty(pPDC)) { + 104740: e35c0000 cmp ip, #0 + 104744: 1a000007 bne 104768 +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 104748: e5801008 str r1, [r0, #8] + pPDC->PDC_TCR = bytes; + 10474c: e580200c str r2, [r0, #12] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104750: e5803018 str r3, [r0, #24] + pPDC->PDC_TNCR = bytes; + 104754: e59d3000 ldr r3, [sp] + //* Buffer and next buffer can be initialized + AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + return 2; + 104758: e3a01002 mov r1, #2 + 10475c: e580301c str r3, [r0, #28] + } + else { + //* All buffer are in use... + return 0; + } +} + 104760: e1a00001 mov r0, r1 + 104764: e12fff1e bx lr +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_TNCR); + 104768: e590c01c ldr ip, [r0, #28] + //* Buffer and next buffer can be initialized + AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + 10476c: e35c0000 cmp ip, #0 +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104770: 05801018 streq r1, [r0, #24] + AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + 104774: 13a01000 movne r1, #0 + return 2; + } + else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { + //* Only one buffer can be initialized + AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); + return 1; + 104778: 03a01001 moveq r1, #1 + pPDC->PDC_TNCR = bytes; + 10477c: 0580201c streq r2, [r0, #28] + } + else { + //* All buffer are in use... + return 0; + } +} + 104780: e1a00001 mov r0, r1 + 104784: e12fff1e bx lr + +00104788 : +//* \brief Test if the current transfer descriptor has been filled +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RCR); + 104788: e590c004 ldr ip, [r0, #4] + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + if (AT91F_PDC_IsRxEmpty(pPDC)) { + 10478c: e35c0000 cmp ip, #0 + 104790: 1a000007 bne 1047b4 +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 104794: e5801000 str r1, [r0] + pPDC->PDC_RCR = bytes; + 104798: e5802004 str r2, [r0, #4] +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 10479c: e5803010 str r3, [r0, #16] + pPDC->PDC_RNCR = bytes; + 1047a0: e59d3000 ldr r3, [sp] + //* Buffer and next buffer can be initialized + AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + return 2; + 1047a4: e3a01002 mov r1, #2 + 1047a8: e5803014 str r3, [r0, #20] + } + else { + //* All buffer are in use... + return 0; + } +} + 1047ac: e1a00001 mov r0, r1 + 1047b0: e12fff1e bx lr +//* \brief Test if the next transfer descriptor has been moved to the current td +//*---------------------------------------------------------------------------- +static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + return !(pPDC->PDC_RNCR); + 1047b4: e590c014 ldr ip, [r0, #20] + //* Buffer and next buffer can be initialized + AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); + AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); + return 2; + } + else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + 1047b8: e35c0000 cmp ip, #0 +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 1047bc: 05801010 streq r1, [r0, #16] + AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + return 1; + } + else { + //* All buffer are in use... + return 0; + 1047c0: 13a01000 movne r1, #0 + return 2; + } + else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { + //* Only one buffer can be initialized + AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); + return 1; + 1047c4: 03a01001 moveq r1, #1 + pPDC->PDC_RNCR = bytes; + 1047c8: 05802014 streq r2, [r0, #20] + } + else { + //* All buffer are in use... + return 0; + } +} + 1047cc: e1a00001 mov r0, r1 + 1047d0: e12fff1e bx lr + +001047d4 : +//*------------------------------------------------------------------------------ +unsigned int AT91F_PMC_GetMasterClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + 1047d4: e92d4038 push {r3, r4, r5, lr} + unsigned int reg = pPMC->PMC_MCKR; + 1047d8: e5903030 ldr r3, [r0, #48] ; 0x30 + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 1047dc: e203401c and r4, r3, #28 + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 1047e0: e2033003 and r3, r3, #3 + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 1047e4: e1a0c124 lsr ip, r4, #2 + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 1047e8: e3530001 cmp r3, #1 + AT91PS_PMC pPMC, // \arg pointer to PMC controller + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + 1047ec: e3a04001 mov r4, #1 + 1047f0: e1a04c14 lsl r4, r4, ip + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 1047f4: 0a000017 beq 104858 + 1047f8: 3a000012 bcc 104848 + 1047fc: e3530003 cmp r3, #3 + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + } + return 0; + 104800: 13a00000 movne r0, #0 +{ + unsigned int reg = pPMC->PMC_MCKR; + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + 104804: 1a00000d bne 104840 + case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + return slowClock / prescaler; + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + 104808: e591500c ldr r5, [r1, #12] +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_CKGR_GetMainClock ( + AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + unsigned int slowClock) // \arg slowClock in Hz +{ + return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; + 10480c: e591e004 ldr lr, [r1, #4] + 104810: e1a0180e lsl r1, lr, #16 + 104814: e1a00821 lsr r0, r1, #16 + 104818: e0020290 mul r2, r0, r2 + pllDivider = (reg & AT91C_CKGR_DIV); + 10481c: e20510ff and r1, r5, #255 ; 0xff + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 104820: e1a00222 lsr r0, r2, #4 + 104824: eb001700 bl 10a42c <__aeabi_uidiv> + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected + reg = pCKGR->CKGR_PLLR; + pllDivider = (reg & AT91C_CKGR_DIV); + pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; + 104828: e59f3048 ldr r3, [pc, #72] ; 104878 + 10482c: e005c003 and ip, r5, r3 + 104830: e1a0282c lsr r2, ip, #16 + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; + 104834: e0200092 mla r0, r2, r0, r0 + 104838: e1a01004 mov r1, r4 + 10483c: eb0016fa bl 10a42c <__aeabi_uidiv> + } + return 0; +} + 104840: e8bd4038 pop {r3, r4, r5, lr} + 104844: e12fff1e bx lr + unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); + unsigned int pllDivider, pllMultiplier; + + switch (reg & AT91C_PMC_CSS) { + case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected + return slowClock / prescaler; + 104848: e1a00002 mov r0, r2 + 10484c: e1a01004 mov r1, r4 + 104850: eb0016f5 bl 10a42c <__aeabi_uidiv> + 104854: eafffff9 b 104840 + 104858: e591e004 ldr lr, [r1, #4] + 10485c: e1a0180e lsl r1, lr, #16 + 104860: e1a00821 lsr r0, r1, #16 + 104864: e0020290 mul r2, r0, r2 + case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected + return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; + 104868: e1a01004 mov r1, r4 + 10486c: e1a00222 lsr r0, r2, #4 + 104870: eb0016ed bl 10a42c <__aeabi_uidiv> + 104874: eafffff1 b 104840 + 104878: 07ff0000 .word 0x07ff0000 + +0010487c : +//*-------------------------------------------------------------------------------------- +//* \fn AT91F_RTT_ReadValue() +//* \brief Read the RTT value +//*-------------------------------------------------------------------------------------- +unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC) +{ + 10487c: e24dd008 sub sp, sp, #8 + register volatile unsigned int val1,val2; + do + { + val1 = pRTTC->RTTC_RTVR; + 104880: e590c008 ldr ip, [r0, #8] + 104884: e58dc004 str ip, [sp, #4] + val2 = pRTTC->RTTC_RTVR; + 104888: e5901008 ldr r1, [r0, #8] + 10488c: e58d1000 str r1, [sp] + } + while(val1 != val2); + 104890: e59d2004 ldr r2, [sp, #4] + 104894: e59d3000 ldr r3, [sp] + 104898: e1520003 cmp r2, r3 + 10489c: 1afffff7 bne 104880 + return(val1); + 1048a0: e59d0004 ldr r0, [sp, #4] +} + 1048a4: e28dd008 add sp, sp, #8 + 1048a8: e12fff1e bx lr + +001048ac : +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + //* Reset all the Chip Select register + pSPI->SPI_CSR[0] = 0 ; + 1048ac: e3a03000 mov r3, #0 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 1048b0: e3a01002 mov r1, #2 + + //* Reset the SPI mode + pSPI->SPI_MR = 0 ; + + //* Disable all interrupts + pSPI->SPI_IDR = 0xFFFFFFFF ; + 1048b4: e3e02000 mvn r2, #0 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 1048b8: e3a0cc02 mov ip, #512 ; 0x200 +//* \brief Close SPI: disable IT disable transfert, close PDC +//*---------------------------------------------------------------------------- +void AT91F_SPI_Close(AT91PS_SPI pSPI) // \arg pointer to a SPI controller +{ + //* Reset all the Chip Select register + pSPI->SPI_CSR[0] = 0 ; + 1048bc: e5803030 str r3, [r0, #48] ; 0x30 + pSPI->SPI_CSR[1] = 0 ; + 1048c0: e5803034 str r3, [r0, #52] ; 0x34 + pSPI->SPI_CSR[2] = 0 ; + 1048c4: e5803038 str r3, [r0, #56] ; 0x38 + pSPI->SPI_CSR[3] = 0 ; + 1048c8: e580303c str r3, [r0, #60] ; 0x3c + + //* Reset the SPI mode + pSPI->SPI_MR = 0 ; + 1048cc: e5803004 str r3, [r0, #4] + + //* Disable all interrupts + pSPI->SPI_IDR = 0xFFFFFFFF ; + 1048d0: e5802018 str r2, [r0, #24] +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 1048d4: e5801120 str r1, [r0, #288] ; 0x120 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 1048d8: e580c120 str ip, [r0, #288] ; 0x120 +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 1048dc: e5803118 str r3, [r0, #280] ; 0x118 + pPDC->PDC_TNCR = bytes; + 1048e0: e580311c str r3, [r0, #284] ; 0x11c +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 1048e4: e5803110 str r3, [r0, #272] ; 0x110 + pPDC->PDC_RNCR = bytes; + 1048e8: e5803114 str r3, [r0, #276] ; 0x114 +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 1048ec: e5803108 str r3, [r0, #264] ; 0x108 + pPDC->PDC_TCR = bytes; + 1048f0: e580310c str r3, [r0, #268] ; 0x10c +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 1048f4: e5803100 str r3, [r0, #256] ; 0x100 + pPDC->PDC_RCR = bytes; + 1048f8: e5803104 str r3, [r0, #260] ; 0x104 + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); + + //* Disable receiver and transmitter and stop any activity immediately + pSPI->SPI_CR = AT91C_SPI_SPIDIS; + 1048fc: e5801000 str r1, [r0] +} + 104900: e12fff1e bx lr + +00104904 : + unsigned int sample_and_hold_time) // in ns +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + 104904: e00c0392 mul ip, r2, r3 + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + 104908: e92d4070 push {r4, r5, r6, lr} + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + 10490c: e1a051ac lsr r5, ip, #3 + 104910: e2456001 sub r6, r5, #1 + shtim = adc_clock*sample_and_hold_time/1000 - 1; + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 104914: e1a0e806 lsl lr, r6, #16 + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + 104918: e1a05000 mov r5, r0 + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + 10491c: e1a00001 mov r0, r1 + 104920: e1a01082 lsl r1, r2, #1 + AT91PS_ADC pADC, // pointer to a ADC controller + unsigned int mck_clock, // in MHz + unsigned int adc_clock, // in MHz + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + 104924: e1a04002 mov r4, r2 + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 104928: e20e681f and r6, lr, #2031616 ; 0x1f0000 + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + 10492c: eb0016be bl 10a42c <__aeabi_uidiv> + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + 104930: e59d1010 ldr r1, [sp, #16] + 104934: e0040491 mul r4, r1, r4 + 104938: e59f3030 ldr r3, [pc, #48] ; 104970 + 10493c: e0842493 umull r2, r4, r3, r4 + unsigned int startup_time, // in us + unsigned int sample_and_hold_time) // in ns +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + 104940: e240c001 sub ip, r0, #1 + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + 104944: e1a02324 lsr r2, r4, #6 + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 104948: e1a0140c lsl r1, ip, #8 +{ + unsigned int prescal,startup,shtim; + + prescal = mck_clock/(2*adc_clock) - 1; + startup = adc_clock*startup_time/8 - 1; + shtim = adc_clock*sample_and_hold_time/1000 - 1; + 10494c: e2420001 sub r0, r2, #1 + + //* Write to the MR register + pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); + 104950: e2013c3f and r3, r1, #16128 ; 0x3f00 + 104954: e1a04c00 lsl r4, r0, #24 + 104958: e1866003 orr r6, r6, r3 + 10495c: e204440f and r4, r4, #251658240 ; 0xf000000 + 104960: e1866004 orr r6, r6, r4 + 104964: e5856004 str r6, [r5, #4] +} + 104968: e8bd4070 pop {r4, r5, r6, lr} + 10496c: e12fff1e bx lr + 104970: 10624dd3 .word 0x10624dd3 + +00104974 : + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 104974: e3520000 cmp r2, #0 +//*---------------------------------------------------------------------------- +void AT91F_SSC_SetBaudrate ( + AT91PS_SSC pSSC, // \arg pointer to a SSC controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + 104978: e92d4010 push {r4, lr} + 10497c: e1a04000 mov r4, r0 + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 104980: 0a00000a beq 1049b0 + baud_value = 0; + else + { + baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 104984: e0811101 add r1, r1, r1, lsl #2 + 104988: e1a00081 lsl r0, r1, #1 + 10498c: e1a01082 lsl r1, r2, #1 + 104990: eb0016a5 bl 10a42c <__aeabi_uidiv> + if ((baud_value % 10) >= 5) + 104994: e59f2020 ldr r2, [pc, #32] ; 1049bc + 104998: e0823290 umull r3, r2, r0, r2 + 10499c: e1a021a2 lsr r2, r2, #3 + 1049a0: e0823102 add r3, r2, r2, lsl #2 + 1049a4: e0400083 sub r0, r0, r3, lsl #1 + 1049a8: e3500004 cmp r0, #4 + baud_value = (baud_value / 10) + 1; + 1049ac: 82822001 addhi r2, r2, #1 + else + baud_value /= 10; + } + + pSSC->SSC_CMR = baud_value; + 1049b0: e5842004 str r2, [r4, #4] +} + 1049b4: e8bd4010 pop {r4, lr} + 1049b8: e12fff1e bx lr + 1049bc: cccccccd .word 0xcccccccd + +001049c0 : + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + 1049c0: e92d4038 push {r3, r4, r5, lr} + 1049c4: e1a05003 mov r5, r3 + //* Disable interrupts + pSSC->SSC_IDR = (unsigned int) -1; + + //* Reset receiver and transmitter + pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + 1049c8: e59f30ac ldr r3, [pc, #172] ; 104a7c + unsigned int baud_rate, // \arg Expected Baud Rate Frequency + unsigned int clock_rx, // \arg Receiver Clock Parameters + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + 1049cc: e1a04000 mov r4, r0 + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 1049d0: e3520000 cmp r2, #0 + unsigned int mode_rx, // \arg mode Register to be programmed + unsigned int clock_tx, // \arg Transmitter Clock Parameters + unsigned int mode_tx) // \arg mode Register to be programmed +{ + //* Disable interrupts + pSSC->SSC_IDR = (unsigned int) -1; + 1049d4: e3e00000 mvn r0, #0 + 1049d8: e5840048 str r0, [r4, #72] ; 0x48 + + //* Reset receiver and transmitter + pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; + 1049dc: e5843000 str r3, [r4] + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg SSC baudrate +{ + unsigned int baud_value; + //* Define the baud rate divisor register + if (speed == 0) + 1049e0: 0a00000a beq 104a10 + baud_value = 0; + else + { + baud_value = (unsigned int) (mainClock * 10)/(2*speed); + 1049e4: e081e101 add lr, r1, r1, lsl #2 + 1049e8: e1a0008e lsl r0, lr, #1 + 1049ec: e1a01082 lsl r1, r2, #1 + 1049f0: eb00168d bl 10a42c <__aeabi_uidiv> + if ((baud_value % 10) >= 5) + 1049f4: e59f2084 ldr r2, [pc, #132] ; 104a80 + 1049f8: e0823290 umull r3, r2, r0, r2 + 1049fc: e1a021a2 lsr r2, r2, #3 + 104a00: e082c102 add ip, r2, r2, lsl #2 + 104a04: e040108c sub r1, r0, ip, lsl #1 + 104a08: e3510004 cmp r1, #4 + baud_value = (baud_value / 10) + 1; + 104a0c: 82822001 addhi r2, r2, #1 + + //* Write the Receive Clock Mode Register + pSSC->SSC_RCMR = clock_rx; + + //* Write the Transmit Clock Mode Register + pSSC->SSC_TCMR = clock_tx; + 104a10: e28d0010 add r0, sp, #16 + 104a14: e8901001 ldm r0, {r0, ip} + + //* Write the Receive Frame Mode Register + pSSC->SSC_RFMR = mode_rx; + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + 104a18: e59d3018 ldr r3, [sp, #24] + baud_value = (baud_value / 10) + 1; + else + baud_value /= 10; + } + + pSSC->SSC_CMR = baud_value; + 104a1c: e5842004 str r2, [r4, #4] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104a20: e3a01000 mov r1, #0 + + //* Define the Clock Mode Register + AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); + + //* Write the Receive Clock Mode Register + pSSC->SSC_RCMR = clock_rx; + 104a24: e5845010 str r5, [r4, #16] +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104a28: e3a02002 mov r2, #2 + + //* Write the Transmit Clock Mode Register + pSSC->SSC_TCMR = clock_tx; + 104a2c: e584c018 str ip, [r4, #24] + + //* Write the Receive Frame Mode Register + pSSC->SSC_RFMR = mode_rx; + 104a30: e5840014 str r0, [r4, #20] +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104a34: e3a0cc02 mov ip, #512 ; 0x200 + + //* Write the Transmit Frame Mode Register + pSSC->SSC_TFMR = mode_tx; + 104a38: e584301c str r3, [r4, #28] +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 104a3c: e3a00001 mov r0, #1 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 104a40: e3a03c01 mov r3, #256 ; 0x100 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104a44: e5842120 str r2, [r4, #288] ; 0x120 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104a48: e584c120 str ip, [r4, #288] ; 0x120 +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104a4c: e5841118 str r1, [r4, #280] ; 0x118 + pPDC->PDC_TNCR = bytes; + 104a50: e584111c str r1, [r4, #284] ; 0x11c +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 104a54: e5841110 str r1, [r4, #272] ; 0x110 + pPDC->PDC_RNCR = bytes; + 104a58: e5841114 str r1, [r4, #276] ; 0x114 +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 104a5c: e5841108 str r1, [r4, #264] ; 0x108 + pPDC->PDC_TCR = bytes; + 104a60: e584110c str r1, [r4, #268] ; 0x10c +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 104a64: e5841100 str r1, [r4, #256] ; 0x100 + pPDC->PDC_RCR = bytes; + 104a68: e5841104 str r1, [r4, #260] ; 0x104 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 104a6c: e5840120 str r0, [r4, #288] ; 0x120 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 104a70: e5843120 str r3, [r4, #288] ; 0x120 + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); + + +} + 104a74: e8bd4038 pop {r3, r4, r5, lr} + 104a78: e12fff1e bx lr + 104a7c: 00008202 .word 0x00008202 + 104a80: cccccccd .word 0xcccccccd + +00104a84 : + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + 104a84: e92d4038 push {r3, r4, r5, lr} + 104a88: e1a04000 mov r4, r0 +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_Baudrate ( + const unsigned int main_clock, // \arg peripheral clock + const unsigned int baud_rate) // \arg UART baudrate +{ + unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + 104a8c: e081e101 add lr, r1, r1, lsl #2 + //* Disable interrupts + pUSART->US_IDR = (unsigned int) -1; + 104a90: e3e00000 mvn r0, #0 + + //* Reset receiver and transmitter + pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; + 104a94: e3a050ac mov r5, #172 ; 0xac + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + //* Disable interrupts + pUSART->US_IDR = (unsigned int) -1; + 104a98: e584000c str r0, [r4, #12] + 104a9c: e1a01203 lsl r1, r3, #4 + + //* Reset receiver and transmitter + pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; + 104aa0: e5845000 str r5, [r4] + 104aa4: e1a0008e lsl r0, lr, #1 + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int mode , // \arg mode Register to be programmed + unsigned int baudRate , // \arg baudrate to be programmed + unsigned int timeguard ) // \arg timeguard to be programmed +{ + 104aa8: e1a05002 mov r5, r2 + 104aac: eb00165e bl 10a42c <__aeabi_uidiv> + if ((baud_value % 10) >= 5) + 104ab0: e59f3074 ldr r3, [pc, #116] ; 104b2c + 104ab4: e0832390 umull r2, r3, r0, r3 + 104ab8: e1a031a3 lsr r3, r3, #3 + 104abc: e083c103 add ip, r3, r3, lsl #2 + 104ac0: e040108c sub r1, r0, ip, lsl #1 + 104ac4: e3510004 cmp r1, #4 +static inline void AT91F_US_SetTimeguard ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int timeguard) // \arg timeguard value +{ + //* Write the Timeguard Register + pUSART->US_TTGR = timeguard ; + 104ac8: e59d2010 ldr r2, [sp, #16] + const unsigned int main_clock, // \arg peripheral clock + const unsigned int baud_rate) // \arg UART baudrate +{ + unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); + if ((baud_value % 10) >= 5) + baud_value = (baud_value / 10) + 1; + 104acc: 82830001 addhi r0, r3, #1 + else + baud_value /= 10; + 104ad0: 91a00003 movls r0, r3 + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int mainClock, // \arg peripheral clock + unsigned int speed) // \arg UART baudrate +{ + //* Define the baud rate divisor register + pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); + 104ad4: e5840020 str r0, [r4, #32] +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104ad8: e3a03000 mov r3, #0 +static inline void AT91F_US_SetTimeguard ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int timeguard) // \arg timeguard value +{ + //* Write the Timeguard Register + pUSART->US_TTGR = timeguard ; + 104adc: e5842028 str r2, [r4, #40] ; 0x28 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104ae0: e3a0c002 mov ip, #2 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104ae4: e3a01c02 mov r1, #512 ; 0x200 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 104ae8: e3a00001 mov r0, #1 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 104aec: e3a02c01 mov r2, #256 ; 0x100 +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104af0: e584c120 str ip, [r4, #288] ; 0x120 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104af4: e5841120 str r1, [r4, #288] ; 0x120 +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104af8: e5843118 str r3, [r4, #280] ; 0x118 + pPDC->PDC_TNCR = bytes; + 104afc: e584311c str r3, [r4, #284] ; 0x11c +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 104b00: e5843110 str r3, [r4, #272] ; 0x110 + pPDC->PDC_RNCR = bytes; + 104b04: e5843114 str r3, [r4, #276] ; 0x114 +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 104b08: e5843108 str r3, [r4, #264] ; 0x108 + pPDC->PDC_TCR = bytes; + 104b0c: e584310c str r3, [r4, #268] ; 0x10c +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 104b10: e5843100 str r3, [r4, #256] ; 0x100 + pPDC->PDC_RCR = bytes; + 104b14: e5843104 str r3, [r4, #260] ; 0x104 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 104b18: e5840120 str r0, [r4, #288] ; 0x120 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 104b1c: e5842120 str r2, [r4, #288] ; 0x120 + + //* Clear Transmit and Receive Counters + AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); + + //* Define the USART mode + pUSART->US_MR = mode ; + 104b20: e5845004 str r5, [r4, #4] + +} + 104b24: e8bd4038 pop {r3, r4, r5, lr} + 104b28: e12fff1e bx lr + 104b2c: cccccccd .word 0xcccccccd + +00104b30 : +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset the baud rate divisor register + pUSART->US_BRGR = 0 ; + 104b30: e3a0c000 mov ip, #0 + + //* Reset the Timeguard Register + pUSART->US_TTGR = 0; + + //* Disable all interrupts + pUSART->US_IDR = 0xFFFFFFFF ; + 104b34: e3e03000 mvn r3, #0 +//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +//*---------------------------------------------------------------------------- +void AT91F_US_Close(AT91PS_USART pUSART) // \arg pointer to a USART controller +{ + //* Reset the baud rate divisor register + pUSART->US_BRGR = 0 ; + 104b38: e580c020 str ip, [r0, #32] +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104b3c: e3a02002 mov r2, #2 + + //* Reset the USART mode + pUSART->US_MR = 0 ; + 104b40: e580c004 str ip, [r0, #4] +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104b44: e3a01c02 mov r1, #512 ; 0x200 + + //* Reset the Timeguard Register + pUSART->US_TTGR = 0; + 104b48: e580c028 str ip, [r0, #40] ; 0x28 + + //* Disable all interrupts + pUSART->US_IDR = 0xFFFFFFFF ; + 104b4c: e580300c str r3, [r0, #12] + + //* Abort the Peripheral Data Transfers + AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); + + //* Disable receiver and transmitter and stop any activity immediately + pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; + 104b50: e3a030ac mov r3, #172 ; 0xac +//* \brief Disable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 104b54: e5802120 str r2, [r0, #288] ; 0x120 +//* \brief Disable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_DisableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 104b58: e5801120 str r1, [r0, #288] ; 0x120 +static inline void AT91F_PDC_SetNextTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TNPR = (unsigned int) address; + 104b5c: e580c118 str ip, [r0, #280] ; 0x118 + pPDC->PDC_TNCR = bytes; + 104b60: e580c11c str ip, [r0, #284] ; 0x11c +static inline void AT91F_PDC_SetNextRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RNPR = (unsigned int) address; + 104b64: e580c110 str ip, [r0, #272] ; 0x110 + pPDC->PDC_RNCR = bytes; + 104b68: e580c114 str ip, [r0, #276] ; 0x114 +static inline void AT91F_PDC_SetTx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + const unsigned char *address,// \arg address to the next bloc to be transmitted + unsigned int bytes) // \arg number of bytes to be transmitted +{ + pPDC->PDC_TPR = (unsigned int) address; + 104b6c: e580c108 str ip, [r0, #264] ; 0x108 + pPDC->PDC_TCR = bytes; + 104b70: e580c10c str ip, [r0, #268] ; 0x10c +static inline void AT91F_PDC_SetRx ( + AT91PS_PDC pPDC, // \arg pointer to a PDC controller + unsigned char *address,// \arg address to the next bloc to be received + unsigned int bytes) // \arg number of bytes to be received +{ + pPDC->PDC_RPR = (unsigned int) address; + 104b74: e580c100 str ip, [r0, #256] ; 0x100 + pPDC->PDC_RCR = bytes; + 104b78: e580c104 str ip, [r0, #260] ; 0x104 + 104b7c: e5803000 str r3, [r0] +} + 104b80: e12fff1e bx lr + +00104b84 : +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) +{ + 104b84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 104b88: e24dd064 sub sp, sp, #100 ; 0x64 + 104b8c: e59db094 ldr fp, [sp, #148] ; 0x94 + const char *digits; + static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + 104b90: e59fc444 ldr ip, [pc, #1092] ; 104fdc +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) +{ + 104b94: e59d8088 ldr r8, [sp, #136] ; 0x88 + const char *digits; + static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + 104b98: e31b0040 tst fp, #64 ; 0x40 + 104b9c: e24ca028 sub sl, ip, #40 ; 0x28 + 104ba0: 01a0a00c moveq sl, ip +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) +{ + 104ba4: e1a07001 mov r7, r1 + static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + 104ba8: e31b0010 tst fp, #16 + type &= ~ZEROPAD; + if (base < 2 || base > 36) + 104bac: e2481002 sub r1, r8, #2 + static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + 104bb0: 13cbb001 bicne fp, fp, #1 + if (base < 2 || base > 36) + 104bb4: e3510022 cmp r1, #34 ; 0x22 +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) +{ + 104bb8: e1a05000 mov r5, r0 + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + 104bbc: 8a0000df bhi 104f40 + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + 104bc0: e31b0001 tst fp, #1 + 104bc4: 03a00020 moveq r0, #32 + 104bc8: 13a00030 movne r0, #48 ; 0x30 + sign = 0; + if (type & SIGN) { + 104bcc: e21b1002 ands r1, fp, #2 + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + 104bd0: e58d000c str r0, [sp, #12] + sign = 0; + if (type & SIGN) { + 104bd4: 1a0000cc bne 104f0c + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + 104bd8: e58d1008 str r1, [sp, #8] + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + if (type & SPECIAL) { + 104bdc: e21b0020 ands r0, fp, #32 + 104be0: e58d0010 str r0, [sp, #16] + 104be4: 0a000005 beq 104c00 + if (base == 16) + 104be8: e3580010 cmp r8, #16 + 104bec: 0a0000ee beq 104fac + size -= 2; + else if (base == 8) + 104bf0: e3580008 cmp r8, #8 + size--; + 104bf4: 059d008c ldreq r0, [sp, #140] ; 0x8c + 104bf8: 02400001 subeq r0, r0, #1 + 104bfc: 058d008c streq r0, [sp, #140] ; 0x8c + } + i = 0; + if (num == 0) + 104c00: e1921003 orrs r1, r2, r3 + 104c04: 13a06000 movne r6, #0 + 104c08: 128d901c addne r9, sp, #28 + 104c0c: 1a0000b3 bne 104ee0 + tmp[i++]='0'; + 104c10: e3a03030 mov r3, #48 ; 0x30 + 104c14: e5cd301c strb r3, [sp, #28] + 104c18: e3a06001 mov r6, #1 + 104c1c: e3a03000 mov r3, #0 + else while (num != 0) + 104c20: e59d0090 ldr r0, [sp, #144] ; 0x90 + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + 104c24: e59d208c ldr r2, [sp, #140] ; 0x8c + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + 104c28: e1560000 cmp r6, r0 + 104c2c: a1a0c006 movge ip, r6 + 104c30: b1a0c000 movlt ip, r0 + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + 104c34: e31b0011 tst fp, #17 + tmp[i++]='0'; + else while (num != 0) + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + 104c38: e06c1002 rsb r1, ip, r2 + if (!(type&(ZEROPAD+LEFT))) { + 104c3c: 1a000024 bne 104cd4 + while(size-->0) { + 104c40: e2412001 sub r2, r1, #1 + 104c44: e58d2004 str r2, [sp, #4] + 104c48: e3510000 cmp r1, #0 + 104c4c: d59d1004 ldrle r1, [sp, #4] + 104c50: da00001f ble 104cd4 + 104c54: e1e09005 mvn r9, r5 +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) + 104c58: e0854001 add r4, r5, r1 + 104c5c: e0840009 add r0, r4, r9 + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + 104c60: e1570005 cmp r7, r5 +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) + 104c64: e58d1014 str r1, [sp, #20] + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + 104c68: e3a09020 mov r9, #32 + 104c6c: e2000001 and r0, r0, #1 + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + 104c70: 2a0000b7 bcs 104f54 + *buf = ' '; + ++buf; + 104c74: e2852001 add r2, r5, #1 + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + 104c78: e1520004 cmp r2, r4 + 104c7c: 0a000010 beq 104cc4 + 104c80: e3500000 cmp r0, #0 + 104c84: 0a000004 beq 104c9c + if (buf <= end) + 104c88: e1570002 cmp r7, r2 + *buf = ' '; + 104c8c: 25c29000 strbcs r9, [r2] + ++buf; + 104c90: e2822001 add r2, r2, #1 + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + 104c94: e1520004 cmp r2, r4 + 104c98: 0a000009 beq 104cc4 + 104c9c: e1a00001 mov r0, r1 + if (buf <= end) + 104ca0: e1570002 cmp r7, r2 + *buf = ' '; + ++buf; + 104ca4: e2821001 add r1, r2, #1 + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + 104ca8: 25c29000 strbcs r9, [r2] + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + 104cac: e1570001 cmp r7, r1 + *buf = ' '; + 104cb0: 25c29001 strbcs r9, [r2, #1] + ++buf; + 104cb4: e2812001 add r2, r1, #1 + tmp[i++] = digits[do_div(num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + 104cb8: e1520004 cmp r2, r4 + 104cbc: 1afffff7 bne 104ca0 + 104cc0: e1a01000 mov r1, r0 + 104cc4: e59d0004 ldr r0, [sp, #4] + 104cc8: e59d2014 ldr r2, [sp, #20] + 104ccc: e0611000 rsb r1, r1, r0 + 104cd0: e0855002 add r5, r5, r2 + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) { + 104cd4: e59d2008 ldr r2, [sp, #8] + 104cd8: e3520000 cmp r2, #0 + 104cdc: 0a000002 beq 104cec + if (buf <= end) + 104ce0: e1550007 cmp r5, r7 + *buf = sign; + 104ce4: 95c52000 strbls r2, [r5] + ++buf; + 104ce8: e2855001 add r5, r5, #1 + } + if (type & SPECIAL) { + 104cec: e59d0010 ldr r0, [sp, #16] + 104cf0: e3500000 cmp r0, #0 + 104cf4: 0a000003 beq 104d08 + if (base==8) { + 104cf8: e3580008 cmp r8, #8 + 104cfc: 0a0000a5 beq 104f98 + if (buf <= end) + *buf = '0'; + ++buf; + } else if (base==16) { + 104d00: e3580010 cmp r8, #16 + 104d04: 0a00009a beq 104f74 + if (buf <= end) + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + 104d08: e31b0010 tst fp, #16 + 104d0c: 1a00001f bne 104d90 + while (size-- > 0) { + 104d10: e3510000 cmp r1, #0 + 104d14: e2412001 sub r2, r1, #1 + 104d18: d1a01002 movle r1, r2 + 104d1c: da00001b ble 104d90 +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) + 104d20: e0851001 add r1, r5, r1 + 104d24: e1e02005 mvn r2, r5 + 104d28: e0812002 add r2, r1, r2 + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + 104d2c: e1570005 cmp r7, r5 + 104d30: e2022001 and r2, r2, #1 + 104d34: 2a000083 bcs 104f48 + *buf = c; + ++buf; + 104d38: e2855001 add r5, r5, #1 + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + 104d3c: e1550001 cmp r5, r1 + 104d40: 0a000010 beq 104d88 + 104d44: e3520000 cmp r2, #0 + 104d48: 0a000005 beq 104d64 + if (buf <= end) + 104d4c: e1570005 cmp r7, r5 + *buf = c; + 104d50: 259d200c ldrcs r2, [sp, #12] + 104d54: 25c52000 strbcs r2, [r5] + ++buf; + 104d58: e2855001 add r5, r5, #1 + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + 104d5c: e1550001 cmp r5, r1 + 104d60: 0a000008 beq 104d88 + 104d64: e59d000c ldr r0, [sp, #12] + if (buf <= end) + 104d68: e1570005 cmp r7, r5 + *buf = c; + ++buf; + 104d6c: e2852001 add r2, r5, #1 + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + 104d70: 25c50000 strbcs r0, [r5] + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + 104d74: e1570002 cmp r7, r2 + *buf = c; + 104d78: 25c50001 strbcs r0, [r5, #1] + ++buf; + 104d7c: e2825001 add r5, r2, #1 + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + 104d80: e1550001 cmp r5, r1 + 104d84: 1afffff7 bne 104d68 + 104d88: e1a05001 mov r5, r1 + 104d8c: e3e01000 mvn r1, #0 + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + 104d90: e15c0006 cmp ip, r6 + 104d94: da00001a ble 104e04 +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) + 104d98: e066000c rsb r0, r6, ip + 104d9c: e0850000 add r0, r5, r0 + 104da0: e1e0c005 mvn ip, r5 + 104da4: e080200c add r2, r0, ip + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + 104da8: e1570005 cmp r7, r5 + *buf = '0'; + 104dac: e3a0c030 mov ip, #48 ; 0x30 + 104db0: e2022001 and r2, r2, #1 + 104db4: 25c5c000 strbcs ip, [r5] + ++buf; + 104db8: e2855001 add r5, r5, #1 + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + 104dbc: e1550000 cmp r5, r0 + 104dc0: 0a00000e beq 104e00 + 104dc4: e3520000 cmp r2, #0 + 104dc8: 0a000004 beq 104de0 + if (buf <= end) + 104dcc: e1570005 cmp r7, r5 + *buf = '0'; + 104dd0: 25c5c000 strbcs ip, [r5] + ++buf; + 104dd4: e2855001 add r5, r5, #1 + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + 104dd8: e1550000 cmp r5, r0 + 104ddc: 0a000007 beq 104e00 + if (buf <= end) + 104de0: e1570005 cmp r7, r5 + *buf = '0'; + ++buf; + 104de4: e2852001 add r2, r5, #1 + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + *buf = '0'; + 104de8: 25c5c000 strbcs ip, [r5] + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + 104dec: e1570002 cmp r7, r2 + *buf = '0'; + 104df0: 25c5c001 strbcs ip, [r5, #1] + ++buf; + 104df4: e2825001 add r5, r2, #1 + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + 104df8: e1550000 cmp r5, r0 + 104dfc: 1afffff7 bne 104de0 + 104e00: e1a05000 mov r5, r0 + 104e04: e3130001 tst r3, #1 + 104e08: 0a00000d beq 104e44 + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + 104e0c: e1550007 cmp r5, r7 + *buf = tmp[i]; + 104e10: 928d201c addls r2, sp, #28 + 104e14: 97d22003 ldrbls r2, [r2, r3] + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + 104e18: e2433001 sub r3, r3, #1 + if (buf <= end) + *buf = tmp[i]; + 104e1c: 95c52000 strbls r2, [r5] + ++buf; + 104e20: e2855001 add r5, r5, #1 + 104e24: ea000006 b 104e44 + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + 104e28: e1520007 cmp r2, r7 + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + 104e2c: e2433001 sub r3, r3, #1 + if (buf <= end) + *buf = tmp[i]; + 104e30: 928d501c addls r5, sp, #28 + 104e34: 97d50003 ldrbls r0, [r5, r3] + 104e38: 95c20000 strbls r0, [r2] + ++buf; + 104e3c: e2825001 add r5, r2, #1 + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + 104e40: e2433001 sub r3, r3, #1 + if (buf <= end) + 104e44: e1550007 cmp r5, r7 + *buf = tmp[i]; + 104e48: 928d001c addls r0, sp, #28 + 104e4c: 97d00003 ldrbls r0, [r0, r3] + ++buf; + 104e50: e2852001 add r2, r5, #1 + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + 104e54: 95c50000 strbls r0, [r5] + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + 104e58: e3530000 cmp r3, #0 + if (buf <= end) + *buf = tmp[i]; + ++buf; + 104e5c: e1a00002 mov r0, r2 + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + 104e60: 1afffff0 bne 104e28 + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + 104e64: e3510000 cmp r1, #0 + 104e68: da000019 ble 104ed4 + 104e6c: e1e04002 mvn r4, r2 +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ + +static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type) + 104e70: e082c001 add ip, r2, r1 + 104e74: e08c3004 add r3, ip, r4 + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + 104e78: e1570002 cmp r7, r2 + *buf = ' '; + 104e7c: e3a04020 mov r4, #32 + 104e80: e2030001 and r0, r3, #1 + 104e84: 25c24000 strbcs r4, [r2] + ++buf; + 104e88: e2823001 add r3, r2, #1 + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + 104e8c: e153000c cmp r3, ip + 104e90: 0a00000e beq 104ed0 + 104e94: e3500000 cmp r0, #0 + 104e98: 0a000004 beq 104eb0 + if (buf <= end) + 104e9c: e1570003 cmp r7, r3 + *buf = ' '; + 104ea0: 25c34000 strbcs r4, [r3] + ++buf; + 104ea4: e2833001 add r3, r3, #1 + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + 104ea8: e153000c cmp r3, ip + 104eac: 0a000007 beq 104ed0 + if (buf <= end) + 104eb0: e1570003 cmp r7, r3 + *buf = ' '; + ++buf; + 104eb4: e2830001 add r0, r3, #1 + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + *buf = ' '; + 104eb8: 25c34000 strbcs r4, [r3] + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + 104ebc: e1570000 cmp r7, r0 + *buf = ' '; + 104ec0: 25c34001 strbcs r4, [r3, #1] + ++buf; + 104ec4: e2803001 add r3, r0, #1 + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + 104ec8: e153000c cmp r3, ip + 104ecc: 1afffff7 bne 104eb0 + 104ed0: e0820001 add r0, r2, r1 + if (buf <= end) + *buf = ' '; + ++buf; + } + return buf; +} + 104ed4: e28dd064 add sp, sp, #100 ; 0x64 + 104ed8: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 104edc: e12fff1e bx lr + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + tmp[i++] = digits[do_div(num,base)]; + 104ee0: e1a00002 mov r0, r2 + 104ee4: e1a01003 mov r1, r3 + 104ee8: e1a04008 mov r4, r8 + 104eec: ebfffd5a bl 10445c <__do_div64> + 104ef0: e7da1001 ldrb r1, [sl, r1] + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + 104ef4: e1920003 orrs r0, r2, r3 + tmp[i++] = digits[do_div(num,base)]; + 104ef8: e7c91006 strb r1, [r9, r6] + 104efc: e2866001 add r6, r6, #1 + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + 104f00: 1afffff6 bne 104ee0 + 104f04: e2463001 sub r3, r6, #1 + 104f08: eaffff44 b 104c20 + if (base < 2 || base > 36) + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + 104f0c: e3520000 cmp r2, #0 + 104f10: e2d31000 sbcs r1, r3, #0 + 104f14: ba000028 blt 104fbc + sign = '-'; + num = - (signed long long) num; + size--; + } else if (type & PLUS) { + 104f18: e31b0004 tst fp, #4 + 104f1c: 1a00000e bne 104f5c + sign = '+'; + size--; + } else if (type & SPACE) { + 104f20: e21b1008 ands r1, fp, #8 + 104f24: 0affff2b beq 104bd8 + sign = ' '; + size--; + 104f28: e59d008c ldr r0, [sp, #140] ; 0x8c + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + 104f2c: e3a01020 mov r1, #32 + size--; + 104f30: e240c001 sub ip, r0, #1 + 104f34: e58dc08c str ip, [sp, #140] ; 0x8c + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + 104f38: e58d1008 str r1, [sp, #8] + 104f3c: eaffff26 b 104bdc + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return NULL; + 104f40: e3a00000 mov r0, #0 + 104f44: eaffffe2 b 104ed4 + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + 104f48: e59d000c ldr r0, [sp, #12] + 104f4c: e5c50000 strb r0, [r5] + 104f50: eaffff78 b 104d38 + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + 104f54: e5c59000 strb r9, [r5] + 104f58: eaffff45 b 104c74 + sign = '-'; + num = - (signed long long) num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + 104f5c: e59d008c ldr r0, [sp, #140] ; 0x8c + if ((signed long long) num < 0) { + sign = '-'; + num = - (signed long long) num; + size--; + } else if (type & PLUS) { + sign = '+'; + 104f60: e3a0102b mov r1, #43 ; 0x2b + size--; + 104f64: e240c001 sub ip, r0, #1 + 104f68: e58dc08c str ip, [sp, #140] ; 0x8c + if ((signed long long) num < 0) { + sign = '-'; + num = - (signed long long) num; + size--; + } else if (type & PLUS) { + sign = '+'; + 104f6c: e58d1008 str r1, [sp, #8] + 104f70: eaffff19 b 104bdc + if (base==8) { + if (buf <= end) + *buf = '0'; + ++buf; + } else if (base==16) { + if (buf <= end) + 104f74: e1550007 cmp r5, r7 + *buf = '0'; + 104f78: 93a02030 movls r2, #48 ; 0x30 + 104f7c: 95c52000 strbls r2, [r5] + ++buf; + 104f80: e2852001 add r2, r5, #1 + if (buf <= end) + 104f84: e1570002 cmp r7, r2 + *buf = digits[33]; + 104f88: 25da0021 ldrbcs r0, [sl, #33] ; 0x21 + 104f8c: 25c50001 strbcs r0, [r5, #1] + ++buf; + 104f90: e2825001 add r5, r2, #1 + 104f94: eaffff5b b 104d08 + *buf = sign; + ++buf; + } + if (type & SPECIAL) { + if (base==8) { + if (buf <= end) + 104f98: e1550007 cmp r5, r7 + *buf = '0'; + 104f9c: 93a02030 movls r2, #48 ; 0x30 + 104fa0: 95c52000 strbls r2, [r5] + ++buf; + 104fa4: e2855001 add r5, r5, #1 + 104fa8: eaffff56 b 104d08 + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + 104fac: e59dc08c ldr ip, [sp, #140] ; 0x8c + 104fb0: e24c1002 sub r1, ip, #2 + 104fb4: e58d108c str r1, [sp, #140] ; 0x8c + 104fb8: eaffff10 b 104c00 + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + sign = '-'; + num = - (signed long long) num; + size--; + 104fbc: e59d008c ldr r0, [sp, #140] ; 0x8c + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + sign = '-'; + 104fc0: e3a0102d mov r1, #45 ; 0x2d + num = - (signed long long) num; + size--; + 104fc4: e240c001 sub ip, r0, #1 + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + sign = '-'; + num = - (signed long long) num; + 104fc8: e2722000 rsbs r2, r2, #0 + 104fcc: e2e33000 rsc r3, r3, #0 + size--; + 104fd0: e58dc08c str ip, [sp, #140] ; 0x8c + return NULL; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if ((signed long long) num < 0) { + sign = '-'; + 104fd4: e58d1008 str r1, [sp, #8] + 104fd8: eafffeff b 104bdc + 104fdc: 0010a5d8 .word 0x0010a5d8 + +00104fe0 : + */ +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) +{ + unsigned long result = 0,value; + + if (!base) { + 104fe0: e3520000 cmp r2, #0 + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) +{ + 104fe4: e92d00f0 push {r4, r5, r6, r7} + 104fe8: e1a03000 mov r3, r0 + unsigned long result = 0,value; + + if (!base) { + 104fec: 1a000007 bne 105010 + base = 10; + if (*cp == '0') { + 104ff0: e5d0c000 ldrb ip, [r0] + 104ff4: e35c0030 cmp ip, #48 ; 0x30 + 104ff8: 0a00002b beq 1050ac + 104ffc: e59f7138 ldr r7, [pc, #312] ; 10513c + 105000: e1a0500c mov r5, ip + 105004: e7d7400c ldrb r4, [r7, ip] +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) +{ + unsigned long result = 0,value; + + if (!base) { + base = 10; + 105008: e3a0200a mov r2, #10 + 10500c: ea000005 b 105028 + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + cp++; + base = 16; + } + } + } else if (base == 16) { + 105010: e3520010 cmp r2, #16 + 105014: 0a00001d beq 105090 + 105018: e5d0c000 ldrb ip, [r0] + 10501c: e59f7118 ldr r7, [pc, #280] ; 10513c + 105020: e7d7400c ldrb r4, [r7, ip] + 105024: e1a0500c mov r5, ip + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + 105028: e2140044 ands r0, r4, #68 ; 0x44 + 10502c: 0a000013 beq 105080 + (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + *endp = (char *)cp; + 105030: e1a06003 mov r6, r3 +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) +{ + unsigned long result = 0,value; + + if (!base) { + base = 10; + 105034: e3a00000 mov r0, #0 + 105038: ea000007 b 10505c + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + 10503c: e5d6c001 ldrb ip, [r6, #1] + 105040: e7d7400c ldrb r4, [r7, ip] + 105044: e3140044 tst r4, #68 ; 0x44 + (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + result = result*base + value; + 105048: e0205092 mla r0, r2, r0, r5 + * simple_strtoul - convert a string to an unsigned long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) + 10504c: e2833001 add r3, r3, #1 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + 105050: e1a0500c mov r5, ip + 105054: 0a000009 beq 105080 + 105058: e1a06003 mov r6, r3 + (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + 10505c: e3140004 tst r4, #4 + 105060: 12455030 subne r5, r5, #48 ; 0x30 + 105064: 1a000003 bne 105078 + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + 105068: e3140002 tst r4, #2 + c -= 'a'-'A'; + 10506c: 124cc020 subne ip, ip, #32 + 105070: 120cc0ff andne ip, ip, #255 ; 0xff + 105074: e24c5037 sub r5, ip, #55 ; 0x37 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + 105078: e1550002 cmp r5, r2 + 10507c: 3affffee bcc 10503c + (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + 105080: e3510000 cmp r1, #0 + *endp = (char *)cp; + 105084: 15813000 strne r3, [r1] + return result; +} + 105088: e8bd00f0 pop {r4, r5, r6, r7} + 10508c: e12fff1e bx lr + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 105090: e5d0c000 ldrb ip, [r0] + 105094: e35c0030 cmp ip, #48 ; 0x30 + 105098: 0a00001a beq 105108 + 10509c: e59f7098 ldr r7, [pc, #152] ; 10513c + 1050a0: e1a0500c mov r5, ip + 1050a4: e7d7400c ldrb r4, [r7, ip] + 1050a8: eaffffde b 105028 + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 1050ac: e5f3c001 ldrb ip, [r3, #1]! + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + 1050b0: e59f7084 ldr r7, [pc, #132] ; 10513c + 1050b4: e7d7400c ldrb r4, [r7, ip] + 1050b8: e3140002 tst r4, #2 + c -= 'a'-'A'; + 1050bc: 124c2020 subne r2, ip, #32 + 1050c0: 120220ff andne r2, r2, #255 ; 0xff + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + 1050c4: 01a0200c moveq r2, ip + 1050c8: e3520058 cmp r2, #88 ; 0x58 + 1050cc: e1a0500c mov r5, ip + 1050d0: 0a000001 beq 1050dc + unsigned long result = 0,value; + + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + 1050d4: e3a02008 mov r2, #8 + 1050d8: eaffffd2 b 105028 + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 1050dc: e5d30001 ldrb r0, [r3, #1] + 1050e0: e7d72000 ldrb r2, [r7, r0] + 1050e4: e3120044 tst r2, #68 ; 0x44 + 1050e8: e2836001 add r6, r3, #1 + 1050ec: 0afffff8 beq 1050d4 + 1050f0: e1a04002 mov r4, r2 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && + 1050f4: e1a05000 mov r5, r0 + 1050f8: e1a0c000 mov ip, r0 + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 1050fc: e1a03006 mov r3, r6 + cp++; + base = 16; + 105100: e3a02010 mov r2, #16 + 105104: eaffffc9 b 105030 + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 105108: e5d00001 ldrb r0, [r0, #1] + 10510c: e59f7028 ldr r7, [pc, #40] ; 10513c + 105110: e7d74000 ldrb r4, [r7, r0] + 105114: e3140002 tst r4, #2 + c -= 'a'-'A'; + 105118: 12400020 subne r0, r0, #32 + 10511c: 120000ff andne r0, r0, #255 ; 0xff + 105120: e3500058 cmp r0, #88 ; 0x58 + cp += 2; + 105124: 05f3c002 ldrbeq ip, [r3, #2]! + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 105128: 15d74030 ldrbne r4, [r7, #48] ; 0x30 + 10512c: 13a05030 movne r5, #48 ; 0x30 + cp += 2; + 105130: 01a0500c moveq r5, ip + 105134: 07d7400c ldrbeq r4, [r7, ip] + 105138: eaffffba b 105028 + 10513c: 0020020c .word 0x0020020c + +00105140 : + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +long simple_strtol(const char *cp,char **endp,unsigned int base) +{ + 105140: e92d4010 push {r4, lr} + if(*cp=='-') + 105144: e5d0c000 ldrb ip, [r0] + 105148: e35c002d cmp ip, #45 ; 0x2d + 10514c: 0a000001 beq 105158 + return -simple_strtoul(cp+1,endp,base); + return simple_strtoul(cp,endp,base); +} + 105150: e8bd4010 pop {r4, lr} + */ +long simple_strtol(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoul(cp+1,endp,base); + return simple_strtoul(cp,endp,base); + 105154: eaffffa1 b 104fe0 + * @base: The number base to use + */ +long simple_strtol(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoul(cp+1,endp,base); + 105158: e2800001 add r0, r0, #1 + 10515c: ebffff9f bl 104fe0 + return simple_strtoul(cp,endp,base); +} + 105160: e2600000 rsb r0, r0, #0 + 105164: e8bd4010 pop {r4, lr} + 105168: e12fff1e bx lr + +0010516c : + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + 10516c: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp} + unsigned long long result = 0,value; + + if (!base) { + 105170: e3520000 cmp r2, #0 + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + 105174: e24dd008 sub sp, sp, #8 + 105178: e58d1004 str r1, [sp, #4] + unsigned long long result = 0,value; + + if (!base) { + 10517c: 1a000007 bne 1051a0 + base = 10; + if (*cp == '0') { + 105180: e5d07000 ldrb r7, [r0] + 105184: e3570030 cmp r7, #48 ; 0x30 + 105188: 0a000039 beq 105274 + 10518c: e59fb180 ldr fp, [pc, #384] ; 105314 + 105190: e1a08007 mov r8, r7 + 105194: e7dbc007 ldrb ip, [fp, r7] +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + unsigned long long result = 0,value; + + if (!base) { + base = 10; + 105198: e3a0200a mov r2, #10 + 10519c: ea000005 b 1051b8 + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + cp++; + base = 16; + } + } + } else if (base == 16) { + 1051a0: e3520010 cmp r2, #16 + 1051a4: 0a00002b beq 105258 + 1051a8: e5d07000 ldrb r7, [r0] + 1051ac: e59fb160 ldr fp, [pc, #352] ; 105314 + 1051b0: e7dbc007 ldrb ip, [fp, r7] + 1051b4: e1a08007 mov r8, r7 + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 1051b8: e31c0044 tst ip, #68 ; 0x44 + 1051bc: 11a01002 movne r1, r2 + 1051c0: 13a02000 movne r2, #0 + 1051c4: 0a000042 beq 1052d4 + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + *endp = (char *)cp; + 1051c8: e1a0a000 mov sl, r0 +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + unsigned long long result = 0,value; + + if (!base) { + base = 10; + 1051cc: e3a03000 mov r3, #0 + 1051d0: e3a04000 mov r4, #0 + 1051d4: ea00000c b 10520c + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + 1051d8: e00c0293 mul ip, r3, r2 + 1051dc: e0865193 umull r5, r6, r3, r1 + 1051e0: e023c491 mla r3, r1, r4, ip + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 1051e4: e5da7001 ldrb r7, [sl, #1] + 1051e8: e7dbc007 ldrb ip, [fp, r7] + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + 1051ec: e0836006 add r6, r3, r6 + 1051f0: e0983005 adds r3, r8, r5 + 1051f4: e0a94006 adc r4, r9, r6 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 1051f8: e31c0044 tst ip, #68 ; 0x44 + * simple_strtoull - convert a string to an unsigned long long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) + 1051fc: e2800001 add r0, r0, #1 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 105200: e1a08007 mov r8, r7 + 105204: 0a00000b beq 105238 + 105208: e1a0a000 mov sl, r0 + 10520c: e31c0004 tst ip, #4 + 105210: 12488030 subne r8, r8, #48 ; 0x30 + 105214: 1a000003 bne 105228 + 105218: e31c0002 tst ip, #2 + 10521c: 12478020 subne r8, r7, #32 + ? toupper(*cp) : *cp)-'A'+10) < base) { + 105220: 120880ff andne r8, r8, #255 ; 0xff + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 105224: e2488037 sub r8, r8, #55 ; 0x37 + 105228: e1a09fc8 asr r9, r8, #31 + 10522c: e1590002 cmp r9, r2 + 105230: 01580001 cmpeq r8, r1 + 105234: 3affffe7 bcc 1051d8 + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + 105238: e59d2004 ldr r2, [sp, #4] + 10523c: e3520000 cmp r2, #0 + *endp = (char *)cp; + 105240: 15820000 strne r0, [r2] + return result; +} + 105244: e1a01004 mov r1, r4 + 105248: e1a00003 mov r0, r3 + 10524c: e28dd008 add sp, sp, #8 + 105250: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp} + 105254: e12fff1e bx lr + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 105258: e5d07000 ldrb r7, [r0] + 10525c: e3570030 cmp r7, #48 ; 0x30 + 105260: 0a00001e beq 1052e0 + 105264: e59fb0a8 ldr fp, [pc, #168] ; 105314 + 105268: e1a08007 mov r8, r7 + 10526c: e7dbc007 ldrb ip, [fp, r7] + 105270: eaffffd0 b 1051b8 + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 105274: e5f07001 ldrb r7, [r0, #1]! + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + 105278: e59fb094 ldr fp, [pc, #148] ; 105314 + 10527c: e7dbc007 ldrb ip, [fp, r7] + 105280: e31c0002 tst ip, #2 + c -= 'a'-'A'; + 105284: 12473020 subne r3, r7, #32 + 105288: 120330ff andne r3, r3, #255 ; 0xff + return c; +} + +static inline unsigned char __toupper(unsigned char c) +{ + if (islower(c)) + 10528c: 01a03007 moveq r3, r7 + 105290: e3530058 cmp r3, #88 ; 0x58 + 105294: e1a08007 mov r8, r7 + 105298: 0a000001 beq 1052a4 + unsigned long long result = 0,value; + + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + 10529c: e3a02008 mov r2, #8 + 1052a0: eaffffc4 b 1051b8 + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 1052a4: e5d02001 ldrb r2, [r0, #1] + 1052a8: e7db3002 ldrb r3, [fp, r2] + 1052ac: e3130044 tst r3, #68 ; 0x44 + 1052b0: e2801001 add r1, r0, #1 + 1052b4: 0afffff8 beq 10529c + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 1052b8: e1a08002 mov r8, r2 + 1052bc: e1a07002 mov r7, r2 + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + 1052c0: e1a00001 mov r0, r1 + 1052c4: e1a0c003 mov ip, r3 + 1052c8: e3a01010 mov r1, #16 + 1052cc: e3a02000 mov r2, #0 + 1052d0: eaffffbc b 1051c8 + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + 1052d4: e3a03000 mov r3, #0 + 1052d8: e3a04000 mov r4, #0 + 1052dc: eaffffd5 b 105238 + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 1052e0: e5d03001 ldrb r3, [r0, #1] + 1052e4: e59fb028 ldr fp, [pc, #40] ; 105314 + 1052e8: e7db1003 ldrb r1, [fp, r3] + 1052ec: e3110002 tst r1, #2 + c -= 'a'-'A'; + 1052f0: 12433020 subne r3, r3, #32 + 1052f4: 120330ff andne r3, r3, #255 ; 0xff + 1052f8: e3530058 cmp r3, #88 ; 0x58 + cp += 2; + 1052fc: 05f07002 ldrbeq r7, [r0, #2]! + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + 105300: 15dbc030 ldrbne ip, [fp, #48] ; 0x30 + 105304: 13a08030 movne r8, #48 ; 0x30 + cp += 2; + 105308: 01a08007 moveq r8, r7 + 10530c: 07dbc007 ldrbeq ip, [fp, r7] + 105310: eaffffa8 b 1051b8 + 105314: 0020020c .word 0x0020020c + +00105318 : + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +long long simple_strtoll(const char *cp,char **endp,unsigned int base) +{ + 105318: e92d4010 push {r4, lr} + if(*cp=='-') + 10531c: e5d0c000 ldrb ip, [r0] + 105320: e35c002d cmp ip, #45 ; 0x2d + 105324: 0a000001 beq 105330 + return -simple_strtoull(cp+1,endp,base); + return simple_strtoull(cp,endp,base); +} + 105328: e8bd4010 pop {r4, lr} + */ +long long simple_strtoll(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoull(cp+1,endp,base); + return simple_strtoull(cp,endp,base); + 10532c: eaffff8e b 10516c + * @base: The number base to use + */ +long long simple_strtoll(const char *cp,char **endp,unsigned int base) +{ + if(*cp=='-') + return -simple_strtoull(cp+1,endp,base); + 105330: e2800001 add r0, r0, #1 + 105334: ebffff8c bl 10516c + 105338: e2703000 rsbs r3, r0, #0 + 10533c: e2e14000 rsc r4, r1, #0 + return simple_strtoull(cp,endp,base); +} + 105340: e1a00003 mov r0, r3 + 105344: e1a01004 mov r1, r4 + 105348: e8bd4010 pop {r4, lr} + 10534c: e12fff1e bx lr + +00105350 : + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + 105350: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} + /* 'z' support added 23/7/1999 S.H. */ + /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ + + /* Reject out-of-range values early */ + if ((int) size < 0) { + 105354: e3510000 cmp r1, #0 + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + 105358: e24dd02c sub sp, sp, #44 ; 0x2c + 10535c: e1a0b000 mov fp, r0 + /* 'z' support added 23/7/1999 S.H. */ + /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ + + /* Reject out-of-range values early */ + if ((int) size < 0) { + 105360: e58d1020 str r1, [sp, #32] + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + 105364: e1a04002 mov r4, r2 + 105368: e1a0a003 mov sl, r3 + /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ + + /* Reject out-of-range values early */ + if ((int) size < 0) { + return 0; + 10536c: b3a00000 movlt r0, #0 + /* 'z' support added 23/7/1999 S.H. */ + /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ + + /* Reject out-of-range values early */ + if ((int) size < 0) { + 105370: ba00001f blt 1053f4 + return 0; + } + + str = buf; + end = buf + size - 1; + 105374: e2417001 sub r7, r1, #1 + 105378: e0807007 add r7, r0, r7 + + if (end < buf - 1) { + 10537c: e2403001 sub r3, r0, #1 + 105380: e1570003 cmp r7, r3 + end = ((void *) -1); + size = end - buf + 1; + 105384: 32600000 rsbcc r0, r0, #0 + 105388: 358d0020 strcc r0, [sp, #32] + } + + for (; *fmt ; ++fmt) { + 10538c: e5d20000 ldrb r0, [r2] + + str = buf; + end = buf + size - 1; + + if (end < buf - 1) { + end = ((void *) -1); + 105390: 33e07000 mvncc r7, #0 + size = end - buf + 1; + } + + for (; *fmt ; ++fmt) { + 105394: e3500000 cmp r0, #0 + 105398: 01a0900b moveq r9, fp + 10539c: 0a00000c beq 1053d4 + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + 1053a0: e59f8808 ldr r8, [pc, #2056] ; 105bb0 + if (end < buf - 1) { + end = ((void *) -1); + size = end - buf + 1; + } + + for (; *fmt ; ++fmt) { + 1053a4: e1a0900b mov r9, fp + if (*fmt != '%') { + 1053a8: e3500025 cmp r0, #37 ; 0x25 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1053ac: 02843001 addeq r3, r4, #1 + 1053b0: 03a06000 moveq r6, #0 + end = ((void *) -1); + size = end - buf + 1; + } + + for (; *fmt ; ++fmt) { + if (*fmt != '%') { + 1053b4: 0a000012 beq 105404 + if (str <= end) + 1053b8: e1590007 cmp r9, r7 + *str = *fmt; + 1053bc: 95c90000 strbls r0, [r9] + *str = '%'; + ++str; + if (*fmt) { + if (str <= end) + *str = *fmt; + ++str; + 1053c0: e2899001 add r9, r9, #1 + if (end < buf - 1) { + end = ((void *) -1); + size = end - buf + 1; + } + + for (; *fmt ; ++fmt) { + 1053c4: e5f40001 ldrb r0, [r4, #1]! + 1053c8: e3500000 cmp r0, #0 + 1053cc: 1afffff5 bne 1053a8 + 1053d0: e06b0009 rsb r0, fp, r9 + num = (signed int) num; + } + str = number(str, end, num, base, + field_width, precision, flags); + } + if (str <= end) + 1053d4: e1590007 cmp r9, r7 + *str = '\0'; + 1053d8: 93a03000 movls r3, #0 + 1053dc: 95c93000 strbls r3, [r9] + num = (signed int) num; + } + str = number(str, end, num, base, + field_width, precision, flags); + } + if (str <= end) + 1053e0: 9a000003 bls 1053f4 + *str = '\0'; + else if (size > 0) + 1053e4: e59dc020 ldr ip, [sp, #32] + 1053e8: e35c0000 cmp ip, #0 + /* don't write out a null byte if the buf size is zero */ + *end = '\0'; + 1053ec: 13a03000 movne r3, #0 + 1053f0: 15c73000 strbne r3, [r7] + /* the trailing null byte doesn't count towards the total + * ++str; + */ + return str-buf; +} + 1053f4: e28dd02c add sp, sp, #44 ; 0x2c + 1053f8: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 1053fc: e12fff1e bx lr + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + 105400: e3866020 orr r6, r6, #32 + for (; *fmt ; ++fmt) { + if (*fmt != '%') { + if (str <= end) + *str = *fmt; + ++str; + continue; + 105404: e1a04003 mov r4, r3 + + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + 105408: e4d32001 ldrb r2, [r3], #1 + 10540c: e2421020 sub r1, r2, #32 + 105410: e3510010 cmp r1, #16 + 105414: 979ff101 ldrls pc, [pc, r1, lsl #2] + 105418: ea000018 b 105480 + 10541c: 00105478 .word 0x00105478 + 105420: 00105480 .word 0x00105480 + 105424: 00105480 .word 0x00105480 + 105428: 00105400 .word 0x00105400 + 10542c: 00105480 .word 0x00105480 + 105430: 00105480 .word 0x00105480 + 105434: 00105480 .word 0x00105480 + 105438: 00105480 .word 0x00105480 + 10543c: 00105480 .word 0x00105480 + 105440: 00105480 .word 0x00105480 + 105444: 00105480 .word 0x00105480 + 105448: 00105470 .word 0x00105470 + 10544c: 00105480 .word 0x00105480 + 105450: 00105468 .word 0x00105468 + 105454: 00105480 .word 0x00105480 + 105458: 00105480 .word 0x00105480 + 10545c: 00105460 .word 0x00105460 + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + 105460: e3866001 orr r6, r6, #1 + 105464: eaffffe6 b 105404 + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + 105468: e3866010 orr r6, r6, #16 + 10546c: eaffffe4 b 105404 + case '+': flags |= PLUS; goto repeat; + 105470: e3866004 orr r6, r6, #4 + 105474: eaffffe2 b 105404 + case ' ': flags |= SPACE; goto repeat; + 105478: e3866008 orr r6, r6, #8 + 10547c: eaffffe0 b 105404 + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + 105480: e7d83002 ldrb r3, [r8, r2] + 105484: e3130004 tst r3, #4 + 105488: 0a000077 beq 10566c + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 10548c: e2843001 add r3, r4, #1 + 105490: e3a05000 mov r5, #0 +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + 105494: e2421030 sub r1, r2, #48 ; 0x30 + 105498: e1a04003 mov r4, r3 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 10549c: e4d32001 ldrb r2, [r3], #1 + 1054a0: e7d80002 ldrb r0, [r8, r2] + i = i*10 + *((*s)++) - '0'; + 1054a4: e0855105 add r5, r5, r5, lsl #2 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1054a8: e3100004 tst r0, #4 + i = i*10 + *((*s)++) - '0'; + 1054ac: e0815085 add r5, r1, r5, lsl #1 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1054b0: 1afffff7 bne 105494 + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + 1054b4: e352002e cmp r2, #46 ; 0x2e + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + 1054b8: 13e0c000 mvnne ip, #0 + if (*fmt == '.') { + 1054bc: 0a000077 beq 1056a0 + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 1054c0: e3520068 cmp r2, #104 ; 0x68 + 1054c4: 1352006c cmpne r2, #108 ; 0x6c + 1054c8: 0a00000a beq 1054f8 + 1054cc: e352005a cmp r2, #90 ; 0x5a + 1054d0: 0a000008 beq 1054f8 + 1054d4: 9a000005 bls 1054f0 + 1054d8: e3520074 cmp r2, #116 ; 0x74 + 1054dc: 0a000005 beq 1054f8 + 1054e0: e352007a cmp r2, #122 ; 0x7a + 1054e4: 0a000003 beq 1054f8 + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = -1; + 1054e8: e3e03000 mvn r3, #0 + 1054ec: ea000006 b 10550c + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 1054f0: e352004c cmp r2, #76 ; 0x4c + 1054f4: 1afffffb bne 1054e8 + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + ++fmt; + if (qualifier == 'l' && *fmt == 'l') { + 1054f8: e352006c cmp r2, #108 ; 0x6c + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + ++fmt; + 1054fc: e2844001 add r4, r4, #1 + + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + 105500: e1a03002 mov r3, r2 + ++fmt; + if (qualifier == 'l' && *fmt == 'l') { + 105504: 15d42000 ldrbne r2, [r4] + 105508: 0a000079 beq 1056f4 + } + + /* default base */ + base = 10; + + switch (*fmt) { + 10550c: e2421025 sub r1, r2, #37 ; 0x25 + 105510: e3510053 cmp r1, #83 ; 0x53 + 105514: 979ff101 ldrls pc, [pc, r1, lsl #2] + 105518: ea00011d b 105994 + 10551c: 001059cc .word 0x001059cc + 105520: 00105994 .word 0x00105994 + 105524: 00105994 .word 0x00105994 + 105528: 00105994 .word 0x00105994 + 10552c: 00105994 .word 0x00105994 + 105530: 00105994 .word 0x00105994 + 105534: 00105994 .word 0x00105994 + 105538: 00105994 .word 0x00105994 + 10553c: 00105994 .word 0x00105994 + 105540: 00105994 .word 0x00105994 + 105544: 00105994 .word 0x00105994 + 105548: 00105994 .word 0x00105994 + 10554c: 00105994 .word 0x00105994 + 105550: 00105994 .word 0x00105994 + 105554: 00105994 .word 0x00105994 + 105558: 00105994 .word 0x00105994 + 10555c: 00105994 .word 0x00105994 + 105560: 00105994 .word 0x00105994 + 105564: 00105994 .word 0x00105994 + 105568: 00105994 .word 0x00105994 + 10556c: 00105994 .word 0x00105994 + 105570: 00105994 .word 0x00105994 + 105574: 00105994 .word 0x00105994 + 105578: 00105994 .word 0x00105994 + 10557c: 00105994 .word 0x00105994 + 105580: 00105994 .word 0x00105994 + 105584: 00105994 .word 0x00105994 + 105588: 00105994 .word 0x00105994 + 10558c: 00105994 .word 0x00105994 + 105590: 00105994 .word 0x00105994 + 105594: 00105994 .word 0x00105994 + 105598: 00105994 .word 0x00105994 + 10559c: 00105994 .word 0x00105994 + 1055a0: 00105994 .word 0x00105994 + 1055a4: 00105994 .word 0x00105994 + 1055a8: 00105994 .word 0x00105994 + 1055ac: 00105994 .word 0x00105994 + 1055b0: 00105994 .word 0x00105994 + 1055b4: 00105994 .word 0x00105994 + 1055b8: 00105994 .word 0x00105994 + 1055bc: 00105994 .word 0x00105994 + 1055c0: 00105994 .word 0x00105994 + 1055c4: 00105994 .word 0x00105994 + 1055c8: 00105994 .word 0x00105994 + 1055cc: 00105994 .word 0x00105994 + 1055d0: 00105994 .word 0x00105994 + 1055d4: 00105994 .word 0x00105994 + 1055d8: 00105994 .word 0x00105994 + 1055dc: 00105994 .word 0x00105994 + 1055e0: 00105994 .word 0x00105994 + 1055e4: 00105994 .word 0x00105994 + 1055e8: 001059c0 .word 0x001059c0 + 1055ec: 00105994 .word 0x00105994 + 1055f0: 00105994 .word 0x00105994 + 1055f4: 00105994 .word 0x00105994 + 1055f8: 00105994 .word 0x00105994 + 1055fc: 00105994 .word 0x00105994 + 105600: 00105994 .word 0x00105994 + 105604: 00105994 .word 0x00105994 + 105608: 00105994 .word 0x00105994 + 10560c: 00105994 .word 0x00105994 + 105610: 00105994 .word 0x00105994 + 105614: 00105a04 .word 0x00105a04 + 105618: 001059f8 .word 0x001059f8 + 10561c: 00105994 .word 0x00105994 + 105620: 00105994 .word 0x00105994 + 105624: 00105994 .word 0x00105994 + 105628: 00105994 .word 0x00105994 + 10562c: 001059f8 .word 0x001059f8 + 105630: 00105994 .word 0x00105994 + 105634: 00105994 .word 0x00105994 + 105638: 00105994 .word 0x00105994 + 10563c: 00105994 .word 0x00105994 + 105640: 001059e4 .word 0x001059e4 + 105644: 001059dc .word 0x001059dc + 105648: 0010596c .word 0x0010596c + 10564c: 00105994 .word 0x00105994 + 105650: 00105994 .word 0x00105994 + 105654: 00105794 .word 0x00105794 + 105658: 00105994 .word 0x00105994 + 10565c: 00105774 .word 0x00105774 + 105660: 00105994 .word 0x00105994 + 105664: 00105994 .word 0x00105994 + 105668: 00105724 .word 0x00105724 + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + 10566c: e352002a cmp r2, #42 ; 0x2a + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + 105670: 13e05000 mvnne r5, #0 + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + 105674: 1affff8e bne 1054b4 + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + 105678: e59a5000 ldr r5, [sl] + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + 10567c: e2844001 add r4, r4, #1 + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + 105680: e5d42000 ldrb r2, [r4] + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + 105684: e3550000 cmp r5, #0 + field_width = -field_width; + 105688: b2655000 rsblt r5, r5, #0 + flags |= LEFT; + 10568c: b3866010 orrlt r6, r6, #16 + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + 105690: e352002e cmp r2, #46 ; 0x2e + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + 105694: e28aa004 add sl, sl, #4 + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + 105698: 13e0c000 mvnne ip, #0 + if (*fmt == '.') { + 10569c: 1affff87 bne 1054c0 + ++fmt; + if (isdigit(*fmt)) + 1056a0: e5d43001 ldrb r3, [r4, #1] + 1056a4: e7d8c003 ldrb ip, [r8, r3] + 1056a8: e21cc004 ands ip, ip, #4 + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + ++fmt; + 1056ac: e2841001 add r1, r4, #1 + if (isdigit(*fmt)) + 1056b0: e1a02003 mov r2, r3 + 1056b4: 0a000013 beq 105708 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1056b8: e2842002 add r2, r4, #2 + 1056bc: e3a0c000 mov ip, #0 +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + 1056c0: e1a04002 mov r4, r2 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1056c4: e4d20001 ldrb r0, [r2], #1 + i = i*10 + *((*s)++) - '0'; + 1056c8: e2431030 sub r1, r3, #48 ; 0x30 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1056cc: e1a03000 mov r3, r0 + 1056d0: e7d80000 ldrb r0, [r8, r0] + i = i*10 + *((*s)++) - '0'; + 1056d4: e08cc10c add ip, ip, ip, lsl #2 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1056d8: e3100004 tst r0, #4 + i = i*10 + *((*s)++) - '0'; + 1056dc: e081c08c add ip, r1, ip, lsl #1 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 1056e0: 1afffff6 bne 1056c0 + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + 1056e4: e35c0000 cmp ip, #0 + 1056e8: e5d42000 ldrb r2, [r4] + precision = 0; + 1056ec: b3a0c000 movlt ip, #0 + 1056f0: eaffff72 b 1054c0 + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + ++fmt; + if (qualifier == 'l' && *fmt == 'l') { + 1056f4: e5d42000 ldrb r2, [r4] + 1056f8: e352006c cmp r2, #108 ; 0x6c + qualifier = 'L'; + ++fmt; + 1056fc: 05f42001 ldrbeq r2, [r4, #1]! + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { + qualifier = *fmt; + ++fmt; + if (qualifier == 'l' && *fmt == 'l') { + qualifier = 'L'; + 105700: 03a0304c moveq r3, #76 ; 0x4c + 105704: eaffff80 b 10550c + precision = -1; + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + 105708: e353002a cmp r3, #42 ; 0x2a + 10570c: 11a04001 movne r4, r1 + 105710: 1affff6a bne 1054c0 + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + 105714: e59ac000 ldr ip, [sl] + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + 105718: e2814001 add r4, r1, #1 + /* it's the next argument */ + precision = va_arg(args, int); + 10571c: e28aa004 add sl, sl, #4 + 105720: eaffffef b 1056e4 + break; + + case 'X': + flags |= LARGE; + case 'x': + base = 16; + 105724: e3a0e010 mov lr, #16 + } else { + --fmt; + } + continue; + } + if (qualifier == 'L') + 105728: e353004c cmp r3, #76 ; 0x4c + 10572c: 0a000013 beq 105780 + num = va_arg(args, long long); + else if (qualifier == 'l') { + 105730: e353006c cmp r3, #108 ; 0x6c + 105734: 0a0000ff beq 105b38 + num = va_arg(args, unsigned long); + if (flags & SIGN) + num = (signed long) num; + } else if (qualifier == 'Z' || qualifier == 'z') { + 105738: e353005a cmp r3, #90 ; 0x5a + 10573c: 1353007a cmpne r3, #122 ; 0x7a + 105740: 1a000103 bne 105b54 + num = va_arg(args, size_t); + 105744: e59a3000 ldr r3, [sl] + 105748: e28aa004 add sl, sl, #4 + 10574c: e1a02003 mov r2, r3 + 105750: e3a03000 mov r3, #0 + } else { + num = va_arg(args, unsigned int); + if (flags & SIGN) + num = (signed int) num; + } + str = number(str, end, num, base, + 105754: e1a00009 mov r0, r9 + 105758: e1a01007 mov r1, r7 + 10575c: e58de000 str lr, [sp] + 105760: e98d1020 stmib sp, {r5, ip} + 105764: e58d600c str r6, [sp, #12] + 105768: ebfffd05 bl 104b84 + 10576c: e1a09000 mov r9, r0 + 105770: eaffff13 b 1053c4 + } else { + --fmt; + } + continue; + } + if (qualifier == 'L') + 105774: e353004c cmp r3, #76 ; 0x4c + ++fmt; + } + } + + /* default base */ + base = 10; + 105778: e3a0e00a mov lr, #10 + } else { + --fmt; + } + continue; + } + if (qualifier == 'L') + 10577c: 1affffeb bne 105730 + num = va_arg(args, long long); + 105780: e28aa007 add sl, sl, #7 + 105784: e3ca1007 bic r1, sl, #7 + 105788: e281a008 add sl, r1, #8 + 10578c: e891000c ldm r1, {r2, r3} + 105790: eaffffef b 105754 + ++str; + } + continue; + + case 's': + s = va_arg(args, char *); + 105794: e59ae000 ldr lr, [sl] + + len = strnlen(s, precision); + 105798: e1a0100c mov r1, ip + 10579c: e1a0000e mov r0, lr + 1057a0: e58de01c str lr, [sp, #28] + 1057a4: eb000349 bl 1064d0 + + if (!(flags & LEFT)) { + 1057a8: e3160010 tst r6, #16 + ++str; + } + continue; + + case 's': + s = va_arg(args, char *); + 1057ac: e28aa004 add sl, sl, #4 + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + 1057b0: e59d301c ldr r3, [sp, #28] + 1057b4: 1a000029 bne 105860 + while (len < field_width--) { + 1057b8: e1550000 cmp r5, r0 + 1057bc: e2456001 sub r6, r5, #1 + 1057c0: d1a05006 movle r5, r6 + 1057c4: da000025 ble 105860 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1057c8: e089c005 add ip, r9, r5 + 1057cc: e060c00c rsb ip, r0, ip + 1057d0: e1e02009 mvn r2, r9 + 1057d4: e08c1002 add r1, ip, r2 + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + 1057d8: e1570009 cmp r7, r9 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1057dc: e58d5024 str r5, [sp, #36] ; 0x24 + 1057e0: e2011001 and r1, r1, #1 + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + 1057e4: 2a0000eb bcs 105b98 + *str = ' '; + ++str; + 1057e8: e2892001 add r2, r9, #1 + s = va_arg(args, char *); + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + 1057ec: e152000c cmp r2, ip + 1057f0: 0a000013 beq 105844 + 1057f4: e3510000 cmp r1, #0 + 1057f8: 0a000005 beq 105814 + if (str <= end) + 1057fc: e1570002 cmp r7, r2 + *str = ' '; + 105800: 23a01020 movcs r1, #32 + 105804: 25c21000 strbcs r1, [r2] + ++str; + 105808: e2822001 add r2, r2, #1 + s = va_arg(args, char *); + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + 10580c: e152000c cmp r2, ip + 105810: 0a00000b beq 105844 + 105814: e58d3014 str r3, [sp, #20] + if (str <= end) + 105818: e1570002 cmp r7, r2 + *str = ' '; + 10581c: 23a03020 movcs r3, #32 + ++str; + 105820: e2821001 add r1, r2, #1 + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + *str = ' '; + 105824: 25c23000 strbcs r3, [r2] + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + 105828: e1570001 cmp r7, r1 + *str = ' '; + 10582c: 23a03020 movcs r3, #32 + 105830: 25c23001 strbcs r3, [r2, #1] + ++str; + 105834: e2812001 add r2, r1, #1 + s = va_arg(args, char *); + + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + 105838: e152000c cmp r2, ip + 10583c: 1afffff5 bne 105818 + 105840: e59d3014 ldr r3, [sp, #20] + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 105844: e59dc024 ldr ip, [sp, #36] ; 0x24 + 105848: e2655001 rsb r5, r5, #1 + 10584c: e2466001 sub r6, r6, #1 + 105850: e0851000 add r1, r5, r0 + 105854: e060e00c rsb lr, r0, ip + 105858: e0865001 add r5, r6, r1 + 10585c: e089900e add r9, r9, lr + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 105860: e3500000 cmp r0, #0 + 105864: da00001f ble 1058e8 + 105868: e2401001 sub r1, r0, #1 + if (str <= end) + 10586c: e1570009 cmp r7, r9 + 105870: e2011001 and r1, r1, #1 + *str = *s; + 105874: 25d3e000 ldrbcs lr, [r3] + 105878: 25c9e000 strbcs lr, [r9] + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 10587c: e3a02001 mov r2, #1 + 105880: e1500002 cmp r0, r2 + 105884: 0a000016 beq 1058e4 + 105888: e3510000 cmp r1, #0 + 10588c: 0a000006 beq 1058ac + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 105890: e0891002 add r1, r9, r2 + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + if (str <= end) + 105894: e1570001 cmp r7, r1 + *str = *s; + 105898: 25d31001 ldrbcs r1, [r3, #1] + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 10589c: e2822001 add r2, r2, #1 + if (str <= end) + *str = *s; + 1058a0: 25c91001 strbcs r1, [r9, #1] + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 1058a4: e1500002 cmp r0, r2 + 1058a8: 0a00000d beq 1058e4 + 1058ac: e1a06005 mov r6, r5 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1058b0: e089e002 add lr, r9, r2 + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + if (str <= end) + 1058b4: e157000e cmp r7, lr + *str = *s; + 1058b8: 27d3e002 ldrbcs lr, [r3, r2] + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 1058bc: e2821001 add r1, r2, #1 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1058c0: e089c001 add ip, r9, r1 + ++str; + } + } + for (i = 0; i < len; ++i) { + if (str <= end) + *str = *s; + 1058c4: 27c9e002 strbcs lr, [r9, r2] + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + if (str <= end) + 1058c8: e157000c cmp r7, ip + *str = *s; + 1058cc: 27d35001 ldrbcs r5, [r3, r1] + 1058d0: 27c95001 strbcs r5, [r9, r1] + if (str <= end) + *str = ' '; + ++str; + } + } + for (i = 0; i < len; ++i) { + 1058d4: e2812001 add r2, r1, #1 + 1058d8: e1500002 cmp r0, r2 + 1058dc: 1afffff3 bne 1058b0 + 1058e0: e1a05006 mov r5, r6 + 1058e4: e0899000 add r9, r9, r0 + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + 1058e8: e1550000 cmp r5, r0 + 1058ec: dafffeb4 ble 1053c4 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 1058f0: e0602005 rsb r2, r0, r5 + 1058f4: e0892002 add r2, r9, r2 + 1058f8: e1e0e009 mvn lr, r9 + 1058fc: e082300e add r3, r2, lr + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + if (str <= end) + 105900: e1570009 cmp r7, r9 + 105904: e2033001 and r3, r3, #1 + *str = ' '; + 105908: 23a00020 movcs r0, #32 + 10590c: 25c90000 strbcs r0, [r9] + ++str; + 105910: e2899001 add r9, r9, #1 + for (i = 0; i < len; ++i) { + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + 105914: e1590002 cmp r9, r2 + 105918: 0a000011 beq 105964 + 10591c: e3530000 cmp r3, #0 + 105920: 0a000005 beq 10593c + if (str <= end) + 105924: e1570009 cmp r7, r9 + *str = ' '; + 105928: 23a01020 movcs r1, #32 + 10592c: 25c91000 strbcs r1, [r9] + ++str; + 105930: e2899001 add r9, r9, #1 + for (i = 0; i < len; ++i) { + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + 105934: e1590002 cmp r9, r2 + 105938: 0a000009 beq 105964 + if (str <= end) + 10593c: e1570009 cmp r7, r9 + *str = ' '; + 105940: 23a00020 movcs r0, #32 + ++str; + 105944: e2893001 add r3, r9, #1 + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + if (str <= end) + *str = ' '; + 105948: 25c90000 strbcs r0, [r9] + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + if (str <= end) + 10594c: e1570003 cmp r7, r3 + *str = ' '; + 105950: 23a0c020 movcs ip, #32 + 105954: 25c9c001 strbcs ip, [r9, #1] + ++str; + 105958: e2839001 add r9, r3, #1 + for (i = 0; i < len; ++i) { + if (str <= end) + *str = *s; + ++str; ++s; + } + while (len < field_width--) { + 10595c: e1590002 cmp r9, r2 + 105960: 1afffff5 bne 10593c + 105964: e1a09002 mov r9, r2 + 105968: eafffe95 b 1053c4 + ++str; + } + continue; + + case 'p': + if (field_width == -1) { + 10596c: e3750001 cmn r5, #1 + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + str = number(str, end, + 105970: e59a2000 ldr r2, [sl] + continue; + + case 'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + 105974: 03866001 orreq r6, r6, #1 + } + continue; + + case 'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + 105978: 03a05008 moveq r5, #8 + flags |= ZEROPAD; + } + str = number(str, end, + (unsigned long) va_arg(args, void *), + 10597c: e28aa004 add sl, sl, #4 + case 'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + str = number(str, end, + 105980: e1a00009 mov r0, r9 + 105984: e1a01007 mov r1, r7 + 105988: e3a03000 mov r3, #0 + 10598c: e3a0e010 mov lr, #16 + 105990: eaffff71 b 10575c + flags |= SIGN; + case 'u': + break; + + default: + if (str <= end) + 105994: e1590007 cmp r9, r7 + *str = '%'; + 105998: 93a03025 movls r3, #37 ; 0x25 + 10599c: 95c93000 strbls r3, [r9] + 1059a0: 95d42000 ldrbls r2, [r4] + ++str; + if (*fmt) { + 1059a4: e3520000 cmp r2, #0 + break; + + default: + if (str <= end) + *str = '%'; + ++str; + 1059a8: e2899001 add r9, r9, #1 + if (*fmt) { + if (str <= end) + *str = *fmt; + ++str; + } else { + --fmt; + 1059ac: 02444001 subeq r4, r4, #1 + + default: + if (str <= end) + *str = '%'; + ++str; + if (*fmt) { + 1059b0: 0afffe83 beq 1053c4 + if (str <= end) + 1059b4: e1590007 cmp r9, r7 + *str = *fmt; + 1059b8: 95c92000 strbls r2, [r9] + 1059bc: eafffe7f b 1053c0 + case 'o': + base = 8; + break; + + case 'X': + flags |= LARGE; + 1059c0: e3866040 orr r6, r6, #64 ; 0x40 + case 'x': + base = 16; + 1059c4: e3a0e010 mov lr, #16 + 1059c8: eaffff56 b 105728 + *ip = (str - buf); + } + continue; + + case '%': + if (str <= end) + 1059cc: e1590007 cmp r9, r7 + *str = '%'; + 1059d0: 93a03025 movls r3, #37 ; 0x25 + 1059d4: 95c93000 strbls r3, [r9] + 1059d8: eafffe78 b 1053c0 + ++str; + continue; + + /* integer number formats - set up the flags and "break" */ + case 'o': + base = 8; + 1059dc: e3a0e008 mov lr, #8 + break; + 1059e0: eaffff50 b 105728 + } else if (qualifier == 'Z' || qualifier == 'z') { + size_t * ip = va_arg(args, size_t *); + *ip = (str - buf); + } else { + int * ip = va_arg(args, int *); + *ip = (str - buf); + 1059e4: e59a3000 ldr r3, [sl] + 1059e8: e06b0009 rsb r0, fp, r9 + 1059ec: e5830000 str r0, [r3] + *ip = (str - buf); + } else if (qualifier == 'Z' || qualifier == 'z') { + size_t * ip = va_arg(args, size_t *); + *ip = (str - buf); + } else { + int * ip = va_arg(args, int *); + 1059f0: e28aa004 add sl, sl, #4 + 1059f4: eafffe72 b 1053c4 + base = 16; + break; + + case 'd': + case 'i': + flags |= SIGN; + 1059f8: e3866002 orr r6, r6, #2 + ++fmt; + } + } + + /* default base */ + base = 10; + 1059fc: e3a0e00a mov lr, #10 + 105a00: eaffff48 b 105728 + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + 105a04: e3160010 tst r6, #16 + 105a08: 1a000021 bne 105a94 + while (--field_width > 0) { + 105a0c: e2451001 sub r1, r5, #1 + 105a10: e3510000 cmp r1, #0 + 105a14: d1a05001 movle r5, r1 + 105a18: da00001d ble 105a94 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 105a1c: e2490001 sub r0, r9, #1 + 105a20: e0805005 add r5, r0, r5 + 105a24: e1e03009 mvn r3, r9 + 105a28: e0852003 add r2, r5, r3 + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + if (str <= end) + 105a2c: e1570009 cmp r7, r9 + 105a30: e2022001 and r2, r2, #1 + 105a34: 2a00005a bcs 105ba4 + *str = ' '; + ++str; + 105a38: e2893001 add r3, r9, #1 + base = 10; + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + 105a3c: e1530005 cmp r3, r5 + 105a40: 0a000011 beq 105a8c + 105a44: e3520000 cmp r2, #0 + 105a48: 0a000005 beq 105a64 + if (str <= end) + 105a4c: e1570003 cmp r7, r3 + *str = ' '; + 105a50: 23a02020 movcs r2, #32 + 105a54: 25c32000 strbcs r2, [r3] + ++str; + 105a58: e2833001 add r3, r3, #1 + base = 10; + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + 105a5c: e1530005 cmp r3, r5 + 105a60: 0a000009 beq 105a8c + if (str <= end) + 105a64: e1570003 cmp r7, r3 + *str = ' '; + 105a68: 23a0c020 movcs ip, #32 + ++str; + 105a6c: e2832001 add r2, r3, #1 + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + if (str <= end) + *str = ' '; + 105a70: 25c3c000 strbcs ip, [r3] + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + if (str <= end) + 105a74: e1570002 cmp r7, r2 + *str = ' '; + 105a78: 23a0c020 movcs ip, #32 + 105a7c: 25c3c001 strbcs ip, [r3, #1] + ++str; + 105a80: e2823001 add r3, r2, #1 + base = 10; + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + 105a84: e1530005 cmp r3, r5 + 105a88: 1afffff5 bne 105a64 + 105a8c: e0899001 add r9, r9, r1 + 105a90: e3a05000 mov r5, #0 + if (str <= end) + *str = ' '; + ++str; + } + } + c = (unsigned char) va_arg(args, int); + 105a94: e59a3000 ldr r3, [sl] + if (str <= end) + 105a98: e1590007 cmp r9, r7 + if (str <= end) + *str = ' '; + ++str; + } + } + c = (unsigned char) va_arg(args, int); + 105a9c: 95c93000 strbls r3, [r9] + 105aa0: e28a0004 add r0, sl, #4 + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + 105aa4: e3550001 cmp r5, #1 + } + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + 105aa8: e2891001 add r1, r9, #1 + if (str <= end) + *str = ' '; + ++str; + } + } + c = (unsigned char) va_arg(args, int); + 105aac: d1a0a000 movle sl, r0 + if (str <= end) + *str = c; + ++str; + 105ab0: d1a09001 movle r9, r1 + while (--field_width > 0) { + 105ab4: dafffe42 ble 1053c4 + 105ab8: e1e02001 mvn r2, r1 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 105abc: e0899005 add r9, r9, r5 + 105ac0: e089a002 add sl, r9, r2 + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + if (str <= end) + 105ac4: e1570001 cmp r7, r1 + 105ac8: e20a2001 and r2, sl, #1 + *str = ' '; + 105acc: 23a0a020 movcs sl, #32 + 105ad0: 25c1a000 strbcs sl, [r1] + ++str; + 105ad4: e2813001 add r3, r1, #1 + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + 105ad8: e1530009 cmp r3, r9 + 105adc: 0a000011 beq 105b28 + 105ae0: e3520000 cmp r2, #0 + 105ae4: 0a000005 beq 105b00 + if (str <= end) + 105ae8: e1570003 cmp r7, r3 + *str = ' '; + 105aec: 23a0c020 movcs ip, #32 + ++str; + 105af0: e2833001 add r3, r3, #1 + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + if (str <= end) + *str = ' '; + 105af4: 25c1c001 strbcs ip, [r1, #1] + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + 105af8: e1530009 cmp r3, r9 + 105afc: 0a000009 beq 105b28 + if (str <= end) + 105b00: e1570003 cmp r7, r3 + *str = ' '; + 105b04: 23a0c020 movcs ip, #32 + ++str; + 105b08: e2832001 add r2, r3, #1 + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + if (str <= end) + *str = ' '; + 105b0c: 25c3c000 strbcs ip, [r3] + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + if (str <= end) + 105b10: e1570002 cmp r7, r2 + *str = ' '; + 105b14: 23a0c020 movcs ip, #32 + 105b18: 25c3c001 strbcs ip, [r3, #1] + ++str; + 105b1c: e2823001 add r3, r2, #1 + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + 105b20: e1530009 cmp r3, r9 + 105b24: 1afffff5 bne 105b00 + * string is truncated. + * + * Call this function if you are already dealing with a va_list. + * You probably want snprintf instead. + */ +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + 105b28: e2455001 sub r5, r5, #1 + } + c = (unsigned char) va_arg(args, int); + if (str <= end) + *str = c; + ++str; + while (--field_width > 0) { + 105b2c: e0819005 add r9, r1, r5 + if (str <= end) + *str = ' '; + ++str; + } + } + c = (unsigned char) va_arg(args, int); + 105b30: e1a0a000 mov sl, r0 + 105b34: eafffe22 b 1053c4 + } else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); + if (flags & SIGN) + num = (signed short) num; + } else { + num = va_arg(args, unsigned int); + 105b38: e59a1000 ldr r1, [sl] + if (flags & SIGN) + 105b3c: e3160002 tst r6, #2 + } else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); + if (flags & SIGN) + num = (signed short) num; + } else { + num = va_arg(args, unsigned int); + 105b40: e1a02001 mov r2, r1 + 105b44: e3a03000 mov r3, #0 + 105b48: e28aa004 add sl, sl, #4 + if (flags & SIGN) + num = (signed int) num; + 105b4c: 11a03fc2 asrne r3, r2, #31 + 105b50: eafffeff b 105754 + num = va_arg(args, unsigned long); + if (flags & SIGN) + num = (signed long) num; + } else if (qualifier == 'Z' || qualifier == 'z') { + num = va_arg(args, size_t); + } else if (qualifier == 't') { + 105b54: e3530074 cmp r3, #116 ; 0x74 + 105b58: 0a00000a beq 105b88 + num = va_arg(args, ptrdiff_t); + } else if (qualifier == 'h') { + 105b5c: e3530068 cmp r3, #104 ; 0x68 + 105b60: 1afffff4 bne 105b38 + num = (unsigned short) va_arg(args, int); + 105b64: e1da00b0 ldrh r0, [sl] + if (flags & SIGN) + 105b68: e3160002 tst r6, #2 + } else if (qualifier == 'Z' || qualifier == 'z') { + num = va_arg(args, size_t); + } else if (qualifier == 't') { + num = va_arg(args, ptrdiff_t); + } else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); + 105b6c: e1a02000 mov r2, r0 + 105b70: e3a03000 mov r3, #0 + if (flags & SIGN) + num = (signed short) num; + 105b74: 11a02800 lslne r2, r0, #16 + 105b78: 11a02842 asrne r2, r2, #16 + } else if (qualifier == 'Z' || qualifier == 'z') { + num = va_arg(args, size_t); + } else if (qualifier == 't') { + num = va_arg(args, ptrdiff_t); + } else if (qualifier == 'h') { + num = (unsigned short) va_arg(args, int); + 105b7c: e28aa004 add sl, sl, #4 + if (flags & SIGN) + num = (signed short) num; + 105b80: 11a03fc2 asrne r3, r2, #31 + 105b84: eafffef2 b 105754 + if (flags & SIGN) + num = (signed long) num; + } else if (qualifier == 'Z' || qualifier == 'z') { + num = va_arg(args, size_t); + } else if (qualifier == 't') { + num = va_arg(args, ptrdiff_t); + 105b88: e59a2000 ldr r2, [sl] + 105b8c: e28aa004 add sl, sl, #4 + 105b90: e1a03fc2 asr r3, r2, #31 + 105b94: eafffeee b 105754 + len = strnlen(s, precision); + + if (!(flags & LEFT)) { + while (len < field_width--) { + if (str <= end) + *str = ' '; + 105b98: e3a02020 mov r2, #32 + 105b9c: e5c92000 strb r2, [r9] + 105ba0: eaffff10 b 1057e8 + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) { + while (--field_width > 0) { + if (str <= end) + *str = ' '; + 105ba4: e3a03020 mov r3, #32 + 105ba8: e5c93000 strb r3, [r9] + 105bac: eaffffa1 b 105a38 + 105bb0: 0020020c .word 0x0020020c + +00105bb4 : + * + * Call this function if you are already dealing with a va_list. + * You probably want scnprintf instead. + */ +int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + 105bb4: e92d4010 push {r4, lr} + 105bb8: e1a04001 mov r4, r1 + unsigned int i; + + i=vsnprintf(buf,size,fmt,args); + 105bbc: ebfffde3 bl 105350 + return (i >= size) ? (size - 1) : i; + 105bc0: e1540000 cmp r4, r0 + 105bc4: 92440001 subls r0, r4, #1 +} + 105bc8: e8bd4010 pop {r4, lr} + 105bcc: e12fff1e bx lr + +00105bd0 : + * generated for the given input, excluding the trailing null, + * as per ISO C99. If the return is greater than or equal to + * @size, the resulting string is truncated. + */ +int snprintf(char * buf, size_t size, const char *fmt, ...) +{ + 105bd0: e92d000c push {r2, r3} + 105bd4: e52de004 push {lr} ; (str lr, [sp, #-4]!) + 105bd8: e24dd00c sub sp, sp, #12 + va_list args; + int i; + + va_start(args, fmt); + 105bdc: e28dc014 add ip, sp, #20 + i=vsnprintf(buf,size,fmt,args); + 105be0: e59d2010 ldr r2, [sp, #16] + 105be4: e1a0300c mov r3, ip +int snprintf(char * buf, size_t size, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + 105be8: e58dc004 str ip, [sp, #4] + i=vsnprintf(buf,size,fmt,args); + 105bec: ebfffdd7 bl 105350 + va_end(args); + return i; +} + 105bf0: e28dd00c add sp, sp, #12 + 105bf4: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 105bf8: e28dd008 add sp, sp, #8 + 105bfc: e12fff1e bx lr + +00105c00 : + * the trailing '\0'. If @size is <= 0 the function returns 0. If the return is + * greater than or equal to @size, the resulting string is truncated. + */ + +int scnprintf(char * buf, size_t size, const char *fmt, ...) +{ + 105c00: e92d000c push {r2, r3} + 105c04: e92d4010 push {r4, lr} + 105c08: e24dd008 sub sp, sp, #8 + va_list args; + unsigned int i; + + va_start(args, fmt); + 105c0c: e28dc014 add ip, sp, #20 + i = vsnprintf(buf, size, fmt, args); + 105c10: e59d2010 ldr r2, [sp, #16] + 105c14: e1a0300c mov r3, ip + * the trailing '\0'. If @size is <= 0 the function returns 0. If the return is + * greater than or equal to @size, the resulting string is truncated. + */ + +int scnprintf(char * buf, size_t size, const char *fmt, ...) +{ + 105c18: e1a04001 mov r4, r1 + va_list args; + unsigned int i; + + va_start(args, fmt); + 105c1c: e58dc004 str ip, [sp, #4] + i = vsnprintf(buf, size, fmt, args); + 105c20: ebfffdca bl 105350 + va_end(args); + return (i >= size) ? (size - 1) : i; + 105c24: e1540000 cmp r4, r0 + 105c28: 92440001 subls r0, r4, #1 +} + 105c2c: e28dd008 add sp, sp, #8 + 105c30: e8bd4010 pop {r4, lr} + 105c34: e28dd008 add sp, sp, #8 + 105c38: e12fff1e bx lr + +00105c3c : + * + * Call this function if you are already dealing with a va_list. + * You probably want sprintf instead. + */ +int vsprintf(char *buf, const char *fmt, va_list args) +{ + 105c3c: e1a0c001 mov ip, r1 + 105c40: e1a03002 mov r3, r2 + return vsnprintf(buf, INT_MAX, fmt, args); + 105c44: e3e01102 mvn r1, #-2147483648 ; 0x80000000 + 105c48: e1a0200c mov r2, ip + 105c4c: eafffdbf b 105350 + +00105c50 : + * The function returns the number of characters written + * into @buf. Use snprintf or scnprintf in order to avoid + * buffer overflows. + */ +int sprintf(char * buf, const char *fmt, ...) +{ + 105c50: e92d000e push {r1, r2, r3} + 105c54: e52de004 push {lr} ; (str lr, [sp, #-4]!) + 105c58: e24dd008 sub sp, sp, #8 + va_list args; + int i; + + va_start(args, fmt); + 105c5c: e28dc010 add ip, sp, #16 + i=vsnprintf(buf, INT_MAX, fmt, args); + 105c60: e3e01102 mvn r1, #-2147483648 ; 0x80000000 + 105c64: e59d200c ldr r2, [sp, #12] + 105c68: e1a0300c mov r3, ip +int sprintf(char * buf, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + 105c6c: e58dc004 str ip, [sp, #4] + i=vsnprintf(buf, INT_MAX, fmt, args); + 105c70: ebfffdb6 bl 105350 + va_end(args); + return i; +} + 105c74: e28dd008 add sp, sp, #8 + 105c78: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 105c7c: e28dd00c add sp, sp, #12 + 105c80: e12fff1e bx lr + +00105c84 : + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) +{ + 105c84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} + while(*fmt && *str) { + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + 105c88: e59f580c ldr r5, [pc, #2060] ; 10649c + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) +{ + 105c8c: e1a03002 mov r3, r2 + const char *str = buf; + char *next; + char digit; + int num = 0; + 105c90: e5d12000 ldrb r2, [r1] + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) +{ + 105c94: e24dd014 sub sp, sp, #20 + 105c98: e1a07000 mov r7, r0 + 105c9c: e1a04001 mov r4, r1 + const char *str = buf; + char *next; + char digit; + int num = 0; + 105ca0: e3a06000 mov r6, #0 + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + while (isspace(*fmt)) + 105ca4: e1a08005 mov r8, r5 + int qualifier; + int base; + int field_width; + int is_sign = 0; + + while(*fmt && *str) { + 105ca8: e3520000 cmp r2, #0 + 105cac: 0a00001d beq 105d28 + 105cb0: e5d0c000 ldrb ip, [r0] + 105cb4: e35c0000 cmp ip, #0 + 105cb8: 0a00001a beq 105d28 + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + 105cbc: e7d51002 ldrb r1, [r5, r2] + 105cc0: e3110020 tst r1, #32 + 105cc4: 0a00000f beq 105d08 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105cc8: e2841001 add r1, r4, #1 + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + while (isspace(*fmt)) + 105ccc: e5d12000 ldrb r2, [r1] + while(*fmt && *str) { + /* skip any white space in format */ + /* white space in format matchs any amount of + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + 105cd0: e1a04001 mov r4, r1 + while (isspace(*fmt)) + 105cd4: e7d51002 ldrb r1, [r5, r2] + 105cd8: e3110020 tst r1, #32 + 105cdc: e2841001 add r1, r4, #1 + 105ce0: 1afffff9 bne 105ccc + ++fmt; + while (isspace(*str)) + 105ce4: e7d8c00c ldrb ip, [r8, ip] + 105ce8: e31c0020 tst ip, #32 + 105cec: 0a000005 beq 105d08 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105cf0: e2801001 add r1, r0, #1 + * white space, including none, in the input. + */ + if (isspace(*fmt)) { + while (isspace(*fmt)) + ++fmt; + while (isspace(*str)) + 105cf4: e1a00001 mov r0, r1 + 105cf8: e4d1c001 ldrb ip, [r1], #1 + 105cfc: e7d5c00c ldrb ip, [r5, ip] + 105d00: e31c0020 tst ip, #32 + 105d04: 1afffffa bne 105cf4 + ++str; + } + + /* anything that is not a conversion must match exactly */ + if (*fmt != '%' && *fmt) { + 105d08: e3520000 cmp r2, #0 + 105d0c: 13520025 cmpne r2, #37 ; 0x25 + 105d10: 03a0c000 moveq ip, #0 + 105d14: 13a0c001 movne ip, #1 + 105d18: 0a000006 beq 105d38 + if (*fmt++ != *str++) + 105d1c: e5d01000 ldrb r1, [r0] + 105d20: e1510002 cmp r1, r2 + 105d24: 0a000088 beq 105f4c + if (!next) + break; + str = next; + } + return num; +} + 105d28: e1a00006 mov r0, r6 + 105d2c: e28dd014 add sp, sp, #20 + 105d30: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 105d34: e12fff1e bx lr + if (*fmt++ != *str++) + break; + continue; + } + + if (!*fmt) + 105d38: e3520000 cmp r2, #0 + 105d3c: 0afffff9 beq 105d28 + ++fmt; + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + 105d40: e5d42001 ldrb r2, [r4, #1] + 105d44: e352002a cmp r2, #42 ; 0x2a + continue; + } + + if (!*fmt) + break; + ++fmt; + 105d48: e284a001 add sl, r4, #1 + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + 105d4c: 0a000081 beq 105f58 + continue; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + 105d50: e7d51002 ldrb r1, [r5, r2] + 105d54: e3110004 tst r1, #4 + str++; + continue; + } + + /* get field width */ + field_width = -1; + 105d58: 03e0c000 mvneq ip, #0 + if (isdigit(*fmt)) + 105d5c: 0a000008 beq 105d84 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105d60: e2844002 add r4, r4, #2 +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + 105d64: e2421030 sub r1, r2, #48 ; 0x30 + 105d68: e1a0a004 mov sl, r4 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 105d6c: e4d42001 ldrb r2, [r4], #1 + 105d70: e7d59002 ldrb r9, [r5, r2] + i = i*10 + *((*s)++) - '0'; + 105d74: e08cc10c add ip, ip, ip, lsl #2 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 105d78: e3190004 tst r9, #4 + i = i*10 + *((*s)++) - '0'; + 105d7c: e081c08c add ip, r1, ip, lsl #1 + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + 105d80: 1afffff7 bne 105d64 + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + + /* get conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 105d84: e3520068 cmp r2, #104 ; 0x68 + 105d88: 1352006c cmpne r2, #108 ; 0x6c + 105d8c: 0a000064 beq 105f24 + 105d90: e352005a cmp r2, #90 ; 0x5a + 105d94: 0a000062 beq 105f24 + 105d98: e352007a cmp r2, #122 ; 0x7a + 105d9c: 0a000060 beq 105f24 + 105da0: e352004c cmp r2, #76 ; 0x4c + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + + /* get conversion qualifier */ + qualifier = -1; + 105da4: 13e09000 mvnne r9, #0 + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + 105da8: 0a00005d beq 105f24 + } + } + base = 10; + is_sign = 0; + + if (!*fmt || !*str) + 105dac: e3520000 cmp r2, #0 + 105db0: 0affffdc beq 105d28 + 105db4: e5d01000 ldrb r1, [r0] + 105db8: e3510000 cmp r1, #0 + 105dbc: 0affffd9 beq 105d28 + break; + + switch(*fmt++) { + 105dc0: e2422025 sub r2, r2, #37 ; 0x25 + 105dc4: e28a4001 add r4, sl, #1 + 105dc8: e3520053 cmp r2, #83 ; 0x53 + 105dcc: 979ff102 ldrls pc, [pc, r2, lsl #2] + 105dd0: eaffffd4 b 105d28 + 105dd4: 00105fcc .word 0x00105fcc + 105dd8: 00105d28 .word 0x00105d28 + 105ddc: 00105d28 .word 0x00105d28 + 105de0: 00105d28 .word 0x00105d28 + 105de4: 00105d28 .word 0x00105d28 + 105de8: 00105d28 .word 0x00105d28 + 105dec: 00105d28 .word 0x00105d28 + 105df0: 00105d28 .word 0x00105d28 + 105df4: 00105d28 .word 0x00105d28 + 105df8: 00105d28 .word 0x00105d28 + 105dfc: 00105d28 .word 0x00105d28 + 105e00: 00105d28 .word 0x00105d28 + 105e04: 00105d28 .word 0x00105d28 + 105e08: 00105d28 .word 0x00105d28 + 105e0c: 00105d28 .word 0x00105d28 + 105e10: 00105d28 .word 0x00105d28 + 105e14: 00105d28 .word 0x00105d28 + 105e18: 00105d28 .word 0x00105d28 + 105e1c: 00105d28 .word 0x00105d28 + 105e20: 00105d28 .word 0x00105d28 + 105e24: 00105d28 .word 0x00105d28 + 105e28: 00105d28 .word 0x00105d28 + 105e2c: 00105d28 .word 0x00105d28 + 105e30: 00105d28 .word 0x00105d28 + 105e34: 00105d28 .word 0x00105d28 + 105e38: 00105d28 .word 0x00105d28 + 105e3c: 00105d28 .word 0x00105d28 + 105e40: 00105d28 .word 0x00105d28 + 105e44: 00105d28 .word 0x00105d28 + 105e48: 00105d28 .word 0x00105d28 + 105e4c: 00105d28 .word 0x00105d28 + 105e50: 00105d28 .word 0x00105d28 + 105e54: 00105d28 .word 0x00105d28 + 105e58: 00105d28 .word 0x00105d28 + 105e5c: 00105d28 .word 0x00105d28 + 105e60: 00105d28 .word 0x00105d28 + 105e64: 00105d28 .word 0x00105d28 + 105e68: 00105d28 .word 0x00105d28 + 105e6c: 00105d28 .word 0x00105d28 + 105e70: 00105d28 .word 0x00105d28 + 105e74: 00105d28 .word 0x00105d28 + 105e78: 00105d28 .word 0x00105d28 + 105e7c: 00105d28 .word 0x00105d28 + 105e80: 00105d28 .word 0x00105d28 + 105e84: 00105d28 .word 0x00105d28 + 105e88: 00105d28 .word 0x00105d28 + 105e8c: 00105d28 .word 0x00105d28 + 105e90: 00105d28 .word 0x00105d28 + 105e94: 00105d28 .word 0x00105d28 + 105e98: 00105d28 .word 0x00105d28 + 105e9c: 00105d28 .word 0x00105d28 + 105ea0: 0010615c .word 0x0010615c + 105ea4: 00105d28 .word 0x00105d28 + 105ea8: 00105d28 .word 0x00105d28 + 105eac: 00105d28 .word 0x00105d28 + 105eb0: 00105d28 .word 0x00105d28 + 105eb4: 00105d28 .word 0x00105d28 + 105eb8: 00105d28 .word 0x00105d28 + 105ebc: 00105d28 .word 0x00105d28 + 105ec0: 00105d28 .word 0x00105d28 + 105ec4: 00105d28 .word 0x00105d28 + 105ec8: 00105d28 .word 0x00105d28 + 105ecc: 0010616c .word 0x0010616c + 105ed0: 00105fe0 .word 0x00105fe0 + 105ed4: 00105d28 .word 0x00105d28 + 105ed8: 00105d28 .word 0x00105d28 + 105edc: 00105d28 .word 0x00105d28 + 105ee0: 00105d28 .word 0x00105d28 + 105ee4: 0010614c .word 0x0010614c + 105ee8: 00105d28 .word 0x00105d28 + 105eec: 00105d28 .word 0x00105d28 + 105ef0: 00105d28 .word 0x00105d28 + 105ef4: 00105d28 .word 0x00105d28 + 105ef8: 001061dc .word 0x001061dc + 105efc: 001062e8 .word 0x001062e8 + 105f00: 00105d28 .word 0x00105d28 + 105f04: 00105d28 .word 0x00105d28 + 105f08: 00105d28 .word 0x00105d28 + 105f0c: 001061f4 .word 0x001061f4 + 105f10: 00105d28 .word 0x00105d28 + 105f14: 001062d8 .word 0x001062d8 + 105f18: 00105d28 .word 0x00105d28 + 105f1c: 00105d28 .word 0x00105d28 + 105f20: 0010615c .word 0x0010615c + + /* get conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt == 'Z' || *fmt == 'z') { + qualifier = *fmt++; + 105f24: e1a09002 mov r9, r2 + if (qualifier == *fmt) { + 105f28: e5fa2001 ldrb r2, [sl, #1]! + 105f2c: e1520009 cmp r2, r9 + 105f30: 1affff9d bne 105dac + if (qualifier == 'h') { + 105f34: e3520068 cmp r2, #104 ; 0x68 + 105f38: 0a000154 beq 106490 + qualifier = 'H'; + fmt++; + } else if (qualifier == 'l') { + 105f3c: e352006c cmp r2, #108 ; 0x6c + qualifier = 'L'; + fmt++; + 105f40: 05fa2001 ldrbeq r2, [sl, #1]! + if (qualifier == *fmt) { + if (qualifier == 'h') { + qualifier = 'H'; + fmt++; + } else if (qualifier == 'l') { + qualifier = 'L'; + 105f44: 03a0904c moveq r9, #76 ; 0x4c + 105f48: eaffff97 b 105dac + ++str; + } + + /* anything that is not a conversion must match exactly */ + if (*fmt != '%' && *fmt) { + if (*fmt++ != *str++) + 105f4c: e2800001 add r0, r0, #1 + 105f50: e5f42001 ldrb r2, [r4, #1]! + 105f54: eaffff53 b 105ca8 + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + while (!isspace(*fmt) && *fmt) + 105f58: e5d5c02a ldrb ip, [r5, #42] ; 0x2a + 105f5c: e31c0020 tst ip, #32 + 105f60: 11a0400a movne r4, sl + 105f64: 1a000008 bne 105f8c + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105f68: e2841002 add r1, r4, #2 + 105f6c: ea000001 b 105f78 + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + while (!isspace(*fmt) && *fmt) + 105f70: e3520000 cmp r2, #0 + 105f74: 0a000004 beq 105f8c + 105f78: e1a04001 mov r4, r1 + 105f7c: e4d12001 ldrb r2, [r1], #1 + 105f80: e7d5c002 ldrb ip, [r5, r2] + 105f84: e31c0020 tst ip, #32 + 105f88: 0afffff8 beq 105f70 + fmt++; + while (!isspace(*str) && *str) + 105f8c: e5d01000 ldrb r1, [r0] + 105f90: e7d5c001 ldrb ip, [r5, r1] + 105f94: e31c0020 tst ip, #32 + 105f98: 1affff42 bne 105ca8 + 105f9c: e3510000 cmp r1, #0 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105fa0: 12801001 addne r1, r0, #1 + * advance both strings to next white space + */ + if (*fmt == '*') { + while (!isspace(*fmt) && *fmt) + fmt++; + while (!isspace(*str) && *str) + 105fa4: 1a000002 bne 105fb4 + 105fa8: eaffff3e b 105ca8 + 105fac: e35c0000 cmp ip, #0 + 105fb0: 0affff3c beq 105ca8 + + /* skip this conversion. + * advance both strings to next white space + */ + if (*fmt == '*') { + while (!isspace(*fmt) && *fmt) + 105fb4: e1a00001 mov r0, r1 + fmt++; + while (!isspace(*str) && *str) + 105fb8: e4d1c001 ldrb ip, [r1], #1 + 105fbc: e7d5a00c ldrb sl, [r5, ip] + 105fc0: e31a0020 tst sl, #32 + 105fc4: 0afffff8 beq 105fac + 105fc8: eaffff36 b 105ca8 + is_sign = 1; + case 'u': + break; + case '%': + /* looking for '%' in str */ + if (*str++ != '%') + 105fcc: e3510025 cmp r1, #37 ; 0x25 + 105fd0: 1affff54 bne 105d28 + 105fd4: e2800001 add r0, r0, #1 + 105fd8: e5d42000 ldrb r2, [r4] + 105fdc: eaffff31 b 105ca8 + is_sign = 0; + + if (!*fmt || !*str) + break; + + switch(*fmt++) { + 105fe0: e3a0b001 mov fp, #1 + base = 16; + break; + case 'i': + base = 0; + case 'd': + is_sign = 1; + 105fe4: e58db004 str fp, [sp, #4] + qualifier = 'L'; + fmt++; + } + } + } + base = 10; + 105fe8: e3a0200a mov r2, #10 + } + + /* have some sort of integer conversion. + * first, skip white space in buffer. + */ + while (isspace(*str)) + 105fec: e7d5c001 ldrb ip, [r5, r1] + 105ff0: e31c0020 tst ip, #32 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 105ff4: 1280c001 addne ip, r0, #1 + 105ff8: 11a0a006 movne sl, r6 + } + + /* have some sort of integer conversion. + * first, skip white space in buffer. + */ + while (isspace(*str)) + 105ffc: 0a000005 beq 106018 + is_sign = 1; + case 'u': + break; + case '%': + /* looking for '%' in str */ + if (*str++ != '%') + 106000: e1a0000c mov r0, ip + } + + /* have some sort of integer conversion. + * first, skip white space in buffer. + */ + while (isspace(*str)) + 106004: e4dc1001 ldrb r1, [ip], #1 + 106008: e7d56001 ldrb r6, [r5, r1] + 10600c: e3160020 tst r6, #32 + 106010: 1afffffa bne 106000 + 106014: e1a0600a mov r6, sl + str++; + + digit = *str; + if (is_sign && digit == '-') + 106018: e351002d cmp r1, #45 ; 0x2d + 10601c: 13a0b000 movne fp, #0 + 106020: 020bb001 andeq fp, fp, #1 + 106024: e35b0000 cmp fp, #0 + digit = *(str + 1); + 106028: 15d01001 ldrbne r1, [r0, #1] + + if (!digit + 10602c: e3510000 cmp r1, #0 + 106030: 0affff3c beq 105d28 + || (base == 16 && !isxdigit(digit)) + 106034: e3520010 cmp r2, #16 + 106038: 0a0000f4 beq 106410 + || (base == 10 && !isdigit(digit)) + 10603c: e352000a cmp r2, #10 + 106040: 0a0000ee beq 106400 + || (base == 8 && (!isdigit(digit) || digit > '7')) + 106044: e3520008 cmp r2, #8 + 106048: 1a0000ea bne 1063f8 + 10604c: e7d5c001 ldrb ip, [r5, r1] + 106050: e31c0004 tst ip, #4 + 106054: 13a0c000 movne ip, #0 + 106058: 03a0c001 moveq ip, #1 + 10605c: e3510037 cmp r1, #55 ; 0x37 + 106060: 91a0100c movls r1, ip + 106064: 838c1001 orrhi r1, ip, #1 + 106068: e3510000 cmp r1, #0 + 10606c: 1affff2d bne 105d28 + || (base == 0 && !isdigit(digit))) + break; + + switch(qualifier) { + 106070: e249e048 sub lr, r9, #72 ; 0x48 + 106074: e35e0032 cmp lr, #50 ; 0x32 + 106078: 979ff10e ldrls pc, [pc, lr, lsl #2] + 10607c: ea0000b6 b 10635c + 106080: 001063ac .word 0x001063ac + 106084: 0010635c .word 0x0010635c + 106088: 0010635c .word 0x0010635c + 10608c: 0010635c .word 0x0010635c + 106090: 00106384 .word 0x00106384 + 106094: 0010635c .word 0x0010635c + 106098: 0010635c .word 0x0010635c + 10609c: 0010635c .word 0x0010635c + 1060a0: 0010635c .word 0x0010635c + 1060a4: 0010635c .word 0x0010635c + 1060a8: 0010635c .word 0x0010635c + 1060ac: 0010635c .word 0x0010635c + 1060b0: 0010635c .word 0x0010635c + 1060b4: 0010635c .word 0x0010635c + 1060b8: 0010635c .word 0x0010635c + 1060bc: 0010635c .word 0x0010635c + 1060c0: 0010635c .word 0x0010635c + 1060c4: 0010635c .word 0x0010635c + 1060c8: 00106304 .word 0x00106304 + 1060cc: 0010635c .word 0x0010635c + 1060d0: 0010635c .word 0x0010635c + 1060d4: 0010635c .word 0x0010635c + 1060d8: 0010635c .word 0x0010635c + 1060dc: 0010635c .word 0x0010635c + 1060e0: 0010635c .word 0x0010635c + 1060e4: 0010635c .word 0x0010635c + 1060e8: 0010635c .word 0x0010635c + 1060ec: 0010635c .word 0x0010635c + 1060f0: 0010635c .word 0x0010635c + 1060f4: 0010635c .word 0x0010635c + 1060f8: 0010635c .word 0x0010635c + 1060fc: 0010635c .word 0x0010635c + 106100: 00106334 .word 0x00106334 + 106104: 0010635c .word 0x0010635c + 106108: 0010635c .word 0x0010635c + 10610c: 0010635c .word 0x0010635c + 106110: 001062f8 .word 0x001062f8 + 106114: 0010635c .word 0x0010635c + 106118: 0010635c .word 0x0010635c + 10611c: 0010635c .word 0x0010635c + 106120: 0010635c .word 0x0010635c + 106124: 0010635c .word 0x0010635c + 106128: 0010635c .word 0x0010635c + 10612c: 0010635c .word 0x0010635c + 106130: 0010635c .word 0x0010635c + 106134: 0010635c .word 0x0010635c + 106138: 0010635c .word 0x0010635c + 10613c: 0010635c .word 0x0010635c + 106140: 0010635c .word 0x0010635c + 106144: 0010635c .word 0x0010635c + 106148: 00106304 .word 0x00106304 + 10614c: e3a0b001 mov fp, #1 + base = 16; + break; + case 'i': + base = 0; + case 'd': + is_sign = 1; + 106150: e58db004 str fp, [sp, #4] + case 'x': + case 'X': + base = 16; + break; + case 'i': + base = 0; + 106154: e3a02000 mov r2, #0 + 106158: eaffffa3 b 105fec + base = 8; + break; + case 'x': + case 'X': + base = 16; + break; + 10615c: e3a0b000 mov fp, #0 + fmt++; + } + } + } + base = 10; + is_sign = 0; + 106160: e58db004 str fp, [sp, #4] + case 'o': + base = 8; + break; + case 'x': + case 'X': + base = 16; + 106164: e3a02010 mov r2, #16 + break; + 106168: eaffff9f b 105fec + switch(*fmt++) { + case 'c': + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + 10616c: e37c0001 cmn ip, #1 + 106170: 03a0c001 moveq ip, #1 + 106174: e24c2001 sub r2, ip, #1 + 106178: e3120001 tst r2, #1 + break; + + switch(*fmt++) { + case 'c': + { + char *s = (char *) va_arg(args,char*); + 10617c: e283a004 add sl, r3, #4 + 106180: e5939000 ldr r9, [r3] + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 106184: e2803001 add r3, r0, #1 + 106188: 1a000091 bne 1063d4 + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + } while (--field_width > 0 && *str); + 10618c: e24cc001 sub ip, ip, #1 + 106190: e35c0000 cmp ip, #0 + 106194: e1a02003 mov r2, r3 + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + 106198: e4c91001 strb r1, [r9], #1 + 10619c: e1a00003 mov r0, r3 + } while (--field_width > 0 && *str); + 1061a0: da000009 ble 1061cc + 1061a4: e4d21001 ldrb r1, [r2], #1 + 1061a8: e3510000 cmp r1, #0 + 1061ac: 0a000006 beq 1061cc + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + 1061b0: e4c91001 strb r1, [r9], #1 + } while (--field_width > 0 && *str); + 1061b4: e5d31001 ldrb r1, [r3, #1] + 1061b8: e3510000 cmp r1, #0 + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + 1061bc: e1a00002 mov r0, r2 + } while (--field_width > 0 && *str); + 1061c0: e24cc001 sub ip, ip, #1 + 1061c4: e2823001 add r3, r2, #1 + 1061c8: 1affffef bne 10618c + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + *s++ = *str++; + } + *s = '\0'; + num++; + 1061cc: e2866001 add r6, r6, #1 + 1061d0: e5d42000 ldrb r2, [r4] + num++; + } + continue; + case 's': + { + char *s = (char *) va_arg(args, char *); + 1061d4: e1a0300a mov r3, sl + *s++ = *str++; + } + *s = '\0'; + num++; + } + continue; + 1061d8: eafffeb2 b 105ca8 + case 'n': + /* return number of characters read so far */ + { + int *i = (int *)va_arg(args,int*); + *i = str - buf; + 1061dc: e5932000 ldr r2, [r3] + 1061e0: e0671000 rsb r1, r7, r0 + 1061e4: e5821000 str r1, [r2] + } + continue; + case 'n': + /* return number of characters read so far */ + { + int *i = (int *)va_arg(args,int*); + 1061e8: e2833004 add r3, r3, #4 + *i = str - buf; + 1061ec: e5da2001 ldrb r2, [sl, #1] + } + continue; + 1061f0: eafffeac b 105ca8 + { + char *s = (char *) va_arg(args, char *); + if(field_width == -1) + field_width = INT_MAX; + /* first, skip leading white space in buffer */ + while (isspace(*str)) + 1061f4: e7d5a001 ldrb sl, [r5, r1] + continue; + case 's': + { + char *s = (char *) va_arg(args, char *); + if(field_width == -1) + field_width = INT_MAX; + 1061f8: e37c0001 cmn ip, #1 + 1061fc: 03e0c102 mvneq ip, #-2147483648 ; 0x80000000 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + 106200: e31a0020 tst sl, #32 + num++; + } + continue; + case 's': + { + char *s = (char *) va_arg(args, char *); + 106204: e283a004 add sl, r3, #4 + 106208: e5933000 ldr r3, [r3] + if(field_width == -1) + field_width = INT_MAX; + /* first, skip leading white space in buffer */ + while (isspace(*str)) + 10620c: 0a000008 beq 106234 + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 106210: e2802001 add r2, r0, #1 + { + char *s = (char *) va_arg(args, char *); + if(field_width == -1) + field_width = INT_MAX; + /* first, skip leading white space in buffer */ + while (isspace(*str)) + 106214: e5d21000 ldrb r1, [r2] + 106218: e1a00002 mov r0, r2 + 10621c: e7d52001 ldrb r2, [r5, r1] + 106220: e3120020 tst r2, #32 + 106224: e2802001 add r2, r0, #1 + 106228: 1afffff9 bne 106214 + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 10622c: e3510000 cmp r1, #0 + 106230: 0a000025 beq 1062cc + 106234: e35c0000 cmp ip, #0 + 106238: 0a000023 beq 1062cc + * vsscanf - Unformat a buffer into a list of arguments + * @buf: input buffer + * @fmt: format of buffer + * @args: arguments + */ +int vsscanf(const char * buf, const char * fmt, va_list args) + 10623c: e083c00c add ip, r3, ip + 106240: e1e09003 mvn r9, r3 + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + *s++ = *str++; + 106244: e4c31001 strb r1, [r3], #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 106248: e1a01000 mov r1, r0 + 10624c: e5f12001 ldrb r2, [r1, #1]! + 106250: e08c9009 add r9, ip, r9 + 106254: e3520000 cmp r2, #0 + 106258: e209b001 and fp, r9, #1 + *s++ = *str++; + 10625c: e2800001 add r0, r0, #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 106260: 0a000019 beq 1062cc + 106264: e7d59002 ldrb r9, [r5, r2] + 106268: e3190020 tst r9, #32 + 10626c: 1a000016 bne 1062cc + 106270: e153000c cmp r3, ip + 106274: 0a000014 beq 1062cc + 106278: e35b0000 cmp fp, #0 + 10627c: 0a000005 beq 106298 + 106280: ea00000c b 1062b8 + 106284: e7d59002 ldrb r9, [r5, r2] + 106288: e3190020 tst r9, #32 + 10628c: 1a00000e bne 1062cc + 106290: e153000c cmp r3, ip + 106294: 0a00000c beq 1062cc + *s++ = *str++; + 106298: e4c32001 strb r2, [r3], #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 10629c: e5f12001 ldrb r2, [r1, #1]! + 1062a0: e3520000 cmp r2, #0 + *s++ = *str++; + 1062a4: e2800001 add r0, r0, #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 1062a8: 0a000007 beq 1062cc + 1062ac: e7d59002 ldrb r9, [r5, r2] + 1062b0: e3190020 tst r9, #32 + 1062b4: 1a000004 bne 1062cc + *s++ = *str++; + 1062b8: e4c32001 strb r2, [r3], #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 1062bc: e5f12001 ldrb r2, [r1, #1]! + 1062c0: e3520000 cmp r2, #0 + *s++ = *str++; + 1062c4: e2800001 add r0, r0, #1 + /* first, skip leading white space in buffer */ + while (isspace(*str)) + str++; + + /* now copy until next white space */ + while (*str && !isspace(*str) && field_width--) { + 1062c8: 1affffed bne 106284 + *s++ = *str++; + } + *s = '\0'; + 1062cc: e3a0c000 mov ip, #0 + 1062d0: e5c3c000 strb ip, [r3] + 1062d4: eaffffbc b 1061cc + is_sign = 0; + + if (!*fmt || !*str) + break; + + switch(*fmt++) { + 1062d8: e3a0b000 mov fp, #0 + fmt++; + } + } + } + base = 10; + is_sign = 0; + 1062dc: e58db004 str fp, [sp, #4] + qualifier = 'L'; + fmt++; + } + } + } + base = 10; + 1062e0: e3a0200a mov r2, #10 + 1062e4: eaffff40 b 105fec + *i = str - buf; + } + continue; + case 'o': + base = 8; + break; + 1062e8: e3a0b000 mov fp, #0 + fmt++; + } + } + } + base = 10; + is_sign = 0; + 1062ec: e58db004 str fp, [sp, #4] + int *i = (int *)va_arg(args,int*); + *i = str - buf; + } + continue; + case 'o': + base = 8; + 1062f0: e3a02008 mov r2, #8 + break; + 1062f4: eaffff3c b 105fec + unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + *s = (unsigned short) simple_strtoul(str, &next, base); + } + break; + case 'l': + if (is_sign) { + 1062f8: e59dc004 ldr ip, [sp, #4] + 1062fc: e35c0000 cmp ip, #0 + 106300: 1a000018 bne 106368 + break; + case 'Z': + case 'z': + { + size_t *s = (size_t*) va_arg(args,size_t*); + *s = (size_t) simple_strtoul(str,&next,base); + 106304: e28d100c add r1, sp, #12 + } + break; + case 'Z': + case 'z': + { + size_t *s = (size_t*) va_arg(args,size_t*); + 106308: e5939000 ldr r9, [r3] + 10630c: e283a004 add sl, r3, #4 + *s = (size_t) simple_strtoul(str,&next,base); + 106310: ebfffb32 bl 104fe0 + 106314: e5890000 str r0, [r9] + } + break; + case 'Z': + case 'z': + { + size_t *s = (size_t*) va_arg(args,size_t*); + 106318: e1a0300a mov r3, sl + } + break; + } + num++; + + if (!next) + 10631c: e59d000c ldr r0, [sp, #12] + 106320: e3500000 cmp r0, #0 + unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + *i = (unsigned int) simple_strtoul(str,&next,base); + } + break; + } + num++; + 106324: e2866001 add r6, r6, #1 + + if (!next) + 106328: 0afffe7e beq 105d28 + 10632c: e5d42000 ldrb r2, [r4] + 106330: eafffe5c b 105ca8 + unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + *s = (unsigned char) simple_strtoul(str, &next, base); + } + break; + case 'h': + if (is_sign) { + 106334: e59d9004 ldr r9, [sp, #4] + 106338: e3590000 cmp r9, #0 + 10633c: 0a00004c beq 106474 + short *s = (short *) va_arg(args,short *); + *s = (short) simple_strtol(str,&next,base); + 106340: e28d100c add r1, sp, #12 + *s = (unsigned char) simple_strtoul(str, &next, base); + } + break; + case 'h': + if (is_sign) { + short *s = (short *) va_arg(args,short *); + 106344: e5939000 ldr r9, [r3] + 106348: e283a004 add sl, r3, #4 + *s = (short) simple_strtol(str,&next,base); + 10634c: ebfffb7b bl 105140 + *s = (unsigned char) simple_strtoul(str, &next, base); + } + break; + case 'h': + if (is_sign) { + short *s = (short *) va_arg(args,short *); + 106350: e1a0300a mov r3, sl + *s = (short) simple_strtol(str,&next,base); + 106354: e1c900b0 strh r0, [r9] + 106358: eaffffef b 10631c + size_t *s = (size_t*) va_arg(args,size_t*); + *s = (size_t) simple_strtoul(str,&next,base); + } + break; + default: + if (is_sign) { + 10635c: e59de004 ldr lr, [sp, #4] + 106360: e35e0000 cmp lr, #0 + 106364: 0a00003b beq 106458 + int *i = (int *) va_arg(args, int*); + *i = (int) simple_strtol(str,&next,base); + 106368: e28d100c add r1, sp, #12 + *s = (size_t) simple_strtoul(str,&next,base); + } + break; + default: + if (is_sign) { + int *i = (int *) va_arg(args, int*); + 10636c: e5939000 ldr r9, [r3] + 106370: e283a004 add sl, r3, #4 + *i = (int) simple_strtol(str,&next,base); + 106374: ebfffb71 bl 105140 + *s = (size_t) simple_strtoul(str,&next,base); + } + break; + default: + if (is_sign) { + int *i = (int *) va_arg(args, int*); + 106378: e1a0300a mov r3, sl + *i = (int) simple_strtol(str,&next,base); + 10637c: e5890000 str r0, [r9] + 106380: eaffffe5 b 10631c + unsigned long *l = (unsigned long*) va_arg(args,unsigned long*); + *l = simple_strtoul(str,&next,base); + } + break; + case 'L': + if (is_sign) { + 106384: e59d1004 ldr r1, [sp, #4] + 106388: e3510000 cmp r1, #0 + 10638c: 0a00002a beq 10643c + long long *l = (long long*) va_arg(args,long long *); + *l = simple_strtoll(str,&next,base); + 106390: e28d100c add r1, sp, #12 + *l = simple_strtoul(str,&next,base); + } + break; + case 'L': + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + 106394: e5939000 ldr r9, [r3] + 106398: e283a004 add sl, r3, #4 + *l = simple_strtoll(str,&next,base); + 10639c: ebfffbdd bl 105318 + *l = simple_strtoul(str,&next,base); + } + break; + case 'L': + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + 1063a0: e1a0300a mov r3, sl + *l = simple_strtoll(str,&next,base); + 1063a4: e8890003 stm r9, {r0, r1} + 1063a8: eaffffdb b 10631c + || (base == 0 && !isdigit(digit))) + break; + + switch(qualifier) { + case 'H': /* that's 'hh' in format */ + if (is_sign) { + 1063ac: e59da004 ldr sl, [sp, #4] + 1063b0: e35a0000 cmp sl, #0 + 1063b4: 0a000019 beq 106420 + signed char *s = (signed char *) va_arg(args,signed char *); + *s = (signed char) simple_strtol(str,&next,base); + 1063b8: e28d100c add r1, sp, #12 + break; + + switch(qualifier) { + case 'H': /* that's 'hh' in format */ + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + 1063bc: e5939000 ldr r9, [r3] + 1063c0: e283a004 add sl, r3, #4 + *s = (signed char) simple_strtol(str,&next,base); + 1063c4: ebfffb5d bl 105140 + break; + + switch(qualifier) { + case 'H': /* that's 'hh' in format */ + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + 1063c8: e1a0300a mov r3, sl + *s = (signed char) simple_strtol(str,&next,base); + 1063cc: e5c90000 strb r0, [r9] + 1063d0: eaffffd1 b 10631c + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + } while (--field_width > 0 && *str); + 1063d4: e252c000 subs ip, r2, #0 + { + char *s = (char *) va_arg(args,char*); + if (field_width == -1) + field_width = 1; + do { + *s++ = *str++; + 1063d8: e4c91001 strb r1, [r9], #1 + 1063dc: e1a00003 mov r0, r3 + } while (--field_width > 0 && *str); + 1063e0: daffff79 ble 1061cc + 1063e4: e5d31000 ldrb r1, [r3] + 1063e8: e3510000 cmp r1, #0 + 1063ec: e2833001 add r3, r3, #1 + 1063f0: 1affff65 bne 10618c + 1063f4: eaffff74 b 1061cc + + if (!digit + || (base == 16 && !isxdigit(digit)) + || (base == 10 && !isdigit(digit)) + || (base == 8 && (!isdigit(digit) || digit > '7')) + || (base == 0 && !isdigit(digit))) + 1063f8: e3520000 cmp r2, #0 + 1063fc: 1affff1b bne 106070 + 106400: e7d51001 ldrb r1, [r5, r1] + 106404: e3110004 tst r1, #4 + 106408: 1affff18 bne 106070 + 10640c: eafffe45 b 105d28 + digit = *str; + if (is_sign && digit == '-') + digit = *(str + 1); + + if (!digit + || (base == 16 && !isxdigit(digit)) + 106410: e7d5c001 ldrb ip, [r5, r1] + 106414: e31c0044 tst ip, #68 ; 0x44 + 106418: 1affff14 bne 106070 + 10641c: eafffe41 b 105d28 + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + *s = (signed char) simple_strtol(str,&next,base); + } else { + unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + *s = (unsigned char) simple_strtoul(str, &next, base); + 106420: e28d100c add r1, sp, #12 + case 'H': /* that's 'hh' in format */ + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + *s = (signed char) simple_strtol(str,&next,base); + } else { + unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + 106424: e5939000 ldr r9, [r3] + 106428: e283a004 add sl, r3, #4 + *s = (unsigned char) simple_strtoul(str, &next, base); + 10642c: ebfffaeb bl 104fe0 + case 'H': /* that's 'hh' in format */ + if (is_sign) { + signed char *s = (signed char *) va_arg(args,signed char *); + *s = (signed char) simple_strtol(str,&next,base); + } else { + unsigned char *s = (unsigned char *) va_arg(args, unsigned char *); + 106430: e1a0300a mov r3, sl + *s = (unsigned char) simple_strtoul(str, &next, base); + 106434: e5c90000 strb r0, [r9] + 106438: eaffffb7 b 10631c + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + *l = simple_strtoll(str,&next,base); + } else { + unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + *l = simple_strtoull(str,&next,base); + 10643c: e28d100c add r1, sp, #12 + case 'L': + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + *l = simple_strtoll(str,&next,base); + } else { + unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + 106440: e5939000 ldr r9, [r3] + 106444: e283a004 add sl, r3, #4 + *l = simple_strtoull(str,&next,base); + 106448: ebfffb47 bl 10516c + case 'L': + if (is_sign) { + long long *l = (long long*) va_arg(args,long long *); + *l = simple_strtoll(str,&next,base); + } else { + unsigned long long *l = (unsigned long long*) va_arg(args,unsigned long long*); + 10644c: e1a0300a mov r3, sl + *l = simple_strtoull(str,&next,base); + 106450: e8890003 stm r9, {r0, r1} + 106454: eaffffb0 b 10631c + if (is_sign) { + int *i = (int *) va_arg(args, int*); + *i = (int) simple_strtol(str,&next,base); + } else { + unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + *i = (unsigned int) simple_strtoul(str,&next,base); + 106458: e28d100c add r1, sp, #12 + default: + if (is_sign) { + int *i = (int *) va_arg(args, int*); + *i = (int) simple_strtol(str,&next,base); + } else { + unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + 10645c: e5939000 ldr r9, [r3] + 106460: e283a004 add sl, r3, #4 + *i = (unsigned int) simple_strtoul(str,&next,base); + 106464: ebfffadd bl 104fe0 + default: + if (is_sign) { + int *i = (int *) va_arg(args, int*); + *i = (int) simple_strtol(str,&next,base); + } else { + unsigned int *i = (unsigned int*) va_arg(args, unsigned int*); + 106468: e1a0300a mov r3, sl + *i = (unsigned int) simple_strtoul(str,&next,base); + 10646c: e5890000 str r0, [r9] + 106470: eaffffa9 b 10631c + if (is_sign) { + short *s = (short *) va_arg(args,short *); + *s = (short) simple_strtol(str,&next,base); + } else { + unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + *s = (unsigned short) simple_strtoul(str, &next, base); + 106474: e28d100c add r1, sp, #12 + case 'h': + if (is_sign) { + short *s = (short *) va_arg(args,short *); + *s = (short) simple_strtol(str,&next,base); + } else { + unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + 106478: e5939000 ldr r9, [r3] + 10647c: e283a004 add sl, r3, #4 + *s = (unsigned short) simple_strtoul(str, &next, base); + 106480: ebfffad6 bl 104fe0 + case 'h': + if (is_sign) { + short *s = (short *) va_arg(args,short *); + *s = (short) simple_strtol(str,&next,base); + } else { + unsigned short *s = (unsigned short *) va_arg(args, unsigned short *); + 106484: e1a0300a mov r3, sl + *s = (unsigned short) simple_strtoul(str, &next, base); + 106488: e1c900b0 strh r0, [r9] + 10648c: eaffffa2 b 10631c + *fmt == 'Z' || *fmt == 'z') { + qualifier = *fmt++; + if (qualifier == *fmt) { + if (qualifier == 'h') { + qualifier = 'H'; + fmt++; + 106490: e5fa2001 ldrb r2, [sl, #1]! + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt == 'Z' || *fmt == 'z') { + qualifier = *fmt++; + if (qualifier == *fmt) { + if (qualifier == 'h') { + qualifier = 'H'; + 106494: e3a09048 mov r9, #72 ; 0x48 + 106498: eafffe43 b 105dac + 10649c: 0020020c .word 0x0020020c + +001064a0 : + * @buf: input buffer + * @fmt: formatting of buffer + * @...: resulting arguments + */ +int sscanf(const char * buf, const char * fmt, ...) +{ + 1064a0: e92d000e push {r1, r2, r3} + 1064a4: e52de004 push {lr} ; (str lr, [sp, #-4]!) + 1064a8: e24dd008 sub sp, sp, #8 + va_list args; + int i; + + va_start(args,fmt); + 1064ac: e28d3010 add r3, sp, #16 + i = vsscanf(buf,fmt,args); + 1064b0: e59d100c ldr r1, [sp, #12] + 1064b4: e1a02003 mov r2, r3 +int sscanf(const char * buf, const char * fmt, ...) +{ + va_list args; + int i; + + va_start(args,fmt); + 1064b8: e58d3004 str r3, [sp, #4] + i = vsscanf(buf,fmt,args); + 1064bc: ebfffdf0 bl 105c84 + va_end(args); + return i; +} + 1064c0: e28dd008 add sp, sp, #8 + 1064c4: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 1064c8: e28dd00c add sp, sp, #12 + 1064cc: e12fff1e bx lr + +001064d0 : + */ +size_t strnlen(const char *s, size_t count) +{ + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + 1064d0: e3510000 cmp r1, #0 + * strnlen - Find the length of a length-limited string + * @s: The string to be sized + * @count: The maximum number of bytes to search + */ +size_t strnlen(const char *s, size_t count) +{ + 1064d4: e52d4004 push {r4} ; (str r4, [sp, #-4]!) + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + 1064d8: 01a00001 moveq r0, r1 + 1064dc: 0a00000d beq 106518 + 1064e0: e5d03000 ldrb r3, [r0] + 1064e4: e3530000 cmp r3, #0 + 1064e8: 01a00003 moveq r0, r3 + 1064ec: 0a000009 beq 106518 +char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); +char *_EXFUN(strerror_r,(int, char *, size_t)); +size_t _EXFUN(strlcat,(char *, const char *, size_t)); +size_t _EXFUN(strlcpy,(char *, const char *, size_t)); +int _EXFUN(strncasecmp,(const char *, const char *, size_t)); +size_t _EXFUN(strnlen,(const char *, size_t)); + 1064f0: e2803001 add r3, r0, #1 + 1064f4: e0801001 add r1, r0, r1 + 1064f8: e0632001 rsb r2, r3, r1 + 1064fc: e3120001 tst r2, #1 + 106500: 0a00000e beq 106540 + 106504: e1a0c003 mov ip, r3 + 106508: e4d32001 ldrb r2, [r3], #1 + 10650c: e3520000 cmp r2, #0 + 106510: 1a00000a bne 106540 + 106514: e060000c rsb r0, r0, ip + /* nothing */; + return sc - s; +} + 106518: e49d4004 pop {r4} ; (ldr r4, [sp], #4) + 10651c: e12fff1e bx lr + */ +size_t strnlen(const char *s, size_t count) +{ + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + 106520: e4d24001 ldrb r4, [r2], #1 + 106524: e3540000 cmp r4, #0 + 106528: 0afffff9 beq 106514 + 10652c: e5d34001 ldrb r4, [r3, #1] + 106530: e3540000 cmp r4, #0 + 106534: e1a0c002 mov ip, r2 + 106538: e2823001 add r3, r2, #1 + 10653c: 0afffff4 beq 106514 + 106540: e1530001 cmp r3, r1 + 106544: e1a02003 mov r2, r3 + 106548: e1a0c003 mov ip, r3 + 10654c: 1afffff3 bne 106520 + 106550: e0600003 rsb r0, r0, r3 + 106554: eaffffef b 106518 + +00106558 : + .state_pending = RCTX_STATE_UDP_EP3_PENDING }, +}; + +/* Send Data through the control endpoint */ +static void udp_ep0_send_data(const char *pData, u_int32_t length) +{ + 106558: e92d41f0 push {r4, r5, r6, r7, r8, lr} + 10655c: e1a04000 mov r4, r0 + 106560: e24dd008 sub sp, sp, #8 + AT91PS_UDP pUdp = AT91C_BASE_UDP; + u_int32_t cpt = 0; + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + 106564: e59f0158 ldr r0, [pc, #344] ; 1066c4 + .state_pending = RCTX_STATE_UDP_EP3_PENDING }, +}; + +/* Send Data through the control endpoint */ +static void udp_ep0_send_data(const char *pData, u_int32_t length) +{ + 106568: e1a05001 mov r5, r1 + AT91PS_UDP pUdp = AT91C_BASE_UDP; + u_int32_t cpt = 0; + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + 10656c: eb00062a bl 107e1c + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + pUdp->UDP_FDR[0] = *pData++; + 106570: e59f6150 ldr r6, [pc, #336] ; 1066c8 + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + + do { + cpt = MIN(length, 8); + 106574: e3550008 cmp r5, #8 + 106578: 31a08005 movcc r8, r5 + 10657c: 23a08008 movcs r8, #8 + length -= cpt; + + DEBUGE("fifo_fill "); + 106580: e59f0144 ldr r0, [pc, #324] ; 1066cc + 106584: eb000624 bl 107e1c + while (cpt--) + 106588: e3580000 cmp r8, #0 + 10658c: 0a000017 beq 1065f0 + pUdp->UDP_FDR[0] = *pData++; + 106590: e1a03004 mov r3, r4 + 106594: e4d32001 ldrb r2, [r3], #1 + [3] = { .state_busy = RCTX_STATE_UDP_EP3_BUSY, + .state_pending = RCTX_STATE_UDP_EP3_PENDING }, +}; + +/* Send Data through the control endpoint */ +static void udp_ep0_send_data(const char *pData, u_int32_t length) + 106598: e0841008 add r1, r4, r8 + 10659c: e1e00004 mvn r0, r4 + 1065a0: e0814000 add r4, r1, r0 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065a4: e1530001 cmp r3, r1 + 1065a8: e2044001 and r4, r4, #1 + pUdp->UDP_FDR[0] = *pData++; + 1065ac: e50620af str r2, [r6, #-175] ; 0xffffff51 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065b0: 0a00000d beq 1065ec + 1065b4: e3540000 cmp r4, #0 + 1065b8: 0a000003 beq 1065cc + pUdp->UDP_FDR[0] = *pData++; + 1065bc: e4d34001 ldrb r4, [r3], #1 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065c0: e1530001 cmp r3, r1 + pUdp->UDP_FDR[0] = *pData++; + 1065c4: e50640af str r4, [r6, #-175] ; 0xffffff51 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065c8: 0a000007 beq 1065ec + pUdp->UDP_FDR[0] = *pData++; + 1065cc: e1a0c003 mov ip, r3 + 1065d0: e4dce001 ldrb lr, [ip], #1 + 1065d4: e506e0af str lr, [r6, #-175] ; 0xffffff51 + 1065d8: e5d37001 ldrb r7, [r3, #1] + 1065dc: e28c3001 add r3, ip, #1 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065e0: e1530001 cmp r3, r1 + pUdp->UDP_FDR[0] = *pData++; + 1065e4: e50670af str r7, [r6, #-175] ; 0xffffff51 + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + 1065e8: 1afffff7 bne 1065cc + 1065ec: e1a04001 mov r4, r1 + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 1065f0: e51630cf ldr r3, [r6, #-207] ; 0xffffff31 + 1065f4: e3130001 tst r3, #1 + 1065f8: 1a000028 bne 1066a0 + DEBUGE("wait_txcomp_clear "); + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + + DEBUGE("set_txpktrdy "); + 1065fc: e59f00cc ldr r0, [pc, #204] ; 1066d0 + 106600: eb000605 bl 107e1c + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 106604: e516c0cf ldr ip, [r6, #-207] ; 0xffffff31 + 106608: e38c7010 orr r7, ip, #16 + DEBUGE("wait_txcomp "); + 10660c: e59f00c0 ldr r0, [pc, #192] ; 1066d4 + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + + DEBUGE("set_txpktrdy "); + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 106610: e50670cf str r7, [r6, #-207] ; 0xffffff31 + DEBUGE("wait_txcomp "); + 106614: eb000600 bl 107e1c + 106618: ea000002 b 106628 + if (csr & AT91C_UDP_RX_DATA_BK0) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + DEBUGE("stopped by status out "); + return; + } + } while (!(csr & AT91C_UDP_TXCOMP)); + 10661c: e59d0004 ldr r0, [sp, #4] + 106620: e3100001 tst r0, #1 + 106624: 1a00000d bne 106660 + + DEBUGE("set_txpktrdy "); + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + DEBUGE("wait_txcomp "); + do { + csr = pUdp->UDP_CSR[0]; + 106628: e51630cf ldr r3, [r6, #-207] ; 0xffffff31 + 10662c: e58d3004 str r3, [sp, #4] + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + 106630: e59de004 ldr lr, [sp, #4] + 106634: e31e0002 tst lr, #2 + + DEBUGE("set_txpktrdy "); + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + DEBUGE("wait_txcomp "); + do { + csr = pUdp->UDP_CSR[0]; + 106638: e59f7088 ldr r7, [pc, #136] ; 1066c8 + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + 10663c: 0afffff6 beq 10661c + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 106640: e51720cf ldr r2, [r7, #-207] ; 0xffffff31 + 106644: e3c21002 bic r1, r2, #2 + DEBUGE("stopped by status out "); + 106648: e59f0088 ldr r0, [pc, #136] ; 1066d8 + do { + csr = pUdp->UDP_CSR[0]; + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 10664c: e50710cf str r1, [r7, #-207] ; 0xffffff31 + DEBUGE("stopped by status out "); + 106650: eb0005f1 bl 107e1c + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + DEBUGE("done "); +} + 106654: e28dd008 add sp, sp, #8 + 106658: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + 10665c: e12fff1e bx lr + DEBUGE("stopped by status out "); + return; + } + } while (!(csr & AT91C_UDP_TXCOMP)); + + } while (length); + 106660: e0555008 subs r5, r5, r8 + 106664: 1affffc2 bne 106574 + + DEBUGE("clear_txcomp "); + 106668: e59f006c ldr r0, [pc, #108] ; 1066dc + 10666c: eb0005ea bl 107e1c + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 106670: e517c0cf ldr ip, [r7, #-207] ; 0xffffff31 + 106674: e31c0001 tst ip, #1 + 106678: 0a000005 beq 106694 + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 10667c: e51730cf ldr r3, [r7, #-207] ; 0xffffff31 + 106680: e3c3e001 bic lr, r3, #1 + 106684: e507e0cf str lr, [r7, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 106688: e51710cf ldr r1, [r7, #-207] ; 0xffffff31 + 10668c: e3110001 tst r1, #1 + 106690: 1afffffc bne 106688 + } + DEBUGE("done "); + 106694: e59f0044 ldr r0, [pc, #68] ; 1066e0 + 106698: eb0005df bl 107e1c + 10669c: eaffffec b 106654 + DEBUGE("fifo_fill "); + while (cpt--) + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + DEBUGE("wait_txcomp_clear "); + 1066a0: e59f003c ldr r0, [pc, #60] ; 1066e4 + 1066a4: eb0005dc bl 107e1c + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 1066a8: e51620cf ldr r2, [r6, #-207] ; 0xffffff31 + 1066ac: e3c21001 bic r1, r2, #1 + 1066b0: e50610cf str r1, [r6, #-207] ; 0xffffff31 + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 1066b4: e51600cf ldr r0, [r6, #-207] ; 0xffffff31 + 1066b8: e3100001 tst r0, #1 + 1066bc: 1afffffc bne 1066b4 + 1066c0: eaffffcd b 1065fc + 1066c4: 0010a67c .word 0x0010a67c + 1066c8: fffb00ff .word 0xfffb00ff + 1066cc: 0010a694 .word 0x0010a694 + 1066d0: 0010a6b4 .word 0x0010a6b4 + 1066d4: 0010a6c4 .word 0x0010a6c4 + 1066d8: 0010a6d4 .word 0x0010a6d4 + 1066dc: 0010a6ec .word 0x0010a6ec + 1066e0: 0010a6fc .word 0x0010a6fc + 1066e4: 0010a6a0 .word 0x0010a6a0 + +001066e8 : + } + DEBUGE("done "); +} + +static void reset_ep(unsigned int ep) +{ + 1066e8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} + AT91PS_UDP pUDP = upcd.pUdp; + 1066ec: e59f8098 ldr r8, [pc, #152] ; 10678c + struct req_ctx *rctx; + + //pUDP->UDP_CSR[ep] = AT91C_UDP_EPEDS; + + atomic_set(&upcd.ep[ep].pkts_in_transit, 0); + 1066f0: e1a09080 lsl r9, r0, #1 + 1066f4: e0891000 add r1, r9, r0 + 1066f8: e59fa090 ldr sl, [pc, #144] ; 106790 + 1066fc: e0883101 add r3, r8, r1, lsl #2 + 106700: e3a02000 mov r2, #0 + DEBUGE("done "); +} + +static void reset_ep(unsigned int ep) +{ + AT91PS_UDP pUDP = upcd.pUdp; + 106704: e5987000 ldr r7, [r8] + struct req_ctx *rctx; + + //pUDP->UDP_CSR[ep] = AT91C_UDP_EPEDS; + + atomic_set(&upcd.ep[ep].pkts_in_transit, 0); + 106708: e583200c str r2, [r3, #12] + 10670c: e79a5180 ldr r5, [sl, r0, lsl #3] + 106710: e59f407c ldr r4, [pc, #124] ; 106794 + } + DEBUGE("done "); +} + +static void reset_ep(unsigned int ep) +{ + 106714: e1a06000 mov r6, r0 + //pUDP->UDP_CSR[ep] = AT91C_UDP_EPEDS; + + atomic_set(&upcd.ep[ep].pkts_in_transit, 0); + + /* free all currently transmitting contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_busy, + 106718: e3a00000 mov r0, #0 + 10671c: e1a01005 mov r1, r5 + 106720: e3a020fe mov r2, #254 ; 0xfe + 106724: e1a0e00f mov lr, pc + 106728: e12fff14 bx r4 + 10672c: e3500000 cmp r0, #0 + 106730: 1afffff8 bne 106718 + 106734: e08aa186 add sl, sl, r6, lsl #3 + 106738: e59a5004 ldr r5, [sl, #4] + RCTX_STATE_FREE))) {} + /* free all currently pending contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_pending, + 10673c: e3a00000 mov r0, #0 + 106740: e1a01005 mov r1, r5 + 106744: e3a020fe mov r2, #254 ; 0xfe + 106748: e1a0e00f mov lr, pc + 10674c: e12fff14 bx r4 + 106750: e3500000 cmp r0, #0 + 106754: 1afffff8 bne 10673c + RCTX_STATE_FREE))) {} + + pUDP->UDP_RSTEP |= (1 << ep); + 106758: e3a0c001 mov ip, #1 + 10675c: e1a0e61c lsl lr, ip, r6 + 106760: e5971028 ldr r1, [r7, #40] ; 0x28 + 106764: e18e3001 orr r3, lr, r1 + 106768: e5873028 str r3, [r7, #40] ; 0x28 + pUDP->UDP_RSTEP &= ~(1 << ep); + 10676c: e5972028 ldr r2, [r7, #40] ; 0x28 + + upcd.ep[ep].incomplete.rctx = NULL; + 106770: e0896006 add r6, r9, r6 + /* free all currently pending contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_pending, + RCTX_STATE_FREE))) {} + + pUDP->UDP_RSTEP |= (1 << ep); + pUDP->UDP_RSTEP &= ~(1 << ep); + 106774: e1c2c00e bic ip, r2, lr + + upcd.ep[ep].incomplete.rctx = NULL; + 106778: e0888106 add r8, r8, r6, lsl #2 + /* free all currently pending contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_pending, + RCTX_STATE_FREE))) {} + + pUDP->UDP_RSTEP |= (1 << ep); + pUDP->UDP_RSTEP &= ~(1 << ep); + 10677c: e587c028 str ip, [r7, #40] ; 0x28 + + upcd.ep[ep].incomplete.rctx = NULL; + 106780: e5880010 str r0, [r8, #16] +} + 106784: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr} + 106788: e12fff1e bx lr + 10678c: 0020030c .word 0x0020030c + 106790: 0010a600 .word 0x0010a600 + 106794: 00200080 .word 0x00200080 + +00106798 <__udp_refill_ep>: + AT91PS_UDP pUDP = upcd.pUdp; + pUDP->UDP_IER = AT91C_UDP_EPINT1; +} + +static int __udp_refill_ep(int ep) +{ + 106798: e92d4ff8 push {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} + u_int16_t i; + AT91PS_UDP pUDP = upcd.pUdp; + 10679c: e59f41c8 ldr r4, [pc, #456] ; 10696c <__udp_refill_ep+0x1d4> + struct req_ctx *rctx; + unsigned int start, end; + + /* If we're not configured by the host yet, there is no point + * in trying to send data to it... */ + if (!upcd.cur_config) { + 1067a0: e5d43005 ldrb r3, [r4, #5] + 1067a4: e3530000 cmp r3, #0 + AT91PS_UDP pUDP = upcd.pUdp; + pUDP->UDP_IER = AT91C_UDP_EPINT1; +} + +static int __udp_refill_ep(int ep) +{ + 1067a8: e1a06000 mov r6, r0 + u_int16_t i; + AT91PS_UDP pUDP = upcd.pUdp; + 1067ac: e5945000 ldr r5, [r4] + unsigned int start, end; + + /* If we're not configured by the host yet, there is no point + * in trying to send data to it... */ + if (!upcd.cur_config) { + return -ENXIO; + 1067b0: 03e00005 mvneq r0, #5 + struct req_ctx *rctx; + unsigned int start, end; + + /* If we're not configured by the host yet, there is no point + * in trying to send data to it... */ + if (!upcd.cur_config) { + 1067b4: 1a000001 bne 1067c0 <__udp_refill_ep+0x28> + upcd.ep[ep].incomplete.bytes_sent += end - start; + DEBUGII("RCTX(ep=%u)_tx_cont ", ep); + } + + return 1; +} + 1067b8: e8bd4ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 1067bc: e12fff1e bx lr + return -ENXIO; + } + + /* If there are already two packets in transit, the DPR of + * the SAM7 UDC doesn't have space for more data */ + if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + 1067c0: e1a07080 lsl r7, r0, #1 + 1067c4: e0878000 add r8, r7, r0 + 1067c8: e0848108 add r8, r4, r8, lsl #2 + 1067cc: e598100c ldr r1, [r8, #12] + 1067d0: e3510002 cmp r1, #2 + return -EBUSY; + 1067d4: 03e0000f mvneq r0, #15 + return -ENXIO; + } + + /* If there are already two packets in transit, the DPR of + * the SAM7 UDC doesn't have space for more data */ + if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + 1067d8: 0afffff6 beq 1067b8 <__udp_refill_ep+0x20> + return -EBUSY; + } + + /* If we have an incompletely-transmitted req_ctx (>EP size), + * we need to transmit the rest and finish the transaction */ + if (upcd.ep[ep].incomplete.rctx) { + 1067dc: e5980010 ldr r0, [r8, #16] + 1067e0: e3500000 cmp r0, #0 + 1067e4: 0a000051 beq 106930 <__udp_refill_ep+0x198> + rctx = upcd.ep[ep].incomplete.rctx; + start = upcd.ep[ep].incomplete.bytes_sent; + 1067e8: e5988014 ldr r8, [r8, #20] + 1067ec: e1a09808 lsl r9, r8, #16 + 1067f0: e1a09829 lsr r9, r9, #16 + 1067f4: e1a01009 mov r1, r9 + start = 0; + + upcd.ep[ep].incomplete.bytes_sent = 0; + } + + if (rctx->tot_len - start <= AT91C_EP_IN_SIZE) + 1067f8: e1d020b6 ldrh r2, [r0, #6] + 1067fc: e068a002 rsb sl, r8, r2 + 106800: e35a0040 cmp sl, #64 ; 0x40 + end = rctx->tot_len; + else + end = start + AT91C_EP_IN_SIZE; + 106804: 82882040 addhi r2, r8, #64 ; 0x40 + 106808: 83a0a040 movhi sl, #64 ; 0x40 + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 10680c: e1520001 cmp r2, r1 + 106810: 9a00001e bls 106890 <__udp_refill_ep+0xf8> + 106814: e289b001 add fp, r9, #1 + 106818: e590c008 ldr ip, [r0, #8] + 10681c: e1a0380b lsl r3, fp, #16 + 106820: e1e09009 mvn r9, r9 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106824: e7dcb001 ldrb fp, [ip, r1] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106828: e1a03823 lsr r3, r3, #16 + 10682c: e2861014 add r1, r6, #20 + 106830: e0899002 add r9, r9, r2 + 106834: e1520003 cmp r2, r3 + 106838: e2099001 and r9, r9, #1 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 10683c: e785b101 str fp, [r5, r1, lsl #2] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106840: 9a000012 bls 106890 <__udp_refill_ep+0xf8> + 106844: e3590000 cmp r9, #0 + 106848: 0a000006 beq 106868 <__udp_refill_ep+0xd0> + 10684c: e283b001 add fp, r3, #1 + 106850: e1a0980b lsl r9, fp, #16 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106854: e7dcb003 ldrb fp, [ip, r3] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106858: e1a03829 lsr r3, r9, #16 + 10685c: e1520003 cmp r2, r3 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106860: e785b101 str fp, [r5, r1, lsl #2] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106864: 9a000009 bls 106890 <__udp_refill_ep+0xf8> + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106868: e7dcb003 ldrb fp, [ip, r3] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 10686c: e2833001 add r3, r3, #1 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106870: e785b101 str fp, [r5, r1, lsl #2] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106874: e1a09803 lsl r9, r3, #16 + 106878: e2893801 add r3, r9, #65536 ; 0x10000 + 10687c: e1a03823 lsr r3, r3, #16 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106880: e7dc9829 ldrb r9, [ip, r9, lsr #16] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 106884: e1520003 cmp r2, r3 + pUDP->UDP_FDR[ep] = rctx->data[i]; + 106888: e7859101 str r9, [r5, r1, lsl #2] + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + 10688c: 8afffff5 bhi 106868 <__udp_refill_ep+0xd0> +static inline int atomic_add_return(int i, atomic_t *v) +{ + unsigned long flags; + int val; + + local_irq_save(flags); + 106890: e10fc000 mrs ip, CPSR + 106894: e38c3080 orr r3, ip, #128 ; 0x80 + 106898: e121f003 msr CPSR_c, r3 + val = v->counter; + 10689c: e0871006 add r1, r7, r6 + 1068a0: e0841101 add r1, r4, r1, lsl #2 + 1068a4: e591300c ldr r3, [r1, #12] + v->counter = val += i; + 1068a8: e2833001 add r3, r3, #1 + 1068ac: e581300c str r3, [r1, #12] + local_irq_restore(flags); + 1068b0: e121f00c msr CPSR_c, ip + pUDP->UDP_FDR[ep] = rctx->data[i]; + + if (atomic_inc_return(&upcd.ep[ep].pkts_in_transit) == 1) { + 1068b4: e3530001 cmp r3, #1 + /* not been transmitting before, start transmit */ + pUDP->UDP_CSR[ep] |= AT91C_UDP_TXPKTRDY; + 1068b8: 0286300c addeq r3, r6, #12 + 1068bc: 07951103 ldreq r1, [r5, r3, lsl #2] + 1068c0: 03811010 orreq r1, r1, #16 + 1068c4: 07851103 streq r1, [r5, r3, lsl #2] + } + + if ((end - start < AT91C_EP_OUT_SIZE) || + 1068c8: e35a003f cmp sl, #63 ; 0x3f + 1068cc: 9a000010 bls 106914 <__udp_refill_ep+0x17c> + 1068d0: e252c000 subs ip, r2, #0 + 1068d4: 13a0c001 movne ip, #1 + 1068d8: e1520008 cmp r2, r8 + 1068dc: 13a0c000 movne ip, #0 + 1068e0: e35c0000 cmp ip, #0 + 1068e4: 0a000002 beq 1068f4 <__udp_refill_ep+0x15c> + (((end - start) == 0) && end && (rctx->tot_len % AT91C_EP_OUT_SIZE) == 0)) { + 1068e8: e1d020b6 ldrh r2, [r0, #6] + 1068ec: e312003f tst r2, #63 ; 0x3f + 1068f0: 0a000007 beq 106914 <__udp_refill_ep+0x17c> + /* CASE 2: mark transfer as incomplete, if + * - after data of transfer == AT91C_EP_OUT_SIZE + * - after data of transfer > AT91C_EP_OUT_SIZE + * - after last packet of transfer % AT91C_EP_OUT_SIZE == 0 + */ + upcd.ep[ep].incomplete.rctx = rctx; + 1068f4: e0876006 add r6, r7, r6 + 1068f8: e0844106 add r4, r4, r6, lsl #2 + upcd.ep[ep].incomplete.bytes_sent += end - start; + 1068fc: e5943014 ldr r3, [r4, #20] + 106900: e08aa003 add sl, sl, r3 + /* CASE 2: mark transfer as incomplete, if + * - after data of transfer == AT91C_EP_OUT_SIZE + * - after data of transfer > AT91C_EP_OUT_SIZE + * - after last packet of transfer % AT91C_EP_OUT_SIZE == 0 + */ + upcd.ep[ep].incomplete.rctx = rctx; + 106904: e5840010 str r0, [r4, #16] + upcd.ep[ep].incomplete.bytes_sent += end - start; + 106908: e584a014 str sl, [r4, #20] + DEBUGII("RCTX(ep=%u)_tx_cont ", ep); + } + + return 1; + 10690c: e3a00001 mov r0, #1 + 106910: eaffffa8 b 1067b8 <__udp_refill_ep+0x20> + * - after ZLP of transfer == AT91C_EP_OUT_SIZE + * - after ZLP of transfer % AT91C_EP_OUT_SIZE == 0 + * - after last packet of transfer % AT91C_EP_OUT_SIZE != 0 + */ + DEBUGII("RCTX(ep=%u,ctx=%u)_tx_done ", ep, req_ctx_num(rctx)); + upcd.ep[ep].incomplete.rctx = NULL; + 106914: e0876006 add r6, r7, r6 + 106918: e3a0e000 mov lr, #0 + 10691c: e0844106 add r4, r4, r6, lsl #2 + 106920: e584e010 str lr, [r4, #16] + req_ctx_put(rctx); + 106924: eb000598 bl 107f8c + upcd.ep[ep].incomplete.rctx = rctx; + upcd.ep[ep].incomplete.bytes_sent += end - start; + DEBUGII("RCTX(ep=%u)_tx_cont ", ep); + } + + return 1; + 106928: e3a00001 mov r0, #1 + * - after ZLP of transfer % AT91C_EP_OUT_SIZE == 0 + * - after last packet of transfer % AT91C_EP_OUT_SIZE != 0 + */ + DEBUGII("RCTX(ep=%u,ctx=%u)_tx_done ", ep, req_ctx_num(rctx)); + upcd.ep[ep].incomplete.rctx = NULL; + req_ctx_put(rctx); + 10692c: eaffffa1 b 1067b8 <__udp_refill_ep+0x20> + if (upcd.ep[ep].incomplete.rctx) { + rctx = upcd.ep[ep].incomplete.rctx; + start = upcd.ep[ep].incomplete.bytes_sent; + } else { + /* get pending rctx and start transmitting from zero */ + rctx = req_ctx_find_get(0, epstate[ep].state_pending, + 106930: e59fe038 ldr lr, [pc, #56] ; 106970 <__udp_refill_ep+0x1d8> + 106934: e08e2186 add r2, lr, r6, lsl #3 + 106938: e5921004 ldr r1, [r2, #4] + 10693c: e59fc030 ldr ip, [pc, #48] ; 106974 <__udp_refill_ep+0x1dc> + 106940: e79e2186 ldr r2, [lr, r6, lsl #3] + 106944: e1a0e00f mov lr, pc + 106948: e12fff1c bx ip + epstate[ep].state_busy); + if (!rctx) + 10694c: e3500000 cmp r0, #0 + 106950: 0affff98 beq 1067b8 <__udp_refill_ep+0x20> + return 0; + start = 0; + + upcd.ep[ep].incomplete.bytes_sent = 0; + 106954: e3a0a000 mov sl, #0 + 106958: e588a014 str sl, [r8, #20] + 10695c: e1a0100a mov r1, sl + 106960: e1a0900a mov r9, sl + /* get pending rctx and start transmitting from zero */ + rctx = req_ctx_find_get(0, epstate[ep].state_pending, + epstate[ep].state_busy); + if (!rctx) + return 0; + start = 0; + 106964: e1a0800a mov r8, sl + 106968: eaffffa2 b 1067f8 <__udp_refill_ep+0x60> + 10696c: 0020030c .word 0x0020030c + 106970: 0010a600 .word 0x0010a600 + 106974: 00200080 .word 0x00200080 + +00106978 : + + return ret; +} + +static void udp_irq(void) +{ + 106978: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} + u_int32_t csr; + AT91PS_UDP pUDP = upcd.pUdp; + 10697c: e59f5b10 ldr r5, [pc, #2832] ; 107494 + 106980: e5954000 ldr r4, [r5] + AT91_REG isr = pUDP->UDP_ISR; + 106984: e594001c ldr r0, [r4, #28] + + return ret; +} + +static void udp_irq(void) +{ + 106988: e24dd014 sub sp, sp, #20 + u_int32_t csr; + AT91PS_UDP pUDP = upcd.pUdp; + AT91_REG isr = pUDP->UDP_ISR; + 10698c: e58d0008 str r0, [sp, #8] + + DEBUGI("udp_irq(imr=0x%04x, isr=0x%04x, state=%d): ", + pUDP->UDP_IMR, isr, upcd.state); + + if (isr & AT91C_UDP_ENDBUSRES) { + 106990: e59d3008 ldr r3, [sp, #8] + 106994: e3130a01 tst r3, #4096 ; 0x1000 + 106998: 1a000098 bne 106c00 + goto out; + } +#endif + } + + if (isr & AT91C_UDP_EPINT0) { + 10699c: e59dc008 ldr ip, [sp, #8] + 1069a0: e31c0001 tst ip, #1 + 1069a4: 1a0000b3 bne 106c78 + DEBUGI("EP0INT(Control) "); + udp_ep0_handler(); + } + if (isr & AT91C_UDP_EPINT1) { + 1069a8: e59d0008 ldr r0, [sp, #8] + 1069ac: e3100002 tst r0, #2 + 1069b0: 0a000046 beq 106ad0 + u_int32_t cur_rcv_bank = upcd.cur_rcv_bank; + 1069b4: e5956008 ldr r6, [r5, #8] + u_int16_t i, pkt_size; + struct req_ctx *rctx; + + csr = pUDP->UDP_CSR[1]; + 1069b8: e5947034 ldr r7, [r4, #52] ; 0x34 + if (csr & AT91C_UDP_RX_DATA_BK1) + DEBUGIO("BANK1 "); + if (csr & AT91C_UDP_RX_DATA_BK0) + DEBUGIO("BANK0 "); + + if (!(csr & cur_rcv_bank)) + 1069bc: e1170006 tst r7, r6 + 1069c0: 0a000042 beq 106ad0 + goto cont_ep2; + + if (upcd.ep[1].incomplete.rctx) { + 1069c4: e59fcac8 ldr ip, [pc, #2760] ; 107494 + 1069c8: e59c001c ldr r0, [ip, #28] + 1069cc: e3500000 cmp r0, #0 + u_int32_t cur_rcv_bank = upcd.cur_rcv_bank; + u_int16_t i, pkt_size; + struct req_ctx *rctx; + + csr = pUDP->UDP_CSR[1]; + pkt_size = csr >> 16; + 1069d0: e1a07827 lsr r7, r7, #16 + DEBUGIO("BANK0 "); + + if (!(csr & cur_rcv_bank)) + goto cont_ep2; + + if (upcd.ep[1].incomplete.rctx) { + 1069d4: 0a000133 beq 106ea8 + 1069d8: e1d020b6 ldrh r2, [r0, #6] + 1069dc: e1a01002 mov r1, r2 + } + rctx->tot_len = 0; + } + DEBUGIO("RCTX=%u ", req_ctx_num(rctx)); + + if (rctx->size - rctx->tot_len < pkt_size) { + 1069e0: e1d030b4 ldrh r3, [r0, #4] + 1069e4: e0611003 rsb r1, r1, r3 + 1069e8: e1510007 cmp r1, r7 + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + 1069ec: b0627003 rsblt r7, r2, r3 + 1069f0: b1a07807 lsllt r7, r7, #16 + 1069f4: b1a07827 lsrlt r7, r7, #16 + } + + for (i = 0; i < pkt_size; i++) + 1069f8: e3570000 cmp r7, #0 + 1069fc: 0a000028 beq 106aa4 + local_irq_restore(flags); + + return ret; +} + +static void udp_irq(void) + 106a00: e087c002 add ip, r7, r2 + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a04: e2828001 add r8, r2, #1 + local_irq_restore(flags); + + return ret; +} + +static void udp_irq(void) + 106a08: e1a0a80c lsl sl, ip, #16 + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a0c: e1a03808 lsl r3, r8, #16 + local_irq_restore(flags); + + return ret; +} + +static void udp_irq(void) + 106a10: e1a0a82a lsr sl, sl, #16 + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a14: e5948054 ldr r8, [r4, #84] ; 0x54 + 106a18: e1a03823 lsr r3, r3, #16 + 106a1c: e1e01002 mvn r1, r2 + 106a20: e590c008 ldr ip, [r0, #8] + 106a24: e081100a add r1, r1, sl + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106a28: e153000a cmp r3, sl + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a2c: e7cc8002 strb r8, [ip, r2] + 106a30: e2011001 and r1, r1, #1 + 106a34: e1c030b6 strh r3, [r0, #6] + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106a38: 0a000019 beq 106aa4 + 106a3c: e3510000 cmp r1, #0 + 106a40: 0a000008 beq 106a68 + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a44: e594c054 ldr ip, [r4, #84] ; 0x54 + 106a48: e2832001 add r2, r3, #1 + 106a4c: e5901008 ldr r1, [r0, #8] + 106a50: e1a02802 lsl r2, r2, #16 + 106a54: e7c1c003 strb ip, [r1, r3] + 106a58: e1a03822 lsr r3, r2, #16 + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106a5c: e153000a cmp r3, sl + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a60: e1c030b6 strh r3, [r0, #6] + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106a64: 0a00000e beq 106aa4 + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a68: e2832001 add r2, r3, #1 + 106a6c: e5948054 ldr r8, [r4, #84] ; 0x54 + 106a70: e590c008 ldr ip, [r0, #8] + 106a74: e1a02802 lsl r2, r2, #16 + 106a78: e1a01822 lsr r1, r2, #16 + 106a7c: e7cc8003 strb r8, [ip, r3] + 106a80: e2818001 add r8, r1, #1 + 106a84: e1a03808 lsl r3, r8, #16 + 106a88: e1a03823 lsr r3, r3, #16 + 106a8c: e5948054 ldr r8, [r4, #84] ; 0x54 + 106a90: e5901008 ldr r1, [r0, #8] + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106a94: e153000a cmp r3, sl + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 106a98: e7c18822 strb r8, [r1, r2, lsr #16] + 106a9c: e1c030b6 strh r3, [r0, #6] + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + 106aa0: 1afffff0 bne 106a68 + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + + pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + 106aa4: e5941034 ldr r1, [r4, #52] ; 0x34 + + /* toggle current receive bank */ + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + 106aa8: e3560002 cmp r6, #2 + } + + for (i = 0; i < pkt_size; i++) + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + + pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + 106aac: e1c16006 bic r6, r1, r6 + 106ab0: e5846034 str r6, [r4, #52] ; 0x34 + /* toggle current receive bank */ + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + else + cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + upcd.cur_rcv_bank = cur_rcv_bank; + 106ab4: e59f69d8 ldr r6, [pc, #2520] ; 107494 + + pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + + /* toggle current receive bank */ + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + 106ab8: 13a03002 movne r3, #2 + 106abc: 03a03040 moveq r3, #64 ; 0x40 + + DEBUGIO("rctxdump(%s) ", hexdump(rctx->data, rctx->tot_len)); + + /* if this is the last packet in transfer, hand rctx up the + * stack */ + if (pkt_size < AT91C_EP_IN_SIZE) { + 106ac0: e357003f cmp r7, #63 ; 0x3f + /* toggle current receive bank */ + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + else + cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + upcd.cur_rcv_bank = cur_rcv_bank; + 106ac4: e5853008 str r3, [r5, #8] + DEBUGIO("RCTX_rx_done "); + req_ctx_set_state(rctx, RCTX_STATE_UDP_RCV_DONE); + upcd.ep[1].incomplete.rctx = NULL; + } else { + DEBUGIO("RCTX_rx_cont "); + upcd.ep[1].incomplete.rctx = rctx; + 106ac8: 8586001c strhi r0, [r6, #28] + + DEBUGIO("rctxdump(%s) ", hexdump(rctx->data, rctx->tot_len)); + + /* if this is the last packet in transfer, hand rctx up the + * stack */ + if (pkt_size < AT91C_EP_IN_SIZE) { + 106acc: 9a0000cb bls 106e00 + DEBUGIO("RCTX_rx_cont "); + upcd.ep[1].incomplete.rctx = rctx; + } + } +cont_ep2: + if (isr & AT91C_UDP_EPINT2) { + 106ad0: e59d3008 ldr r3, [sp, #8] + 106ad4: e3130004 tst r3, #4 + 106ad8: 0a000015 beq 106b34 + csr = pUDP->UDP_CSR[2]; + 106adc: e594c038 ldr ip, [r4, #56] ; 0x38 + DEBUGI("EP2INT(In, CSR=0x%08x) ", csr); + if (csr & AT91C_UDP_TXCOMP) { + 106ae0: e31c0001 tst ip, #1 + 106ae4: 0a000012 beq 106b34 + DEBUGII("ACK_TX_COMP "); + /* acknowledge TX completion */ + pUDP->UDP_CSR[2] &= ~AT91C_UDP_TXCOMP; + 106ae8: e5942038 ldr r2, [r4, #56] ; 0x38 + 106aec: e3c2e001 bic lr, r2, #1 + 106af0: e584e038 str lr, [r4, #56] ; 0x38 + while (pUDP->UDP_CSR[2] & AT91C_UDP_TXCOMP) ; + 106af4: e5941038 ldr r1, [r4, #56] ; 0x38 + 106af8: e3110001 tst r1, #1 + 106afc: 1afffffc bne 106af4 +static inline int atomic_sub_return(int i, atomic_t *v) +{ + unsigned long flags; + int val; + + local_irq_save(flags); + 106b00: e10fc000 mrs ip, CPSR + 106b04: e38c3080 orr r3, ip, #128 ; 0x80 + 106b08: e121f003 msr CPSR_c, r3 + val = v->counter; + 106b0c: e5953024 ldr r3, [r5, #36] ; 0x24 + v->counter = val -= i; + 106b10: e2430001 sub r0, r3, #1 + 106b14: e5850024 str r0, [r5, #36] ; 0x24 + local_irq_restore(flags); + 106b18: e121f00c msr CPSR_c, ip + + /* if we already have another packet in DPR, send it */ + if (atomic_dec_return(&upcd.ep[2].pkts_in_transit) == 1) + 106b1c: e3500001 cmp r0, #1 + pUDP->UDP_CSR[2] |= AT91C_UDP_TXPKTRDY; + 106b20: 05940038 ldreq r0, [r4, #56] ; 0x38 + 106b24: 03800010 orreq r0, r0, #16 + 106b28: 05840038 streq r0, [r4, #56] ; 0x38 + + __udp_refill_ep(2); + 106b2c: e3a00002 mov r0, #2 + 106b30: ebffff18 bl 106798 <__udp_refill_ep> + } + } + if (isr & AT91C_UDP_EPINT3) { + 106b34: e59d2008 ldr r2, [sp, #8] + 106b38: e3120008 tst r2, #8 + 106b3c: 0a000015 beq 106b98 + csr = pUDP->UDP_CSR[3]; + 106b40: e594103c ldr r1, [r4, #60] ; 0x3c + DEBUGII("EP3INT(Interrupt, CSR=0x%08x) ", csr); + /* Transmit has completed, re-fill from pending rcts for EP3 */ + if (csr & AT91C_UDP_TXCOMP) { + 106b44: e3110001 tst r1, #1 + 106b48: 0a000012 beq 106b98 + pUDP->UDP_CSR[3] &= ~AT91C_UDP_TXCOMP; + 106b4c: e594003c ldr r0, [r4, #60] ; 0x3c + 106b50: e3c0e001 bic lr, r0, #1 + 106b54: e584e03c str lr, [r4, #60] ; 0x3c + while (pUDP->UDP_CSR[3] & AT91C_UDP_TXCOMP) ; + 106b58: e594c03c ldr ip, [r4, #60] ; 0x3c + 106b5c: e31c0001 tst ip, #1 + 106b60: 1afffffc bne 106b58 +static inline int atomic_sub_return(int i, atomic_t *v) +{ + unsigned long flags; + int val; + + local_irq_save(flags); + 106b64: e10f2000 mrs r2, CPSR + 106b68: e3823080 orr r3, r2, #128 ; 0x80 + 106b6c: e121f003 msr CPSR_c, r3 + val = v->counter; + 106b70: e5951030 ldr r1, [r5, #48] ; 0x30 + v->counter = val -= i; + 106b74: e2413001 sub r3, r1, #1 + 106b78: e5853030 str r3, [r5, #48] ; 0x30 + local_irq_restore(flags); + 106b7c: e121f002 msr CPSR_c, r2 + + /* if we already have another packet in DPR, send it */ + if (atomic_dec_return(&upcd.ep[3].pkts_in_transit) == 1) + 106b80: e3530001 cmp r3, #1 + pUDP->UDP_CSR[3] |= AT91C_UDP_TXPKTRDY; + 106b84: 0594303c ldreq r3, [r4, #60] ; 0x3c + 106b88: 03833010 orreq r3, r3, #16 + 106b8c: 0584303c streq r3, [r4, #60] ; 0x3c + + __udp_refill_ep(3); + 106b90: e3a00003 mov r0, #3 + 106b94: ebfffeff bl 106798 <__udp_refill_ep> + } + } + if (isr & AT91C_UDP_RXSUSP) { + 106b98: e59d1008 ldr r1, [sp, #8] + 106b9c: e3110c01 tst r1, #256 ; 0x100 + pUDP->UDP_ICR = AT91C_UDP_RXSUSP; + 106ba0: 13a01c01 movne r1, #256 ; 0x100 + 106ba4: 15841020 strne r1, [r4, #32] + * involves saving the pre-suspend state, and calling back + * into the main application program to ask it to power down + * all peripherals, switching to slow clock, ... */ +#endif + } + if (isr & AT91C_UDP_RXRSM) { + 106ba8: e59d2008 ldr r2, [sp, #8] + 106bac: e3120c02 tst r2, #512 ; 0x200 + pUDP->UDP_ICR = AT91C_UDP_RXRSM; + 106bb0: 13a02c02 movne r2, #512 ; 0x200 + 106bb4: 15842020 strne r2, [r4, #32] + if (upcd.state == USB_STATE_SUSPENDED) + upcd.state = USB_STATE_CONFIGURED; + /* FIXME: implement suspend/resume */ +#endif + } + if (isr & AT91C_UDP_EXTRSM) { + 106bb8: e59d3008 ldr r3, [sp, #8] + 106bbc: e3130b01 tst r3, #1024 ; 0x400 + pUDP->UDP_ICR = AT91C_UDP_EXTRSM; + 106bc0: 13a03b01 movne r3, #1024 ; 0x400 + 106bc4: 15843020 strne r3, [r4, #32] + DEBUGI("EXTRSM "); + /* FIXME: implement suspend/resume */ + } + if (isr & AT91C_UDP_SOFINT) { + 106bc8: e59dc008 ldr ip, [sp, #8] + 106bcc: e31c0b02 tst ip, #2048 ; 0x800 + pUDP->UDP_ICR = AT91C_UDP_SOFINT; + 106bd0: 13a0cb02 movne ip, #2048 ; 0x800 + 106bd4: 1584c020 strne ip, [r4, #32] + DEBUGI("SOFINT "); + } + if (isr & AT91C_UDP_WAKEUP) { + 106bd8: e59d0008 ldr r0, [sp, #8] + 106bdc: e3100a02 tst r0, #8192 ; 0x2000 + pUDP->UDP_ICR = AT91C_UDP_WAKEUP; + 106be0: 13a00a02 movne r0, #8192 ; 0x2000 + 106be4: 15840020 strne r0, [r4, #32] +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); + 106be8: e3a00b02 mov r0, #2048 ; 0x800 + 106bec: e3e0cc0f mvn ip, #3840 ; 0xf00 + 106bf0: e58c0029 str r0, [ip, #41] ; 0x29 + DEBUGI("WAKEUP "); + } +out: + DEBUGI("END\r\n"); + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); +} + 106bf4: e28dd014 add sp, sp, #20 + 106bf8: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 106bfc: e12fff1e bx lr + pUDP->UDP_IMR, isr, upcd.state); + + if (isr & AT91C_UDP_ENDBUSRES) { + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + pUDP->UDP_IER = AT91C_UDP_EPINT0; + 106c00: e3a0e001 mov lr, #1 + DEBUGI("udp_irq(imr=0x%04x, isr=0x%04x, state=%d): ", + pUDP->UDP_IMR, isr, upcd.state); + + if (isr & AT91C_UDP_ENDBUSRES) { + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + 106c04: e3a00a01 mov r0, #4096 ; 0x1000 + 106c08: e5840020 str r0, [r4, #32] + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + 106c0c: e3a0c000 mov ip, #0 + pUDP->UDP_IMR, isr, upcd.state); + + if (isr & AT91C_UDP_ENDBUSRES) { + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + pUDP->UDP_IER = AT91C_UDP_EPINT0; + 106c10: e584e010 str lr, [r4, #16] + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + 106c14: e3e02000 mvn r2, #0 + pUDP->UDP_RSTEP = 0; + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + 106c18: e3a03c01 mov r3, #256 ; 0x100 + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + upcd.cur_config = 0; + upcd.state = USB_STATE_DEFAULT; + + reset_ep(1); + 106c1c: e1a0000e mov r0, lr + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 106c20: e3a0e902 mov lr, #32768 ; 0x8000 + if (isr & AT91C_UDP_ENDBUSRES) { + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + 106c24: e5842028 str r2, [r4, #40] ; 0x28 + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + upcd.cur_config = 0; + upcd.state = USB_STATE_DEFAULT; + 106c28: e3a01005 mov r1, #5 + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + 106c2c: e584c028 str ip, [r4, #40] ; 0x28 + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + 106c30: e5843008 str r3, [r4, #8] + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 106c34: e584e030 str lr, [r4, #48] ; 0x30 + upcd.cur_config = 0; + 106c38: e5c5c005 strb ip, [r5, #5] + upcd.state = USB_STATE_DEFAULT; + 106c3c: e5c51004 strb r1, [r5, #4] + + reset_ep(1); + 106c40: ebfffea8 bl 1066e8 + reset_ep(2); + 106c44: e3a00002 mov r0, #2 + 106c48: ebfffea6 bl 1066e8 + reset_ep(3); + 106c4c: e3a00003 mov r0, #3 + 106c50: ebfffea4 bl 1066e8 + +#ifdef CONFIG_DFU + if (*dfu->dfu_state == DFU_STATE_appDETACH) { + 106c54: e59f383c ldr r3, [pc, #2108] ; 107498 + 106c58: e59320e8 ldr r2, [r3, #232] ; 0xe8 + 106c5c: e5922000 ldr r2, [r2] + 106c60: e3520001 cmp r2, #1 + 106c64: 1affff4c bne 10699c + DEBUGI("DFU_SWITCH "); + /* now we need to switch to DFU mode */ + dfu->dfu_switch(); + 106c68: e593c0e4 ldr ip, [r3, #228] ; 0xe4 + 106c6c: e1a0e00f mov lr, pc + 106c70: e12fff1c bx ip + goto out; + 106c74: eaffffdb b 106be8 +} + +/* Handle requests on the USB Control Endpoint */ +static void udp_ep0_handler(void) +{ + AT91PS_UDP pUDP = upcd.pUdp; + 106c78: e595a000 ldr sl, [r5] + u_int8_t bmRequestType, bRequest; + u_int16_t wValue, wIndex, wLength, wStatus; + u_int32_t csr = pUDP->UDP_CSR[0]; + 106c7c: e59a6030 ldr r6, [sl, #48] ; 0x30 + + DEBUGE("CSR=0x%04x ", csr); + 106c80: e59f0814 ldr r0, [pc, #2068] ; 10749c + 106c84: e1a01006 mov r1, r6 + 106c88: eb000463 bl 107e1c + + if (csr & AT91C_UDP_STALLSENT) { + 106c8c: e3160008 tst r6, #8 + 106c90: 1a000065 bne 106e2c + DEBUGE("ACK_STALLSENT "); + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + } + + if (csr & AT91C_UDP_RX_DATA_BK0) { + 106c94: e3160002 tst r6, #2 + 106c98: 1a00005d bne 106e14 + DEBUGE("ACK_BANK0 "); + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + } + + if (!(csr & AT91C_UDP_RXSETUP)) { + 106c9c: e3160004 tst r6, #4 + 106ca0: 0a000053 beq 106df4 + DEBUGE("no setup packet "); + return; + } + + DEBUGE("len=%d ", csr >> 16); + 106ca4: e1a06826 lsr r6, r6, #16 + 106ca8: e59f07f0 ldr r0, [pc, #2032] ; 1074a0 + 106cac: e1a01006 mov r1, r6 + 106cb0: eb000459 bl 107e1c + if (csr >> 16 == 0) { + 106cb4: e3560000 cmp r6, #0 + 106cb8: 0a000060 beq 106e40 + DEBUGE("empty packet "); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + 106cbc: e59a6050 ldr r6, [sl, #80] ; 0x50 + bRequest = pUDP->UDP_FDR[0]; + 106cc0: e59a7050 ldr r7, [sl, #80] ; 0x50 + wValue = (pUDP->UDP_FDR[0] & 0xFF); + 106cc4: e59a9050 ldr r9, [sl, #80] ; 0x50 + wValue |= (pUDP->UDP_FDR[0] << 8); + 106cc8: e59a8050 ldr r8, [sl, #80] ; 0x50 + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 106ccc: e59a2050 ldr r2, [sl, #80] ; 0x50 + wIndex |= (pUDP->UDP_FDR[0] << 8); + 106cd0: e59ae050 ldr lr, [sl, #80] ; 0x50 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + 106cd4: e59a0050 ldr r0, [sl, #80] ; 0x50 + wLength |= (pUDP->UDP_FDR[0] << 8); + 106cd8: e59a1050 ldr r1, [sl, #80] ; 0x50 + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 106cdc: e202b0ff and fp, r2, #255 ; 0xff + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + 106ce0: e20030ff and r3, r0, #255 ; 0xff + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + 106ce4: e18b240e orr r2, fp, lr, lsl #8 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + 106ce8: e1830401 orr r0, r3, r1, lsl #8 + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + 106cec: e209c0ff and ip, r9, #255 ; 0xff + wValue |= (pUDP->UDP_FDR[0] << 8); + 106cf0: e18c9408 orr r9, ip, r8, lsl #8 + if (csr >> 16 == 0) { + DEBUGE("empty packet "); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + 106cf4: e20660ff and r6, r6, #255 ; 0xff + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + 106cf8: e1a0c802 lsl ip, r2, #16 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + 106cfc: e1a0b800 lsl fp, r0, #16 + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + 106d00: e1a08809 lsl r8, r9, #16 + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + 106d04: e1a0e82c lsr lr, ip, #16 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + 106d08: e59f0794 ldr r0, [pc, #1940] ; 1074a4 + 106d0c: e1a01006 mov r1, r6 + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + 106d10: e1a0982b lsr r9, fp, #16 + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + 106d14: e58de000 str lr, [sp] + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + 106d18: e58d9004 str r9, [sp, #4] + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + 106d1c: eb00043e bl 107e1c + + if (bmRequestType & 0x80) { + 106d20: e3160080 tst r6, #128 ; 0x80 + DEBUGE("empty packet "); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + 106d24: e20770ff and r7, r7, #255 ; 0xff + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + 106d28: e1a08828 lsr r8, r8, #16 + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + 106d2c: 1a00006d bne 106ee8 + DEBUGE("DATA_IN=1 "); + pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + } + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + 106d30: e59ac030 ldr ip, [sl, #48] ; 0x30 + 106d34: e3cce004 bic lr, ip, #4 + 106d38: e58ae030 str lr, [sl, #48] ; 0x30 + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + 106d3c: e59a0030 ldr r0, [sl, #48] ; 0x30 + 106d40: e2109004 ands r9, r0, #4 + 106d44: 1afffffc bne 106d3c + + DEBUGE("dfu_state = %u ", *dfu->dfu_state); + 106d48: e59fb748 ldr fp, [pc, #1864] ; 107498 + 106d4c: e59b30e8 ldr r3, [fp, #232] ; 0xe8 + 106d50: e59f0750 ldr r0, [pc, #1872] ; 1074a8 + 106d54: e5931000 ldr r1, [r3] + 106d58: eb00042f bl 107e1c + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + 106d5c: e59f2748 ldr r2, [pc, #1864] ; 1074ac + 106d60: e1863407 orr r3, r6, r7, lsl #8 + 106d64: e1530002 cmp r3, r2 + 106d68: 0a0000f8 beq 107150 + 106d6c: da000036 ble 106e4c + 106d70: e3530d22 cmp r3, #2176 ; 0x880 + 106d74: 0a000093 beq 106fc8 + 106d78: ca00006c bgt 106f30 + 106d7c: e3530c05 cmp r3, #1280 ; 0x500 + 106d80: 0a00016b beq 107334 + 106d84: e3530d1a cmp r3, #1664 ; 0x680 + 106d88: 0a0000fd beq 107184 + 106d8c: e59fe71c ldr lr, [pc, #1820] ; 1074b0 + 106d90: e153000e cmp r3, lr + 106d94: 1a000035 bne 106e70 + (wIndex & 0xff) != 0) + goto out_stall; + udp_ep0_send_zlp(); + break; + case STD_SET_FEATURE_ENDPOINT: + DEBUGE("SET_FEATURE_ENDPOINT "); + 106d98: e59f0714 ldr r0, [pc, #1812] ; 1074b4 + 106d9c: eb00041e bl 107e1c + if (upcd.state == USB_STATE_ADDRESS && + 106da0: e5d53004 ldrb r3, [r5, #4] + 106da4: e3530006 cmp r3, #6 + 106da8: 0a000178 beq 107390 + (wIndex & 0xff) != 0) + goto out_stall; + if (wValue != USB_ENDPOINT_HALT) + 106dac: e3580000 cmp r8, #0 + 106db0: 1a000035 bne 106e8c + goto out_stall; + udp_ep0_send_zlp(); + 106db4: e59f66dc ldr r6, [pc, #1756] ; 107498 + 106db8: e596c0d8 ldr ip, [r6, #216] ; 0xd8 + 106dbc: e1a0e00f mov lr, pc + 106dc0: e12fff1c bx ip + wIndex &= 0x0F; + if ((wValue == 0) && wIndex && (wIndex <= 3)) { + 106dc4: e59d2000 ldr r2, [sp] + 106dc8: e312000f tst r2, #15 + 106dcc: e202300f and r3, r2, #15 + 106dd0: 0a00002d beq 106e8c + 106dd4: e3530003 cmp r3, #3 + 106dd8: 8a00002b bhi 106e8c + pUDP->UDP_CSR[wIndex] = 0; + 106ddc: e283000c add r0, r3, #12 + 106de0: e78a8100 str r8, [sl, r0, lsl #2] + udp_ep0_send_zlp(); + 106de4: e596c0d8 ldr ip, [r6, #216] ; 0xd8 + 106de8: e1a0e00f mov lr, pc + 106dec: e12fff1c bx ip + 106df0: eafffeec b 1069a8 + DEBUGE("ACK_BANK0 "); + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + } + + if (!(csr & AT91C_UDP_RXSETUP)) { + DEBUGE("no setup packet "); + 106df4: e59f06bc ldr r0, [pc, #1724] ; 1074b8 + 106df8: eb000407 bl 107e1c + 106dfc: eafffee9 b 1069a8 + + /* if this is the last packet in transfer, hand rctx up the + * stack */ + if (pkt_size < AT91C_EP_IN_SIZE) { + DEBUGIO("RCTX_rx_done "); + req_ctx_set_state(rctx, RCTX_STATE_UDP_RCV_DONE); + 106e00: e3a01002 mov r1, #2 + 106e04: eb00045a bl 107f74 + upcd.ep[1].incomplete.rctx = NULL; + 106e08: e3a00000 mov r0, #0 + 106e0c: e586001c str r0, [r6, #28] + 106e10: eaffff2e b 106ad0 + DEBUGE("ACK_STALLSENT "); + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + } + + if (csr & AT91C_UDP_RX_DATA_BK0) { + DEBUGE("ACK_BANK0 "); + 106e14: e59f06a0 ldr r0, [pc, #1696] ; 1074bc + 106e18: eb0003ff bl 107e1c + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + 106e1c: e59a2030 ldr r2, [sl, #48] ; 0x30 + 106e20: e3c23002 bic r3, r2, #2 + 106e24: e58a3030 str r3, [sl, #48] ; 0x30 + 106e28: eaffff9b b 106c9c + u_int32_t csr = pUDP->UDP_CSR[0]; + + DEBUGE("CSR=0x%04x ", csr); + + if (csr & AT91C_UDP_STALLSENT) { + DEBUGE("ACK_STALLSENT "); + 106e2c: e59f068c ldr r0, [pc, #1676] ; 1074c0 + 106e30: eb0003f9 bl 107e1c + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + 106e34: e3e01008 mvn r1, #8 + 106e38: e58a1030 str r1, [sl, #48] ; 0x30 + 106e3c: eaffff94 b 106c94 + return; + } + + DEBUGE("len=%d ", csr >> 16); + if (csr >> 16 == 0) { + DEBUGE("empty packet "); + 106e40: e59f067c ldr r0, [pc, #1660] ; 1074c4 + 106e44: eb0003f4 bl 107e1c + 106e48: eafffed6 b 1069a8 + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + + DEBUGE("dfu_state = %u ", *dfu->dfu_state); + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + 106e4c: e3530c01 cmp r3, #256 ; 0x100 + 106e50: 0a00007e beq 107050 + 106e54: ca00002c bgt 106f0c + 106e58: e3530081 cmp r3, #129 ; 0x81 + 106e5c: 0a0000a3 beq 1070f0 + 106e60: e3530082 cmp r3, #130 ; 0x82 + 106e64: 0a00007c beq 10705c + 106e68: e3530080 cmp r3, #128 ; 0x80 + 106e6c: 0a0000b0 beq 107134 + * the given interface, we shall respond with STALL in the + * status stage */ + udp_ep0_send_stall(); + break; + default: + DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + 106e70: e59f0650 ldr r0, [pc, #1616] ; 1074c8 + 106e74: e1a01007 mov r1, r7 + 106e78: e1a02006 mov r2, r6 + 106e7c: eb0003e6 bl 107e1c + bRequest, bmRequestType); +#ifdef CONFIG_DFU + if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + 106e80: e206c03f and ip, r6, #63 ; 0x3f + 106e84: e35c0021 cmp ip, #33 ; 0x21 + 106e88: 0a00015c beq 107400 + goto out_stall; + break; + } + return; +out_stall: + DEBUGE("STALL!! "); + 106e8c: e59f0638 ldr r0, [pc, #1592] ; 1074cc + 106e90: eb0003e1 bl 107e1c + udp_ep0_send_stall(); + 106e94: e59f35fc ldr r3, [pc, #1532] ; 107498 + 106e98: e593c0dc ldr ip, [r3, #220] ; 0xdc + 106e9c: e1a0e00f mov lr, pc + 106ea0: e12fff1c bx ip + 106ea4: eafffebf b 1069a8 + } else { + /* allocate new req_ctx */ + DEBUGIO("alloc_new_RCTX "); + + /* whether to get a big or a small req_ctx */ + if (pkt_size >= AT91C_EP_IN_SIZE) + 106ea8: e357003f cmp r7, #63 ; 0x3f + rctx = req_ctx_find_get(1, RCTX_STATE_FREE, + 106eac: 83a00001 movhi r0, #1 + 106eb0: 83a010fe movhi r1, #254 ; 0xfe + 106eb4: 81a02000 movhi r2, r0 + RCTX_STATE_UDP_RCV_BUSY); + else + rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 106eb8: 93a010fe movls r1, #254 ; 0xfe + 106ebc: 93a02001 movls r2, #1 + 106ec0: e59f3608 ldr r3, [pc, #1544] ; 1074d0 + 106ec4: e1a0e00f mov lr, pc + 106ec8: e12fff13 bx r3 + RCTX_STATE_UDP_RCV_BUSY); + + if (!rctx) { + 106ecc: e3500000 cmp r0, #0 + 106ed0: 0a000129 beq 10737c + /* disable interrupts for now */ + pUDP->UDP_IDR = AT91C_UDP_EPINT1; + DEBUGP("NO_RCTX_AVAIL! "); + goto cont_ep2; + } + rctx->tot_len = 0; + 106ed4: e3a02000 mov r2, #0 + 106ed8: e3a01000 mov r1, #0 + 106edc: e1c020b6 strh r2, [r0, #6] + 106ee0: e1a02001 mov r2, r1 + 106ee4: eafffebd b 1069e0 + wLength |= (pUDP->UDP_FDR[0] << 8); + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + DEBUGE("DATA_IN=1 "); + 106ee8: e59f05e4 ldr r0, [pc, #1508] ; 1074d4 + 106eec: eb0003ca bl 107e1c + pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 106ef0: e59a1030 ldr r1, [sl, #48] ; 0x30 + 106ef4: e3813080 orr r3, r1, #128 ; 0x80 + 106ef8: e58a3030 str r3, [sl, #48] ; 0x30 + while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 106efc: e59ab030 ldr fp, [sl, #48] ; 0x30 + 106f00: e31b0080 tst fp, #128 ; 0x80 + 106f04: 0afffffc beq 106efc + 106f08: eaffff88 b 106d30 + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + + DEBUGE("dfu_state = %u ", *dfu->dfu_state); + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + 106f0c: e59f15c4 ldr r1, [pc, #1476] ; 1074d8 + 106f10: e1530001 cmp r3, r1 + 106f14: 0a0000f6 beq 1072f4 + 106f18: ba0000ef blt 1072dc + 106f1c: e3530c03 cmp r3, #768 ; 0x300 + 106f20: 1affffd2 bne 106e70 + sizeof(wStatus)); + } else + goto out_stall; + break; + case STD_SET_FEATURE_ZERO: + DEBUGE("SET_FEATURE_ZERO "); + 106f24: e59f05b0 ldr r0, [pc, #1456] ; 1074dc + 106f28: eb0003bb bl 107e1c + 106f2c: eaffffd6 b 106e8c + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + + DEBUGE("dfu_state = %u ", *dfu->dfu_state); + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + 106f30: e59f25a8 ldr r2, [pc, #1448] ; 1074e0 + 106f34: e1530002 cmp r3, r2 + 106f38: 0a00003b beq 10702c + 106f3c: e282c080 add ip, r2, #128 ; 0x80 + 106f40: e153000c cmp r3, ip + 106f44: 0a000029 beq 106ff0 + 106f48: e3530c09 cmp r3, #2304 ; 0x900 + 106f4c: 1affffc7 bne 106e70 + goto out_stall; + break; + } + break; + case STD_SET_CONFIGURATION: + DEBUGE("SET_CONFIG "); + 106f50: e59f058c ldr r0, [pc, #1420] ; 1074e4 + 106f54: eb0003b0 bl 107e1c + if (upcd.state != USB_STATE_ADDRESS && + 106f58: e5d5c004 ldrb ip, [r5, #4] + 106f5c: e24c3006 sub r3, ip, #6 + 106f60: e3530001 cmp r3, #1 + 106f64: 8affffc8 bhi 106e8c + upcd.state != USB_STATE_CONFIGURED) { + goto out_stall; + } + if ((wValue & 0xff) == 0) { + 106f68: e21830ff ands r3, r8, #255 ; 0xff + 106f6c: 0a000118 beq 1073d4 + upcd.state = USB_STATE_ADDRESS; + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = 0; + pUDP->UDP_CSR[2] = 0; + pUDP->UDP_CSR[3] = 0; + } else if ((wValue & 0xff) <= + 106f70: e3530001 cmp r3, #1 + 106f74: 1affffc4 bne 106e8c + dev_descriptor.bNumConfigurations) { + DEBUGE("VALUE!=0 "); + 106f78: e59f0568 ldr r0, [pc, #1384] ; 1074e8 + 106f7c: eb0003a6 bl 107e1c + upcd.state = USB_STATE_CONFIGURED; + pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + 106f80: e3a00c82 mov r0, #33280 ; 0x8200 + AT91C_UDP_EPTYPE_BULK_OUT; + pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + 106f84: e280cb01 add ip, r0, #1024 ; 0x400 + pUDP->UDP_CSR[2] = 0; + pUDP->UDP_CSR[3] = 0; + } else if ((wValue & 0xff) <= + dev_descriptor.bNumConfigurations) { + DEBUGE("VALUE!=0 "); + upcd.state = USB_STATE_CONFIGURED; + 106f88: e3a01007 mov r1, #7 + pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + 106f8c: e3a02002 mov r2, #2 + pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + AT91C_UDP_EPTYPE_BULK_OUT; + pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + AT91C_UDP_EPTYPE_BULK_IN; + pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + 106f90: e28c3c01 add r3, ip, #256 ; 0x100 + pUDP->UDP_CSR[2] = 0; + pUDP->UDP_CSR[3] = 0; + } else if ((wValue & 0xff) <= + dev_descriptor.bNumConfigurations) { + DEBUGE("VALUE!=0 "); + upcd.state = USB_STATE_CONFIGURED; + 106f94: e5c51004 strb r1, [r5, #4] + pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + 106f98: e58a2004 str r2, [sl, #4] + pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + 106f9c: e58a0034 str r0, [sl, #52] ; 0x34 + AT91C_UDP_EPTYPE_BULK_OUT; + pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + 106fa0: e58ac038 str ip, [sl, #56] ; 0x38 + AT91C_UDP_EPTYPE_BULK_IN; + pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + 106fa4: e58a303c str r3, [sl, #60] ; 0x3c + } else { + /* invalid configuration */ + goto out_stall; + break; + } + upcd.cur_config = wValue; + 106fa8: e5c58005 strb r8, [r5, #5] + udp_ep0_send_zlp(); + 106fac: e59fc4e4 ldr ip, [pc, #1252] ; 107498 + 106fb0: e59cc0d8 ldr ip, [ip, #216] ; 0xd8 + 106fb4: e1a0e00f mov lr, pc + 106fb8: e12fff1c bx ip + pUDP->UDP_IER = (AT91C_UDP_EPINT0 | AT91C_UDP_EPINT1 | + 106fbc: e3a0300f mov r3, #15 + 106fc0: e58a3010 str r3, [sl, #16] + 106fc4: eafffe77 b 1069a8 + AT91C_UDP_EPINT2 | AT91C_UDP_EPINT3); + break; + case STD_GET_CONFIGURATION: + DEBUGE("GET_CONFIG "); + 106fc8: e59f051c ldr r0, [pc, #1308] ; 1074ec + 106fcc: eb000392 bl 107e1c + switch (upcd.state) { + 106fd0: e5d52004 ldrb r2, [r5, #4] + 106fd4: e2420006 sub r0, r2, #6 + 106fd8: e3500001 cmp r0, #1 + 106fdc: 8affffaa bhi 106e8c + case USB_STATE_ADDRESS: + case USB_STATE_CONFIGURED: + udp_ep0_send_data((char *)&(upcd.cur_config), + 106fe0: e59f0508 ldr r0, [pc, #1288] ; 1074f0 + 106fe4: e3a01001 mov r1, #1 + 106fe8: ebfffd5a bl 106558 + 106fec: eafffe6d b 1069a8 + udp_ep0_send_zlp(); + } else + goto out_stall; + break; + case STD_SET_INTERFACE: + DEBUGE("SET INTERFACE "); + 106ff0: e59f04fc ldr r0, [pc, #1276] ; 1074f4 + 106ff4: eb000388 bl 107e1c + if (upcd.state != USB_STATE_CONFIGURED) + 106ff8: e5d51004 ldrb r1, [r5, #4] + 106ffc: e3510007 cmp r1, #7 + 107000: e59f348c ldr r3, [pc, #1164] ; 107494 + 107004: 1affffa0 bne 106e8c + goto out_stall; + if (wIndex > cfg_descriptor.ucfg.bNumInterfaces) + 107008: e59d1000 ldr r1, [sp] + 10700c: e3510003 cmp r1, #3 + 107010: 8affff9d bhi 106e8c + goto out_stall; + upcd.cur_interface = wIndex; + 107014: e5c31006 strb r1, [r3, #6] + upcd.cur_altsett = wValue; + 107018: e5c38007 strb r8, [r3, #7] + /* USB spec mandates that if we only support one altsetting in + * the given interface, we shall respond with STALL in the + * status stage */ + udp_ep0_send_stall(); + 10701c: e59bc0dc ldr ip, [fp, #220] ; 0xdc + 107020: e1a0e00f mov lr, pc + 107024: e12fff1c bx ip + 107028: eafffe5e b 1069a8 + goto out_stall; + break; + } + break; + case STD_GET_INTERFACE: + DEBUGE("GET_INTERFACE "); + 10702c: e59f04c4 ldr r0, [pc, #1220] ; 1074f8 + 107030: eb000379 bl 107e1c + if (upcd.state != USB_STATE_CONFIGURED) + 107034: e5d51004 ldrb r1, [r5, #4] + 107038: e3510007 cmp r1, #7 + 10703c: 1affff92 bne 106e8c + goto out_stall; + udp_ep0_send_data((char *)&(upcd.cur_altsett), + 107040: e59f04b4 ldr r0, [pc, #1204] ; 1074fc + 107044: e3a01001 mov r1, #1 + 107048: ebfffd42 bl 106558 + 10704c: eafffe55 b 1069a8 + udp_ep0_send_zlp(); + } else + goto out_stall; + break; + case STD_CLEAR_FEATURE_ZERO: + DEBUGE("CLEAR_FEATURE_ZERO "); + 107050: e59f04a8 ldr r0, [pc, #1192] ; 107500 + 107054: eb000370 bl 107e1c + 107058: eaffff8b b 106e8c + goto out_stall; + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + 10705c: e59d6000 ldr r6, [sp] + 107060: e206600f and r6, r6, #15 + 107064: e59f0498 ldr r0, [pc, #1176] ; 107504 + 107068: e1a01006 mov r1, r6 + 10706c: eb00036a bl 107e1c + if (upcd.state == USB_STATE_DEFAULT || + 107070: e5d53004 ldrb r3, [r5, #4] + 107074: e3530005 cmp r3, #5 + 107078: 0affff83 beq 106e8c + 10707c: e59dc000 ldr ip, [sp] + 107080: e25c2000 subs r2, ip, #0 + 107084: 13a02001 movne r2, #1 + 107088: e3530006 cmp r3, #6 + 10708c: 13a02000 movne r2, #0 + 107090: e3520000 cmp r2, #0 + 107094: 1affff7c bne 106e8c + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 107098: e59a3004 ldr r3, [sl, #4] + 10709c: e3130002 tst r3, #2 + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + if (upcd.state == USB_STATE_DEFAULT || + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + 1070a0: e1cd20be strh r2, [sp, #14] + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 1070a4: 0a000003 beq 1070b8 + 1070a8: e3560003 cmp r6, #3 + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1070ac: 9286600c addls r6, r6, #12 + 1070b0: 979a3106 ldrls r3, [sl, r6, lsl #2] + if (upcd.state == USB_STATE_DEFAULT || + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 1070b4: 9a000005 bls 1070d0 + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 1070b8: e59a3004 ldr r3, [sl, #4] + 1070bc: e3130001 tst r3, #1 + 1070c0: 0affff71 beq 106e8c + && (wIndex == 0)) { + 1070c4: e3560000 cmp r6, #0 + 1070c8: 1affff6f bne 106e8c + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1070cc: e59a3030 ldr r3, [sl, #48] ; 0x30 + 1070d0: e3130902 tst r3, #32768 ; 0x8000 + 1070d4: e28d0010 add r0, sp, #16 + 1070d8: 13a02000 movne r2, #0 + 1070dc: 03a02001 moveq r2, #1 + 1070e0: e16020b2 strh r2, [r0, #-2]! + udp_ep0_send_data((char *)&wStatus, + 1070e4: e3a01002 mov r1, #2 + 1070e8: ebfffd1a bl 106558 + 1070ec: eafffe2d b 1069a8 + DEBUGE("GET_STATUS_ZERO "); + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_INTERFACE: + DEBUGE("GET_STATUS_INTERFACE "); + 1070f0: e59f0410 ldr r0, [pc, #1040] ; 107508 + 1070f4: eb000348 bl 107e1c + if (upcd.state == USB_STATE_DEFAULT || + 1070f8: e5d53004 ldrb r3, [r5, #4] + 1070fc: e3530005 cmp r3, #5 + 107100: 0affff61 beq 106e8c + 107104: e59de000 ldr lr, [sp] + 107108: e25e2000 subs r2, lr, #0 + 10710c: 13a02001 movne r2, #1 + 107110: e3530006 cmp r3, #6 + 107114: 13a02000 movne r2, #0 + 107118: e3520000 cmp r2, #0 + 10711c: 1affff5a bne 106e8c + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + 107120: e28d0010 add r0, sp, #16 + 107124: e16020b2 strh r2, [r0, #-2]! + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 107128: e3a01002 mov r1, #2 + 10712c: ebfffd09 bl 106558 + 107130: eafffe1c b 1069a8 + goto out_stall; + udp_ep0_send_data((char *)&(upcd.cur_altsett), + sizeof(upcd.cur_altsett)); + break; + case STD_GET_STATUS_ZERO: + DEBUGE("GET_STATUS_ZERO "); + 107134: e59f03d0 ldr r0, [pc, #976] ; 10750c + 107138: eb000337 bl 107e1c + wStatus = 0; + 10713c: e28d0010 add r0, sp, #16 + 107140: e16090b2 strh r9, [r0, #-2]! + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 107144: e3a01002 mov r1, #2 + 107148: ebfffd02 bl 106558 + 10714c: eafffe15 b 1069a8 + goto out_stall; + /* FIXME: implement this */ + goto out_stall; + break; + case STD_SET_FEATURE_INTERFACE: + DEBUGE("SET_FEATURE_INTERFACE "); + 107150: e59f03b8 ldr r0, [pc, #952] ; 107510 + 107154: eb000330 bl 107e1c + if (upcd.state == USB_STATE_ADDRESS && + 107158: e5d50004 ldrb r0, [r5, #4] + 10715c: e3500006 cmp r0, #6 + 107160: 1a000002 bne 107170 + 107164: e59d1000 ldr r1, [sp] + 107168: e31100ff tst r1, #255 ; 0xff + 10716c: 1affff46 bne 106e8c + (wIndex & 0xff) != 0) + goto out_stall; + udp_ep0_send_zlp(); + 107170: e59fc320 ldr ip, [pc, #800] ; 107498 + 107174: e59cc0d8 ldr ip, [ip, #216] ; 0xd8 + 107178: e1a0e00f mov lr, pc + 10717c: e12fff1c bx ip + 107180: eafffe08 b 1069a8 + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", + 107184: e59f0388 ldr r0, [pc, #904] ; 107514 + 107188: e59d2000 ldr r2, [sp] + 10718c: e1a01008 mov r1, r8 + 107190: eb000321 bl 107e1c + wValue, wIndex); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + switch (desc_type) { + 107194: e1a02428 lsr r2, r8, #8 + 107198: e2420001 sub r0, r2, #1 + 10719c: e3500020 cmp r0, #32 + 1071a0: 979ff100 ldrls pc, [pc, r0, lsl #2] + 1071a4: eaffff38 b 106e8c + 1071a8: 00107290 .word 0x00107290 + 1071ac: 00107264 .word 0x00107264 + 1071b0: 00106e8c .word 0x00106e8c + 1071b4: 0010722c .word 0x0010722c + 1071b8: 00106e8c .word 0x00106e8c + 1071bc: 00106e8c .word 0x00106e8c + 1071c0: 00106e8c .word 0x00106e8c + 1071c4: 00106e8c .word 0x00106e8c + 1071c8: 00106e8c .word 0x00106e8c + 1071cc: 00106e8c .word 0x00106e8c + 1071d0: 00106e8c .word 0x00106e8c + 1071d4: 00106e8c .word 0x00106e8c + 1071d8: 00106e8c .word 0x00106e8c + 1071dc: 00106e8c .word 0x00106e8c + 1071e0: 00106e8c .word 0x00106e8c + 1071e4: 00106e8c .word 0x00106e8c + 1071e8: 00106e8c .word 0x00106e8c + 1071ec: 00106e8c .word 0x00106e8c + 1071f0: 00106e8c .word 0x00106e8c + 1071f4: 00106e8c .word 0x00106e8c + 1071f8: 00106e8c .word 0x00106e8c + 1071fc: 00106e8c .word 0x00106e8c + 107200: 00106e8c .word 0x00106e8c + 107204: 00106e8c .word 0x00106e8c + 107208: 00106e8c .word 0x00106e8c + 10720c: 00106e8c .word 0x00106e8c + 107210: 00106e8c .word 0x00106e8c + 107214: 00106e8c .word 0x00106e8c + 107218: 00106e8c .word 0x00106e8c + 10721c: 00106e8c .word 0x00106e8c + 107220: 00106e8c .word 0x00106e8c + 107224: 00106e8c .word 0x00106e8c + 107228: 001072bc .word 0x001072bc + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", + wValue, wIndex); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + 10722c: e20880ff and r8, r8, #255 ; 0xff + udp_ep0_send_data((const char *) &dfu->dfu_cfg_descriptor->func_dfu, + MIN(sizeof(dfu->dfu_cfg_descriptor->func_dfu), wLength)); + break; + case USB_DT_INTERFACE: + /* Return Interface descriptor */ + if (desc_index > cfg_descriptor.ucfg.bNumInterfaces) + 107230: e3580003 cmp r8, #3 + 107234: 8affff14 bhi 106e8c + goto out_stall; + switch (desc_index) { + 107238: e3580001 cmp r8, #1 + 10723c: 0a00008e beq 10747c + 107240: 3a000087 bcc 107464 + 107244: e3580002 cmp r8, #2 + 107248: 1affff0f bne 106e8c + &cfg_descriptor.uif_dfu[0], + MIN(sizeof(cfg_descriptor.uif_dfu[0]), + wLength)); + break; + case 2: + udp_ep0_send_data((const char *) + 10724c: e59d1004 ldr r1, [sp, #4] + 107250: e59f02c0 ldr r0, [pc, #704] ; 107518 + 107254: e3510009 cmp r1, #9 + 107258: 23a01009 movcs r1, #9 + 10725c: ebfffcbd bl 106558 + 107260: eafffdd0 b 1069a8 + MIN(sizeof(dev_descriptor), wLength)); + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + 107264: e59f322c ldr r3, [pc, #556] ; 107498 + 107268: e59300e8 ldr r0, [r3, #232] ; 0xe8 + 10726c: e590c000 ldr ip, [r0] + 107270: e35c0000 cmp ip, #0 + 107274: 1a00006a bne 107424 + dfu->dfu_cfg_descriptor, + MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + wLength)); + else +#endif + udp_ep0_send_data((const char *) &cfg_descriptor, + 107278: e59d1004 ldr r1, [sp, #4] + 10727c: e59f0298 ldr r0, [pc, #664] ; 10751c + 107280: e3510039 cmp r1, #57 ; 0x39 + 107284: 23a01039 movcs r1, #57 ; 0x39 + 107288: ebfffcb2 bl 106558 + 10728c: eafffdc5 b 1069a8 + desc_index = wValue & 0xff; + switch (desc_type) { + case USB_DT_DEVICE: + /* Return Device Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + 107290: e59f3200 ldr r3, [pc, #512] ; 107498 + 107294: e593e0e8 ldr lr, [r3, #232] ; 0xe8 + 107298: e59e1000 ldr r1, [lr] + 10729c: e3510000 cmp r1, #0 + 1072a0: 1a000068 bne 107448 + dfu->dfu_dev_descriptor, + MIN(dfu->dfu_dev_descriptor->bLength, + wLength)); + else +#endif + udp_ep0_send_data((const char *) &dev_descriptor, + 1072a4: e59d1004 ldr r1, [sp, #4] + 1072a8: e59f0270 ldr r0, [pc, #624] ; 107520 + 1072ac: e3510012 cmp r1, #18 + 1072b0: 23a01012 movcs r1, #18 + 1072b4: ebfffca7 bl 106558 + 1072b8: eafffdba b 1069a8 + goto out_stall; +#endif + break; + case USB_DT_CS_DEVICE: + /* Return Function descriptor */ + udp_ep0_send_data((const char *) &dfu->dfu_cfg_descriptor->func_dfu, + 1072bc: e59fc1d4 ldr ip, [pc, #468] ; 107498 + 1072c0: e59d1004 ldr r1, [sp, #4] + 1072c4: e59c30f0 ldr r3, [ip, #240] ; 0xf0 + 1072c8: e3510009 cmp r1, #9 + 1072cc: 23a01009 movcs r1, #9 + 1072d0: e283001b add r0, r3, #27 + 1072d4: ebfffc9f bl 106558 + 1072d8: eafffdb2 b 1069a8 + case STD_CLEAR_FEATURE_ZERO: + DEBUGE("CLEAR_FEATURE_ZERO "); + goto out_stall; + break; + case STD_CLEAR_FEATURE_INTERFACE: + DEBUGP("CLEAR_FEATURE_INTERFACE "); + 1072dc: e59f0240 ldr r0, [pc, #576] ; 107524 + 1072e0: eb0002cd bl 107e1c + udp_ep0_send_zlp(); + 1072e4: e59bc0d8 ldr ip, [fp, #216] ; 0xd8 + 1072e8: e1a0e00f mov lr, pc + 1072ec: e12fff1c bx ip + 1072f0: eafffdac b 1069a8 + break; + case STD_CLEAR_FEATURE_ENDPOINT: + DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + 1072f4: e59d6000 ldr r6, [sp] + 1072f8: e206600f and r6, r6, #15 + 1072fc: e59f0224 ldr r0, [pc, #548] ; 107528 + 107300: e1a01006 mov r1, r6 + 107304: eb0002c4 bl 107e1c + if (wValue != USB_ENDPOINT_HALT) + 107308: e3580000 cmp r8, #0 + 10730c: 1afffede bne 106e8c + goto out_stall; + wIndex &= 0x0F; + if ((wValue == 0) && wIndex && (wIndex <= 3)) { + 107310: e2560000 subs r0, r6, #0 + 107314: 0afffedc beq 106e8c + 107318: e3560003 cmp r6, #3 + 10731c: 8afffeda bhi 106e8c + reset_ep(wIndex); + 107320: ebfffcf0 bl 1066e8 + udp_ep0_send_zlp(); + 107324: e59bc0d8 ldr ip, [fp, #216] ; 0xd8 + 107328: e1a0e00f mov lr, pc + 10732c: e12fff1c bx ip + 107330: eafffd9c b 1069a8 + goto out_stall; + break; + } + break; + case STD_SET_ADDRESS: + DEBUGE("SET_ADDRESS "); + 107334: e59f01f0 ldr r0, [pc, #496] ; 10752c + 107338: eb0002b7 bl 107e1c + if (wValue > 127) + 10733c: e358007f cmp r8, #127 ; 0x7f + 107340: 8afffed1 bhi 106e8c + goto out_stall; + + switch (upcd.state) { + 107344: e5d53004 ldrb r3, [r5, #4] + 107348: e3530005 cmp r3, #5 + 10734c: 0a000013 beq 1073a0 + 107350: e3530006 cmp r3, #6 + 107354: 1afffecc bne 106e8c + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + upcd.state = USB_STATE_ADDRESS; + } + break; + case USB_STATE_ADDRESS: + udp_ep0_send_zlp(); + 107358: e59bc0d8 ldr ip, [fp, #216] ; 0xd8 + 10735c: e1a0e00f mov lr, pc + 107360: e12fff1c bx ip + if (wValue == 0) { + 107364: e3580000 cmp r8, #0 + upcd.state = USB_STATE_DEFAULT; + 107368: 03a01005 moveq r1, #5 + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 10736c: 13888c01 orrne r8, r8, #256 ; 0x100 + } + break; + case USB_STATE_ADDRESS: + udp_ep0_send_zlp(); + if (wValue == 0) { + upcd.state = USB_STATE_DEFAULT; + 107370: 05c51004 strbeq r1, [r5, #4] + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 107374: 158a8008 strne r8, [sl, #8] + 107378: eafffd8a b 1069a8 + rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_UDP_RCV_BUSY); + + if (!rctx) { + /* disable interrupts for now */ + pUDP->UDP_IDR = AT91C_UDP_EPINT1; + 10737c: e3a0e002 mov lr, #2 + 107380: e584e014 str lr, [r4, #20] + DEBUGP("NO_RCTX_AVAIL! "); + 107384: e59f01a4 ldr r0, [pc, #420] ; 107530 + 107388: eb0002a3 bl 107e1c + goto cont_ep2; + 10738c: eafffdcf b 106ad0 + goto out_stall; + udp_ep0_send_zlp(); + break; + case STD_SET_FEATURE_ENDPOINT: + DEBUGE("SET_FEATURE_ENDPOINT "); + if (upcd.state == USB_STATE_ADDRESS && + 107390: e59de000 ldr lr, [sp] + 107394: e31e00ff tst lr, #255 ; 0xff + 107398: 1afffebb bne 106e8c + 10739c: eafffe82 b 106dac + if (wValue > 127) + goto out_stall; + + switch (upcd.state) { + case USB_STATE_DEFAULT: + udp_ep0_send_zlp(); + 1073a0: e59bc0d8 ldr ip, [fp, #216] ; 0xd8 + 1073a4: e1a0e00f mov lr, pc + 1073a8: e12fff1c bx ip + if (wValue == 0) { + 1073ac: e3580000 cmp r8, #0 + 1073b0: 0afffd7c beq 1069a8 + /* do nothing */ + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1073b4: e3a02001 mov r2, #1 + case USB_STATE_DEFAULT: + udp_ep0_send_zlp(); + if (wValue == 0) { + /* do nothing */ + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1073b8: e3888c01 orr r8, r8, #256 ; 0x100 + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + upcd.state = USB_STATE_ADDRESS; + 1073bc: e59f00d0 ldr r0, [pc, #208] ; 107494 + case USB_STATE_DEFAULT: + udp_ep0_send_zlp(); + if (wValue == 0) { + /* do nothing */ + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1073c0: e58a8008 str r8, [sl, #8] + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1073c4: e58a2004 str r2, [sl, #4] + upcd.state = USB_STATE_ADDRESS; + 1073c8: e3a02006 mov r2, #6 + 1073cc: e5c02004 strb r2, [r0, #4] + 1073d0: eafffd74 b 1069a8 + if (upcd.state != USB_STATE_ADDRESS && + upcd.state != USB_STATE_CONFIGURED) { + goto out_stall; + } + if ((wValue & 0xff) == 0) { + DEBUGE("VALUE==0 "); + 1073d4: e59f0158 ldr r0, [pc, #344] ; 107534 + 1073d8: eb00028f bl 107e1c + upcd.state = USB_STATE_ADDRESS; + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = 0; + 1073dc: e3a00000 mov r0, #0 + upcd.state != USB_STATE_CONFIGURED) { + goto out_stall; + } + if ((wValue & 0xff) == 0) { + DEBUGE("VALUE==0 "); + upcd.state = USB_STATE_ADDRESS; + 1073e0: e3a01006 mov r1, #6 + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1073e4: e3a02001 mov r2, #1 + upcd.state != USB_STATE_CONFIGURED) { + goto out_stall; + } + if ((wValue & 0xff) == 0) { + DEBUGE("VALUE==0 "); + upcd.state = USB_STATE_ADDRESS; + 1073e8: e5c51004 strb r1, [r5, #4] + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1073ec: e58a2004 str r2, [sl, #4] + pUDP->UDP_CSR[1] = 0; + 1073f0: e58a0034 str r0, [sl, #52] ; 0x34 + pUDP->UDP_CSR[2] = 0; + 1073f4: e58a0038 str r0, [sl, #56] ; 0x38 + pUDP->UDP_CSR[3] = 0; + 1073f8: e58a003c str r0, [sl, #60] ; 0x3c + 1073fc: eafffee9 b 106fa8 + default: + DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + bRequest, bmRequestType); +#ifdef CONFIG_DFU + if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + dfu->dfu_ep0_handler(bmRequestType, bRequest, wValue, + 107400: e1a00006 mov r0, r6 + 107404: e1a01007 mov r1, r7 + 107408: e1a02008 mov r2, r8 + 10740c: e59d3004 ldr r3, [sp, #4] + 107410: e59fc080 ldr ip, [pc, #128] ; 107498 + 107414: e59cc0e0 ldr ip, [ip, #224] ; 0xe0 + 107418: e1a0e00f mov lr, pc + 10741c: e12fff1c bx ip + 107420: eafffd60 b 1069a8 + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + dfu->dfu_cfg_descriptor, + 107424: e59300f0 ldr r0, [r3, #240] ; 0xf0 + MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + 107428: e5d0e002 ldrb lr, [r0, #2] + 10742c: e5d01003 ldrb r1, [r0, #3] + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + 107430: e59d2004 ldr r2, [sp, #4] + dfu->dfu_cfg_descriptor, + MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + 107434: e18e1401 orr r1, lr, r1, lsl #8 + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + 107438: e1520001 cmp r2, r1 + 10743c: 31a01002 movcc r1, r2 + 107440: ebfffc44 bl 106558 + 107444: eafffd57 b 1069a8 + case USB_DT_DEVICE: + /* Return Device Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + dfu->dfu_dev_descriptor, + 107448: e59300ec ldr r0, [r3, #236] ; 0xec + switch (desc_type) { + case USB_DT_DEVICE: + /* Return Device Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + 10744c: e59d3004 ldr r3, [sp, #4] + dfu->dfu_dev_descriptor, + MIN(dfu->dfu_dev_descriptor->bLength, + 107450: e5d01000 ldrb r1, [r0] + switch (desc_type) { + case USB_DT_DEVICE: + /* Return Device Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + 107454: e1530001 cmp r3, r1 + 107458: 31a01003 movcc r1, r3 + 10745c: ebfffc3d bl 106558 + 107460: eafffd50 b 1069a8 + /* Return Interface descriptor */ + if (desc_index > cfg_descriptor.ucfg.bNumInterfaces) + goto out_stall; + switch (desc_index) { + case 0: + udp_ep0_send_data((const char *) + 107464: e59d1004 ldr r1, [sp, #4] + 107468: e59f00c8 ldr r0, [pc, #200] ; 107538 + 10746c: e3510009 cmp r1, #9 + 107470: 23a01009 movcs r1, #9 + 107474: ebfffc37 bl 106558 + 107478: eafffd4a b 1069a8 + MIN(sizeof(cfg_descriptor.uif), + wLength)); + break; + #ifdef CONFIG_DFU + case 1: + udp_ep0_send_data((const char *) + 10747c: e59d1004 ldr r1, [sp, #4] + 107480: e59f00b4 ldr r0, [pc, #180] ; 10753c + 107484: e3510009 cmp r1, #9 + 107488: 23a01009 movcs r1, #9 + 10748c: ebfffc31 bl 106558 + 107490: eafffd44 b 1069a8 + 107494: 0020030c .word 0x0020030c + 107498: 00103f00 .word 0x00103f00 + 10749c: 0010a704 .word 0x0010a704 + 1074a0: 0010a740 .word 0x0010a740 + 1074a4: 0010a758 .word 0x0010a758 + 1074a8: 0010a77c .word 0x0010a77c + 1074ac: 00000301 .word 0x00000301 + 1074b0: 00000302 .word 0x00000302 + 1074b4: 0010a884 .word 0x0010a884 + 1074b8: 0010a72c .word 0x0010a72c + 1074bc: 0010a720 .word 0x0010a720 + 1074c0: 0010a710 .word 0x0010a710 + 1074c4: 0010a748 .word 0x0010a748 + 1074c8: 0010a900 .word 0x0010a900 + 1074cc: 0010a924 .word 0x0010a924 + 1074d0: 00200080 .word 0x00200080 + 1074d4: 0010a770 .word 0x0010a770 + 1074d8: 00000102 .word 0x00000102 + 1074dc: 0010a858 .word 0x0010a858 + 1074e0: 00000a81 .word 0x00000a81 + 1074e4: 0010a7cc .word 0x0010a7cc + 1074e8: 0010a7e4 .word 0x0010a7e4 + 1074ec: 0010a7f0 .word 0x0010a7f0 + 1074f0: 00200311 .word 0x00200311 + 1074f4: 0010a8f0 .word 0x0010a8f0 + 1074f8: 0010a7fc .word 0x0010a7fc + 1074fc: 00200313 .word 0x00200313 + 107500: 0010a89c .word 0x0010a89c + 107504: 0010a838 .word 0x0010a838 + 107508: 0010a820 .word 0x0010a820 + 10750c: 0010a80c .word 0x0010a80c + 107510: 0010a86c .word 0x0010a86c + 107514: 0010a78c .word 0x0010a78c + 107518: 0010a664 .word 0x0010a664 + 10751c: 0010a634 .word 0x0010a634 + 107520: 0010a620 .word 0x0010a620 + 107524: 0010a8b0 .word 0x0010a8b0 + 107528: 0010a8cc .word 0x0010a8cc + 10752c: 0010a7bc .word 0x0010a7bc + 107530: 0010a930 .word 0x0010a930 + 107534: 0010a7d8 .word 0x0010a7d8 + 107538: 0010a63d .word 0x0010a63d + 10753c: 0010a65b .word 0x0010a65b + +00107540 : + +static void udp_ep0_handler(void); + +void udp_unthrottle(void) +{ + AT91PS_UDP pUDP = upcd.pUdp; + 107540: e59f000c ldr r0, [pc, #12] ; 107554 + 107544: e5903000 ldr r3, [r0] + pUDP->UDP_IER = AT91C_UDP_EPINT1; + 107548: e3a02002 mov r2, #2 + 10754c: e5832010 str r2, [r3, #16] +} + 107550: e12fff1e bx lr + 107554: 0020030c .word 0x0020030c + +00107558 : + + return 1; +} + +int udp_refill_ep(int ep) +{ + 107558: e92d4010 push {r4, lr} + unsigned long flags; + int ret; + + local_irq_save(flags); + 10755c: e10f4000 mrs r4, CPSR + 107560: e3843080 orr r3, r4, #128 ; 0x80 + 107564: e121f003 msr CPSR_c, r3 + ret = __udp_refill_ep(ep); + 107568: ebfffc8a bl 106798 <__udp_refill_ep> + local_irq_restore(flags); + 10756c: e121f004 msr CPSR_c, r4 + + return ret; +} + 107570: e8bd4010 pop {r4, lr} + 107574: e12fff1e bx lr + +00107578 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107578: e3e03c0b mvn r3, #2816 ; 0xb00 + 10757c: e3a00501 mov r0, #4194304 ; 0x400000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107580: e3a02801 mov r2, #65536 ; 0x10000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107584: e50300cf str r0, [r3, #-207] ; 0xffffff31 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107588: e50320cb str r2, [r3, #-203] ; 0xffffff35 +{ +#ifdef PCD + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + 10758c: e12fff1e bx lr + +00107590 : + 107590: e3e03c0b mvn r3, #2816 ; 0xb00 + 107594: e3a00501 mov r0, #4194304 ; 0x400000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107598: e3a02801 mov r2, #65536 ; 0x10000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 10759c: e50300cb str r0, [r3, #-203] ; 0xffffff35 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 1075a0: e50320cf str r2, [r3, #-207] ; 0xffffff31 +{ +#ifdef PCD + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + 1075a4: e12fff1e bx lr + +001075a8 : + +/* Open USB Device Port */ +void udp_open(void) +{ + 1075a8: e92d4030 push {r4, r5, lr} + DEBUGPCRF("entering"); + 1075ac: e59f0084 ldr r0, [pc, #132] ; 107638 + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +/* Open USB Device Port */ +void udp_open(void) +{ + 1075b0: e24dd00c sub sp, sp, #12 + DEBUGPCRF("entering"); + 1075b4: e59f1080 ldr r1, [pc, #128] ; 10763c + 1075b8: e3a02f79 mov r2, #484 ; 0x1e4 + udp_init(); + 1075bc: e59f407c ldr r4, [pc, #124] ; 107640 +} + +/* Open USB Device Port */ +void udp_open(void) +{ + DEBUGPCRF("entering"); + 1075c0: eb000215 bl 107e1c + udp_init(); + 1075c4: e594c0d0 ldr ip, [r4, #208] ; 0xd0 + 1075c8: e1a0e00f mov lr, pc + 1075cc: e12fff1c bx ip + upcd.pUdp = AT91C_BASE_UDP; + 1075d0: e59fc06c ldr ip, [pc, #108] ; 107644 + upcd.cur_config = 0; + upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 1075d4: e3a0e002 mov lr, #2 +/* Open USB Device Port */ +void udp_open(void) +{ + DEBUGPCRF("entering"); + udp_init(); + upcd.pUdp = AT91C_BASE_UDP; + 1075d8: e59f5068 ldr r5, [pc, #104] ; 107648 + upcd.cur_config = 0; + upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 1075dc: e58ce008 str lr, [ip, #8] + /* This should start with USB_STATE_NOTATTACHED, but we're a pure + * bus powered device and thus start with powered */ + upcd.state = USB_STATE_POWERED; + 1075e0: e5cce004 strb lr, [ip, #4] + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 1075e4: e1a0200e mov r2, lr +void udp_open(void) +{ + DEBUGPCRF("entering"); + udp_init(); + upcd.pUdp = AT91C_BASE_UDP; + upcd.cur_config = 0; + 1075e8: e3a04000 mov r4, #0 + upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + /* This should start with USB_STATE_NOTATTACHED, but we're a pure + * bus powered device and thus start with powered */ + upcd.state = USB_STATE_POWERED; + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 1075ec: e59fe058 ldr lr, [pc, #88] ; 10764c +/* Open USB Device Port */ +void udp_open(void) +{ + DEBUGPCRF("entering"); + udp_init(); + upcd.pUdp = AT91C_BASE_UDP; + 1075f0: e58c5000 str r5, [ip] + upcd.cur_config = 0; + 1075f4: e5cc4005 strb r4, [ip, #5] + upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + /* This should start with USB_STATE_NOTATTACHED, but we're a pure + * bus powered device and thus start with powered */ + upcd.state = USB_STATE_POWERED; + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 1075f8: e3a0100b mov r1, #11 + 1075fc: e1a03004 mov r3, r4 + 107600: e59f0048 ldr r0, [pc, #72] ; 107650 + 107604: e58de000 str lr, [sp] + 107608: ebfff3df bl 10458c + 10760c: e3e03c0b mvn r3, #2816 ; 0xb00 +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 107610: e3a01b02 mov r1, #2048 ; 0x800 + 107614: e3e0cc0f mvn ip, #3840 ; 0xf00 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107618: e3a00501 mov r0, #4194304 ; 0x400000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 10761c: e3a02801 mov r2, #65536 ; 0x10000 +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 107620: e58c1021 str r1, [ip, #33] ; 0x21 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107624: e50300cf str r0, [r3, #-207] ; 0xffffff31 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107628: e50320cb str r2, [r3, #-203] ; 0xffffff35 + + /* End-of-Bus-Reset is always enabled */ + + /* Set the Pull up resistor */ + udp_pullup_on(); +} + 10762c: e28dd00c add sp, sp, #12 + 107630: e8bd4030 pop {r4, r5, lr} + 107634: e12fff1e bx lr + 107638: 0010a940 .word 0x0010a940 + 10763c: 0010a670 .word 0x0010a670 + 107640: 00103f00 .word 0x00103f00 + 107644: 0020030c .word 0x0020030c + 107648: fffb0000 .word 0xfffb0000 + 10764c: 00106978 .word 0x00106978 + 107650: fffff000 .word 0xfffff000 + +00107654 : + +void udp_reset(void) +{ + 107654: e24dd008 sub sp, sp, #8 + 107658: e3e01c0b mvn r1, #2816 ; 0xb00 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 10765c: e3a02801 mov r2, #65536 ; 0x10000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107660: e3a0c501 mov ip, #4194304 ; 0x400000 + volatile int i; + + udp_pullup_off(); + for (i = 0; i < 0xffff; i++) + 107664: e3a00000 mov r0, #0 + 107668: e501c0cb str ip, [r1, #-203] ; 0xffffff35 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 10766c: e50120cf str r2, [r1, #-207] ; 0xffffff31 + 107670: e58d0004 str r0, [sp, #4] + 107674: e59d3004 ldr r3, [sp, #4] + 107678: e2422002 sub r2, r2, #2 + 10767c: e1530002 cmp r3, r2 + 107680: ca000005 bgt 10769c + 107684: e59d1004 ldr r1, [sp, #4] + 107688: e2810001 add r0, r1, #1 + 10768c: e58d0004 str r0, [sp, #4] + 107690: e59d3004 ldr r3, [sp, #4] + 107694: e1530002 cmp r3, r2 + 107698: dafffff9 ble 107684 + 10769c: e3e0cc0b mvn ip, #2816 ; 0xb00 + 1076a0: e3a03501 mov r3, #4194304 ; 0x400000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 1076a4: e3a02801 mov r2, #65536 ; 0x10000 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 1076a8: e50c30cf str r3, [ip, #-207] ; 0xffffff31 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 1076ac: e50c20cb str r2, [ip, #-203] ; 0xffffff35 + ; + udp_pullup_on(); +} + 1076b0: e28dd008 add sp, sp, #8 + 1076b4: e12fff1e bx lr + +001076b8 : +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 1076b8: e1d020b2 ldrh r2, [r0, #2] + 1076bc: e1d030b4 ldrh r3, [r0, #4] + 1076c0: e1520003 cmp r2, r3 + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1076c4: 91d000b0 ldrhls r0, [r0] + 1076c8: 90822000 addls r2, r2, r0 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 1076cc: 80630002 rsbhi r0, r3, r2 + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1076d0: 90630002 rsbls r0, r3, r2 +} + 1076d4: e12fff1e bx lr + +001076d8 : +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 1076d8: e1d010b2 ldrh r1, [r0, #2] + 1076dc: e1d030b4 ldrh r3, [r0, #4] + 1076e0: e1510003 cmp r1, r3 + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1076e4: 91d0c0b0 ldrhls ip, [r0] + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 1076e8: 81d0c0b0 ldrhhi ip, [r0] + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1076ec: 9081100c addls r1, r1, ip + +void fifo_check_water(struct fifo *fifo) +{ + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + 1076f0: e1d020b6 ldrh r2, [r0, #6] + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 1076f4: 80631001 rsbhi r1, r3, r1 + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1076f8: 90631001 rsbls r1, r3, r1 +void fifo_check_water(struct fifo *fifo) +{ + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + fifo->irq |= FIFO_IRQ_LO; + 1076fc: e5d03008 ldrb r3, [r0, #8] + +void fifo_check_water(struct fifo *fifo) +{ + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + 107700: e1520001 cmp r2, r1 + fifo->irq |= FIFO_IRQ_LO; + else + fifo->irq &= FIFO_IRQ_LO; + + if (fifo->size - avail >= fifo->watermark) + 107704: e061100c rsb r1, r1, ip +void fifo_check_water(struct fifo *fifo) +{ + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + fifo->irq |= FIFO_IRQ_LO; + 107708: a3833001 orrge r3, r3, #1 + else + fifo->irq &= FIFO_IRQ_LO; + 10770c: b2033001 andlt r3, r3, #1 + + if (fifo->size - avail >= fifo->watermark) + 107710: e1520001 cmp r2, r1 + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + fifo->irq |= FIFO_IRQ_LO; + else + fifo->irq &= FIFO_IRQ_LO; + 107714: e5c03008 strb r3, [r0, #8] + + if (fifo->size - avail >= fifo->watermark) + fifo->irq |= FIFO_IRQ_HI; + 107718: d3833002 orrle r3, r3, #2 + else + fifo->irq &= FIFO_IRQ_HI; + 10771c: c2033002 andgt r3, r3, #2 + 107720: e5c03008 strb r3, [r0, #8] + 107724: e12fff1e bx lr + +00107728 : +} + +void fifo_check_raise_int(struct fifo *fifo) +{ + if (fifo->irq & fifo->irq_en) + 107728: e5d01008 ldrb r1, [r0, #8] + 10772c: e5d02009 ldrb r2, [r0, #9] + 107730: e1110002 tst r1, r2 + else + fifo->irq &= FIFO_IRQ_HI; +} + +void fifo_check_raise_int(struct fifo *fifo) +{ + 107734: e92d4008 push {r3, lr} + if (fifo->irq & fifo->irq_en) + fifo->callback(fifo, fifo->irq, fifo->cb_data); + 107738: 15902010 ldrne r2, [r0, #16] + 10773c: 1590c00c ldrne ip, [r0, #12] + 107740: 11a0e00f movne lr, pc + 107744: 112fff1c bxne ip +} + 107748: e8bd4008 pop {r3, lr} + 10774c: e12fff1e bx lr + +00107750 : + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + 107750: e92d45f8 push {r3, r4, r5, r6, r7, r8, sl, lr} + 107754: e1a04000 mov r4, r0 +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 107758: e1d430b4 ldrh r3, [r4, #4] + 10775c: e1d000b2 ldrh r0, [r0, #2] + 107760: e1500003 cmp r0, r3 + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107764: 91d470b0 ldrhls r7, [r4] + fifo->callback(fifo, fifo->irq, fifo->cb_data); +} + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + 107768: e1a06002 mov r6, r2 +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 10776c: 90802007 addls r2, r0, r7 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 107770: 80632000 rsbhi r2, r3, r0 + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107774: 90632002 rsbls r2, r3, r2 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 107778: 81d470b0 ldrhhi r7, [r4] +} + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + 10777c: e1510002 cmp r1, r2 + fifo->callback(fifo, fifo->irq, fifo->cb_data); +} + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + 107780: e1a05001 mov r5, r1 + if (len > fifo_available(fifo)) { + 107784: da000008 ble 1077ac +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 107788: e1500003 cmp r0, r3 + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + len = fifo_available(fifo); + fifo->irq |= FIFO_IRQ_OFLOW; + 10778c: e5d41008 ldrb r1, [r4, #8] +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107790: 90875000 addls r5, r7, r0 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + 107794: 80635000 rsbhi r5, r3, r0 + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107798: 90635005 rsbls r5, r3, r5 + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + len = fifo_available(fifo); + fifo->irq |= FIFO_IRQ_OFLOW; + 10779c: e3812004 orr r2, r1, #4 + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + len = fifo_available(fifo); + 1077a0: e1a05805 lsl r5, r5, #16 + fifo->irq |= FIFO_IRQ_OFLOW; + 1077a4: e5c42008 strb r2, [r4, #8] + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + len = fifo_available(fifo); + 1077a8: e1a05825 lsr r5, r5, #16 + fifo->irq |= FIFO_IRQ_OFLOW; + } + + if (len + fifo->producer <= fifo->size) { + 1077ac: e0853000 add r3, r5, r0 + 1077b0: e1530007 cmp r3, r7 + 1077b4: da000012 ble 107804 + fifo->producer += len; + } else { + /* difficult: wrap around */ + u_int16_t chunk_len; + + chunk_len = fifo->size - fifo->producer; + 1077b8: e0608007 rsb r8, r0, r7 + 1077bc: e1a07808 lsl r7, r8, #16 + 1077c0: e1a07827 lsr r7, r7, #16 + memcpy(&fifo->data[fifo->producer], data, chunk_len); + 1077c4: e284a014 add sl, r4, #20 + 1077c8: e1a01006 mov r1, r6 + 1077cc: e1a02007 mov r2, r7 + + memcpy(&fifo->data[0], data + chunk_len, len - chunk_len); + 1077d0: e0678005 rsb r8, r7, r5 + } else { + /* difficult: wrap around */ + u_int16_t chunk_len; + + chunk_len = fifo->size - fifo->producer; + memcpy(&fifo->data[fifo->producer], data, chunk_len); + 1077d4: e08a0000 add r0, sl, r0 + 1077d8: eb000a4b bl 10a10c + + memcpy(&fifo->data[0], data + chunk_len, len - chunk_len); + 1077dc: e1a0000a mov r0, sl + 1077e0: e0861007 add r1, r6, r7 + 1077e4: e1a02008 mov r2, r8 + 1077e8: eb000a47 bl 10a10c + fifo->producer = len - chunk_len; + 1077ec: e1c480b2 strh r8, [r4, #2] + } + + fifo_check_water(fifo); + 1077f0: e1a00004 mov r0, r4 + 1077f4: ebffffb7 bl 1076d8 + + return len; +} + 1077f8: e1a00005 mov r0, r5 + 1077fc: e8bd45f8 pop {r3, r4, r5, r6, r7, r8, sl, lr} + 107800: e12fff1e bx lr + fifo->irq |= FIFO_IRQ_OFLOW; + } + + if (len + fifo->producer <= fifo->size) { + /* easy case */ + memcpy(&fifo->data[fifo->producer], data, len); + 107804: e284e014 add lr, r4, #20 + 107808: e08e0000 add r0, lr, r0 + 10780c: e1a01006 mov r1, r6 + 107810: e1a02005 mov r2, r5 + 107814: eb000a3c bl 10a10c + fifo->producer += len; + 107818: e1d4c0b2 ldrh ip, [r4, #2] + 10781c: e085000c add r0, r5, ip + 107820: e1c400b2 strh r0, [r4, #2] + 107824: eafffff1 b 1077f0 + +00107828 : + return len; +} + + +u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + 107828: e92d41f0 push {r4, r5, r6, r7, r8, lr} + 10782c: e1a04000 mov r4, r0 +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 107830: e1d430b4 ldrh r3, [r4, #4] + 107834: e1d000b2 ldrh r0, [r0, #2] + 107838: e1500003 cmp r0, r3 + return len; +} + + +u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + 10783c: e1a07002 mov r7, r2 +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 107840: 9a00000e bls 107880 + return fifo->producer - fifo->consumer; + 107844: e0630000 rsb r0, r3, r0 +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + 107848: e1a05800 lsl r5, r0, #16 + 10784c: e1a05825 lsr r5, r5, #16 + 107850: e1510005 cmp r1, r5 + 107854: 31a05001 movcc r5, r1 + if (avail < len) + len = avail; + + if (fifo->producer > fifo->consumer) { + /* easy case */ + memcpy(data, &fifo->data[fifo->consumer], len); + 107858: e2841014 add r1, r4, #20 + 10785c: e1a00002 mov r0, r2 + 107860: e0811003 add r1, r1, r3 + 107864: e1a02005 mov r2, r5 + 107868: eb000a27 bl 10a10c + u_int16_t chunk_len = fifo->size - fifo->consumer; + memcpy(data, &fifo->data[fifo->consumer], chunk_len); + memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); + } + + fifo_check_water(fifo); + 10786c: e1a00004 mov r0, r4 + 107870: ebffff98 bl 1076d8 + + return len; +} + 107874: e1a00005 mov r0, r5 + 107878: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + 10787c: e12fff1e bx lr +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107880: e1a06004 mov r6, r4 + 107884: e0d621b4 ldrh r2, [r6], #20 + 107888: e0805002 add r5, r0, r2 + 10788c: e063e005 rsb lr, r3, r5 + if (fifo->producer > fifo->consumer) { + /* easy case */ + memcpy(data, &fifo->data[fifo->consumer], len); + } else { + /* difficult case: wrap */ + u_int16_t chunk_len = fifo->size - fifo->consumer; + 107890: e063c002 rsb ip, r3, r2 + 107894: e1a0880c lsl r8, ip, #16 +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 107898: e1a0280e lsl r2, lr, #16 + if (fifo->producer > fifo->consumer) { + /* easy case */ + memcpy(data, &fifo->data[fifo->consumer], len); + } else { + /* difficult case: wrap */ + u_int16_t chunk_len = fifo->size - fifo->consumer; + 10789c: e1a08828 lsr r8, r8, #16 +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; + 1078a0: e1a05822 lsr r5, r2, #16 + 1078a4: e1550001 cmp r5, r1 + 1078a8: 21a05001 movcs r5, r1 + /* easy case */ + memcpy(data, &fifo->data[fifo->consumer], len); + } else { + /* difficult case: wrap */ + u_int16_t chunk_len = fifo->size - fifo->consumer; + memcpy(data, &fifo->data[fifo->consumer], chunk_len); + 1078ac: e1a02008 mov r2, r8 + 1078b0: e0861003 add r1, r6, r3 + 1078b4: e1a00007 mov r0, r7 + 1078b8: eb000a13 bl 10a10c + memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); + 1078bc: e0870008 add r0, r7, r8 + 1078c0: e1a01006 mov r1, r6 + 1078c4: e0682005 rsb r2, r8, r5 + 1078c8: eb000a0f bl 10a10c + 1078cc: eaffffe6 b 10786c + +001078d0 : +} + +int fifo_init(struct fifo *fifo, u_int16_t size, + void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) +{ + if (size > sizeof(fifo->data)) + 1078d0: e3510b01 cmp r1, #1024 ; 0x400 + return len; +} + +int fifo_init(struct fifo *fifo, u_int16_t size, + void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) +{ + 1078d4: e92d40f8 push {r3, r4, r5, r6, r7, lr} + 1078d8: e1a04000 mov r4, r0 + 1078dc: e1a05001 mov r5, r1 + 1078e0: e1a06002 mov r6, r2 + 1078e4: e1a07003 mov r7, r3 + if (size > sizeof(fifo->data)) + return -EINVAL; + 1078e8: 83e00015 mvnhi r0, #21 +} + +int fifo_init(struct fifo *fifo, u_int16_t size, + void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) +{ + if (size > sizeof(fifo->data)) + 1078ec: 8a00000b bhi 107920 + return -EINVAL; + + memset(fifo->data, 0, sizeof(fifo->data)); + 1078f0: e2800014 add r0, r0, #20 + 1078f4: e3a01000 mov r1, #0 + 1078f8: e3a02b01 mov r2, #1024 ; 0x400 + 1078fc: eb000a72 bl 10a2cc + fifo->size = size; + fifo->producer = fifo->consumer = 0; + 107900: e3a03000 mov r3, #0 +{ + if (size > sizeof(fifo->data)) + return -EINVAL; + + memset(fifo->data, 0, sizeof(fifo->data)); + fifo->size = size; + 107904: e1c450b0 strh r5, [r4] + fifo->producer = fifo->consumer = 0; + 107908: e1c430b4 strh r3, [r4, #4] + 10790c: e1c430b2 strh r3, [r4, #2] + fifo->watermark = 0; + 107910: e1c430b6 strh r3, [r4, #6] + fifo->callback = cb; + 107914: e584600c str r6, [r4, #12] + fifo->cb_data = cb_data; + 107918: e5847010 str r7, [r4, #16] + + return 0; + 10791c: e3a00000 mov r0, #0 +} + 107920: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} + 107924: e12fff1e bx lr + +00107928 <__rb_flush>: + + return 0; +} + +static void __rb_flush(void) +{ + 107928: e92d01f0 push {r4, r5, r6, r7, r8} +/* pull one char out of debug ring buffer */ +static int dbgu_rb_pull(char *ret) +{ + unsigned long flags; + + local_irq_save(flags); + 10792c: e10fc000 mrs ip, CPSR + 107930: e38c3080 orr r3, ip, #128 ; 0x80 + 107934: e121f003 msr CPSR_c, r3 + + if (dbgu.next_outbyte == dbgu.next_inbyte) { + 107938: e59f107c ldr r1, [pc, #124] ; 1079bc <__rb_flush+0x94> + 10793c: e59f007c ldr r0, [pc, #124] ; 1079c0 <__rb_flush+0x98> + 107940: e3a05a01 mov r5, #4096 ; 0x1000 + 107944: e7913000 ldr r3, [r1, r0] + 107948: e7912005 ldr r2, [r1, r5] + 10794c: e1530002 cmp r3, r2 + 107950: 0a000016 beq 1079b0 <__rb_flush+0x88> +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 107954: e3e02c0d mvn r2, #3328 ; 0xd00 + 107958: e0817005 add r7, r1, r5 + return -1; + } + + *ret = *dbgu.next_outbyte; + + dbgu.next_outbyte++; + 10795c: e1a08001 mov r8, r1 + 107960: e1a06002 mov r6, r2 + if (dbgu.next_outbyte == dbgu.next_inbyte) { + local_irq_restore(flags); + return -1; + } + + *ret = *dbgu.next_outbyte; + 107964: e4d34001 ldrb r4, [r3], #1 + + dbgu.next_outbyte++; + if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + 107968: e1530007 cmp r3, r7 + return -1; + } + + *ret = *dbgu.next_outbyte; + + dbgu.next_outbyte++; + 10796c: e7813000 str r3, [r1, r0] + if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + //AT91F_DBGU_Printk("WRAP DURING PULL\r\n"); + dbgu.next_outbyte = &dbgu.buf[0]; + 107970: 07888000 streq r8, [r8, r0] + } + + *ret = *dbgu.next_outbyte; + + dbgu.next_outbyte++; + if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + 107974: 0a000001 beq 107980 <__rb_flush+0x58> + //AT91F_DBGU_Printk("WRAP DURING PULL\r\n"); + dbgu.next_outbyte = &dbgu.buf[0]; + } else if (dbgu.next_outbyte > &dbgu.buf[0]+sizeof(dbgu.buf)) { + //AT91F_DBGU_Printk("OUTBYTE > END_OF_BUF!!\r\n"); + dbgu.next_outbyte -= sizeof(dbgu.buf); + 107978: 82433a01 subhi r3, r3, #4096 ; 0x1000 + 10797c: 87883000 strhi r3, [r8, r0] + } + + local_irq_restore(flags); + 107980: e121f00c msr CPSR_c, ip + 107984: e51230eb ldr r3, [r2, #-235] ; 0xffffff15 + +static void __rb_flush(void) +{ + char ch; + while (dbgu_rb_pull(&ch) >= 0) { + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 107988: e3130002 tst r3, #2 + 10798c: 0afffffc beq 107984 <__rb_flush+0x5c> +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 107990: e50640e3 str r4, [r6, #-227] ; 0xffffff1d +/* pull one char out of debug ring buffer */ +static int dbgu_rb_pull(char *ret) +{ + unsigned long flags; + + local_irq_save(flags); + 107994: e10fc000 mrs ip, CPSR + 107998: e38c3080 orr r3, ip, #128 ; 0x80 + 10799c: e121f003 msr CPSR_c, r3 + + if (dbgu.next_outbyte == dbgu.next_inbyte) { + 1079a0: e7913000 ldr r3, [r1, r0] + 1079a4: e7914005 ldr r4, [r1, r5] + 1079a8: e1530004 cmp r3, r4 + 1079ac: 1affffec bne 107964 <__rb_flush+0x3c> + local_irq_restore(flags); + 1079b0: e121f00c msr CPSR_c, ip + char ch; + while (dbgu_rb_pull(&ch) >= 0) { + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, ch); + } +} + 1079b4: e8bd01f0 pop {r4, r5, r6, r7, r8} + 1079b8: e12fff1e bx lr + 1079bc: 00200348 .word 0x00200348 + 1079c0: 00001004 .word 0x00001004 + +001079c4 : +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Ready(void) +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 1079c4: e3e02c0d mvn r2, #3328 ; 0xd00 + 1079c8: e51230eb ldr r3, [r2, #-235] ; 0xffffff15 + 1079cc: e3130c02 tst r3, #512 ; 0x200 + 1079d0: 0afffffc beq 1079c8 +} + 1079d4: e12fff1e bx lr + +001079d8 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 1079d8: e3e03c0b mvn r3, #2816 ; 0xb00 + 1079dc: e3a01b01 mov r1, #1024 ; 0x400 +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + 1079e0: e3a02c02 mov r2, #512 ; 0x200 +/* + * Disable the PIO assignments for the DBGU + */ +void AT91F_DBGU_Fini(void) +{ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXDIS | AT91C_US_TXDIS; + 1079e4: e3a0c0a0 mov ip, #160 ; 0xa0 + 1079e8: e3e00c0d mvn r0, #3328 ; 0xd00 + 1079ec: e500c0ff str ip, [r0, #-255] ; 0xffffff01 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 1079f0: e50310ff str r1, [r3, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + 1079f4: e50310ef str r1, [r3, #-239] ; 0xffffff11 +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + 1079f8: e50320eb str r2, [r3, #-235] ; 0xffffff15 + pPio->PIO_PER = inputEnable; + 1079fc: e50320ff str r2, [r3, #-255] ; 0xffffff01 + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PA10_DTXD); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PA9_DRXD); + // Maybe FIXME, do more? -- Henryk Plötz +} + 107a00: e12fff1e bx lr + +00107a04 : +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel (Very low level debugging) +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + 107a04: e5d01000 ldrb r1, [r0] + 107a08: e3510000 cmp r1, #0 + 107a0c: 012fff1e bxeq lr +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 107a10: e3e02c0d mvn r2, #3328 ; 0xd00 + 107a14: e51230eb ldr r3, [r2, #-235] ; 0xffffff15 + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 107a18: e3130002 tst r3, #2 + 107a1c: 0afffffc beq 107a14 +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 107a20: e50210e3 str r1, [r2, #-227] ; 0xffffff1d +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel (Very low level debugging) +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + 107a24: e5f01001 ldrb r1, [r0, #1]! + 107a28: e3510000 cmp r1, #0 + 107a2c: 1afffff8 bne 107a14 + 107a30: e12fff1e bx lr + +00107a34 <__dbgu_rb_append>: +{ + __rb_flush(); +} + +static void __dbgu_rb_append(char *data, int len) +{ + 107a34: e92d41f0 push {r4, r5, r6, r7, r8, lr} + char *pos = dbgu.next_inbyte; + 107a38: e59f404c ldr r4, [pc, #76] ; 107a8c <__dbgu_rb_append+0x58> + 107a3c: e3a05a01 mov r5, #4096 ; 0x1000 + 107a40: e7947005 ldr r7, [r4, r5] + + dbgu.next_inbyte += len; + if (dbgu.next_inbyte >= &dbgu.buf[0]+sizeof(dbgu.buf)) { + 107a44: e0842005 add r2, r4, r5 + +static void __dbgu_rb_append(char *data, int len) +{ + char *pos = dbgu.next_inbyte; + + dbgu.next_inbyte += len; + 107a48: e0873001 add r3, r7, r1 + if (dbgu.next_inbyte >= &dbgu.buf[0]+sizeof(dbgu.buf)) { + 107a4c: e1530002 cmp r3, r2 +{ + __rb_flush(); +} + +static void __dbgu_rb_append(char *data, int len) +{ + 107a50: e1a06001 mov r6, r1 + 107a54: e1a08000 mov r8, r0 + char *pos = dbgu.next_inbyte; + + dbgu.next_inbyte += len; + 107a58: e7843005 str r3, [r4, r5] + if (dbgu.next_inbyte >= &dbgu.buf[0]+sizeof(dbgu.buf)) { + 107a5c: 3a000004 bcc 107a74 <__dbgu_rb_append+0x40> + AT91F_DBGU_Printk("WRAP DURING APPEND\r\n"); + 107a60: e59f0028 ldr r0, [pc, #40] ; 107a90 <__dbgu_rb_append+0x5c> + 107a64: ebffffe6 bl 107a04 + dbgu.next_inbyte -= sizeof(dbgu.buf); + 107a68: e7941005 ldr r1, [r4, r5] + 107a6c: e2410a01 sub r0, r1, #4096 ; 0x1000 + 107a70: e7840005 str r0, [r4, r5] + } + + memcpy(pos, data, len); + 107a74: e1a00007 mov r0, r7 + 107a78: e1a01008 mov r1, r8 + 107a7c: e1a02006 mov r2, r6 + 107a80: eb0009a1 bl 10a10c +} + 107a84: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + 107a88: e12fff1e bx lr + 107a8c: 00200348 .word 0x00200348 + 107a90: 0010a954 .word 0x0010a954 + +00107a94 : +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Frame +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Frame(char *buffer) +{ + 107a94: e52de004 push {lr} ; (str lr, [sp, #-4]!) + unsigned char len; + + for (len = 0; buffer[len] != '\0'; len++) { + 107a98: e5d02000 ldrb r2, [r0] + 107a9c: e3520000 cmp r2, #0 +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Frame +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Frame(char *buffer) +{ + 107aa0: e24dd00c sub sp, sp, #12 + 107aa4: e1a01000 mov r1, r0 + unsigned char len; + + for (len = 0; buffer[len] != '\0'; len++) { + 107aa8: 0a000006 beq 107ac8 + 107aac: e3a03000 mov r3, #0 + 107ab0: e2833001 add r3, r3, #1 + 107ab4: e20330ff and r3, r3, #255 ; 0xff + 107ab8: e7d12003 ldrb r2, [r1, r3] + 107abc: e3520000 cmp r2, #0 + 107ac0: e1a02003 mov r2, r3 + 107ac4: 1afffff9 bne 107ab0 + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_SendFrame( + 107ac8: e3a0c000 mov ip, #0 + 107acc: e1a0300c mov r3, ip + 107ad0: e59f0010 ldr r0, [pc, #16] ; 107ae8 + 107ad4: e58dc000 str ip, [sp] + 107ad8: ebfff317 bl 10473c + } + + AT91F_US_SendFrame((AT91PS_USART) AT91C_BASE_DBGU, + (unsigned char *)buffer, len, 0, 0); + +} + 107adc: e28dd00c add sp, sp, #12 + 107ae0: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 107ae4: e12fff1e bx lr + 107ae8: fffff300 .word 0xfffff300 + +00107aec : +//* \brief Return 1 if a character can be read in US_RHR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_RxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_RXRDY); + 107aec: e3e01c0d mvn r1, #3328 ; 0xd00 + 107af0: e51120eb ldr r2, [r1, #-235] ; 0xffffff15 +//* Function Name : DBGU_irq_handler +//* Object : C handler interrupt function called by the sysirq +//* demultiplexer +//*---------------------------------------------------------------------------- +static void DBGU_irq_handler(u_int32_t sr) +{ + 107af4: e92d4010 push {r4, lr} +//* \fn AT91F_US_Get +//* \brief Get a Char to USART +//*---------------------------------------------------------------------------- +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 107af8: e3120001 tst r2, #1 + 107afc: 059f10ec ldreq r1, [pc, #236] ; 107bf0 +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_US_GetChar ( + const AT91PS_USART pUSART) +{ + return((pUSART->US_RHR) & 0x1FF); + 107b00: 151100e7 ldrne r0, [r1, #-231] ; 0xffffff19 + 107b04: 05510ff0 ldrbeq r0, [r1, #-4080] ; 0xfffff010 + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 107b08: 120000ff andne r0, r0, #255 ; 0xff + 107b0c: 159f10dc ldrne r1, [pc, #220] ; 107bf0 +static void DBGU_irq_handler(u_int32_t sr) +{ + static char value; + + AT91F_DBGU_Get(&value); + switch (value) { + 107b10: e2403030 sub r3, r0, #48 ; 0x30 +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 107b14: 15410ff0 strbne r0, [r1, #-4080] ; 0xfffff010 +static void DBGU_irq_handler(u_int32_t sr) +{ + static char value; + + AT91F_DBGU_Get(&value); + switch (value) { + 107b18: e3530009 cmp r3, #9 + 107b1c: 979ff103 ldrls pc, [pc, r3, lsl #2] + 107b20: ea000010 b 107b68 + 107b24: 00107b80 .word 0x00107b80 + 107b28: 00107b90 .word 0x00107b90 + 107b2c: 00107bc8 .word 0x00107bc8 + 107b30: 00107bdc .word 0x00107bdc + 107b34: 00107b68 .word 0x00107b68 + 107b38: 00107b68 .word 0x00107b68 + 107b3c: 00107b68 .word 0x00107b68 + 107b40: 00107b68 .word 0x00107b68 + 107b44: 00107b68 .word 0x00107b68 + 107b48: 00107b4c .word 0x00107b4c + case '3': + AT91F_DBGU_Printk("Toggling LED 2\n\r"); + led_toggle(2); + break; + case '9': + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 107b4c: e59f00a0 ldr r0, [pc, #160] ; 107bf4 + 107b50: ebffffab bl 107a04 +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSoftReset( + AT91PS_RSTC pRSTC, + unsigned int reset) +{ + pRSTC->RSTC_RCR = (0xA5000000 | reset); + 107b54: e59f109c ldr r1, [pc, #156] ; 107bf8 + 107b58: e3e02c02 mvn r2, #512 ; 0x200 + 107b5c: e50210ff str r1, [r2, #-255] ; 0xffffff01 + default: + if (_main_dbgu(value) < 0) + AT91F_DBGU_Printk("\n\r"); + break; + } // end switch +} + 107b60: e8bd4010 pop {r4, lr} + 107b64: e12fff1e bx lr + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + if (_main_dbgu(value) < 0) + 107b68: eb0008f1 bl 109f34 <_main_dbgu> + 107b6c: e3500000 cmp r0, #0 + 107b70: aafffffa bge 107b60 + AT91F_DBGU_Printk("\n\r"); + 107b74: e59f0080 ldr r0, [pc, #128] ; 107bfc + break; + } // end switch +} + 107b78: e8bd4010 pop {r4, lr} + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + if (_main_dbgu(value) < 0) + AT91F_DBGU_Printk("\n\r"); + 107b7c: eaffffa0 b 107a04 + static char value; + + AT91F_DBGU_Get(&value); + switch (value) { + case '0': //* info + AT91F_DBGU_Frame("Clear Pull up\n\r"); + 107b80: e59f0078 ldr r0, [pc, #120] ; 107c00 + 107b84: ebffffc2 bl 107a94 + // Set + udp_pullup_on(); + 107b88: ebfffe7a bl 107578 + break; + 107b8c: eafffff3 b 107b60 + case '1': //* info + udp_pullup_off(); + 107b90: ebfffe7e bl 107590 + AT91F_DBGU_Printk("Set Pull up\n\r"); + 107b94: e59f0068 ldr r0, [pc, #104] ; 107c04 + 107b98: ebffff99 bl 107a04 +{ + void (*pfct) (void) = (void (*)(void))0x00000000; + + // Acknoledge the interrupt + // Mark the End of Interrupt on the AIC + AT91C_BASE_AIC->AIC_EOICR = 0; + 107b9c: e3a00000 mov r0, #0 + 107ba0: e3e0cc0f mvn ip, #3840 ; 0xf00 + 107ba4: e58c0031 str r0, [ip, #49] ; 0x31 +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Ready(void) +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 107ba8: e3e02c0d mvn r2, #3328 ; 0xd00 + 107bac: e512e0eb ldr lr, [r2, #-235] ; 0xffffff15 + 107bb0: e31e0c02 tst lr, #512 ; 0x200 + 107bb4: 0afffffc beq 107bac + // Acknoledge the interrupt + // Mark the End of Interrupt on the AIC + AT91C_BASE_AIC->AIC_EOICR = 0; + AT91F_DBGU_Ready(); + // Jump in reset + pfct(); + 107bb8: e3a03000 mov r3, #0 + 107bbc: e1a0e00f mov lr, pc + 107bc0: e12fff13 bx r3 + case '1': //* info + udp_pullup_off(); + AT91F_DBGU_Printk("Set Pull up\n\r"); + // Reset Application + Send_reset(); + break; + 107bc4: eaffffe5 b 107b60 + case '2': + AT91F_DBGU_Printk("Toggling LED 1\n\r"); + 107bc8: e59f0038 ldr r0, [pc, #56] ; 107c08 + 107bcc: ebffff8c bl 107a04 + led_toggle(1); + 107bd0: e3a00001 mov r0, #1 + 107bd4: eb0000c2 bl 107ee4 + break; + 107bd8: eaffffe0 b 107b60 + case '3': + AT91F_DBGU_Printk("Toggling LED 2\n\r"); + 107bdc: e59f0028 ldr r0, [pc, #40] ; 107c0c + 107be0: ebffff87 bl 107a04 + led_toggle(2); + 107be4: e3a00002 mov r0, #2 + 107be8: eb0000bd bl 107ee4 + break; + 107bec: eaffffdb b 107b60 + 107bf0: 00202340 .word 0x00202340 + 107bf4: 0010a9b4 .word 0x0010a9b4 + 107bf8: a500000d .word 0xa500000d + 107bfc: 0010aa80 .word 0x0010aa80 + 107c00: 0010a96c .word 0x0010a96c + 107c04: 0010a97c .word 0x0010a97c + 107c08: 0010a98c .word 0x0010a98c + 107c0c: 0010a9a0 .word 0x0010a9a0 + +00107c10 : +//* \brief Return 1 if a character can be read in US_RHR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_RxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_RXRDY); + 107c10: e3e02c0d mvn r2, #3328 ; 0xd00 + 107c14: e51210eb ldr r1, [r2, #-235] ; 0xffffff15 +//* \fn AT91F_US_Get +//* \brief Get a Char to USART +//*---------------------------------------------------------------------------- +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 107c18: e2113001 ands r3, r1, #1 +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_US_GetChar ( + const AT91PS_USART pUSART) +{ + return((pUSART->US_RHR) & 0x1FF); + 107c1c: 151220e7 ldrne r2, [r2, #-231] ; 0xffffff19 + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + return (-1); + 107c20: 13e03000 mvnne r3, #0 +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 107c24: 15c02000 strbne r2, [r0] + return (-1); + } +} + 107c28: e1a00003 mov r0, r3 + 107c2c: e12fff1e bx lr + +00107c30 : +{ + static char string[256]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + 107c30: e59f3080 ldr r3, [pc, #128] ; 107cb8 + 107c34: e3a02000 mov r2, #0 + left = sizeof(string); + for (i = 0; len--; i += 3) { + 107c38: e3510000 cmp r1, #0 +#include +#include +#include +const char * +hexdump(const void *data, unsigned int len) +{ + 107c3c: e92d41f0 push {r4, r5, r6, r7, r8, lr} + static char string[256]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + 107c40: e5432fec strb r2, [r3, #-4076] ; 0xfffff014 + left = sizeof(string); + for (i = 0; len--; i += 3) { + 107c44: 0a000018 beq 107cac + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + 107c48: e2436efe sub r6, r3, #4064 ; 0xfe0 +#include +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[256]; + unsigned char *d = (unsigned char *) data; + 107c4c: e1a04000 mov r4, r0 + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + 107c50: e246600c sub r6, r6, #12 +#ifdef DEBUG +#include +#include +#include +const char * +hexdump(const void *data, unsigned int len) + 107c54: e0807001 add r7, r0, r1 + 107c58: e2808054 add r8, r0, #84 ; 0x54 + 107c5c: ea000007 b 107c80 + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + 107c60: e5d43001 ldrb r3, [r4, #1] + 107c64: e2854001 add r4, r5, #1 + 107c68: ebfff7d8 bl 105bd0 + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + 107c6c: e1540007 cmp r4, r7 + 107c70: 0a00000d beq 107cac + if (i >= sizeof(string) -4) + 107c74: e1540008 cmp r4, r8 +#ifdef DEBUG +#include +#include +#include +const char * +hexdump(const void *data, unsigned int len) + 107c78: e2866006 add r6, r6, #6 + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + 107c7c: 0a00000a beq 107cac + break; + snprintf(string+i, 4, " %02x", *d++); + 107c80: e1a05004 mov r5, r4 + 107c84: e4d53001 ldrb r3, [r5], #1 + 107c88: e3a01004 mov r1, #4 + 107c8c: e59f2028 ldr r2, [pc, #40] ; 107cbc + 107c90: e1a00006 mov r0, r6 + 107c94: ebfff7cd bl 105bd0 + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + 107c98: e1550007 cmp r5, r7 + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + 107c9c: e2860003 add r0, r6, #3 + 107ca0: e3a01004 mov r1, #4 + 107ca4: e59f2010 ldr r2, [pc, #16] ; 107cbc + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + 107ca8: 1affffec bne 107c60 + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + 107cac: e59f000c ldr r0, [pc, #12] ; 107cc0 + 107cb0: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + 107cb4: e12fff1e bx lr + 107cb8: 00202340 .word 0x00202340 + 107cbc: 0010a9c8 .word 0x0010a9c8 + 107cc0: 00201354 .word 0x00201354 + +00107cc4 : + char *next_outbyte; +}; +static struct dbgu dbgu; + +void dbgu_rb_init(void) +{ + 107cc4: e92d4038 push {r3, r4, r5, lr} + memset(dbgu.buf, 0, sizeof(dbgu.buf)); + 107cc8: e59f4024 ldr r4, [pc, #36] ; 107cf4 + 107ccc: e3a05a01 mov r5, #4096 ; 0x1000 + 107cd0: e1a00004 mov r0, r4 + 107cd4: e3a01000 mov r1, #0 + 107cd8: e1a02005 mov r2, r5 + 107cdc: eb00097a bl 10a2cc + dbgu.next_inbyte = &dbgu.buf[0]; + dbgu.next_outbyte = &dbgu.buf[0]; + 107ce0: e59f3010 ldr r3, [pc, #16] ; 107cf8 +static struct dbgu dbgu; + +void dbgu_rb_init(void) +{ + memset(dbgu.buf, 0, sizeof(dbgu.buf)); + dbgu.next_inbyte = &dbgu.buf[0]; + 107ce4: e7844005 str r4, [r4, r5] + dbgu.next_outbyte = &dbgu.buf[0]; + 107ce8: e7844003 str r4, [r4, r3] +} + 107cec: e8bd4038 pop {r3, r4, r5, lr} + 107cf0: e12fff1e bx lr + 107cf4: 00200348 .word 0x00200348 + 107cf8: 00001004 .word 0x00001004 + +00107cfc : +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Init +//* \brief This function is used to send a string through the DBGU channel (Very low level debugging) +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Init(void) +{ + 107cfc: e92d4030 push {r4, r5, lr} + 107d00: e24dd00c sub sp, sp, #12 + dbgu_rb_init(); + 107d04: ebffffee bl 107cc4 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 107d08: e3a05c06 mov r5, #1536 ; 0x600 + pPio->PIO_BSR = periphBEnable; + 107d0c: e3a0e000 mov lr, #0 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 107d10: e3e0cc0b mvn ip, #2816 ; 0xb00 + 107d14: e50c508f str r5, [ip, #-143] ; 0xffffff71 + + //* Open PIO for DBGU + AT91F_DBGU_CfgPIO(); + //* Enable Transmitter & receivier + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 107d18: e3e04c0d mvn r4, #3328 ; 0xd00 + pPio->PIO_BSR = periphBEnable; + 107d1c: e50ce08b str lr, [ip, #-139] ; 0xffffff75 + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 107d20: e50c50fb str r5, [ip, #-251] ; 0xffffff05 + 107d24: e3a0c00c mov ip, #12 + 107d28: e504c0ff str ip, [r4, #-255] ; 0xffffff01 + AT91C_US_RSTTX | AT91C_US_RSTRX; + + //* Configure DBGU + AT91F_US_Configure((AT91PS_USART) AT91C_BASE_DBGU, // DBGU base address + 107d2c: e3a02d23 mov r2, #2240 ; 0x8c0 + 107d30: e59f3050 ldr r3, [pc, #80] ; 107d88 + 107d34: e59f0050 ldr r0, [pc, #80] ; 107d8c + 107d38: e59f1050 ldr r1, [pc, #80] ; 107d90 + 107d3c: e58de000 str lr, [sp] + 107d40: ebfff34f bl 104a84 +static inline void AT91F_US_EnableIt ( + AT91PS_USART pUSART, // \arg pointer to a USART controller + unsigned int flag) // \arg IT to be enabled +{ + //* Write to the IER register + pUSART->US_IER = flag; + 107d44: e3a03001 mov r3, #1 + MCK, AT91C_US_ASYNC_MODE, // Mode Register to be programmed + AT91C_DBGU_BAUD, // Baudrate to be programmed + 0); // Timeguard to be programmed + + //* Enable Transmitter & receivier + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + 107d48: e3a02050 mov r2, #80 ; 0x50 + + //* Enable USART IT error and AT91C_US_ENDRX + AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + + //* open interrupt + sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 107d4c: e1a00003 mov r0, r3 + MCK, AT91C_US_ASYNC_MODE, // Mode Register to be programmed + AT91C_DBGU_BAUD, // Baudrate to be programmed + 0); // Timeguard to be programmed + + //* Enable Transmitter & receivier + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + 107d50: e50420ff str r2, [r4, #-255] ; 0xffffff01 + + //* Enable USART IT error and AT91C_US_ENDRX + AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + + //* open interrupt + sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 107d54: e59f1038 ldr r1, [pc, #56] ; 107d94 + 107d58: e50430f7 str r3, [r4, #-247] ; 0xffffff09 + 107d5c: eb000567 bl 109300 + + AT91F_DBGU_Printk("\n\r"); + 107d60: e59f0030 ldr r0, [pc, #48] ; 107d98 + 107d64: ebffff26 bl 107a04 + AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + 107d68: e59f002c ldr r0, [pc, #44] ; 107d9c + 107d6c: ebffff24 bl 107a04 + "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + AT91F_DBGU_Printk("Version " COMPILE_SVNREV + 107d70: e59f0028 ldr r0, [pc, #40] ; 107da0 + 107d74: ebffff22 bl 107a04 + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + 107d78: e59f0024 ldr r0, [pc, #36] ; 107da4 + "0) Set Pull-up 1) Clear Pull-up 2) Toggle LED1 3) " + "Toggle LED2\r\n9) Reset\n\r"); +} + 107d7c: e28dd00c add sp, sp, #12 + 107d80: e8bd4030 pop {r4, r5, lr} + AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + AT91F_DBGU_Printk("Version " COMPILE_SVNREV + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + 107d84: eaffff1e b 107a04 + 107d88: 0001c200 .word 0x0001c200 + 107d8c: fffff200 .word 0xfffff200 + 107d90: 02db4000 .word 0x02db4000 + 107d94: 00107aec .word 0x00107aec + 107d98: 0010aa80 .word 0x0010aa80 + 107d9c: 0010a9d0 .word 0x0010a9d0 + 107da0: 0010aa40 .word 0x0010aa40 + 107da4: 0010aa84 .word 0x0010aa84 + +00107da8 : +} + +/* flush pending data from debug ring buffer to serial port */ +void dbgu_rb_flush(void) +{ + __rb_flush(); + 107da8: eafffede b 107928 <__rb_flush> + +00107dac : + + memcpy(pos, data, len); +} + +void dbgu_rb_append(char *data, int len) +{ + 107dac: e92d40f8 push {r3, r4, r5, r6, r7, lr} + 107db0: e1a06000 mov r6, r0 + 107db4: e1a04001 mov r4, r1 + unsigned long flags; + int bytes_left; + char *data_cur; + + local_irq_save(flags); + 107db8: e10f7000 mrs r7, CPSR + 107dbc: e3873080 orr r3, r7, #128 ; 0x80 + 107dc0: e121f003 msr CPSR_c, r3 + + bytes_left = &dbgu.buf[0]+sizeof(dbgu.buf)-dbgu.next_inbyte; + 107dc4: e59f3048 ldr r3, [pc, #72] ; 107e14 + 107dc8: e3a0ca01 mov ip, #4096 ; 0x1000 + 107dcc: e793200c ldr r2, [r3, ip] + 107dd0: e2835a01 add r5, r3, #4096 ; 0x1000 + 107dd4: e0625005 rsb r5, r2, r5 + data_cur = data; + + if (len > bytes_left) { + 107dd8: e1550001 cmp r5, r1 + 107ddc: aa000007 bge 107e00 + AT91F_DBGU_Printk("LEN > BYTES_LEFT\r\n"); + 107de0: e59f0030 ldr r0, [pc, #48] ; 107e18 + 107de4: ebffff06 bl 107a04 + __rb_flush(); + 107de8: ebfffece bl 107928 <__rb_flush> + __dbgu_rb_append(data_cur, bytes_left); + 107dec: e1a00006 mov r0, r6 + 107df0: e1a01005 mov r1, r5 + 107df4: ebffff0e bl 107a34 <__dbgu_rb_append> + len -= bytes_left; + 107df8: e0654004 rsb r4, r5, r4 + data_cur += bytes_left; + 107dfc: e0860005 add r0, r6, r5 + } + __dbgu_rb_append(data_cur, len); + 107e00: e1a01004 mov r1, r4 + 107e04: ebffff0a bl 107a34 <__dbgu_rb_append> + + local_irq_restore(flags); + 107e08: e121f007 msr CPSR_c, r7 +} + 107e0c: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} + 107e10: e12fff1e bx lr + 107e14: 00200348 .word 0x00200348 + 107e18: 0010aae4 .word 0x0010aae4 + +00107e1c : + +static char dbg_buf[256]; +void debugp(const char *format, ...) +{ + 107e1c: e92d000f push {r0, r1, r2, r3} + 107e20: e92d4030 push {r4, r5, lr} + va_list ap; + + va_start(ap, format); + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + 107e24: e59f5050 ldr r5, [pc, #80] ; 107e7c + local_irq_restore(flags); +} + +static char dbg_buf[256]; +void debugp(const char *format, ...) +{ + 107e28: e24dd00c sub sp, sp, #12 + va_list ap; + + va_start(ap, format); + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + 107e2c: e2454eee sub r4, r5, #3808 ; 0xee0 +static char dbg_buf[256]; +void debugp(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + 107e30: e28dc01c add ip, sp, #28 + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + 107e34: e244400c sub r4, r4, #12 + 107e38: e1a0300c mov r3, ip + 107e3c: e3a010ff mov r1, #255 ; 0xff + 107e40: e59d2018 ldr r2, [sp, #24] + 107e44: e1a00004 mov r0, r4 +static char dbg_buf[256]; +void debugp(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + 107e48: e58dc004 str ip, [sp, #4] + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + 107e4c: ebfff53f bl 105350 + va_end(ap); + + dbg_buf[sizeof(dbg_buf)-1] = '\0'; + 107e50: e3a03000 mov r3, #0 + //AT91F_DBGU_Frame(dbg_buf); +#ifdef DEBUG_UNBUFFERED + AT91F_DBGU_Printk(dbg_buf); +#else + dbgu_rb_append(dbg_buf, strlen(dbg_buf)); + 107e54: e1a00004 mov r0, r4 + + va_start(ap, format); + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + va_end(ap); + + dbg_buf[sizeof(dbg_buf)-1] = '\0'; + 107e58: e5453ded strb r3, [r5, #-3565] ; 0xfffff213 + //AT91F_DBGU_Frame(dbg_buf); +#ifdef DEBUG_UNBUFFERED + AT91F_DBGU_Printk(dbg_buf); +#else + dbgu_rb_append(dbg_buf, strlen(dbg_buf)); + 107e5c: eb00095a bl 10a3cc + 107e60: e1a01000 mov r1, r0 + 107e64: e1a00004 mov r0, r4 + 107e68: ebffffcf bl 107dac +#endif +} + 107e6c: e28dd00c add sp, sp, #12 + 107e70: e8bd4030 pop {r4, r5, lr} + 107e74: e28dd010 add sp, sp, #16 + 107e78: e12fff1e bx lr + 107e7c: 00202340 .word 0x00202340 + +00107e80 : + +void led_switch(int led, int on) +{ + int port; + + if (led < 1 || led > 2) + 107e80: e2403001 sub r3, r0, #1 + 107e84: e3530001 cmp r3, #1 + 107e88: 812fff1e bxhi lr + return; + + port = ledport[led]; + if (on) + 107e8c: e3510000 cmp r1, #0 + int port; + + if (led < 1 || led > 2) + return; + + port = ledport[led]; + 107e90: e59f1010 ldr r1, [pc, #16] ; 107ea8 + 107e94: e7910100 ldr r0, [r1, r0, lsl #2] +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107e98: e3e02c0b mvn r2, #2816 ; 0xb00 + 107e9c: 150200cb strne r0, [r2, #-203] ; 0xffffff35 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107ea0: 050200cf streq r0, [r2, #-207] ; 0xffffff31 + 107ea4: e12fff1e bx lr + 107ea8: 0010aaf8 .word 0x0010aaf8 + +00107eac : + +int led_get(int led) +{ + int port; + + if (led < 1 || led > 2) + 107eac: e2403001 sub r3, r0, #1 + 107eb0: e3530001 cmp r3, #1 + 107eb4: 9a000001 bls 107ec0 + return -1; + 107eb8: e3e00000 mvn r0, #0 + + port = ledport[led]; + + return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); +} + 107ebc: e12fff1e bx lr + if (led < 1 || led > 2) + return -1; + + port = ledport[led]; + + return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 107ec0: e59f1018 ldr r1, [pc, #24] ; 107ee0 +//* \brief Return PIO Output Data Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_ODSR; + 107ec4: e3e0cc0b mvn ip, #2816 ; 0xb00 + 107ec8: e7910100 ldr r0, [r1, r0, lsl #2] + 107ecc: e51c20c7 ldr r2, [ip, #-199] ; 0xffffff39 + 107ed0: e1120000 tst r2, r0 + 107ed4: 13a00000 movne r0, #0 + 107ed8: 03a00001 moveq r0, #1 + 107edc: e12fff1e bx lr + 107ee0: 0010aaf8 .word 0x0010aaf8 + +00107ee4 : + +int led_get(int led) +{ + int port; + + if (led < 1 || led > 2) + 107ee4: e2403001 sub r3, r0, #1 + 107ee8: e3530001 cmp r3, #1 + 107eec: 9a000001 bls 107ef8 + 107ef0: e3e00000 mvn r0, #0 + led_switch(led, 0); + else + led_switch(led, 1); + + return !on; +} + 107ef4: e12fff1e bx lr + if (led < 1 || led > 2) + return -1; + + port = ledport[led]; + + return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 107ef8: e59f3024 ldr r3, [pc, #36] ; 107f24 + 107efc: e3e0cc0b mvn ip, #2816 ; 0xb00 + 107f00: e7932100 ldr r2, [r3, r0, lsl #2] + 107f04: e51c10c7 ldr r1, [ip, #-199] ; 0xffffff39 + 107f08: e1120001 tst r2, r1 +{ + int on = led_get(led); + if (on < 0) + return on; + + if (on) + 107f0c: 13a00000 movne r0, #0 + 107f10: 03a00001 moveq r0, #1 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107f14: 050c20cf streq r2, [ip, #-207] ; 0xffffff31 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 107f18: 150c20cb strne r2, [ip, #-203] ; 0xffffff35 + led_switch(led, 0); + else + led_switch(led, 1); + + return !on; + 107f1c: e2200001 eor r0, r0, #1 + 107f20: e12fff1e bx lr + 107f24: 0010aaf8 .word 0x0010aaf8 + +00107f28 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 107f28: e3e03c0b mvn r3, #2816 ; 0xb00 + 107f2c: e3a01402 mov r1, #33554432 ; 0x2000000 + 107f30: e3a02301 mov r2, #67108864 ; 0x4000000 + 107f34: e50310ff str r1, [r3, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + 107f38: e50310ef str r1, [r3, #-239] ; 0xffffff11 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 107f3c: e50320ff str r2, [r3, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + 107f40: e50320ef str r2, [r3, #-239] ; 0xffffff11 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 107f44: e50310cf str r1, [r3, #-207] ; 0xffffff31 + 107f48: e50320cf str r2, [r3, #-207] ; 0xffffff31 +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + led_switch(1, 0); + led_switch(2, 0); +} + 107f4c: e12fff1e bx lr + +00107f50 : + return NULL; +} + +u_int8_t req_ctx_num(struct req_ctx *ctx) +{ + return ((char *)ctx - (char *)&req_ctx[0])/sizeof(*ctx); + 107f50: e59f3014 ldr r3, [pc, #20] ; 107f6c + 107f54: e59f2014 ldr r2, [pc, #20] ; 107f70 + 107f58: e0631000 rsb r1, r3, r0 + 107f5c: e0813192 umull r3, r1, r2, r1 + + return NULL; +} + +u_int8_t req_ctx_num(struct req_ctx *ctx) +{ + 107f60: e1a001a1 lsr r0, r1, #3 + return ((char *)ctx - (char *)&req_ctx[0])/sizeof(*ctx); +} + 107f64: e20000ff and r0, r0, #255 ; 0xff + 107f68: e12fff1e bx lr + 107f6c: 00201554 .word 0x00201554 + 107f70: aaaaaaab .word 0xaaaaaaab + +00107f74 : +void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state) +{ + unsigned long flags; + + /* FIXME: do we need this kind of locking, we're UP! */ + local_irq_save(flags); + 107f74: e10f3000 mrs r3, CPSR + 107f78: e3832080 orr r2, r3, #128 ; 0x80 + 107f7c: e121f002 msr CPSR_c, r2 + ctx->state = new_state; + 107f80: e5801000 str r1, [r0] + local_irq_restore(flags); + 107f84: e121f003 msr CPSR_c, r3 +} + 107f88: e12fff1e bx lr + +00107f8c : +void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state) +{ + unsigned long flags; + + /* FIXME: do we need this kind of locking, we're UP! */ + local_irq_save(flags); + 107f8c: e10f3000 mrs r3, CPSR + 107f90: e3832080 orr r2, r3, #128 ; 0x80 + 107f94: e121f002 msr CPSR_c, r2 + ctx->state = new_state; + 107f98: e3a020fe mov r2, #254 ; 0xfe + 107f9c: e5802000 str r2, [r0] + local_irq_restore(flags); + 107fa0: e121f003 msr CPSR_c, r3 +} + +void req_ctx_put(struct req_ctx *ctx) +{ + req_ctx_set_state(ctx, RCTX_STATE_FREE); +} + 107fa4: e12fff1e bx lr + +00107fa8 : +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fa8: e59f30c4 ldr r3, [pc, #196] ; 108074 + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 107fac: e283ce29 add ip, r3, #656 ; 0x290 +{ + req_ctx_set_state(ctx, RCTX_STATE_FREE); +} + +void req_ctx_init(void) +{ + 107fb0: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp} + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + 107fb4: e3a01040 mov r1, #64 ; 0x40 + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + 107fb8: e3a020fe mov r2, #254 ; 0xfe + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 107fbc: e28c4a01 add r4, ip, #4096 ; 0x1000 + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + 107fc0: e5832000 str r2, [r3] + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 107fc4: e3a00b02 mov r0, #2048 ; 0x800 + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + 107fc8: e583200c str r2, [r3, #12] +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fcc: e2839090 add r9, r3, #144 ; 0x90 + req_ctx[i].state = RCTX_STATE_FREE; + 107fd0: e5832018 str r2, [r3, #24] +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fd4: e283a0d0 add sl, r3, #208 ; 0xd0 + req_ctx[i].state = RCTX_STATE_FREE; + 107fd8: e5832024 str r2, [r3, #36] ; 0x24 +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fdc: e2838e11 add r8, r3, #272 ; 0x110 + req_ctx[i].state = RCTX_STATE_FREE; + 107fe0: e5832030 str r2, [r3, #48] ; 0x30 +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fe4: e2837e15 add r7, r3, #336 ; 0x150 + req_ctx[i].state = RCTX_STATE_FREE; + 107fe8: e583203c str r2, [r3, #60] ; 0x3c +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107fec: e2836e19 add r6, r3, #400 ; 0x190 + req_ctx[i].state = RCTX_STATE_FREE; + 107ff0: e5832048 str r2, [r3, #72] ; 0x48 +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 107ff4: e2835e1d add r5, r3, #464 ; 0x1d0 + 107ff8: e283be21 add fp, r3, #528 ; 0x210 + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 107ffc: e5834080 str r4, [r3, #128] ; 0x80 +void req_ctx_init(void) +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + 108000: e1c310b4 strh r1, [r3, #4] + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 108004: e28c4b06 add r4, ip, #6144 ; 0x1800 +void req_ctx_init(void) +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + 108008: e1c311b0 strh r1, [r3, #16] + 10800c: e1c311bc strh r1, [r3, #28] + 108010: e1c312b8 strh r1, [r3, #40] ; 0x28 + 108014: e1c313b4 strh r1, [r3, #52] ; 0x34 + 108018: e1c314b0 strh r1, [r3, #64] ; 0x40 + 10801c: e1c314bc strh r1, [r3, #76] ; 0x4c + 108020: e1c315b8 strh r1, [r3, #88] ; 0x58 + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + 108024: e5832054 str r2, [r3, #84] ; 0x54 +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 108028: e2831e25 add r1, r3, #592 ; 0x250 + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 10802c: e2832ea9 add r2, r3, #2704 ; 0xa90 +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + 108030: e5839008 str r9, [r3, #8] + 108034: e583a014 str sl, [r3, #20] + 108038: e5838020 str r8, [r3, #32] + 10803c: e583702c str r7, [r3, #44] ; 0x2c + 108040: e5836038 str r6, [r3, #56] ; 0x38 + 108044: e5835044 str r5, [r3, #68] ; 0x44 + 108048: e583b050 str fp, [r3, #80] ; 0x50 + 10804c: e583105c str r1, [r3, #92] ; 0x5c + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 108050: e1c306b4 strh r0, [r3, #100] ; 0x64 + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 108054: e583c068 str ip, [r3, #104] ; 0x68 + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 108058: e1c307b0 strh r0, [r3, #112] ; 0x70 + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 10805c: e5832074 str r2, [r3, #116] ; 0x74 + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 108060: e1c307bc strh r0, [r3, #124] ; 0x7c + 108064: e1c308b8 strh r0, [r3, #136] ; 0x88 + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 108068: e583408c str r4, [r3, #140] ; 0x8c + } +} + 10806c: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp} + 108070: e12fff1e bx lr + 108074: 00201554 .word 0x00201554 + +00108078 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 108078: e3e03c0b mvn r3, #2816 ; 0xb00 + 10807c: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 108080: e50320ff str r2, [r3, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + 108084: e50320ef str r2, [r3, #-239] ; 0xffffff11 +#include "../openpcd.h" + +void trigger_init(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); +} + 108088: e12fff1e bx lr + +0010808c : + +void trigger_pulse(void) +{ + 10808c: e24dd008 sub sp, sp, #8 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 108090: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 108094: e3e01c0b mvn r1, #2816 ; 0xb00 + volatile int i; + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + for (i=0; i < 0xff; i++) + 108098: e3a00000 mov r0, #0 + 10809c: e50120cf str r2, [r1, #-207] ; 0xffffff31 + 1080a0: e58d0004 str r0, [sp, #4] + 1080a4: e59d3004 ldr r3, [sp, #4] + 1080a8: e35300fe cmp r3, #254 ; 0xfe + 1080ac: ca000005 bgt 1080c8 + 1080b0: e59d0004 ldr r0, [sp, #4] + 1080b4: e2803001 add r3, r0, #1 + 1080b8: e58d3004 str r3, [sp, #4] + 1080bc: e59dc004 ldr ip, [sp, #4] + 1080c0: e35c00fe cmp ip, #254 ; 0xfe + 1080c4: dafffff9 ble 1080b0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 1080c8: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 1080cc: e3e01c0b mvn r1, #2816 ; 0xb00 + 1080d0: e50120cb str r2, [r1, #-203] ; 0xffffff35 + { } + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); +} + 1080d4: e28dd008 add sp, sp, #8 + 1080d8: e12fff1e bx lr + +001080dc
: + .date = COMPILE_DATE, + .by = COMPILE_BY, +}; + +int main(void) +{ + 1080dc: e92d4008 push {r3, lr} + /* initialize LED and debug unit */ + led_init(); + 1080e0: ebffff90 bl 107f28 + sysirq_init(); + 1080e4: eb00048a bl 109314 + AT91F_DBGU_Init(); + 1080e8: ebffff03 bl 107cfc +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 1080ec: e3e01c03 mvn r1, #768 ; 0x300 + 1080f0: e3a00004 mov r0, #4 + 1080f4: e50100ef str r0, [r1, #-239] ; 0xffffff11 + + AT91F_PIOA_CfgPMC(); + wdt_init(); + 1080f8: eb00035c bl 108e70 + pit_init(); + 1080fc: eb0001b8 bl 1087e4 + blinkcode_init(); + 108100: eb0003de bl 109080 + + /* initialize USB */ + req_ctx_init(); + 108104: ebffffa7 bl 107fa8 + usbcmd_gen_init(); + 108108: eb00033c bl 108e00 + udp_open(); + 10810c: ebfffd25 bl 1075a8 + + /* call application specific init function */ + _init_func(); + 108110: eb000783 bl 109f24 <_init_func> + + // Enable User Reset and set its minimal assertion to 960 us + AT91C_BASE_RSTC->RSTC_RMR = + 108114: e59f2030 ldr r2, [pc, #48] ; 10814c + 108118: e3e03c02 mvn r3, #512 ; 0x200 + AT91F_PMC_EnablePCK(AT91C_BASE_PMC, 0, AT91C_PMC_CSS_PLL_CLK); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA6_PCK0); +#endif + + /* switch on first led */ + led_switch(2, 1); + 10811c: e3a00002 mov r0, #2 + 108120: e3a01001 mov r1, #1 + + /* call application specific init function */ + _init_func(); + + // Enable User Reset and set its minimal assertion to 960 us + AT91C_BASE_RSTC->RSTC_RMR = + 108124: e50320f7 str r2, [r3, #-247] ; 0xffffff09 + AT91F_PMC_EnablePCK(AT91C_BASE_PMC, 0, AT91C_PMC_CSS_PLL_CLK); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA6_PCK0); +#endif + + /* switch on first led */ + led_switch(2, 1); + 108128: ebffff54 bl 107e80 + + DEBUGPCRF("entering main (idle) loop"); + 10812c: e59f001c ldr r0, [pc, #28] ; 108150 + 108130: e59f101c ldr r1, [pc, #28] ; 108154 + 108134: e3a0204c mov r2, #76 ; 0x4c + 108138: ebffff37 bl 107e1c + while (1) { + /* Call application specific main idle function */ + _main_func(); + 10813c: eb0007e1 bl 10a0c8 <_main_func> + dbgu_rb_flush(); + 108140: ebffff18 bl 107da8 + + /* restart watchdog timer */ + wdt_restart(); + 108144: eb000344 bl 108e5c + 108148: eafffffb b 10813c + 10814c: a5000401 .word 0xa5000401 + 108150: 0010ab3c .word 0x0010ab3c + 108154: 0010ab04 .word 0x0010ab04 + +00108158 <_read_r>: + unsigned int i; + unsigned char *p; + + p = (unsigned char*)ptr; + + for (i = 0; i < len; i++) { + 108158: e3530000 cmp r3, #0 + 10815c: 01a00003 moveq r0, r3 + 108160: 0a00000c beq 108198 <_read_r+0x40> + 108164: e3a00000 mov r0, #0 +//* \brief Return 1 if a character can be read in US_RHR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_RxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_RXRDY); + 108168: e3e0cc0d mvn ip, #3328 ; 0xd00 + 10816c: e51c10eb ldr r1, [ip, #-235] ; 0xffffff15 + AT91F_US_PutChar((AT91PS_USART)AT91C_BASE_DBGU, c); +} + +static int my_kbhit( void ) +{ + if ((AT91F_US_RxReady((AT91PS_USART)AT91C_BASE_DBGU)) == 0) return 0; + 108170: e3110001 tst r1, #1 + 108174: 0afffffc beq 10816c <_read_r+0x14> +//* \brief Receive a character,does not check if a character is available +//*---------------------------------------------------------------------------- +static inline int AT91F_US_GetChar ( + const AT91PS_USART pUSART) +{ + return((pUSART->US_RHR) & 0x1FF); + 108178: e51c10e7 ldr r1, [ip, #-231] ; 0xffffff19 + else return 1; +} + +static char my_getc( void ) +{ + return AT91F_US_GetChar((AT91PS_USART)AT91C_BASE_DBGU); + 10817c: e20110ff and r1, r1, #255 ; 0xff + for (i = 0; i < len; i++) { + // c = uart0Getch(); + // c = uart0GetchW(); + while ( !my_kbhit() ) ; + c = (char) my_getc(); + if (c == 0x0D) { + 108180: e351000d cmp r1, #13 + 108184: 0a000005 beq 1081a0 <_read_r+0x48> + unsigned int i; + unsigned char *p; + + p = (unsigned char*)ptr; + + for (i = 0; i < len; i++) { + 108188: e2800001 add r0, r0, #1 + 10818c: e1500003 cmp r0, r3 + c = (char) my_getc(); + if (c == 0x0D) { + *p='\0'; + break; + } + *p++ = c; + 108190: e4c21001 strb r1, [r2], #1 + unsigned int i; + unsigned char *p; + + p = (unsigned char*)ptr; + + for (i = 0; i < len; i++) { + 108194: 1afffff4 bne 10816c <_read_r+0x14> + } + *p++ = c; + ////// uart0_putc(c); + } + return len - i; +} + 108198: e0600003 rsb r0, r0, r3 + 10819c: e12fff1e bx lr + // c = uart0Getch(); + // c = uart0GetchW(); + while ( !my_kbhit() ) ; + c = (char) my_getc(); + if (c == 0x0D) { + *p='\0'; + 1081a0: e3a0c000 mov ip, #0 + 1081a4: e5c2c000 strb ip, [r2] + } + *p++ = c; + ////// uart0_putc(c); + } + return len - i; +} + 1081a8: e0600003 rsb r0, r0, r3 + 1081ac: e12fff1e bx lr + +001081b0 <_write_r>: + int i; + const unsigned char *p; + + p = (const unsigned char*) ptr; + + for (i = 0; i < len; i++) { + 1081b0: e2530000 subs r0, r3, #0 +_ssize_t _write_r ( + struct _reent *r, + int file, + const void *ptr, + size_t len) +{ + 1081b4: e92d0070 push {r4, r5, r6} + int i; + const unsigned char *p; + + p = (const unsigned char*) ptr; + + for (i = 0; i < len; i++) { + 1081b8: 0a00000c beq 1081f0 <_write_r+0x40> +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 1081bc: e3e01c0d mvn r1, #3328 ; 0xd00 +extern void *_sbrk_r _PARAMS ((struct _reent *, ptrdiff_t)); +extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); +extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); +extern int _unlink_r _PARAMS ((struct _reent *, const char *)); +extern int _wait_r _PARAMS ((struct _reent *, int *)); +extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); + 1081c0: e0825000 add r5, r2, r0 + 1081c4: e1a04001 mov r4, r1 +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 1081c8: e3a0600d mov r6, #13 + if (*p == '\n' ) my_putc('\r'); + 1081cc: e4d2c001 ldrb ip, [r2], #1 + 1081d0: e35c000a cmp ip, #10 + 1081d4: 0a000007 beq 1081f8 <_write_r+0x48> +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 1081d8: e51130eb ldr r3, [r1, #-235] ; 0xffffff15 + +#include + +static void my_putc(char c) +{ + while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + 1081dc: e3130002 tst r3, #2 + 1081e0: 0afffffc beq 1081d8 <_write_r+0x28> + int i; + const unsigned char *p; + + p = (const unsigned char*) ptr; + + for (i = 0; i < len; i++) { + 1081e4: e1520005 cmp r2, r5 +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 1081e8: e504c0e3 str ip, [r4, #-227] ; 0xffffff1d + 1081ec: 1afffff6 bne 1081cc <_write_r+0x1c> + if (*p == '\n' ) my_putc('\r'); + my_putc(*p++); + } + + return len; +} + 1081f0: e8bd0070 pop {r4, r5, r6} + 1081f4: e12fff1e bx lr +//* \brief Return 1 if a character can be written in US_THR +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_US_TxReady ( + AT91PS_USART pUSART ) // \arg pointer to a USART controller +{ + return (pUSART->US_CSR & AT91C_US_TXRDY); + 1081f8: e51130eb ldr r3, [r1, #-235] ; 0xffffff15 + +#include + +static void my_putc(char c) +{ + while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + 1081fc: e3130002 tst r3, #2 + 108200: 0afffffc beq 1081f8 <_write_r+0x48> +//*---------------------------------------------------------------------------- +static inline void AT91F_US_PutChar ( + AT91PS_USART pUSART, + int character ) +{ + pUSART->US_THR = (character & 0x1FF); + 108204: e50460e3 str r6, [r4, #-227] ; 0xffffff1d + 108208: e552c001 ldrb ip, [r2, #-1] + 10820c: eafffff1 b 1081d8 <_write_r+0x28> + +00108210 <_close_r>: +int _close_r( + struct _reent *r, + int file) +{ + return 0; +} + 108210: e3a00000 mov r0, #0 + 108214: e12fff1e bx lr + +00108218 <_lseek_r>: + int file, + _off_t ptr, + int dir) +{ + return (_off_t)0; /* Always indicate we are at file beginning. */ +} + 108218: e3a00000 mov r0, #0 + 10821c: e12fff1e bx lr + +00108220 <_fstat_r>: + struct _reent *r, + int file, + struct stat *st) +{ + /* Always set as character device. */ + st->st_mode = S_IFCHR; + 108220: e3a03a02 mov r3, #8192 ; 0x2000 + 108224: e5823008 str r3, [r2, #8] + /* assigned to strong type with implicit */ + /* signed/unsigned conversion. Required by */ + /* newlib. */ + + return 0; +} + 108228: e3a00000 mov r0, #0 + 10822c: e12fff1e bx lr + +00108230 : +int isatty(int file); /* avoid warning */ + +int isatty(int file) +{ + return 1; +} + 108230: e3a00001 mov r0, #1 + 108234: e12fff1e bx lr + +00108238 <_sbrk_r>: + struct _reent *_s_r, + ptrdiff_t nbytes) +{ + char *base; /* errno should be set to ENOMEM on error */ + + if (!heap_ptr) { /* Initialize if first time through. */ + 108238: e59f3018 ldr r3, [pc, #24] ; 108258 <_sbrk_r+0x20> + 10823c: e5930000 ldr r0, [r3] + 108240: e59f2014 ldr r2, [pc, #20] ; 10825c <_sbrk_r+0x24> + 108244: e3500000 cmp r0, #0 + 108248: 01a00002 moveq r0, r2 + heap_ptr = end; + } + base = heap_ptr; /* Point to end of heap. */ + heap_ptr += nbytes; /* Increase heap. */ + 10824c: e0801001 add r1, r0, r1 + 108250: e5831000 str r1, [r3] + + return base; /* Return pointer to start of new heap area. */ +} + 108254: e12fff1e bx lr + 108258: 002037e4 .word 0x002037e4 + 10825c: 00203b4c .word 0x00203b4c + +00108260 : + +static usb_cmd_fn *cmd_hdlrs[16]; + +int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class) +{ + cmd_hdlrs[class] = hdlr; + 108260: e59f3008 ldr r3, [pc, #8] ; 108270 + 108264: e7830101 str r0, [r3, r1, lsl #2] + return 0; +} + 108268: e3a00000 mov r0, #0 + 10826c: e12fff1e bx lr + 108270: 002037e8 .word 0x002037e8 + +00108274 : + +void usb_hdlr_unregister(u_int8_t class) +{ + cmd_hdlrs[class] = NULL; + 108274: e59f3008 ldr r3, [pc, #8] ; 108284 + 108278: e3a02000 mov r2, #0 + 10827c: e7832100 str r2, [r3, r0, lsl #2] +} + 108280: e12fff1e bx lr + 108284: 002037e8 .word 0x002037e8 + +00108288 : +} + +/* Process all pending request contexts that want to Tx on either + * IN or INTERRUPT endpoint */ +void usb_out_process(void) +{ + 108288: e92d4008 push {r3, lr} + /* interrupts are likely to be more urgent than bulk */ + udp_refill_ep(3); + 10828c: e3a00003 mov r0, #3 + 108290: ebfffcb0 bl 107558 + udp_refill_ep(2); + 108294: e3a00002 mov r0, #2 + 108298: ebfffcae bl 107558 +} + 10829c: e8bd4008 pop {r3, lr} + 1082a0: e12fff1e bx lr + +001082a4 : + +/* process incoming USB packets (OUT pipe) that have already been + * put into request contexts by the UDP IRQ handler */ +void usb_in_process(void) +{ + 1082a4: e92d41f0 push {r4, r5, r6, r7, r8, lr} + 1082a8: e59f40c0 ldr r4, [pc, #192] ; 108370 +/* DEBUGP("usb_in(cls=%d) ", OPENPCD_CMD_CLS(poh->cmd));*/ + + if (rctx->tot_len < sizeof(*poh)) + return -EINVAL; + + hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + 1082ac: e59f50c0 ldr r5, [pc, #192] ; 108374 + } else + ret = (hdlr)(rctx); + + if (ret & USB_RET_ERR) { + poh->val = ret & 0xff; + poh->flags = OPENPCD_FLAG_ERROR; + 1082b0: e3e0607f mvn r6, #127 ; 0x7f + * put into request contexts by the UDP IRQ handler */ +void usb_in_process(void) +{ + struct req_ctx *rctx; + + while (rctx = req_ctx_find_get(0, RCTX_STATE_UDP_RCV_DONE, + 1082b4: e3a02003 mov r2, #3 + 1082b8: e3a01002 mov r1, #2 + 1082bc: e3a00000 mov r0, #0 + 1082c0: e1a0e00f mov lr, pc + 1082c4: e12fff14 bx r4 + 1082c8: e2507000 subs r7, r0, #0 + 1082cc: 0a00001b beq 108340 + usb_cmd_fn *hdlr; + int ret; + +/* DEBUGP("usb_in(cls=%d) ", OPENPCD_CMD_CLS(poh->cmd));*/ + + if (rctx->tot_len < sizeof(*poh)) + 1082d0: e1d730b6 ldrh r3, [r7, #6] + 1082d4: e3530003 cmp r3, #3 + cmd_hdlrs[class] = NULL; +} + +static int usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 1082d8: e5978008 ldr r8, [r7, #8] + usb_cmd_fn *hdlr; + int ret; + +/* DEBUGP("usb_in(cls=%d) ", OPENPCD_CMD_CLS(poh->cmd));*/ + + if (rctx->tot_len < sizeof(*poh)) + 1082dc: 9afffff4 bls 1082b4 + return -EINVAL; + + hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + 1082e0: e5d82000 ldrb r2, [r8] + 1082e4: e1a01222 lsr r1, r2, #4 + 1082e8: e7953101 ldr r3, [r5, r1, lsl #2] + if (!hdlr) { + 1082ec: e3530000 cmp r3, #0 + 1082f0: 0a000019 beq 10835c + DEBUGPCR("no handler for this class "); + ret = USB_ERR(USB_ERR_CMD_UNKNOWN); + } else + ret = (hdlr)(rctx); + 1082f4: e1a0e00f mov lr, pc + 1082f8: e12fff13 bx r3 + + if (ret & USB_RET_ERR) { + 1082fc: e3100c02 tst r0, #512 ; 0x200 + 108300: 02003c01 andeq r3, r0, #256 ; 0x100 + 108304: 1a000010 bne 10834c + poh->val = ret & 0xff; + poh->flags = OPENPCD_FLAG_ERROR; + } + if (ret & USB_RET_RESPOND) { + 108308: e3530000 cmp r3, #0 + 10830c: 0affffe8 beq 1082b4 + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 108310: e1a00007 mov r0, r7 + 108314: e3a01010 mov r1, #16 + 108318: ebffff15 bl 107f74 + udp_refill_ep(2); + 10831c: e3a00002 mov r0, #2 + 108320: ebfffc8c bl 107558 + * put into request contexts by the UDP IRQ handler */ +void usb_in_process(void) +{ + struct req_ctx *rctx; + + while (rctx = req_ctx_find_get(0, RCTX_STATE_UDP_RCV_DONE, + 108324: e3a02003 mov r2, #3 + 108328: e3a01002 mov r1, #2 + 10832c: e3a00000 mov r0, #0 + 108330: e1a0e00f mov lr, pc + 108334: e12fff14 bx r4 + 108338: e2507000 subs r7, r0, #0 + 10833c: 1affffe3 bne 1082d0 + RCTX_STATE_MAIN_PROCESSING)) { +/* DEBUGPCRF("found used ctx %u: len=%u", + req_ctx_num(rctx), rctx->tot_len);*/ + usb_in(rctx); + } + udp_unthrottle(); + 108340: ebfffc7e bl 107540 +} + 108344: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} + 108348: e12fff1e bx lr + DEBUGPCR("no handler for this class "); + ret = USB_ERR(USB_ERR_CMD_UNKNOWN); + } else + ret = (hdlr)(rctx); + + if (ret & USB_RET_ERR) { + 10834c: e2003c01 and r3, r0, #256 ; 0x100 + poh->val = ret & 0xff; + 108350: e5c80003 strb r0, [r8, #3] + poh->flags = OPENPCD_FLAG_ERROR; + 108354: e5c86001 strb r6, [r8, #1] + 108358: eaffffea b 108308 + if (rctx->tot_len < sizeof(*poh)) + return -EINVAL; + + hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + if (!hdlr) { + DEBUGPCR("no handler for this class "); + 10835c: e59f0014 ldr r0, [pc, #20] ; 108378 + 108360: ebfffead bl 107e1c + 108364: e3a03c01 mov r3, #256 ; 0x100 + 108368: e3a00001 mov r0, #1 + 10836c: eafffff7 b 108350 + 108370: 00200080 .word 0x00200080 + 108374: 002037e8 .word 0x002037e8 + 108378: 0010ab60 .word 0x0010ab60 + +0010837c : + +static struct req_ctx dummy_rctx; +static struct req_ctx empty_rctx; + +static int usbtest_rx(struct req_ctx *rctx) +{ + 10837c: e92d4038 push {r3, r4, r5, lr} + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 108380: e5904008 ldr r4, [r0, #8] + struct req_ctx *rctx_new; + int i; + + switch (poh->cmd) { + 108384: e5d43000 ldrb r3, [r4] + 108388: e35300f1 cmp r3, #241 ; 0xf1 + +static struct req_ctx dummy_rctx; +static struct req_ctx empty_rctx; + +static int usbtest_rx(struct req_ctx *rctx) +{ + 10838c: e1a05000 mov r5, r0 + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + struct req_ctx *rctx_new; + int i; + + switch (poh->cmd) { + 108390: 0a000006 beq 1083b0 + 108394: e35300f2 cmp r3, #242 ; 0xf2 + 108398: 0a00001a beq 108408 + /* test bulk out pipe */ + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + break; + } + + req_ctx_put(rctx); + 10839c: e1a00005 mov r0, r5 + 1083a0: ebfffef9 bl 107f8c + return 1; + 1083a4: e3a00001 mov r0, #1 +} + 1083a8: e8bd4038 pop {r3, r4, r5, lr} + 1083ac: e12fff1e bx lr + struct req_ctx *rctx_new; + int i; + + switch (poh->cmd) { + case OPENPCD_CMD_USBTEST_IN: + DEBUGP("USBTEST_IN "); + 1083b0: e59f0070 ldr r0, [pc, #112] ; 108428 + 1083b4: ebfffe98 bl 107e1c + /* test bulk in pipe */ + if (poh->val > RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE) + 1083b8: e5d40003 ldrb r0, [r4, #3] + 1083bc: e3500020 cmp r0, #32 + poh->val = RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE; + 1083c0: 83a00020 movhi r0, #32 + 1083c4: 85c40003 strbhi r0, [r4, #3] + rctx_new = req_ctx_find_get(1, RCTX_STATE_FREE, + 1083c8: e59f305c ldr r3, [pc, #92] ; 10842c + 1083cc: e3a00001 mov r0, #1 + 1083d0: e3a010fe mov r1, #254 ; 0xfe + 1083d4: e3a02003 mov r2, #3 + 1083d8: e1a0e00f mov lr, pc + 1083dc: e12fff13 bx r3 + RCTX_STATE_MAIN_PROCESSING); + if (!rctx_new) { + 1083e0: e2503000 subs r3, r0, #0 + 1083e4: 0a00000b beq 108418 + DEBUGP("NO RCTX "); + return USB_ERR(0); + } + + rctx_new->tot_len = poh->val * AT91C_EP_OUT_SIZE; + 1083e8: e5d41003 ldrb r1, [r4, #3] + 1083ec: e1a02301 lsl r2, r1, #6 + 1083f0: e1c320b6 strh r2, [r3, #6] + req_ctx_set_state(rctx_new, RCTX_STATE_UDP_EP2_PENDING); + 1083f4: e3a01010 mov r1, #16 + 1083f8: ebfffedd bl 107f74 + led_toggle(2); + 1083fc: e3a00002 mov r0, #2 + 108400: ebfffeb7 bl 107ee4 + break; + 108404: eaffffe4 b 10839c + case OPENPCD_CMD_USBTEST_OUT: + DEBUGP("USBTEST_IN "); + 108408: e59f0018 ldr r0, [pc, #24] ; 108428 + 10840c: ebfffe82 bl 107e1c + /* test bulk out pipe */ + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 108410: e59f0018 ldr r0, [pc, #24] ; 108430 + 108414: eaffffe3 b 1083a8 + if (poh->val > RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE) + poh->val = RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE; + rctx_new = req_ctx_find_get(1, RCTX_STATE_FREE, + RCTX_STATE_MAIN_PROCESSING); + if (!rctx_new) { + DEBUGP("NO RCTX "); + 108418: e59f0014 ldr r0, [pc, #20] ; 108434 + 10841c: ebfffe7e bl 107e1c + return USB_ERR(0); + 108420: e3a00c03 mov r0, #768 ; 0x300 + 108424: eaffffdf b 1083a8 + 108428: 0010ab80 .word 0x0010ab80 + 10842c: 00200080 .word 0x00200080 + 108430: 00000302 .word 0x00000302 + 108434: 0010ab8c .word 0x0010ab8c + +00108438 : + req_ctx_put(rctx); + return 1; +} + +void usbtest_init(void) +{ + 108438: e92d4010 push {r4, lr} + dummy_rctx.tot_len = 64; + 10843c: e59f4030 ldr r4, [pc, #48] ; 108474 + 108440: e3a0c040 mov ip, #64 ; 0x40 + memset(dummy_rctx.data, 0x23, 64); + 108444: e3a01023 mov r1, #35 ; 0x23 + 108448: e5940008 ldr r0, [r4, #8] + 10844c: e1a0200c mov r2, ip + return 1; +} + +void usbtest_init(void) +{ + dummy_rctx.tot_len = 64; + 108450: e1c4c0b6 strh ip, [r4, #6] + memset(dummy_rctx.data, 0x23, 64); + 108454: eb00079c bl 10a2cc + + empty_rctx.tot_len = 0; + 108458: e3a03000 mov r3, #0 + + usb_hdlr_register(&usbtest_rx, OPENPCD_CMD_CLS_USBTEST); + 10845c: e3a0100f mov r1, #15 + 108460: e59f0010 ldr r0, [pc, #16] ; 108478 +void usbtest_init(void) +{ + dummy_rctx.tot_len = 64; + memset(dummy_rctx.data, 0x23, 64); + + empty_rctx.tot_len = 0; + 108464: e1c431b2 strh r3, [r4, #18] + + usb_hdlr_register(&usbtest_rx, OPENPCD_CMD_CLS_USBTEST); + 108468: ebffff7c bl 108260 +} + 10846c: e8bd4010 pop {r4, lr} + 108470: e12fff1e bx lr + 108474: 00203828 .word 0x00203828 + 108478: 0010837c .word 0x0010837c + +0010847c : +static AT91PS_TCB tcb = AT91C_BASE_TCB; + +/* set carrier divider to a specific */ +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + 10847c: e59f3018 ldr r3, [pc, #24] ; 10849c + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 108480: e1a0c0a0 lsr ip, r0, #1 + 108484: e28c2001 add r2, ip, #1 +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + 108488: e3a01001 mov r1, #1 +static AT91PS_TCB tcb = AT91C_BASE_TCB; + +/* set carrier divider to a specific */ +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + 10848c: e50300e3 str r0, [r3, #-227] ; 0xffffff1d + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + 108490: e50310eb str r1, [r3, #-235] ; 0xffffff15 + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 108494: e50320e7 str r2, [r3, #-231] ; 0xffffff19 +} + 108498: e12fff1e bx lr + 10849c: fffa00ff .word 0xfffa00ff + +001084a0 : + +void tc_cdiv_phase_add(int16_t inc) +{ + 1084a0: e92d4038 push {r3, r4, r5, lr} + tcb->TCB_TC0.TC_RA = (tcb->TCB_TC0.TC_RA + inc) % tcb->TCB_TC0.TC_RC; + 1084a4: e59f4054 ldr r4, [pc, #84] ; 108500 + 1084a8: e51420eb ldr r2, [r4, #-235] ; 0xffffff15 + tcb->TCB_TC0.TC_RA = 1; + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); +} + +void tc_cdiv_phase_add(int16_t inc) +{ + 1084ac: e1a05000 mov r5, r0 + tcb->TCB_TC0.TC_RA = (tcb->TCB_TC0.TC_RA + inc) % tcb->TCB_TC0.TC_RC; + 1084b0: e51410e3 ldr r1, [r4, #-227] ; 0xffffff1d + 1084b4: e0800002 add r0, r0, r2 + 1084b8: eb000818 bl 10a520 <__aeabi_uidivmod> + 1084bc: e50410eb str r1, [r4, #-235] ; 0xffffff15 + tcb->TCB_TC0.TC_RB = (tcb->TCB_TC0.TC_RB + inc) % tcb->TCB_TC0.TC_RC; + 1084c0: e51400e7 ldr r0, [r4, #-231] ; 0xffffff19 + 1084c4: e51410e3 ldr r1, [r4, #-227] ; 0xffffff1d + 1084c8: e0850000 add r0, r5, r0 + 1084cc: eb000813 bl 10a520 <__aeabi_uidivmod> + 1084d0: e50410e7 str r1, [r4, #-231] ; 0xffffff19 + + /* FIXME: can this be done more elegantly? */ + if (tcb->TCB_TC0.TC_RA == 0) { + 1084d4: e51430eb ldr r3, [r4, #-235] ; 0xffffff15 + 1084d8: e3530000 cmp r3, #0 + 1084dc: 1a000005 bne 1084f8 + tcb->TCB_TC0.TC_RA += 1; + 1084e0: e51430eb ldr r3, [r4, #-235] ; 0xffffff15 + 1084e4: e283e001 add lr, r3, #1 + 1084e8: e504e0eb str lr, [r4, #-235] ; 0xffffff15 + tcb->TCB_TC0.TC_RB += 1; + 1084ec: e514c0e7 ldr ip, [r4, #-231] ; 0xffffff19 + 1084f0: e28c1001 add r1, ip, #1 + 1084f4: e50410e7 str r1, [r4, #-231] ; 0xffffff19 + } +} + 1084f8: e8bd4038 pop {r3, r4, r5, lr} + 1084fc: e12fff1e bx lr + 108500: fffa00ff .word 0xfffa00ff + +00108504 : + + AT91F_PMC_EnablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_TC0)); + + /* Enable Clock for TC0 */ + tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKEN; + 108504: e59f3060 ldr r3, [pc, #96] ; 10856c + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 108508: e3e01c0b mvn r1, #2816 ; 0xb00 + pPio->PIO_BSR = periphBEnable; + 10850c: e3a00233 mov r0, #805306371 ; 0x30000003 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 108510: e3a0c000 mov ip, #0 + 108514: e501c08f str ip, [r1, #-143] ; 0xffffff71 + 108518: e3a02001 mov r2, #1 + pPio->PIO_BSR = periphBEnable; + 10851c: e501008b str r0, [r1, #-139] ; 0xffffff75 + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 108520: e50100fb str r0, [r1, #-251] ; 0xffffff05 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 108524: e3a00a01 mov r0, #4096 ; 0x1000 + 108528: e3e01c03 mvn r1, #768 ; 0x300 + 10852c: e50100ef str r0, [r1, #-239] ; 0xffffff11 + 108530: e50320ff str r2, [r3, #-255] ; 0xffffff01 + + /* Connect TCLK1 to XC1, TCLK2 to XC2 */ + tcb->TCB_BMR &= ~(AT91C_TCB_TC1XC1S | AT91C_TCB_TC2XC2S); + 108534: e513c03b ldr ip, [r3, #-59] ; 0xffffffc5 + 108538: e3cc003c bic r0, ip, #60 ; 0x3c + 10853c: e503003b str r0, [r3, #-59] ; 0xffffffc5 + tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2); + 108540: e513103b ldr r1, [r3, #-59] ; 0xffffffc5 + + /* Clock XC1, Wave mode, Reset on RC comp + * TIOA0 on RA comp = set, * TIOA0 on RC comp = clear, + * TIOB0 on EEVT = set, TIOB0 on RB comp = clear, + * EEVT = XC2 (TIOA0) */ + tcb->TCB_TC0.TC_CMR = AT91C_TC_CLKS_XC1 | AT91C_TC_WAVE | + 108544: e59fc024 ldr ip, [pc, #36] ; 108570 + /* Enable Clock for TC0 */ + tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKEN; + + /* Connect TCLK1 to XC1, TCLK2 to XC2 */ + tcb->TCB_BMR &= ~(AT91C_TCB_TC1XC1S | AT91C_TCB_TC2XC2S); + tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2); + 108548: e503103b str r1, [r3, #-59] ; 0xffffffc5 +static AT91PS_TCB tcb = AT91C_BASE_TCB; + +/* set carrier divider to a specific */ +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + 10854c: e3a00080 mov r0, #128 ; 0x80 + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 108550: e3a01041 mov r1, #65 ; 0x41 + + /* Clock XC1, Wave mode, Reset on RC comp + * TIOA0 on RA comp = set, * TIOA0 on RC comp = clear, + * TIOB0 on EEVT = set, TIOB0 on RB comp = clear, + * EEVT = XC2 (TIOA0) */ + tcb->TCB_TC0.TC_CMR = AT91C_TC_CLKS_XC1 | AT91C_TC_WAVE | + 108554: e503c0fb str ip, [r3, #-251] ; 0xffffff05 +static AT91PS_TCB tcb = AT91C_BASE_TCB; + +/* set carrier divider to a specific */ +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + 108558: e50300e3 str r0, [r3, #-227] ; 0xffffff1d + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + 10855c: e50320eb str r2, [r3, #-235] ; 0xffffff15 + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 108560: e50310e7 str r1, [r3, #-231] ; 0xffffff19 + AT91C_TC_BSWTRG_CLEAR | AT91C_TC_ASWTRG_CLEAR; + + tc_cdiv_set_divider(128); + + /* Reset to start timers */ + tcb->TCB_BCR = 1; + 108564: e503203f str r2, [r3, #-63] ; 0xffffffc1 +} + 108568: e12fff1e bx lr + 10856c: fffa00ff .word 0xfffa00ff + 108570: 9289cd06 .word 0x9289cd06 + +00108574 : + +void tc_cdiv_print(void) +{ + 108574: e92d4010 push {r4, lr} + DEBUGP("TCB_BMR=0x%08x ", tcb->TCB_BMR); + 108578: e59f4048 ldr r4, [pc, #72] ; 1085c8 + 10857c: e59f0048 ldr r0, [pc, #72] ; 1085cc + 108580: e514103b ldr r1, [r4, #-59] ; 0xffffffc5 + 108584: ebfffe24 bl 107e1c + DEBUGP("TC0_CV=0x%08x ", tcb->TCB_TC0.TC_CV); + 108588: e51410ef ldr r1, [r4, #-239] ; 0xffffff11 + 10858c: e59f003c ldr r0, [pc, #60] ; 1085d0 + 108590: ebfffe21 bl 107e1c + DEBUGP("TC0_CMR=0x%08x ", tcb->TCB_TC0.TC_CMR); + 108594: e51410fb ldr r1, [r4, #-251] ; 0xffffff05 + 108598: e59f0034 ldr r0, [pc, #52] ; 1085d4 + 10859c: ebfffe1e bl 107e1c + DEBUGPCR("TC0_SR=0x%08x", tcb->TCB_TC0.TC_SR); + 1085a0: e51410df ldr r1, [r4, #-223] ; 0xffffff21 + 1085a4: e59f002c ldr r0, [pc, #44] ; 1085d8 + 1085a8: ebfffe1b bl 107e1c + + DEBUGPCR("TC0_RA=0x%04x, TC0_RB=0x%04x, TC0_RC=0x%04x", + 1085ac: e51410eb ldr r1, [r4, #-235] ; 0xffffff15 + 1085b0: e59f0024 ldr r0, [pc, #36] ; 1085dc + 1085b4: e51420e7 ldr r2, [r4, #-231] ; 0xffffff19 + 1085b8: e51430e3 ldr r3, [r4, #-227] ; 0xffffff1d + 1085bc: ebfffe16 bl 107e1c + tcb->TCB_TC0.TC_RA, tcb->TCB_TC0.TC_RB, tcb->TCB_TC0.TC_RC); +} + 1085c0: e8bd4010 pop {r4, lr} + 1085c4: e12fff1e bx lr + 1085c8: fffa00ff .word 0xfffa00ff + 1085cc: 0010ab98 .word 0x0010ab98 + 1085d0: 0010aba8 .word 0x0010aba8 + 1085d4: 0010abb8 .word 0x0010abb8 + 1085d8: 0010abc8 .word 0x0010abc8 + 1085dc: 0010abd8 .word 0x0010abd8 + +001085e0 : + +void tc_cdiv_fini(void) +{ + tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKDIS; + 1085e0: e59f1014 ldr r1, [pc, #20] ; 1085fc + 1085e4: e3a00002 mov r0, #2 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_DisablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCDR = periphIds; + 1085e8: e3a02a01 mov r2, #4096 ; 0x1000 + 1085ec: e3e03c03 mvn r3, #768 ; 0x300 + 1085f0: e50100ff str r0, [r1, #-255] ; 0xffffff01 + 1085f4: e50320eb str r2, [r3, #-235] ; 0xffffff15 + AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_TC0)); +} + 1085f8: e12fff1e bx lr + 1085fc: fffa00ff .word 0xfffa00ff + +00108600 : +int timer_del(struct timer_list *tl) +{ + unsigned long flags; + int ret; + + local_irq_save(flags); + 108600: e10fc000 mrs ip, CPSR + 108604: e38c3080 orr r3, ip, #128 ; 0x80 + 108608: e121f003 msr CPSR_c, r3 + +static int __timer_remove(struct timer_list *old) +{ + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + 10860c: e59f1060 ldr r1, [pc, #96] ; 108674 + 108610: e5912000 ldr r2, [r1] + 108614: e3520000 cmp r2, #0 + return 1; + } + tl_prev = tl; + } + + return 0; + 108618: 01a00002 moveq r0, r2 + +static int __timer_remove(struct timer_list *old) +{ + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + 10861c: 0a000009 beq 108648 + if (tl == old) { + 108620: e1500002 cmp r0, r2 + 108624: 1a000003 bne 108638 + 108628: ea00000d b 108664 + 10862c: e1500003 cmp r0, r3 + 108630: 0a000006 beq 108650 + 108634: e1a02003 mov r2, r3 + +static int __timer_remove(struct timer_list *old) +{ + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + 108638: e5923000 ldr r3, [r2] + 10863c: e3530000 cmp r3, #0 + 108640: 1afffff9 bne 10862c + return 1; + } + tl_prev = tl; + } + + return 0; + 108644: e1a00003 mov r0, r3 + unsigned long flags; + int ret; + + local_irq_save(flags); + ret = __timer_remove(tl); + local_irq_restore(flags); + 108648: e121f00c msr CPSR_c, ip + + return ret; +} + 10864c: e12fff1e bx lr + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl == old) { + if (tl == timers) + timers = tl->next; + else + tl_prev->next = tl->next; + 108650: e5903000 ldr r3, [r0] + return 1; + 108654: e3a00001 mov r0, #1 + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl == old) { + if (tl == timers) + timers = tl->next; + else + tl_prev->next = tl->next; + 108658: e5823000 str r3, [r2] + unsigned long flags; + int ret; + + local_irq_save(flags); + ret = __timer_remove(tl); + local_irq_restore(flags); + 10865c: e121f00c msr CPSR_c, ip + + return ret; +} + 108660: e12fff1e bx lr + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl == old) { + if (tl == timers) + timers = tl->next; + 108664: e5902000 ldr r2, [r0] + else + tl_prev->next = tl->next; + return 1; + 108668: e3a00001 mov r0, #1 + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl == old) { + if (tl == timers) + timers = tl->next; + 10866c: e5812000 str r2, [r1] + 108670: eafffff4 b 108648 + 108674: 00203840 .word 0x00203840 + +00108678 : + +static void pit_irq(u_int32_t sr) +{ + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + 108678: e3100001 tst r0, #1 + __timer_insert(tl); + local_irq_restore(flags); +} + +static void pit_irq(u_int32_t sr) +{ + 10867c: e92d4070 push {r4, r5, r6, lr} + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + 108680: 0a00001a beq 1086f0 + return; + + jiffies += *AT91C_PITC_PIVR >> 20; + 108684: e59f606c ldr r6, [pc, #108] ; 1086f8 + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + 108688: e59f106c ldr r1, [pc, #108] ; 1086fc + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + return; + + jiffies += *AT91C_PITC_PIVR >> 20; + 10868c: e3e04000 mvn r4, #0 + 108690: e51422c7 ldr r2, [r4, #-711] ; 0xfffffd39 + 108694: e5960000 ldr r0, [r6] + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + 108698: e5914000 ldr r4, [r1] + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + return; + + jiffies += *AT91C_PITC_PIVR >> 20; + 10869c: e0803a22 add r3, r0, r2, lsr #20 + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + 1086a0: e3540000 cmp r4, #0 + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + return; + + jiffies += *AT91C_PITC_PIVR >> 20; + 1086a4: e5863000 str r3, [r6] + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + 1086a8: 1a000003 bne 1086bc + 1086ac: ea00000f b 1086f0 + 1086b0: e3550000 cmp r5, #0 + 1086b4: 0a00000d beq 1086f0 + 1086b8: e1a04005 mov r4, r5 + next = tl->next; + if (tl->expires <= jiffies) { + 1086bc: e5945004 ldr r5, [r4, #4] + 1086c0: e596c000 ldr ip, [r6] + 1086c4: e155000c cmp r5, ip + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + next = tl->next; + 1086c8: e5945000 ldr r5, [r4] + if (tl->expires <= jiffies) { + 1086cc: 8afffff7 bhi 1086b0 + /* delete timer from list */ + timer_del(tl); + 1086d0: e1a00004 mov r0, r4 + 1086d4: ebffffc9 bl 108600 + tl->function(tl->data); + 1086d8: e594000c ldr r0, [r4, #12] + 1086dc: e594c008 ldr ip, [r4, #8] + 1086e0: e1a0e00f mov lr, pc + 1086e4: e12fff1c bx ip + jiffies += *AT91C_PITC_PIVR >> 20; + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + 1086e8: e3550000 cmp r5, #0 + 1086ec: 1afffff1 bne 1086b8 + /* delete timer from list */ + timer_del(tl); + tl->function(tl->data); + } + } +} + 1086f0: e8bd4070 pop {r4, r5, r6, lr} + 1086f4: e12fff1e bx lr + 1086f8: 00203a14 .word 0x00203a14 + 1086fc: 00203840 .word 0x00203840 + +00108700 : + + return ret; +} + +void timer_add(struct timer_list *tl) +{ + 108700: e92d0070 push {r4, r5, r6} + unsigned long flags; + + local_irq_save(flags); + 108704: e10f6000 mrs r6, CPSR + 108708: e3863080 orr r3, r6, #128 ; 0x80 + 10870c: e121f003 msr CPSR_c, r3 + +static void __timer_insert(struct timer_list *new) +{ + struct timer_list *tl, *tl_prev = NULL; + + if (!timers) { + 108710: e59f505c ldr r5, [pc, #92] ; 108774 + 108714: e5954000 ldr r4, [r5] + 108718: e3540000 cmp r4, #0 + /* optimize for the common, fast case */ + new->next = NULL; + 10871c: 05804000 streq r4, [r0] + timers = new; + 108720: 05850000 streq r0, [r5] + +static void __timer_insert(struct timer_list *new) +{ + struct timer_list *tl, *tl_prev = NULL; + + if (!timers) { + 108724: 0a00000f beq 108768 + timers = new; + return; + } + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl->expires < new->expires) { + 108728: e590c004 ldr ip, [r0, #4] + 10872c: e1a03004 mov r3, r4 + 108730: e3a02000 mov r2, #0 + 108734: e5931004 ldr r1, [r3, #4] + 108738: e151000c cmp r1, ip + 10873c: 2a000004 bcs 108754 + /* we need ot add just before this one */ + if (!tl_prev) { + 108740: e3520000 cmp r2, #0 + new->next = timers; + timers = new; + } else { + new->next = tl; + 108744: 15803000 strne r3, [r0] + tl_prev->next = new; + 108748: 15820000 strne r0, [r2] + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl->expires < new->expires) { + /* we need ot add just before this one */ + if (!tl_prev) { + new->next = timers; + 10874c: 05804000 streq r4, [r0] + timers = new; + 108750: 01a04000 moveq r4, r0 + new->next = NULL; + timers = new; + return; + } + + for (tl = timers; tl != NULL; tl = tl->next) { + 108754: e1a02003 mov r2, r3 + 108758: e5933000 ldr r3, [r3] + 10875c: e3530000 cmp r3, #0 + 108760: 1afffff3 bne 108734 + 108764: e5854000 str r4, [r5] +{ + unsigned long flags; + + local_irq_save(flags); + __timer_insert(tl); + local_irq_restore(flags); + 108768: e121f006 msr CPSR_c, r6 +} + 10876c: e8bd0070 pop {r4, r5, r6} + 108770: e12fff1e bx lr + 108774: 00203840 .word 0x00203840 + +00108778 : +//* \brief Read PIT CPIV and PICNT without ressetting the counters +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PITGetPIIR( + AT91PS_PITC pPITC) +{ + return(pPITC->PITC_PIIR); + 108778: e3e03c02 mvn r3, #512 ; 0x200 + 10877c: e51320c3 ldr r2, [r3, #-195] ; 0xffffff3d + +void pit_mdelay(u_int32_t ms) +{ + u_int32_t end; + + end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; + 108780: e59fc020 ldr ip, [pc, #32] ; 1087a8 + 108784: e0800002 add r0, r0, r2 + 108788: e08c1c90 umull r1, ip, r0, ip + 10878c: e1a0122c lsr r1, ip, #4 + 108790: e0812101 add r2, r1, r1, lsl #2 + 108794: e0402102 sub r2, r0, r2, lsl #2 + 108798: e51300c3 ldr r0, [r3, #-195] ; 0xffffff3d + + while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } + 10879c: e1520000 cmp r2, r0 + 1087a0: 3afffffc bcc 108798 +} + 1087a4: e12fff1e bx lr + 1087a8: cccccccd .word 0xcccccccd + +001087ac : + 1087ac: e3e03c02 mvn r3, #512 ; 0x200 + 1087b0: e51320c3 ldr r2, [r3, #-195] ; 0xffffff3d + +void pit_mdelay(u_int32_t ms) +{ + u_int32_t end; + + end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; + 1087b4: e59fc020 ldr ip, [pc, #32] ; 1087dc + 1087b8: e0800002 add r0, r0, r2 + 1087bc: e08c1c90 umull r1, ip, r0, ip + 1087c0: e1a0122c lsr r1, ip, #4 + 1087c4: e0812101 add r2, r1, r1, lsl #2 + 1087c8: e0402102 sub r2, r0, r2, lsl #2 + 1087cc: e51300c3 ldr r0, [r3, #-195] ; 0xffffff3d + + while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } + 1087d0: e1520000 cmp r2, r0 + 1087d4: 3afffffc bcc 1087cc +} + +void mdelay(u_int32_t ms) +{ + return pit_mdelay(ms); +} + 1087d8: e12fff1e bx lr + 1087dc: cccccccd .word 0xcccccccd + +001087e0 : + +void usleep(u_int32_t us) +{ + return; + return pit_mdelay(us/1000); +} + 1087e0: e12fff1e bx lr + +001087e4 : +static inline void AT91F_PITInit( + AT91PS_PITC pPITC, + unsigned int period, + unsigned int pit_frequency) +{ + pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 1087e4: e59fc040 ldr ip, [pc, #64] ; 10882c + +void pit_init(void) +{ + 1087e8: e92d4010 push {r4, lr} +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 1087ec: e3e03c03 mvn r3, #768 ; 0x300 +static inline void AT91F_PITInit( + AT91PS_PITC pPITC, + unsigned int period, + unsigned int pit_frequency) +{ + pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 1087f0: e3e04c02 mvn r4, #512 ; 0x200 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 1087f4: e3a0e002 mov lr, #2 + 1087f8: e503e0ef str lr, [r3, #-239] ; 0xffffff11 +static inline void AT91F_PITInit( + AT91PS_PITC pPITC, + unsigned int period, + unsigned int pit_frequency) +{ + pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 1087fc: e504c0cf str ip, [r4, #-207] ; 0xffffff31 + pPITC->PITC_PIMR |= AT91C_PITC_PITEN; + 108800: e51410cf ldr r1, [r4, #-207] ; 0xffffff31 + 108804: e3812401 orr r2, r1, #16777216 ; 0x1000000 + AT91F_PITC_CfgPMC(); + + AT91F_PITInit(AT91C_BASE_PITC, 1000000/HZ /* uS */, 48 /* MHz */); + + sysirq_register(AT91SAM7_SYSIRQ_PIT, &pit_irq); + 108808: e3a00000 mov r0, #0 + 10880c: e59f101c ldr r1, [pc, #28] ; 108830 + 108810: e50420cf str r2, [r4, #-207] ; 0xffffff31 + 108814: eb0002b9 bl 109300 +//* \brief Enable PIT periodic interrupt +//*---------------------------------------------------------------------------- +static inline void AT91F_PITEnableInt( + AT91PS_PITC pPITC) +{ + pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; + 108818: e51400cf ldr r0, [r4, #-207] ; 0xffffff31 + 10881c: e3803402 orr r3, r0, #33554432 ; 0x2000000 + 108820: e50430cf str r3, [r4, #-207] ; 0xffffff31 + + AT91F_PITEnableInt(AT91C_BASE_PITC); +} + 108824: e8bd4010 pop {r4, lr} + 108828: e12fff1e bx lr + 10882c: 00007530 .word 0x00007530 + 108830: 00108678 .word 0x00108678 + +00108834 : + return 0; +} + +/* set frequency of PWM signal to freq */ +int pwm_freq_set(int channel, u_int32_t freq) +{ + 108834: e92d40f0 push {r4, r5, r6, r7, lr} + u_int32_t overall_div; + u_int32_t presc_total; + u_int8_t cpre = 0; + u_int16_t cprd; + + if (freq > MCLK) + 108838: e59f7100 ldr r7, [pc, #256] ; 108940 + 10883c: e1510007 cmp r1, r7 + return 0; +} + +/* set frequency of PWM signal to freq */ +int pwm_freq_set(int channel, u_int32_t freq) +{ + 108840: e1a05000 mov r5, r0 + 108844: e24dd00c sub sp, sp, #12 + 108848: e1a04001 mov r4, r1 + u_int32_t presc_total; + u_int8_t cpre = 0; + u_int16_t cprd; + + if (freq > MCLK) + return -ERANGE; + 10884c: 83e00021 mvnhi r0, #33 ; 0x21 + u_int32_t overall_div; + u_int32_t presc_total; + u_int8_t cpre = 0; + u_int16_t cprd; + + if (freq > MCLK) + 108850: 9a000002 bls 108860 + DEBUGPCRF("cpre=%u, cprd=%u", cpre, cprd); + AT91F_PWMC_CfgChannel(AT91C_BASE_PWMC, channel, + cpre|AT91C_PWMC_CPOL, cprd, 1); + + return 0; +} + 108854: e28dd00c add sp, sp, #12 + 108858: e8bd40f0 pop {r4, r5, r6, r7, lr} + 10885c: e12fff1e bx lr + u_int16_t cprd; + + if (freq > MCLK) + return -ERANGE; + + overall_div = MCLK / freq; + 108860: e1a00007 mov r0, r7 + 108864: eb0006f0 bl 10a42c <__aeabi_uidiv> + DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + 108868: e59f10d4 ldr r1, [pc, #212] ; 108944 + u_int16_t cprd; + + if (freq > MCLK) + return -ERANGE; + + overall_div = MCLK / freq; + 10886c: e1a06000 mov r6, r0 + DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + 108870: e3a02049 mov r2, #73 ; 0x49 + 108874: e59f00cc ldr r0, [pc, #204] ; 108948 + 108878: e1a03007 mov r3, r7 + 10887c: e88d0050 stm sp, {r4, r6} + 108880: ebfffd65 bl 107e1c + + if (overall_div > 0x7fff) { + 108884: e3560902 cmp r6, #32768 ; 0x8000 + /* divisor is larger than half the maximum CPRD register, we + * have to configure prescalers */ + presc_total = overall_div >> 15; + 108888: 21a007a6 lsrcs r0, r6, #15 +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + if (val & (1 << (i-1))) + 10888c: 23a01001 movcs r1, #1 +/* find highest bit set. returns bit (32..1) or 0 in case no bit set */ +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + 108890: 23a0401f movcs r4, #31 + return -ERANGE; + + overall_div = MCLK / freq; + DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + + if (overall_div > 0x7fff) { + 108894: 2a00001d bcs 108910 + /* subtract one, because of fhs semantics */ + cpre--; + } + cprd = overall_div / (1 << cpre); + } else + cprd = overall_div; + 108898: e1a01806 lsl r1, r6, #16 + 10889c: e1a06821 lsr r6, r1, #16 + 1088a0: e3a04c02 mov r4, #512 ; 0x200 + 1088a4: e3a03000 mov r3, #0 + + DEBUGPCRF("cpre=%u, cprd=%u", cpre, cprd); + 1088a8: e59f009c ldr r0, [pc, #156] ; 10894c + 1088ac: e59f1090 ldr r1, [pc, #144] ; 108944 + 1088b0: e3a0205a mov r2, #90 ; 0x5a + 1088b4: e58d6000 str r6, [sp] + 1088b8: ebfffd57 bl 107e1c + unsigned int channelId, // \arg PWM channel ID + unsigned int mode, // \arg PWM mode + unsigned int period, // \arg PWM period + unsigned int duty) // \arg PWM duty cycle +{ + pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 1088bc: e59fc08c ldr ip, [pc, #140] ; 108950 + 1088c0: e2852010 add r2, r5, #16 + 1088c4: e1a01282 lsl r1, r2, #5 + pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; + 1088c8: e1a0300c mov r3, ip + 1088cc: e1a05285 lsl r5, r5, #5 + unsigned int channelId, // \arg PWM channel ID + unsigned int mode, // \arg PWM mode + unsigned int period, // \arg PWM period + unsigned int duty) // \arg PWM duty cycle +{ + pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 1088d0: e081000c add r0, r1, ip + pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; + 1088d4: e0853003 add r3, r5, r3 + unsigned int channelId, // \arg PWM channel ID + unsigned int mode, // \arg PWM mode + unsigned int period, // \arg PWM period + unsigned int duty) // \arg PWM duty cycle +{ + pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 1088d8: e241c90d sub ip, r1, #212992 ; 0x34000 + pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + 1088dc: e3a02001 mov r2, #1 + unsigned int channelId, // \arg PWM channel ID + unsigned int mode, // \arg PWM mode + unsigned int period, // \arg PWM period + unsigned int duty) // \arg PWM duty cycle +{ + pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 1088e0: e50040ff str r4, [r0, #-255] ; 0xffffff01 + pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + 1088e4: e58c2004 str r2, [ip, #4] + AT91F_PWMC_CfgChannel(AT91C_BASE_PWMC, channel, + cpre|AT91C_PWMC_CPOL, cprd, 1); + + return 0; + 1088e8: e3a00000 mov r0, #0 + pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; + 1088ec: e5836109 str r6, [r3, #265] ; 0x109 + 1088f0: eaffffd7 b 108854 +/* find highest bit set. returns bit (32..1) or 0 in case no bit set */ +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + 1088f4: e3530000 cmp r3, #0 + 1088f8: e1a04003 mov r4, r3 + if (val & (1 << (i-1))) + 1088fc: e2432001 sub r2, r3, #1 +/* find highest bit set. returns bit (32..1) or 0 in case no bit set */ +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + 108900: 0a000009 beq 10892c + if (val & (1 << (i-1))) + 108904: e0103211 ands r3, r0, r1, lsl r2 + 108908: 1a000003 bne 10891c +/* find highest bit set. returns bit (32..1) or 0 in case no bit set */ +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + 10890c: e1a04002 mov r4, r2 + if (val & (1 << (i-1))) + 108910: e2443001 sub r3, r4, #1 + 108914: e0102311 ands r2, r0, r1, lsl r3 + 108918: 0afffff5 beq 1088f4 + * have to configure prescalers */ + presc_total = overall_div >> 15; + + /* find highest 2^n fitting in prescaler (highest bit set) */ + cpre = fhs(presc_total); + if (cpre > 0) { + 10891c: e21440ff ands r4, r4, #255 ; 0xff + /* subtract one, because of fhs semantics */ + cpre--; + 108920: 12444001 subne r4, r4, #1 + 108924: 120440ff andne r4, r4, #255 ; 0xff + * have to configure prescalers */ + presc_total = overall_div >> 15; + + /* find highest 2^n fitting in prescaler (highest bit set) */ + cpre = fhs(presc_total); + if (cpre > 0) { + 108928: e1a03004 mov r3, r4 + /* subtract one, because of fhs semantics */ + cpre--; + } + cprd = overall_div / (1 << cpre); + 10892c: e1a00336 lsr r0, r6, r3 + 108930: e1a06800 lsl r6, r0, #16 + 108934: e1a06826 lsr r6, r6, #16 + 108938: e3844c02 orr r4, r4, #512 ; 0x200 + 10893c: eaffffd9 b 1088a8 + 108940: 02dc6c00 .word 0x02dc6c00 + 108944: 0010ac08 .word 0x0010ac08 + 108948: 0010ac30 .word 0x0010ac30 + 10894c: 0010ac5c .word 0x0010ac5c + 108950: fffcc0ff .word 0xfffcc0ff + +00108954 : + return 0; +} + +void pwm_start(int channel) +{ + AT91F_PWMC_StartChannel(AT91C_BASE_PWMC, (1 << channel)); + 108954: e3a01001 mov r1, #1 + 108958: e1a03011 lsl r3, r1, r0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StartChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_ENA = flag; + 10895c: e59f2004 ldr r2, [pc, #4] ; 108968 + 108960: e50230fb str r3, [r2, #-251] ; 0xffffff05 +} + 108964: e12fff1e bx lr + 108968: fffcc0ff .word 0xfffcc0ff + +0010896c : + +void pwm_stop(int channel) +{ + AT91F_PWMC_StopChannel(AT91C_BASE_PWMC, (1 << channel)); + 10896c: e3a01001 mov r1, #1 + 108970: e1a03011 lsl r3, r1, r0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StopChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_DIS = flag; + 108974: e59f2004 ldr r2, [pc, #4] ; 108980 + 108978: e50230f7 str r3, [r2, #-247] ; 0xffffff09 +} + 10897c: e12fff1e bx lr + 108980: fffcc0ff .word 0xfffcc0ff + +00108984 : + +void pwm_duty_set_percent(int channel, u_int16_t duty) +{ + 108984: e92d4038 push {r3, r4, r5, lr} + u_int32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; + 108988: e59f4040 ldr r4, [pc, #64] ; 1089d0 + 10898c: e1a0c280 lsl ip, r0, #5 + 108990: e08c4004 add r4, ip, r4 + 108994: e5942109 ldr r2, [r4, #265] ; 0x109 + + tmp = tmp << 16; /* extend value by 2^16 */ + tmp = tmp / 100; /* tmp = 1 % of extended cprd */ + 108998: e59f3034 ldr r3, [pc, #52] ; 1089d4 + +void pwm_duty_set_percent(int channel, u_int16_t duty) +{ + u_int32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; + + tmp = tmp << 16; /* extend value by 2^16 */ + 10899c: e1a00802 lsl r0, r2, #16 + tmp = tmp / 100; /* tmp = 1 % of extended cprd */ + 1089a0: e0802093 umull r2, r0, r3, r0 + 1089a4: e1a052a0 lsr r5, r0, #5 + tmp = duty * tmp; /* tmp = 'duty' % of extended cprd */ + 1089a8: e0050591 mul r5, r1, r5 + tmp = tmp >> 16; /* un-extend tmp (divide by 2^16) */ + 1089ac: e1a05825 lsr r5, r5, #16 + + DEBUGPWM("Writing %u to Update register\n", tmp); + 1089b0: e59f0020 ldr r0, [pc, #32] ; 1089d8 + 1089b4: e59f1020 ldr r1, [pc, #32] ; 1089dc + 1089b8: e3a02074 mov r2, #116 ; 0x74 + 1089bc: e1a03005 mov r3, r5 + 1089c0: ebfffd15 bl 107e1c +static inline void AT91F_PWMC_UpdateChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int channelId, // \arg PWM channel ID + unsigned int update) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; + 1089c4: e5845111 str r5, [r4, #273] ; 0x111 + AT91F_PWMC_UpdateChannel(AT91C_BASE_PWMC, channel, tmp); +} + 1089c8: e8bd4038 pop {r3, r4, r5, lr} + 1089cc: e12fff1e bx lr + 1089d0: fffcc0ff .word 0xfffcc0ff + 1089d4: 51eb851f .word 0x51eb851f + 1089d8: 0010ac78 .word 0x0010ac78 + 1089dc: 0010ac18 .word 0x0010ac18 + +001089e0 : + +static int pwm_usb_in(struct req_ctx *rctx) +{ + 1089e0: e92d4010 push {r4, lr} + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 1089e4: e5903008 ldr r3, [r0, #8] + u_int32_t *freq; + + switch (poh->cmd) { + 1089e8: e5d31000 ldrb r1, [r3] + 1089ec: e2412041 sub r2, r1, #65 ; 0x41 + DEBUGPWM("Writing %u to Update register\n", tmp); + AT91F_PWMC_UpdateChannel(AT91C_BASE_PWMC, channel, tmp); +} + +static int pwm_usb_in(struct req_ctx *rctx) +{ + 1089f0: e1a04000 mov r4, r0 + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int32_t *freq; + + switch (poh->cmd) { + 1089f4: e3520004 cmp r2, #4 + 1089f8: 979ff102 ldrls pc, [pc, r2, lsl #2] + 1089fc: ea000007 b 108a20 + 108a00: 00108a68 .word 0x00108a68 + 108a04: 00108a14 .word 0x00108a14 + 108a08: 00108a50 .word 0x00108a50 + 108a0c: 00108a34 .word 0x00108a34 + 108a10: 00108a50 .word 0x00108a50 + pwm_start(0); + else + pwm_stop(0); + break; + case OPENPCD_CMD_PWM_DUTY_SET: + pwm_duty_set_percent(0, poh->val); + 108a14: e3a00000 mov r0, #0 + 108a18: e5d31003 ldrb r1, [r3, #3] + 108a1c: ebffffd8 bl 108984 + break; + default: + break; + } + + req_ctx_put(rctx); + 108a20: e1a00004 mov r0, r4 + 108a24: ebfffd58 bl 107f8c + return 0; + 108a28: e3a00000 mov r0, #0 +respond: + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + udp_refill_ep(2); + return 1; +} + 108a2c: e8bd4010 pop {r4, lr} + 108a30: e12fff1e bx lr + break; + case OPENPCD_CMD_PWM_DUTY_GET: + goto respond; + break; + case OPENPCD_CMD_PWM_FREQ_SET: + if (rctx->tot_len < sizeof(*poh)+4) + 108a34: e1d0e0b6 ldrh lr, [r0, #6] + 108a38: e35e0007 cmp lr, #7 + 108a3c: 9afffff7 bls 108a20 + break; + freq = (u_int32_t *) ((unsigned char *) poh) + sizeof(*poh); + pwm_freq_set(0, *freq); + 108a40: e5931010 ldr r1, [r3, #16] + 108a44: e3a00000 mov r0, #0 + 108a48: ebffff79 bl 108834 + break; + 108a4c: eafffff3 b 108a20 + } + + req_ctx_put(rctx); + return 0; +respond: + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 108a50: e3a01010 mov r1, #16 + 108a54: ebfffd46 bl 107f74 + udp_refill_ep(2); + 108a58: e3a00002 mov r0, #2 + 108a5c: ebfffabd bl 107558 + return 1; + 108a60: e3a00001 mov r0, #1 + 108a64: eafffff0 b 108a2c + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int32_t *freq; + + switch (poh->cmd) { + case OPENPCD_CMD_PWM_ENABLE: + if (poh->val) + 108a68: e5d3c003 ldrb ip, [r3, #3] +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StartChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_ENA = flag; + 108a6c: e59f3010 ldr r3, [pc, #16] ; 108a84 + 108a70: e35c0000 cmp ip, #0 + 108a74: e3a00001 mov r0, #1 + 108a78: 150300fb strne r0, [r3, #-251] ; 0xffffff05 +//*---------------------------------------------------------------------------- +static inline void AT91F_PWMC_StopChannel( + AT91PS_PWMC pPWM, // \arg pointer to a PWM controller + unsigned int flag) // \arg Channels IDs to be enabled +{ + pPWM->PWMC_DIS = flag; + 108a7c: 050300f7 streq r0, [r3, #-247] ; 0xffffff09 + 108a80: eaffffe6 b 108a20 + 108a84: fffcc0ff .word 0xfffcc0ff + +00108a88 : + udp_refill_ep(2); + return 1; +} + +void pwm_init(void) +{ + 108a88: e92d4008 push {r3, lr} +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + 108a8c: e3e02c0b mvn r2, #2816 ; 0xb00 + 108a90: e3a03802 mov r3, #131072 ; 0x20000 + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + pPio->PIO_BSR = periphBEnable; + 108a94: e3a0e502 mov lr, #8388608 ; 0x800000 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 108a98: e3a0c000 mov ip, #0 +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + 108a9c: e50230eb str r3, [r2, #-235] ; 0xffffff15 + pPio->PIO_PER = inputEnable; + 108aa0: e50230ff str r3, [r2, #-255] ; 0xffffff01 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 108aa4: e502c08f str ip, [r2, #-143] ; 0xffffff71 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 108aa8: e3e03c03 mvn r3, #768 ; 0x300 + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + pPio->PIO_BSR = periphBEnable; + 108aac: e502e08b str lr, [r2, #-139] ; 0xffffff75 + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 108ab0: e502e0fb str lr, [r2, #-251] ; 0xffffff05 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 108ab4: e3a02b01 mov r2, #1024 ; 0x400 + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, OPENPCD_PIO_MFIN_PWM); + + /* Enable Clock for PWM controller */ + AT91F_PWMC_CfgPMC(); + + usb_hdlr_register(&pwm_usb_in, OPENPCD_CMD_CLS_PWM); + 108ab8: e3a01004 mov r1, #4 + 108abc: e50320ef str r2, [r3, #-239] ; 0xffffff11 + 108ac0: e59f0008 ldr r0, [pc, #8] ; 108ad0 + 108ac4: ebfffde5 bl 108260 +} + 108ac8: e8bd4008 pop {r3, lr} + 108acc: e12fff1e bx lr + 108ad0: 001089e0 .word 0x001089e0 + +00108ad4 : + +void pwm_fini(void) +{ + 108ad4: e92d4008 push {r3, lr} + usb_hdlr_unregister(OPENPCD_CMD_CLS_PWM); + 108ad8: e3a00004 mov r0, #4 + 108adc: ebfffde4 bl 108274 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_DisablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCDR = periphIds; + 108ae0: e3a02b01 mov r2, #1024 ; 0x400 + 108ae4: e3e03c03 mvn r3, #768 ; 0x300 + 108ae8: e50320eb str r2, [r3, #-235] ; 0xffffff15 + AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, (1 << AT91C_ID_PWMC)); +} + 108aec: e8bd4008 pop {r3, lr} + 108af0: e12fff1e bx lr + +00108af4 : +//* \brief Return PIO Interrupt Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + AT91PS_PIO pPio) // \arg pointer to a PIO controller +{ + return pPio->PIO_ISR; + 108af4: e3e00c0b mvn r0, #2816 ; 0xb00 + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_PIOA); +} + +/* regular interrupt handler, in case fast forcing for PIOA disabled */ +static void pio_irq_demux(void) +{ + 108af8: e92d4008 push {r3, lr} + 108afc: e51000b3 ldr r0, [r0, #-179] ; 0xffffff4d + u_int32_t pio = AT91F_PIO_GetInterruptStatus(AT91C_BASE_PIOA); + __pio_irq_demux(pio); + 108b00: e59f300c ldr r3, [pc, #12] ; 108b14 + 108b04: e1a0e00f mov lr, pc + 108b08: e12fff13 bx r3 +} + 108b0c: e8bd4008 pop {r3, lr} + 108b10: e12fff1e bx lr + 108b14: 002000e8 .word 0x002000e8 + +00108b18 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InterruptEnable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio interrupt to be enabled +{ + pPio->PIO_IER = flag; + 108b18: e3e03c0b mvn r3, #2816 ; 0xb00 + 108b1c: e50300bf str r0, [r3, #-191] ; 0xffffff41 + +void pio_irq_enable(u_int32_t pio) +{ + AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, pio); +} + 108b20: e12fff1e bx lr + +00108b24 : +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InterruptDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio interrupt to be disabled +{ + pPio->PIO_IDR = flag; + 108b24: e3e03c0b mvn r3, #2816 ; 0xb00 + 108b28: e50300bb str r0, [r3, #-187] ; 0xffffff45 + +void pio_irq_disable(u_int32_t pio) +{ + AT91F_PIO_InterruptDisable(AT91C_BASE_PIOA, pio); +} + 108b2c: e12fff1e bx lr + +00108b30 : + +int pio_irq_register(u_int32_t pio, irq_handler_t *handler) +{ + 108b30: e92d40f0 push {r4, r5, r6, r7, lr} + 108b34: e24dd00c sub sp, sp, #12 + 108b38: e1a04000 mov r4, r0 + 108b3c: e1a05001 mov r5, r1 + u_int8_t num = ffs(pio); + 108b40: eb00067f bl 10a544 <__ffssi2> + + if (num == 0) + 108b44: e21000ff ands r0, r0, #255 ; 0xff + return -EINVAL; + 108b48: 03e00015 mvneq r0, #21 + +int pio_irq_register(u_int32_t pio, irq_handler_t *handler) +{ + u_int8_t num = ffs(pio); + + if (num == 0) + 108b4c: 1a000002 bne 108b5c + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, pio); + pirqs.handlers[num] = handler; + DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + + return 0; +} + 108b50: e28dd00c add sp, sp, #12 + 108b54: e8bd40f0 pop {r4, r5, r6, r7, lr} + 108b58: e12fff1e bx lr +{ + u_int8_t num = ffs(pio); + + if (num == 0) + return -EINVAL; + num--; + 108b5c: e2400001 sub r0, r0, #1 + + if (pirqs.handlers[num]) + 108b60: e59f6044 ldr r6, [pc, #68] ; 108bac + 108b64: e200c0ff and ip, r0, #255 ; 0xff + 108b68: e796710c ldr r7, [r6, ip, lsl #2] + 108b6c: e3570000 cmp r7, #0 + return -EBUSY; + 108b70: 13e0000f mvnne r0, #15 + + if (num == 0) + return -EINVAL; + num--; + + if (pirqs.handlers[num]) + 108b74: 1afffff5 bne 108b50 + 108b78: e3e0ec0b mvn lr, #2816 ; 0xb00 + 108b7c: e50e40bb str r4, [lr, #-187] ; 0xffffff45 + return -EBUSY; + + pio_irq_disable(pio); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, pio); + pirqs.handlers[num] = handler; + DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 108b80: e59f0028 ldr r0, [pc, #40] ; 108bb0 +static inline void AT91F_PIO_CfgInput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int inputEnable) // \arg PIO to be enabled +{ + // Disable output + pPio->PIO_ODR = inputEnable; + 108b84: e50e40eb str r4, [lr, #-235] ; 0xffffff15 + 108b88: e59f1024 ldr r1, [pc, #36] ; 108bb4 + pPio->PIO_PER = inputEnable; + 108b8c: e50e40ff str r4, [lr, #-255] ; 0xffffff01 + 108b90: e3a0206d mov r2, #109 ; 0x6d + 108b94: e1a03005 mov r3, r5 + if (pirqs.handlers[num]) + return -EBUSY; + + pio_irq_disable(pio); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, pio); + pirqs.handlers[num] = handler; + 108b98: e786510c str r5, [r6, ip, lsl #2] + DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 108b9c: e58dc000 str ip, [sp] + 108ba0: ebfffc9d bl 107e1c + + return 0; + 108ba4: e1a00007 mov r0, r7 + 108ba8: eaffffe8 b 108b50 + 108bac: 00203844 .word 0x00203844 + 108bb0: 0010acec .word 0x0010acec + 108bb4: 0010acb4 .word 0x0010acb4 + +00108bb8 : +} + +void pio_irq_unregister(u_int32_t pio) +{ + 108bb8: e92d4010 push {r4, lr} + 108bbc: e1a04000 mov r4, r0 + u_int8_t num = ffs(pio); + 108bc0: eb00065f bl 10a544 <__ffssi2> + + if (num == 0) + 108bc4: e21000ff ands r0, r0, #255 ; 0xff + 108bc8: 0a000006 beq 108be8 + return; + num--; + 108bcc: e240c001 sub ip, r0, #1 + + pio_irq_disable(pio); + pirqs.handlers[num] = NULL; + 108bd0: e59f3018 ldr r3, [pc, #24] ; 108bf0 + 108bd4: e20c00ff and r0, ip, #255 ; 0xff +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_InterruptDisable( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg pio interrupt to be disabled +{ + pPio->PIO_IDR = flag; + 108bd8: e3e01c0b mvn r1, #2816 ; 0xb00 + 108bdc: e3a02000 mov r2, #0 + 108be0: e50140bb str r4, [r1, #-187] ; 0xffffff45 + 108be4: e7832100 str r2, [r3, r0, lsl #2] +} + 108be8: e8bd4010 pop {r4, lr} + 108bec: e12fff1e bx lr + 108bf0: 00203844 .word 0x00203844 + +00108bf4 : + + return 0; +} + +void pio_irq_init(void) +{ + 108bf4: e92d4010 push {r4, lr} + AT91F_PIOA_CfgPMC(); + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, + 108bf8: e3a02000 mov r2, #0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 108bfc: e3a04004 mov r4, #4 + 108c00: e3e0ec03 mvn lr, #768 ; 0x300 + 108c04: e59fc02c ldr ip, [pc, #44] ; 108c38 + + return 0; +} + +void pio_irq_init(void) +{ + 108c08: e24dd008 sub sp, sp, #8 + AT91F_PIOA_CfgPMC(); + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, + 108c0c: e1a03002 mov r3, r2 + 108c10: e50e40ef str r4, [lr, #-239] ; 0xffffff11 + 108c14: e59f0020 ldr r0, [pc, #32] ; 108c3c + 108c18: e3a01002 mov r1, #2 + 108c1c: e58dc000 str ip, [sp] + 108c20: ebffee59 bl 10458c +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 108c24: e3e03c0f mvn r3, #3840 ; 0xf00 + 108c28: e5834021 str r4, [r3, #33] ; 0x21 + AT91C_AIC_PRIOR_LOWEST, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &pio_irq_demux); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA); +} + 108c2c: e28dd008 add sp, sp, #8 + 108c30: e8bd4010 pop {r4, lr} + 108c34: e12fff1e bx lr + 108c38: 00108af4 .word 0x00108af4 + 108c3c: fffff000 .word 0xfffff000 + +00108c40 : + + return len; +} + +static int gen_usb_rx(struct req_ctx *rctx) +{ + 108c40: e92d4070 push {r4, r5, r6, lr} + struct openpcd_compile_version *ver = + (struct openpcd_compile_version *)poh->data; + u_int32_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + 108c44: e3a0c004 mov ip, #4 + return len; +} + +static int gen_usb_rx(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 108c48: e5904008 ldr r4, [r0, #8] + struct openpcd_compile_version *ver = + (struct openpcd_compile_version *)poh->data; + u_int32_t len = rctx->tot_len-sizeof(*poh); + 108c4c: e1d020b6 ldrh r2, [r0, #6] + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + 108c50: e1c0c0b6 strh ip, [r0, #6] + + switch (poh->cmd) { + 108c54: e5d41000 ldrb r1, [r4] + 108c58: e2413001 sub r3, r1, #1 + + return len; +} + +static int gen_usb_rx(struct req_ctx *rctx) +{ + 108c5c: e24dd008 sub sp, sp, #8 + 108c60: e1a05000 mov r5, r0 + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + struct openpcd_compile_version *ver = + (struct openpcd_compile_version *)poh->data; + 108c64: e2841004 add r1, r4, #4 + u_int32_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + 108c68: e3530006 cmp r3, #6 + 108c6c: 979ff103 ldrls pc, [pc, r3, lsl #2] + 108c70: ea00000f b 108cb4 + 108c74: 00108cbc .word 0x00108cbc + 108c78: 00108cec .word 0x00108cec + 108c7c: 00108d00 .word 0x00108d00 + 108c80: 00108d34 .word 0x00108d34 + 108c84: 00108d4c .word 0x00108d4c + 108c88: 00108d84 .word 0x00108d84 + 108c8c: 00108c90 .word 0x00108c90 +//*---------------------------------------------------------------------------- +static inline void AT91F_RSTSoftReset( + AT91PS_RSTC pRSTC, + unsigned int reset) +{ + pRSTC->RSTC_RCR = (0xA5000000 | reset); + 108c90: e59f1150 ldr r1, [pc, #336] ; 108de8 + 108c94: e3e03c02 mvn r3, #512 ; 0x200 + 108c98: e50310ff str r1, [r3, #-255] ; 0xffffff01 + 108c9c: e5d40001 ldrb r0, [r4, #1] + DEBUGP("UNKNOWN\n"); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + break; + } + + if (poh->flags & OPENPCD_FLAG_RESPOND) + 108ca0: e2100001 ands r0, r0, #1 + return USB_RET_RESPOND; + 108ca4: 13a00c01 movne r0, #256 ; 0x100 + return 0; +} + 108ca8: e28dd008 add sp, sp, #8 + 108cac: e8bd4070 pop {r4, r5, r6, lr} + 108cb0: e12fff1e bx lr +#endif + break; + + default: + DEBUGP("UNKNOWN\n"); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + 108cb4: e59f0130 ldr r0, [pc, #304] ; 108dec + 108cb8: eafffffa b 108ca8 + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + + case OPENPCD_CMD_GET_VERSION: + DEBUGP("GET_VERSION\n"); + poh->flags |= OPENPCD_FLAG_RESPOND; + 108cbc: e5d40001 ldrb r0, [r4, #1] + 108cc0: e380e001 orr lr, r0, #1 + memcpy(ver, &opcd_version, sizeof(*ver)); + 108cc4: e3a02030 mov r2, #48 ; 0x30 + 108cc8: e1a00001 mov r0, r1 + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + + case OPENPCD_CMD_GET_VERSION: + DEBUGP("GET_VERSION\n"); + poh->flags |= OPENPCD_FLAG_RESPOND; + 108ccc: e5c4e001 strb lr, [r4, #1] + memcpy(ver, &opcd_version, sizeof(*ver)); + 108cd0: e59f1118 ldr r1, [pc, #280] ; 108df0 + 108cd4: eb00050c bl 10a10c + rctx->tot_len += sizeof(*ver); + 108cd8: e1d520b6 ldrh r2, [r5, #6] + 108cdc: e282c030 add ip, r2, #48 ; 0x30 + 108ce0: e1c5c0b6 strh ip, [r5, #6] + 108ce4: e5d40001 ldrb r0, [r4, #1] + break; + 108ce8: eaffffec b 108ca0 + + case OPENPCD_CMD_SET_LED: + DEBUGP("SET LED(%u,%u)\n", poh->reg, poh->val); + led_switch(poh->reg, poh->val); + 108cec: e5d40002 ldrb r0, [r4, #2] + 108cf0: e5d41003 ldrb r1, [r4, #3] + 108cf4: ebfffc61 bl 107e80 + 108cf8: e5d40001 ldrb r0, [r4, #1] + break; + 108cfc: eaffffe7 b 108ca0 + + case OPENPCD_CMD_GET_SERIAL: + DEBUGP("GET SERIAL("); + poh->flags |= OPENPCD_FLAG_RESPOND; + 108d00: e5d4e001 ldrb lr, [r4, #1] + 108d04: e38e2001 orr r2, lr, #1 + 108d08: e5c42001 strb r2, [r4, #1] +#ifdef PCD + rctx->tot_len += 4; + 108d0c: e1d0c0b6 ldrh ip, [r0, #6] + 108d10: e28c3004 add r3, ip, #4 + 108d14: e1c030b6 strh r3, [r0, #6] + if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + 108d18: e3a00000 mov r0, #0 + 108d1c: eb00047c bl 109f14 + 108d20: e3500000 cmp r0, #0 + DEBUGP("ERROR) "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 108d24: b59f00c8 ldrlt r0, [pc, #200] ; 108df4 + case OPENPCD_CMD_GET_SERIAL: + DEBUGP("GET SERIAL("); + poh->flags |= OPENPCD_FLAG_RESPOND; +#ifdef PCD + rctx->tot_len += 4; + if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + 108d28: baffffde blt 108ca8 + 108d2c: e5d40001 ldrb r0, [r4, #1] + 108d30: eaffffda b 108ca0 + + switch (poh->cmd) { + + case OPENPCD_CMD_GET_API_VERSION: + DEBUGP("CMD_GET_API_VERSION\n"); + poh->flags &= OPENPCD_FLAG_RESPOND; + 108d34: e5d40001 ldrb r0, [r4, #1] + poh->val = OPENPCD_API_VERSION; + 108d38: e3a02001 mov r2, #1 + + switch (poh->cmd) { + + case OPENPCD_CMD_GET_API_VERSION: + DEBUGP("CMD_GET_API_VERSION\n"); + poh->flags &= OPENPCD_FLAG_RESPOND; + 108d3c: e2000001 and r0, r0, #1 + 108d40: e5c40001 strb r0, [r4, #1] + poh->val = OPENPCD_API_VERSION; + 108d44: e5c42003 strb r2, [r4, #3] + break; + 108d48: eaffffd4 b 108ca0 + + case OPENPCD_CMD_GET_ENVIRONMENT: + poh->flags &= OPENPCD_FLAG_RESPOND; + 108d4c: e5d4c001 ldrb ip, [r4, #1] + poh->val = gen_getenv(&poh->data,poh->val); + 108d50: e5d46003 ldrb r6, [r4, #3] + poh->flags &= OPENPCD_FLAG_RESPOND; + poh->val = OPENPCD_API_VERSION; + break; + + case OPENPCD_CMD_GET_ENVIRONMENT: + poh->flags &= OPENPCD_FLAG_RESPOND; + 108d54: e20ce001 and lr, ip, #1 +static int gen_getenv(void* buffer,int len) +{ + if( len >= sizeof(config_stack) ) + len=sizeof(config_stack); + + memcpy(buffer,&config_stack,len); + 108d58: e1a00001 mov r0, r1 + 108d5c: e1a02006 mov r2, r6 + poh->flags &= OPENPCD_FLAG_RESPOND; + poh->val = OPENPCD_API_VERSION; + break; + + case OPENPCD_CMD_GET_ENVIRONMENT: + poh->flags &= OPENPCD_FLAG_RESPOND; + 108d60: e5c4e001 strb lr, [r4, #1] +static int gen_getenv(void* buffer,int len) +{ + if( len >= sizeof(config_stack) ) + len=sizeof(config_stack); + + memcpy(buffer,&config_stack,len); + 108d64: e59f108c ldr r1, [pc, #140] ; 108df8 + 108d68: eb0004e7 bl 10a10c + poh->val = OPENPCD_API_VERSION; + break; + + case OPENPCD_CMD_GET_ENVIRONMENT: + poh->flags &= OPENPCD_FLAG_RESPOND; + poh->val = gen_getenv(&poh->data,poh->val); + 108d6c: e5c46003 strb r6, [r4, #3] + rctx->tot_len += poh->val; + 108d70: e1d530b6 ldrh r3, [r5, #6] + 108d74: e0866003 add r6, r6, r3 + 108d78: e1c560b6 strh r6, [r5, #6] + 108d7c: e5d40001 ldrb r0, [r4, #1] + DEBUGP("CMD_GET_ENVIRONMENT(res_len=%u)\n", poh->val); + break; + 108d80: eaffffc6 b 108ca0 +static int gen_usb_rx(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + struct openpcd_compile_version *ver = + (struct openpcd_compile_version *)poh->data; + u_int32_t len = rctx->tot_len-sizeof(*poh); + 108d84: e2422004 sub r2, r2, #4 + u_int32_t *dst; + + if( len >= sizeof(config_stack) ) + len=sizeof(config_stack); + + memcpy(&config_stack,buffer,len); + 108d88: e35200ff cmp r2, #255 ; 0xff + 108d8c: 83a02c01 movhi r2, #256 ; 0x100 + 108d90: e59f0060 ldr r0, [pc, #96] ; 108df8 + 108d94: eb0004dc bl 10a10c + + /* retrieve current content to allow partial flashing */ + + /* flash changes */ + dst=(u_int32_t*)CONFIG_AREA_ADDR; + for(i=0;i + 108dac: e59f3048 ldr r3, [pc, #72] ; 108dfc + 108db0: e59f1040 ldr r1, [pc, #64] ; 108df8 + *dst++=config_stack[i]; + 108db4: e59d0004 ldr r0, [sp, #4] + 108db8: e7912100 ldr r2, [r1, r0, lsl #2] + 108dbc: e4832004 str r2, [r3], #4 + + /* retrieve current content to allow partial flashing */ + + /* flash changes */ + dst=(u_int32_t*)CONFIG_AREA_ADDR; + for(i=0;i + *dst++=config_stack[i]; + + flash_page(CONFIG_AREA_ADDR); + 108dd8: e59f001c ldr r0, [pc, #28] ; 108dfc + 108ddc: eb00015d bl 109358 + 108de0: e5d40001 ldrb r0, [r4, #1] + break; + + case OPENPCD_CMD_SET_ENVIRONMENT: + DEBUGP("CMD_SET_ENVIRONMENT (in_len=%u)\n", len); + gen_setenv(&poh->data,len); + break; + 108de4: eaffffad b 108ca0 + 108de8: a500000d .word 0xa500000d + 108dec: 00000301 .word 0x00000301 + 108df0: 0010ab0c .word 0x0010ab0c + 108df4: 00000302 .word 0x00000302 + 108df8: 00203a18 .word 0x00203a18 + 108dfc: 0011ff00 .word 0x0011ff00 + +00108e00 : + return USB_RET_RESPOND; + return 0; +} + +void usbcmd_gen_init(void) +{ + 108e00: e92d4008 push {r3, lr} + DEBUGP("Inititalizing usbcmd_gen_init\n"); + /* setup FLASH write support for environment storage */ + flash_init(); + 108e04: eb00017b bl 1093f8 + + /* retrieve default data from flash */ + memcpy(&config_stack,CONFIG_AREA_ADDR,sizeof(config_stack)); + 108e08: e59f101c ldr r1, [pc, #28] ; 108e2c + 108e0c: e3a02c01 mov r2, #256 ; 0x100 + 108e10: e59f0018 ldr r0, [pc, #24] ; 108e30 + 108e14: eb0004bc bl 10a10c + + usb_hdlr_register(&gen_usb_rx, OPENPCD_CMD_CLS_GENERIC); + 108e18: e3a01000 mov r1, #0 + 108e1c: e59f0010 ldr r0, [pc, #16] ; 108e34 + 108e20: ebfffd0e bl 108260 +} + 108e24: e8bd4008 pop {r3, lr} + 108e28: e12fff1e bx lr + 108e2c: 0011ff00 .word 0x0011ff00 + 108e30: 00203a18 .word 0x00203a18 + 108e34: 00108c40 .word 0x00108c40 + +00108e38 : +#ifdef WDT_DEBUG +#undef WDT_DEBUG +#endif/*WDT_DEBUG*/ + +static void wdt_irq(u_int32_t sr) +{ + 108e38: e92d4008 push {r3, lr} + DEBUGPCRF("================> WATCHDOG EXPIRED !!!!!"); + 108e3c: e59f0010 ldr r0, [pc, #16] ; 108e54 + 108e40: e59f1010 ldr r1, [pc, #16] ; 108e58 + 108e44: e3a02020 mov r2, #32 + 108e48: ebfffbf3 bl 107e1c +} + 108e4c: e8bd4008 pop {r3, lr} + 108e50: e12fff1e bx lr + 108e54: 0010ad24 .word 0x0010ad24 + 108e58: 0010ad1c .word 0x0010ad1c + +00108e5c : +//* \brief Restart Watchdog +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTRestart( + AT91PS_WDTC pWDTC) +{ + pWDTC->WDTC_WDCR = 0xA5000001; + 108e5c: e59f2008 ldr r2, [pc, #8] ; 108e6c + 108e60: e3e03c02 mvn r3, #512 ; 0x200 + 108e64: e50320bf str r2, [r3, #-191] ; 0xffffff41 + +void wdt_restart(void) +{ + AT91F_WDTRestart(AT91C_BASE_WDTC); +} + 108e68: e12fff1e bx lr + 108e6c: a5000001 .word 0xa5000001 + +00108e70 : + +void wdt_init(void) +{ + 108e70: e92d4008 push {r3, lr} + sysirq_register(AT91SAM7_SYSIRQ_WDT, &wdt_irq); + 108e74: e3a00003 mov r0, #3 + 108e78: e59f1014 ldr r1, [pc, #20] ; 108e94 + 108e7c: eb00011f bl 109300 +//*---------------------------------------------------------------------------- +static inline void AT91F_WDTSetMode( + AT91PS_WDTC pWDTC, + unsigned int Mode) +{ + pWDTC->WDTC_WDMR = Mode; + 108e80: e59f2010 ldr r2, [pc, #16] ; 108e98 + 108e84: e3e03c02 mvn r3, #512 ; 0x200 + 108e88: e50320bb str r2, [r3, #-187] ; 0xffffff45 + AT91C_WDTC_WDFIEN); +#else + AT91F_WDTSetMode(AT91C_BASE_WDTC, (0x80 << 16) | + AT91C_WDTC_WDRSTEN | 0x80); +#endif +} + 108e8c: e8bd4008 pop {r3, lr} + 108e90: e12fff1e bx lr + 108e94: 00108e38 .word 0x00108e38 + 108e98: 00802080 .word 0x00802080 + +00108e9c : +}; + +static struct blinker blink_state[NUM_LEDS]; + +static void blinkcode_cb(void *data) +{ + 108e9c: e92d4030 push {r4, r5, lr} + /* we got called back by the timer */ + struct blinker *bl = data; + + DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + 108ea0: e59f513c ldr r5, [pc, #316] ; 108fe4 + 108ea4: e5d0c010 ldrb ip, [r0, #16] +}; + +static struct blinker blink_state[NUM_LEDS]; + +static void blinkcode_cb(void *data) +{ + 108ea8: e24dd00c sub sp, sp, #12 + 108eac: e1a04000 mov r4, r0 + /* we got called back by the timer */ + struct blinker *bl = data; + + DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + 108eb0: e5953000 ldr r3, [r5] + 108eb4: e59f012c ldr r0, [pc, #300] ; 108fe8 + 108eb8: e59f112c ldr r1, [pc, #300] ; 108fec + 108ebc: e3a0202a mov r2, #42 ; 0x2a + 108ec0: e88d1010 stm sp, {r4, ip} + 108ec4: ebfffbd4 bl 107e1c + jiffies, data, bl->state); + switch (bl->state) { + 108ec8: e5d43010 ldrb r3, [r4, #16] + 108ecc: e3530005 cmp r3, #5 + 108ed0: 979ff103 ldrls pc, [pc, r3, lsl #2] + 108ed4: ea00000d b 108f10 + 108ed8: 00108f34 .word 0x00108f34 + 108edc: 00108f60 .word 0x00108f60 + 108ee0: 00108f84 .word 0x00108f84 + 108ee4: 00108fa8 .word 0x00108fa8 + 108ee8: 00108ef0 .word 0x00108ef0 + 108eec: 00108f24 .word 0x00108f24 + if (bl->cur <= 0) + bl->state = BLINKCODE_STATE_DONE; + break; + case BLINKCODE_STATE_BLINK_ON: + /* we've been on, turn off */ + led_switch(bl->led, 0); + 108ef0: e5d4001c ldrb r0, [r4, #28] + 108ef4: e3a01000 mov r1, #0 + 108ef8: ebfffbe0 bl 107e80 + bl->state = BLINKCODE_STATE_BLINK_OFF; + bl->timer.expires = jiffies + TIME_BLINK; + 108efc: e5951000 ldr r1, [r5] + bl->state = BLINKCODE_STATE_DONE; + break; + case BLINKCODE_STATE_BLINK_ON: + /* we've been on, turn off */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + 108f00: e3a02003 mov r2, #3 + bl->timer.expires = jiffies + TIME_BLINK; + 108f04: e2810019 add r0, r1, #25 + bl->state = BLINKCODE_STATE_DONE; + break; + case BLINKCODE_STATE_BLINK_ON: + /* we've been on, turn off */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + 108f08: e5c42010 strb r2, [r4, #16] + bl->timer.expires = jiffies + TIME_BLINK; + 108f0c: e5840004 str r0, [r4, #4] + led_switch(bl->led, 0); + return; + break; + } + /* default case: re-add the timer */ + timer_add(&bl->timer); + 108f10: e1a00004 mov r0, r4 + 108f14: ebfffdf9 bl 108700 +} + 108f18: e28dd00c add sp, sp, #12 + 108f1c: e8bd4030 pop {r4, r5, lr} + 108f20: e12fff1e bx lr + bl->state = BLINKCODE_STATE_BLINK_OFF; + bl->timer.expires = jiffies + TIME_BLINK; + break; + case BLINKCODE_STATE_DONE: + /* we've been on, turn off */ + led_switch(bl->led, 0); + 108f24: e5d4001c ldrb r0, [r4, #28] + 108f28: e3a01000 mov r1, #0 + 108f2c: ebfffbd3 bl 107e80 + return; + 108f30: eafffff8 b 108f18 + + DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + jiffies, data, bl->state); + switch (bl->state) { + case BLINKCODE_STATE_NONE: + led_switch(bl->led, 0); + 108f34: e5d4001c ldrb r0, [r4, #28] + 108f38: e3a01000 mov r1, #0 + 108f3c: ebfffbcf bl 107e80 + bl->state = BLINKCODE_STATE_SILENT; + bl->timer.expires = jiffies + TIME_SILENT; + 108f40: e5953000 ldr r3, [r5] + bl->cur = bl->num; + 108f44: e5940014 ldr r0, [r4, #20] + jiffies, data, bl->state); + switch (bl->state) { + case BLINKCODE_STATE_NONE: + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_SILENT; + bl->timer.expires = jiffies + TIME_SILENT; + 108f48: e2832064 add r2, r3, #100 ; 0x64 + DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + jiffies, data, bl->state); + switch (bl->state) { + case BLINKCODE_STATE_NONE: + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_SILENT; + 108f4c: e3a01001 mov r1, #1 + 108f50: e5c41010 strb r1, [r4, #16] + bl->timer.expires = jiffies + TIME_SILENT; + 108f54: e5842004 str r2, [r4, #4] + bl->cur = bl->num; + 108f58: e5840018 str r0, [r4, #24] + break; + 108f5c: eaffffeb b 108f10 + case BLINKCODE_STATE_SILENT: + /* we've finished the period of silence, turn led on */ + led_switch(bl->led, 1); + 108f60: e5d4001c ldrb r0, [r4, #28] + 108f64: e3a01001 mov r1, #1 + 108f68: ebfffbc4 bl 107e80 + bl->state = BLINKCODE_STATE_INIT; + bl->timer.expires = jiffies + TIME_INIT; + 108f6c: e5952000 ldr r2, [r5] + bl->cur = bl->num; + break; + case BLINKCODE_STATE_SILENT: + /* we've finished the period of silence, turn led on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_INIT; + 108f70: e3a00002 mov r0, #2 + bl->timer.expires = jiffies + TIME_INIT; + 108f74: e282c064 add ip, r2, #100 ; 0x64 + bl->cur = bl->num; + break; + case BLINKCODE_STATE_SILENT: + /* we've finished the period of silence, turn led on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_INIT; + 108f78: e5c40010 strb r0, [r4, #16] + bl->timer.expires = jiffies + TIME_INIT; + 108f7c: e584c004 str ip, [r4, #4] + break; + 108f80: eaffffe2 b 108f10 + case BLINKCODE_STATE_INIT: + /* we've finished the period of init */ + led_switch(bl->led, 0); + 108f84: e3a01000 mov r1, #0 + 108f88: e5d4001c ldrb r0, [r4, #28] + 108f8c: ebfffbbb bl 107e80 + bl->state = BLINKCODE_STATE_BLINK_OFF; + bl->timer.expires = jiffies + TIME_INIT; + 108f90: e595c000 ldr ip, [r5] + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_INIT: + /* we've finished the period of init */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + 108f94: e3a03003 mov r3, #3 + bl->timer.expires = jiffies + TIME_INIT; + 108f98: e28c1064 add r1, ip, #100 ; 0x64 + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_INIT: + /* we've finished the period of init */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + 108f9c: e5c43010 strb r3, [r4, #16] + bl->timer.expires = jiffies + TIME_INIT; + 108fa0: e5841004 str r1, [r4, #4] + break; + 108fa4: eaffffd9 b 108f10 + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + 108fa8: e5d4001c ldrb r0, [r4, #28] + 108fac: e3a01001 mov r1, #1 + 108fb0: ebfffbb2 bl 107e80 + bl->state = BLINKCODE_STATE_BLINK_ON; + bl->cur--; + 108fb4: e5943018 ldr r3, [r4, #24] + bl->timer.expires = jiffies + TIME_BLINK; + 108fb8: e595c000 ldr ip, [r5] + break; + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_BLINK_ON; + bl->cur--; + 108fbc: e2430001 sub r0, r3, #1 + bl->timer.expires = jiffies + TIME_BLINK; + if (bl->cur <= 0) + 108fc0: e3500000 cmp r0, #0 + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_BLINK_ON; + bl->cur--; + bl->timer.expires = jiffies + TIME_BLINK; + 108fc4: e28c2019 add r2, ip, #25 + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_BLINK_ON; + 108fc8: e3a01004 mov r1, #4 + bl->cur--; + 108fcc: e5840018 str r0, [r4, #24] + bl->timer.expires = jiffies + TIME_BLINK; + if (bl->cur <= 0) + bl->state = BLINKCODE_STATE_DONE; + 108fd0: d3a00005 movle r0, #5 + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_BLINK_ON; + 108fd4: e5c41010 strb r1, [r4, #16] + bl->cur--; + bl->timer.expires = jiffies + TIME_BLINK; + 108fd8: e5842004 str r2, [r4, #4] + if (bl->cur <= 0) + bl->state = BLINKCODE_STATE_DONE; + 108fdc: d5c40010 strble r0, [r4, #16] + 108fe0: eaffffca b 108f10 + 108fe4: 00203a14 .word 0x00203a14 + 108fe8: 0010ad78 .word 0x0010ad78 + 108fec: 0010ad58 .word 0x0010ad58 + +00108ff0 : + /* default case: re-add the timer */ + timer_add(&bl->timer); +} + +void blinkcode_set(int led, enum blinkcode_num num) +{ + 108ff0: e92d4070 push {r4, r5, r6, lr} + DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + 108ff4: e59f6074 ldr r6, [pc, #116] ; 109070 + /* default case: re-add the timer */ + timer_add(&bl->timer); +} + +void blinkcode_set(int led, enum blinkcode_num num) +{ + 108ff8: e24dd008 sub sp, sp, #8 + 108ffc: e1a04000 mov r4, r0 + 109000: e1a05001 mov r5, r1 + DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + 109004: e58d4000 str r4, [sp] + 109008: e5963000 ldr r3, [r6] + 10900c: e59f0060 ldr r0, [pc, #96] ; 109074 + 109010: e59f1060 ldr r1, [pc, #96] ; 109078 + 109014: e3a02059 mov r2, #89 ; 0x59 + + if (--led > NUM_LEDS) + 109018: e2444001 sub r4, r4, #1 + timer_add(&bl->timer); +} + +void blinkcode_set(int led, enum blinkcode_num num) +{ + DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + 10901c: e58d5004 str r5, [sp, #4] + 109020: ebfffb7d bl 107e1c + + if (--led > NUM_LEDS) + 109024: e3540002 cmp r4, #2 + 109028: da000002 ble 109038 + blink_state[led].state = BLINKCODE_STATE_NONE; + blink_state[led].timer.expires = jiffies; + + if (num != BLINKCODE_NONE) + timer_add(&blink_state[led].timer); +} + 10902c: e28dd008 add sp, sp, #8 + 109030: e8bd4070 pop {r4, r5, r6, lr} + 109034: e12fff1e bx lr + DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + + if (--led > NUM_LEDS) + return; + + timer_del(&blink_state[led].timer); + 109038: e59f003c ldr r0, [pc, #60] ; 10907c + 10903c: e0804284 add r4, r0, r4, lsl #5 + 109040: e1a00004 mov r0, r4 + 109044: ebfffd6d bl 108600 + + blink_state[led].num = num; + blink_state[led].state = BLINKCODE_STATE_NONE; + blink_state[led].timer.expires = jiffies; + 109048: e5963000 ldr r3, [r6] + return; + + timer_del(&blink_state[led].timer); + + blink_state[led].num = num; + blink_state[led].state = BLINKCODE_STATE_NONE; + 10904c: e3a02000 mov r2, #0 + blink_state[led].timer.expires = jiffies; + + if (num != BLINKCODE_NONE) + 109050: e3550000 cmp r5, #0 + if (--led > NUM_LEDS) + return; + + timer_del(&blink_state[led].timer); + + blink_state[led].num = num; + 109054: e5845014 str r5, [r4, #20] + blink_state[led].state = BLINKCODE_STATE_NONE; + 109058: e5c42010 strb r2, [r4, #16] + blink_state[led].timer.expires = jiffies; + 10905c: e5843004 str r3, [r4, #4] + + if (num != BLINKCODE_NONE) + 109060: 0afffff1 beq 10902c + timer_add(&blink_state[led].timer); + 109064: e1a00004 mov r0, r4 + 109068: ebfffda4 bl 108700 + 10906c: eaffffee b 10902c + 109070: 00203a14 .word 0x00203a14 + 109074: 0010ada4 .word 0x0010ada4 + 109078: 0010ad68 .word 0x0010ad68 + 10907c: 002038cc .word 0x002038cc + +00109080 : +void blinkcode_init(void) +{ + int i; + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + 109080: e59f303c ldr r3, [pc, #60] ; 1090c4 + 109084: e3a02000 mov r2, #0 + blink_state[i].state = BLINKCODE_STATE_NONE; + blink_state[i].led = i+1; + blink_state[i].timer.data = &blink_state[i]; + blink_state[i].timer.function = &blinkcode_cb; + 109088: e59f1038 ldr r1, [pc, #56] ; 1090c8 + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + blink_state[i].state = BLINKCODE_STATE_NONE; + blink_state[i].led = i+1; + blink_state[i].timer.data = &blink_state[i]; + 10908c: e2830020 add r0, r3, #32 +void blinkcode_init(void) +{ + int i; + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + 109090: e5832014 str r2, [r3, #20] + blink_state[i].state = BLINKCODE_STATE_NONE; + 109094: e5c32010 strb r2, [r3, #16] + blink_state[i].led = i+1; + 109098: e3a0c001 mov ip, #1 +void blinkcode_init(void) +{ + int i; + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + 10909c: e5832034 str r2, [r3, #52] ; 0x34 + blink_state[i].state = BLINKCODE_STATE_NONE; + 1090a0: e5c32030 strb r2, [r3, #48] ; 0x30 + blink_state[i].led = i+1; + 1090a4: e3a02002 mov r2, #2 + 1090a8: e5c3c01c strb ip, [r3, #28] + blink_state[i].timer.data = &blink_state[i]; + 1090ac: e583300c str r3, [r3, #12] + blink_state[i].timer.function = &blinkcode_cb; + 1090b0: e5831008 str r1, [r3, #8] + int i; + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + blink_state[i].state = BLINKCODE_STATE_NONE; + blink_state[i].led = i+1; + 1090b4: e5c3203c strb r2, [r3, #60] ; 0x3c + blink_state[i].timer.data = &blink_state[i]; + 1090b8: e583002c str r0, [r3, #44] ; 0x2c + blink_state[i].timer.function = &blinkcode_cb; + 1090bc: e5831028 str r1, [r3, #40] ; 0x28 + } +} + 1090c0: e12fff1e bx lr + 1090c4: 002038cc .word 0x002038cc + 1090c8: 00108e9c .word 0x00108e9c + +001090cc : + + /* Somehow Atmel decided to do really stupid interrupt sharing + * for commonly-used interrupts such as the timer irq */ + + /* dbgu */ + if (*AT91C_DBGU_IMR) { + 1090cc: e3e02000 mvn r2, #0 +#include "../openpcd.h" + +static sysirq_hdlr *sysirq_hdlrs[AT91SAM7_SYSIRQ_COUNT]; + +static void sys_irq(void) +{ + 1090d0: e92d4008 push {r3, lr} + + /* Somehow Atmel decided to do really stupid interrupt sharing + * for commonly-used interrupts such as the timer irq */ + + /* dbgu */ + if (*AT91C_DBGU_IMR) { + 1090d4: e5123def ldr r3, [r2, #-3567] ; 0xfffff211 + 1090d8: e3530000 cmp r3, #0 + 1090dc: 0a000003 beq 1090f0 + sr = *AT91C_DBGU_CSR; + 1090e0: e5120deb ldr r0, [r2, #-3563] ; 0xfffff215 + if (sr & *AT91C_DBGU_IMR) { + 1090e4: e5121def ldr r1, [r2, #-3567] ; 0xfffff211 + 1090e8: e1110000 tst r1, r0 + 1090ec: 1a000062 bne 10927c + DEBUGP(") "); + } + } + + /* pit_irq */ + if (*AT91C_PITC_PIMR & AT91C_PITC_PITIEN) { + 1090f0: e3e02000 mvn r2, #0 + 1090f4: e51232cf ldr r3, [r2, #-719] ; 0xfffffd31 + 1090f8: e3130402 tst r3, #33554432 ; 0x2000000 + 1090fc: 0a000002 beq 10910c + sr = *AT91C_PITC_PISR; + 109100: e51202cb ldr r0, [r2, #-715] ; 0xfffffd35 + if (sr & AT91C_PITC_PITS) { + 109104: e3100001 tst r0, #1 + 109108: 1a000054 bne 109260 + } + } + } + + /* rtt_irq */ + if (*AT91C_RTTC_RTMR & (AT91C_RTTC_ALMIEN|AT91C_RTTC_RTTINCIEN)) { + 10910c: e3e02000 mvn r2, #0 + 109110: e51232df ldr r3, [r2, #-735] ; 0xfffffd21 + 109114: e3130803 tst r3, #196608 ; 0x30000 + 109118: 0a000002 beq 109128 + sr = *AT91C_RTTC_RTSR; + 10911c: e51202d3 ldr r0, [r2, #-723] ; 0xfffffd2d + if (sr) { + 109120: e3500000 cmp r0, #0 + 109124: 1a000046 bne 109244 + DEBUGP(") "); + } + } + + /* pmc_irq */ + if (*AT91C_PMC_IMR) { + 109128: e3e02000 mvn r2, #0 + 10912c: e5123393 ldr r3, [r2, #-915] ; 0xfffffc6d + 109130: e3530000 cmp r3, #0 + 109134: 0a000003 beq 109148 + sr = *AT91C_PMC_SR; + 109138: e5120397 ldr r0, [r2, #-919] ; 0xfffffc69 + if (sr & *AT91C_PMC_IMR) { + 10913c: e5121393 ldr r1, [r2, #-915] ; 0xfffffc6d + 109140: e1110000 tst r1, r0 + 109144: 1a000037 bne 109228 + DEBUGP(") "); + } + } + + /* rstc_irq */ + if (*AT91C_RSTC_RMR & (AT91C_RSTC_URSTIEN|AT91C_RSTC_BODIEN)) { + 109148: e3e02000 mvn r2, #0 + 10914c: e51212f7 ldr r1, [r2, #-759] ; 0xfffffd09 + 109150: e59fc1a0 ldr ip, [pc, #416] ; 1092f8 + 109154: e001300c and r3, r1, ip + 109158: e3530000 cmp r3, #0 + 10915c: 0a000002 beq 10916c + sr = *AT91C_RSTC_RSR; + 109160: e51202fb ldr r0, [r2, #-763] ; 0xfffffd05 + if (sr & (AT91C_RSTC_URSTS|AT91C_RSTC_BODSTS)) { + 109164: e3100003 tst r0, #3 + 109168: 1a000027 bne 10920c + DEBUGP(") "); + } + } + + /* mc_irq */ + if (*AT91C_MC_FMR & (AT91C_MC_LOCKE | AT91C_MC_PROGE)) { + 10916c: e3e03000 mvn r3, #0 + 109170: e513209f ldr r2, [r3, #-159] ; 0xffffff61 + 109174: e312000c tst r2, #12 + 109178: 0a00000b beq 1091ac + sr = *AT91C_MC_FSR; + 10917c: e5130097 ldr r0, [r3, #-151] ; 0xffffff69 + if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + 109180: e513309f ldr r3, [r3, #-159] ; 0xffffff61 + 109184: e3130004 tst r3, #4 + 109188: 0a000018 beq 1091f0 + 10918c: e3100004 tst r0, #4 + 109190: 0a000016 beq 1091f0 + (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + DEBUGP("EFC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC]) { + 109194: e59f2160 ldr r2, [pc, #352] ; 1092fc + 109198: e5923008 ldr r3, [r2, #8] + 10919c: e3530000 cmp r3, #0 + 1091a0: 0a00004f beq 1092e4 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC](sr); + 1091a4: e1a0e00f mov lr, pc + 1091a8: e12fff13 bx r3 + DEBUGP(") "); + } + } + + /* wdt_irq */ + if (*AT91C_WDTC_WDMR & AT91C_WDTC_WDFIEN) { + 1091ac: e3e03000 mvn r3, #0 + 1091b0: e51312bb ldr r1, [r3, #-699] ; 0xfffffd45 + 1091b4: e3110a01 tst r1, #4096 ; 0x1000 + 1091b8: 0a000007 beq 1091dc + sr = *AT91C_WDTC_WDSR; + 1091bc: e51302b7 ldr r0, [r3, #-695] ; 0xfffffd49 + if (sr) { + 1091c0: e3500000 cmp r0, #0 + 1091c4: 0a000004 beq 1091dc + DEBUGP("WDT("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT]) { + 1091c8: e59f212c ldr r2, [pc, #300] ; 1092fc + 1091cc: e592300c ldr r3, [r2, #12] + 1091d0: e3530000 cmp r3, #0 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT](sr); + 1091d4: 11a0e00f movne lr, pc + 1091d8: 112fff13 bxne r3 +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); + 1091dc: e3a00002 mov r0, #2 + 1091e0: e3e03c0f mvn r3, #3840 ; 0xf00 + 1091e4: e5830029 str r0, [r3, #41] ; 0x29 + DEBUGP(") "); + } + } + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SYS); + DEBUGPCR("END"); +} + 1091e8: e8bd4008 pop {r3, lr} + 1091ec: e12fff1e bx lr + + /* mc_irq */ + if (*AT91C_MC_FMR & (AT91C_MC_LOCKE | AT91C_MC_PROGE)) { + sr = *AT91C_MC_FSR; + if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + 1091f0: e3e01000 mvn r1, #0 + 1091f4: e511c09f ldr ip, [r1, #-159] ; 0xffffff61 + } + + /* mc_irq */ + if (*AT91C_MC_FMR & (AT91C_MC_LOCKE | AT91C_MC_PROGE)) { + sr = *AT91C_MC_FSR; + if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + 1091f8: e31c0008 tst ip, #8 + 1091fc: 0affffea beq 1091ac + (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + 109200: e3100008 tst r0, #8 + 109204: 0affffe8 beq 1091ac + 109208: eaffffe1 b 109194 + /* rstc_irq */ + if (*AT91C_RSTC_RMR & (AT91C_RSTC_URSTIEN|AT91C_RSTC_BODIEN)) { + sr = *AT91C_RSTC_RSR; + if (sr & (AT91C_RSTC_URSTS|AT91C_RSTC_BODSTS)) { + DEBUGP("RSTC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC]) { + 10920c: e59f30e8 ldr r3, [pc, #232] ; 1092fc + 109210: e5933014 ldr r3, [r3, #20] + 109214: e3530000 cmp r3, #0 + 109218: 0a000025 beq 1092b4 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC](sr); + 10921c: e1a0e00f mov lr, pc + 109220: e12fff13 bx r3 + 109224: eaffffd0 b 10916c + /* pmc_irq */ + if (*AT91C_PMC_IMR) { + sr = *AT91C_PMC_SR; + if (sr & *AT91C_PMC_IMR) { + DEBUGP("PMC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC]) { + 109228: e59fc0cc ldr ip, [pc, #204] ; 1092fc + 10922c: e59c3018 ldr r3, [ip, #24] + 109230: e3530000 cmp r3, #0 + 109234: 0a00001b beq 1092a8 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC](sr); + 109238: e1a0e00f mov lr, pc + 10923c: e12fff13 bx r3 + 109240: eaffffc0 b 109148 + /* rtt_irq */ + if (*AT91C_RTTC_RTMR & (AT91C_RTTC_ALMIEN|AT91C_RTTC_RTTINCIEN)) { + sr = *AT91C_RTTC_RTSR; + if (sr) { + DEBUGP("RTT("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT]) { + 109244: e59f10b0 ldr r1, [pc, #176] ; 1092fc + 109248: e5913010 ldr r3, [r1, #16] + 10924c: e3530000 cmp r3, #0 + 109250: 0a000010 beq 109298 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT](sr); + 109254: e1a0e00f mov lr, pc + 109258: e12fff13 bx r3 + 10925c: eaffffb1 b 109128 + + /* pit_irq */ + if (*AT91C_PITC_PIMR & AT91C_PITC_PITIEN) { + sr = *AT91C_PITC_PISR; + if (sr & AT91C_PITC_PITS) { + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT]) { + 109260: e59f1094 ldr r1, [pc, #148] ; 1092fc + 109264: e5913000 ldr r3, [r1] + 109268: e3530000 cmp r3, #0 + 10926c: 0a000018 beq 1092d4 + sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT](sr); + 109270: e1a0e00f mov lr, pc + 109274: e12fff13 bx r3 + 109278: eaffffa3 b 10910c + /* dbgu */ + if (*AT91C_DBGU_IMR) { + sr = *AT91C_DBGU_CSR; + if (sr & *AT91C_DBGU_IMR) { + DEBUGP("DBGU("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU]) { + 10927c: e59fc078 ldr ip, [pc, #120] ; 1092fc + 109280: e59c3004 ldr r3, [ip, #4] + 109284: e3530000 cmp r3, #0 + 109288: 0a00000e beq 1092c8 + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU](sr); + 10928c: e1a0e00f mov lr, pc + 109290: e12fff13 bx r3 + 109294: eaffff95 b 1090f0 + DEBUGP("RTT("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT](sr); + } else { + *AT91C_RTTC_RTMR &= ~(AT91C_RTTC_ALMIEN| + 109298: e51202df ldr r0, [r2, #-735] ; 0xfffffd21 + 10929c: e3c0c803 bic ip, r0, #196608 ; 0x30000 + 1092a0: e502c2df str ip, [r2, #-735] ; 0xfffffd21 + 1092a4: eaffff9f b 109128 + DEBUGP("PMC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC](sr); + } else { + *AT91C_PMC_IDR = *AT91C_PMC_IMR; + 1092a8: e5120393 ldr r0, [r2, #-915] ; 0xfffffc6d + 1092ac: e502039b str r0, [r2, #-923] ; 0xfffffc65 + 1092b0: eaffffa4 b 109148 + DEBUGP("RSTC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC](sr); + } else { + *AT91C_RSTC_RMR &= ~(AT91C_RSTC_URSTIEN| + 1092b4: e51212f7 ldr r1, [r2, #-759] ; 0xfffffd09 + 1092b8: e3c1c801 bic ip, r1, #65536 ; 0x10000 + 1092bc: e3cc0010 bic r0, ip, #16 + 1092c0: e50202f7 str r0, [r2, #-759] ; 0xfffffd09 + 1092c4: eaffffa8 b 10916c + DEBUGP("DBGU("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU](sr); + } else { + *AT91C_DBGU_IDR = *AT91C_DBGU_IMR; + 1092c8: e5120def ldr r0, [r2, #-3567] ; 0xfffff211 + 1092cc: e5020df3 str r0, [r2, #-3571] ; 0xfffff20d + 1092d0: eaffff86 b 1090f0 + if (sr & AT91C_PITC_PITS) { + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT]) { + sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT](sr); + } else { + DEBUGP("no handler DISABLE_PIT "); + *AT91C_PITC_PIMR &= ~AT91C_PITC_PITIEN; + 1092d4: e51202cf ldr r0, [r2, #-719] ; 0xfffffd31 + 1092d8: e3c0c402 bic ip, r0, #33554432 ; 0x2000000 + 1092dc: e502c2cf str ip, [r2, #-719] ; 0xfffffd31 + 1092e0: eaffff89 b 10910c + DEBUGP("EFC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC](sr); + } else { + *AT91C_MC_FMR &= ~(AT91C_MC_LOCKE | + 1092e4: e3e03000 mvn r3, #0 + 1092e8: e513c09f ldr ip, [r3, #-159] ; 0xffffff61 + 1092ec: e3cc000c bic r0, ip, #12 + 1092f0: e503009f str r0, [r3, #-159] ; 0xffffff61 + 1092f4: eaffffac b 1091ac + 1092f8: 00010010 .word 0x00010010 + 1092fc: 0020390c .word 0x0020390c + +00109300 : + DEBUGPCR("END"); +} + +void sysirq_register(enum sysirqs irq, sysirq_hdlr *hdlr) +{ + if (irq >= AT91SAM7_SYSIRQ_COUNT) + 109300: e3500006 cmp r0, #6 + return; + + sysirq_hdlrs[irq] = hdlr; + 109304: 959f3004 ldrls r3, [pc, #4] ; 109310 + 109308: 97831100 strls r1, [r3, r0, lsl #2] + 10930c: e12fff1e bx lr + 109310: 0020390c .word 0x0020390c + +00109314 : +} + +void sysirq_init(void) +{ + 109314: e52de004 push {lr} ; (str lr, [sp, #-4]!) + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, + 109318: e59fc030 ldr ip, [pc, #48] ; 109350 + + sysirq_hdlrs[irq] = hdlr; +} + +void sysirq_init(void) +{ + 10931c: e24dd00c sub sp, sp, #12 + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, + 109320: e3a02005 mov r2, #5 + 109324: e3a03000 mov r3, #0 + 109328: e59f0024 ldr r0, [pc, #36] ; 109354 + 10932c: e3a01001 mov r1, #1 + 109330: e58dc000 str ip, [sp] + 109334: ebffec94 bl 10458c +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 109338: e3a02002 mov r2, #2 + 10933c: e3e03c0f mvn r3, #3840 ; 0xf00 + 109340: e5832021 str r2, [r3, #33] ; 0x21 + OPENPCD_IRQ_PRIO_SYS, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + &sys_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); +} + 109344: e28dd00c add sp, sp, #12 + 109348: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 10934c: e12fff1e bx lr + 109350: 001090cc .word 0x001090cc + 109354: fffff000 .word 0xfffff000 + +00109358 : + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 109358: e1a02700 lsl r2, r0, #14 + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + 10935c: e1a01000 mov r1, r0 + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 109360: e1a00b22 lsr r0, r2, #22 + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + 109364: e92d40f8 push {r3, r4, r5, r6, r7, lr} + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 109368: e1a05800 lsl r5, r0, #16 + 10936c: e1a06825 lsr r6, r5, #16 +//* \brief Return MC EFC Status +//*---------------------------------------------------------------------------- +static inline unsigned int AT91F_MC_EFC_GetStatus( + AT91PS_MC pMC) // pointer to a MC controller +{ + return pMC->MC_FSR; + 109370: e3e04000 mvn r4, #0 + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + DEBUGP("flash_page(0x%x=%u) ", addr, page); + 109374: e59f006c ldr r0, [pc, #108] ; 1093e8 + 109378: e1a02006 mov r2, r6 + 10937c: e5147097 ldr r7, [r4, #-151] ; 0xffffff69 + 109380: ebfffaa5 bl 107e1c + +static int is_page_locked(u_int16_t page) +{ + u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + + return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 109384: e5143097 ldr r3, [r4, #-151] ; 0xffffff69 + 109388: e1a05a25 lsr r5, r5, #20 +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + DEBUGP("flash_page(0x%x=%u) ", addr, page); + + if (is_page_locked(page)) { + 10938c: e0135805 ands r5, r3, r5, lsl #16 + 109390: 1a00000d bne 1093cc + DEBUGP("unlocking "); + unlock_page(page); + } + + if (!(fsr & AT91C_MC_FRDY)) { + 109394: e3170001 tst r7, #1 + 109398: 0a000008 beq 1093c0 + DEBUGP("NOT_FLASHING "); + return; + } + + DEBUGP("performing start_prog "); + 10939c: e59f0048 ldr r0, [pc, #72] ; 1093ec + 1093a0: ebfffa9d bl 107e1c + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + AT91C_MC_CORRECT_KEY | (page << 8)); + 1093a4: e1a02406 lsl r2, r6, #8 + return; + } + + DEBUGP("performing start_prog "); + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 1093a8: e382645a orr r6, r2, #1509949440 ; 0x5a000000 + 1093ac: e3866001 orr r6, r6, #1 +//*---------------------------------------------------------------------------- +static inline void AT91F_MC_EFC_PerformCmd ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int transfer_cmd) +{ + pMC->MC_FCR = transfer_cmd; + 1093b0: e3e00000 mvn r0, #0 + 1093b4: e500609b str r6, [r0, #-155] ; 0xffffff65 + AT91C_MC_CORRECT_KEY | (page << 8)); +} + 1093b8: e8bd40f8 pop {r3, r4, r5, r6, r7, lr} + 1093bc: e12fff1e bx lr + DEBUGP("unlocking "); + unlock_page(page); + } + + if (!(fsr & AT91C_MC_FRDY)) { + DEBUGP("NOT_FLASHING "); + 1093c0: e59f0028 ldr r0, [pc, #40] ; 1093f0 + 1093c4: ebfffa94 bl 107e1c + return; + 1093c8: eafffffa b 1093b8 + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + DEBUGP("flash_page(0x%x=%u) ", addr, page); + + if (is_page_locked(page)) { + DEBUGP("unlocking "); + 1093cc: e59f0020 ldr r0, [pc, #32] ; 1093f4 + 1093d0: ebfffa91 bl 107e1c + +static void unlock_page(u_int16_t page) +{ + page &= 0x3ff; + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); + 1093d4: e1a03406 lsl r3, r6, #8 +} + +static void unlock_page(u_int16_t page) +{ + page &= 0x3ff; + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + 1093d8: e383c45a orr ip, r3, #1509949440 ; 0x5a000000 + 1093dc: e38c1004 orr r1, ip, #4 + 1093e0: e504109b str r1, [r4, #-155] ; 0xffffff65 + 1093e4: eaffffea b 109394 + 1093e8: 0010adcc .word 0x0010adcc + 1093ec: 0010ae00 .word 0x0010ae00 + 1093f0: 0010adf0 .word 0x0010adf0 + 1093f4: 0010ade4 .word 0x0010ade4 + +001093f8 : +static inline void AT91F_MC_EFC_CfgModeReg ( + AT91PS_MC pMC, // pointer to a MC controller + unsigned int mode) // mode register +{ + // Write to the FMR register + pMC->MC_FMR = mode; + 1093f8: e59f2008 ldr r2, [pc, #8] ; 109408 + 1093fc: e3e03000 mvn r3, #0 + 109400: e503209f str r2, [r3, #-159] ; 0xffffff61 +{ + unsigned int fmcn = AT91F_MC_EFC_ComputeFMCN(MCK); + + AT91F_MC_EFC_CfgModeReg(AT91C_BASE_MC, (fmcn&0xff) << 16 | + AT91C_MC_FWS_3FWS); +} + 109404: e12fff1e bx lr + 109408: 00310300 .word 0x00310300 + +0010940c : +static const AT91PS_SPI pSPI = AT91C_BASE_SPI; + +/* SPI irq handler */ +static void spi_irq(void) +{ + u_int32_t status = pSPI->SPI_SR; + 10940c: e59f002c ldr r0, [pc, #44] ; 109440 + 109410: e510c0ef ldr ip, [r0, #-239] ; 0xffffff11 + + if (status & AT91C_SPI_OVRES) + DEBUGPSPIIRQ("Overrun "); + if (status & AT91C_SPI_MODF) + DEBUGPSPIIRQ("ModeFault "); + if (status & AT91C_SPI_ENDRX) { + 109414: e31c0010 tst ip, #16 + pSPI->SPI_IDR = AT91C_SPI_ENDRX; + 109418: 13a01010 movne r1, #16 + 10941c: 150010e7 strne r1, [r0, #-231] ; 0xffffff19 + DEBUGPSPIIRQ("ENDRX "); + } + if (status & AT91C_SPI_ENDTX) { + 109420: e31c0020 tst ip, #32 + pSPI->SPI_IDR = AT91C_SPI_ENDTX; + 109424: 159fc014 ldrne ip, [pc, #20] ; 109440 + 109428: 13a00020 movne r0, #32 +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); + 10942c: e3a02020 mov r2, #32 + 109430: e3e03c0f mvn r3, #3840 ; 0xf00 + 109434: 150c00e7 strne r0, [ip, #-231] ; 0xffffff19 + 109438: e5832029 str r2, [r3, #41] ; 0x29 + } + + DEBUGPSPIIRQ("\r\n"); + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SPI); +} + 10943c: e12fff1e bx lr + 109440: fffe00ff .word 0xfffe00ff + +00109444 : + +#ifdef SPI_USES_DMA +static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 109444: e92d40f0 push {r4, r5, r6, r7, lr} + u_int8_t *rx_data, u_int16_t *rx_len) +{ + DEBUGPSPI("DMA Xfer tx=%s\r\n", hexdump(tx_data, tx_len)); + if (*rx_len < tx_len) { + 109448: e1d230b0 ldrh r3, [r2] + 10944c: e1530001 cmp r3, r1 + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SPI); +} + +#ifdef SPI_USES_DMA +static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 109450: e1a07000 mov r7, r0 + 109454: e24dd00c sub sp, sp, #12 + 109458: e1a05002 mov r5, r2 + 10945c: e1a04001 mov r4, r1 + u_int8_t *rx_data, u_int16_t *rx_len) +{ + DEBUGPSPI("DMA Xfer tx=%s\r\n", hexdump(tx_data, tx_len)); + if (*rx_len < tx_len) { + DEBUGPCRF("rx_len=%u smaller tx_len=%u\n", *rx_len, tx_len); + return -1; + 109460: 33e00000 mvncc r0, #0 +#ifdef SPI_USES_DMA +static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + u_int8_t *rx_data, u_int16_t *rx_len) +{ + DEBUGPSPI("DMA Xfer tx=%s\r\n", hexdump(tx_data, tx_len)); + if (*rx_len < tx_len) { + 109464: 2a000002 bcs 109474 + DEBUGPSPI("DMA Xfer finished rx=%s\r\n", hexdump(rx_data, tx_len)); + + *rx_len = tx_len; + + return 0; +} + 109468: e28dd00c add sp, sp, #12 + 10946c: e8bd40f0 pop {r4, r5, r6, r7, lr} + 109470: e12fff1e bx lr + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 109474: e3e0cc0f mvn ip, #3840 ; 0xf00 + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + 109478: e3a06000 mov r6, #0 + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 10947c: e3a0e102 mov lr, #-2147483648 ; 0x80000000 + 109480: e58ce025 str lr, [ip, #37] ; 0x25 + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + 109484: e59f1070 ldr r1, [pc, #112] ; 1094fc +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; + 109488: e58ce029 str lr, [ip, #41] ; 0x29 + unsigned char *pBuffer, + unsigned int szBuffer, + unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_ReceiveFrame( + 10948c: e1a02004 mov r2, r4 + 109490: e1a03006 mov r3, r6 + 109494: e59f0064 ldr r0, [pc, #100] ; 109500 + 109498: e58d6000 str r6, [sp] + 10949c: ebffecb9 bl 104788 + const unsigned char *pBuffer, + unsigned int szBuffer, + const unsigned char *pNextBuffer, + unsigned int szNextBuffer ) +{ + return AT91F_PDC_SendFrame( + 1094a0: e1a01007 mov r1, r7 + 1094a4: e1a02004 mov r2, r4 + 1094a8: e1a03006 mov r3, r6 + 1094ac: e59f004c ldr r0, [pc, #76] ; 109500 + 1094b0: e58d6000 str r6, [sp] + 1094b4: ebffeca0 bl 10473c +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 1094b8: e59fc044 ldr ip, [pc, #68] ; 109504 + AT91F_SPI_SendFrame(pSPI, tx_data, tx_len, NULL, 0); + + AT91F_PDC_EnableRx(AT91C_BASE_PDC_SPI); + AT91F_PDC_EnableTx(AT91C_BASE_PDC_SPI); + + pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + 1094bc: e59f2044 ldr r2, [pc, #68] ; 109508 + 1094c0: e3a03001 mov r3, #1 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 1094c4: e3a01c01 mov r1, #256 ; 0x100 + 1094c8: e3a00030 mov r0, #48 ; 0x30 +//* \brief Enable receive +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableRx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 1094cc: e50c30df str r3, [ip, #-223] ; 0xffffff21 +//* \brief Enable transmit +//*---------------------------------------------------------------------------- +static inline void AT91F_PDC_EnableTx ( + AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +{ + pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 1094d0: e50c10df str r1, [ip, #-223] ; 0xffffff21 + 1094d4: e50200eb str r0, [r2, #-235] ; 0xffffff15 + + + while (! (pSPI->SPI_SR & AT91C_SPI_ENDRX)) ; + 1094d8: e51200ef ldr r0, [r2, #-239] ; 0xffffff11 + 1094dc: e3100010 tst r0, #16 + 1094e0: 0afffffc beq 1094d8 +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 1094e4: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 1094e8: e3e01c0f mvn r1, #3840 ; 0xf00 + 1094ec: e5812021 str r2, [r1, #33] ; 0x21 + + DEBUGPSPI("DMA Xfer finished rx=%s\r\n", hexdump(rx_data, tx_len)); + + *rx_len = tx_len; + + return 0; + 1094f0: e3a00000 mov r0, #0 + /* Re-enable RC632 interrupts */ + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + DEBUGPSPI("DMA Xfer finished rx=%s\r\n", hexdump(rx_data, tx_len)); + + *rx_len = tx_len; + 1094f4: e1c540b0 strh r4, [r5] + 1094f8: eaffffda b 109468 + 1094fc: 00203928 .word 0x00203928 + 109500: fffe0100 .word 0xfffe0100 + 109504: fffe01ff .word 0xfffe01ff + 109508: fffe00ff .word 0xfffe00ff + +0010950c : + +/* RC632 access primitives */ + +int opcd_rc632_reg_write(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t data) +{ + 10950c: e92d4010 push {r4, lr} + 109510: e24dd008 sub sp, sp, #8 + u_int16_t rx_len = 2; + 109514: e3a0e002 mov lr, #2 + 109518: e28dc008 add ip, sp, #8 + + DEBUG632("[0x%02x] <= 0x%02x", addr, data); + + addr = RC632_WRITE_ADDR(addr); + + spi_outbuf[0] = addr; + 10951c: e59f302c ldr r3, [pc, #44] ; 109550 +/* RC632 access primitives */ + +int opcd_rc632_reg_write(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t data) +{ + u_int16_t rx_len = 2; + 109520: e16ce0b2 strh lr, [ip, #-2]! + + DEBUG632("[0x%02x] <= 0x%02x", addr, data); + + addr = RC632_WRITE_ADDR(addr); + 109524: e1a01081 lsl r1, r1, #1 + 109528: e201407e and r4, r1, #126 ; 0x7e + + spi_outbuf[0] = addr; + spi_outbuf[1] = data; + 10952c: e5c32045 strb r2, [r3, #69] ; 0x45 + + return spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 109530: e2830044 add r0, r3, #68 ; 0x44 + 109534: e1a0100e mov r1, lr + 109538: e1a0200c mov r2, ip + + DEBUG632("[0x%02x] <= 0x%02x", addr, data); + + addr = RC632_WRITE_ADDR(addr); + + spi_outbuf[0] = addr; + 10953c: e5c34044 strb r4, [r3, #68] ; 0x44 + spi_outbuf[1] = data; + + return spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 109540: ebffffbf bl 109444 +} + 109544: e28dd008 add sp, sp, #8 + 109548: e8bd4010 pop {r4, lr} + 10954c: e12fff1e bx lr + 109550: 00203928 .word 0x00203928 + +00109554 : +#define RC632_REGSET_MAXSIZE (RC632_REGSET_END-RC632_REGSET_START) +static u_int8_t regset_buf[RC632_REGSET_MAXSIZE * 2]; + +int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + u_int8_t *regs, int len) +{ + 109554: e92d4010 push {r4, lr} + u_int8_t i, j = 0; + u_int16_t rx_len; + + if (len > RC632_REGSET_MAXSIZE) + 109558: e352002f cmp r2, #47 ; 0x2f +#define RC632_REGSET_MAXSIZE (RC632_REGSET_END-RC632_REGSET_START) +static u_int8_t regset_buf[RC632_REGSET_MAXSIZE * 2]; + +int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + u_int8_t *regs, int len) +{ + 10955c: e24dd008 sub sp, sp, #8 + u_int8_t i, j = 0; + u_int16_t rx_len; + + if (len > RC632_REGSET_MAXSIZE) + return -E2BIG; + 109560: c3e00006 mvngt r0, #6 + u_int8_t *regs, int len) +{ + u_int8_t i, j = 0; + u_int16_t rx_len; + + if (len > RC632_REGSET_MAXSIZE) + 109564: ca00001d bgt 1095e0 + 109568: e3a00000 mov r0, #0 + 10956c: e1a0c001 mov ip, r1 + 109570: e3a03010 mov r3, #16 + 109574: e1a01000 mov r1, r0 + + for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + /* skip bank registers */ + if (i % 8 == 0) + continue; + regset_buf[j++] = RC632_WRITE_ADDR(i); + 109578: e59fe06c ldr lr, [pc, #108] ; 1095ec + 10957c: ea00000f b 1095c0 + if (len > RC632_REGSET_MAXSIZE) + return -E2BIG; + + for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + /* skip bank registers */ + if (i % 8 == 0) + 109580: e3120007 tst r2, #7 + 109584: 0a00000b beq 1095b8 +#define RC632_REGSET_START 0x10 +#define RC632_REGSET_END 0x3f +#define RC632_REGSET_MAXSIZE (RC632_REGSET_END-RC632_REGSET_START) +static u_int8_t regset_buf[RC632_REGSET_MAXSIZE * 2]; + +int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + 109588: e2802011 add r2, r0, #17 + + for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + /* skip bank registers */ + if (i % 8 == 0) + continue; + regset_buf[j++] = RC632_WRITE_ADDR(i); + 10958c: e1a04082 lsl r4, r2, #1 + 109590: e204407e and r4, r4, #126 ; 0x7e + 109594: e08e2001 add r2, lr, r1 + 109598: e5c24088 strb r4, [r2, #136] ; 0x88 + 10959c: e2814001 add r4, r1, #1 + 1095a0: e20410ff and r1, r4, #255 ; 0xff + regset_buf[j++] = regs[i - RC632_REGSET_START]; + 1095a4: e5dc4001 ldrb r4, [ip, #1] + 1095a8: e08e2001 add r2, lr, r1 + 1095ac: e5c24088 strb r4, [r2, #136] ; 0x88 + 1095b0: e2811001 add r1, r1, #1 + 1095b4: e20110ff and r1, r1, #255 ; 0xff + 1095b8: e2800001 add r0, r0, #1 + 1095bc: e28cc001 add ip, ip, #1 + u_int16_t rx_len; + + if (len > RC632_REGSET_MAXSIZE) + return -E2BIG; + + for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + 1095c0: e2832001 add r2, r3, #1 + 1095c4: e20230ff and r3, r2, #255 ; 0xff + 1095c8: e3530040 cmp r3, #64 ; 0x40 + 1095cc: 1affffeb bne 109580 + continue; + regset_buf[j++] = RC632_WRITE_ADDR(i); + regset_buf[j++] = regs[i - RC632_REGSET_START]; + } + + rx_len = j; + 1095d0: e28d2008 add r2, sp, #8 + 1095d4: e16210b2 strh r1, [r2, #-2]! + return spi_transceive(regset_buf, j, spi_inbuf, &rx_len); + 1095d8: e59f0010 ldr r0, [pc, #16] ; 1095f0 + 1095dc: ebffff98 bl 109444 +} + 1095e0: e28dd008 add sp, sp, #8 + 1095e4: e8bd4010 pop {r4, lr} + 1095e8: e12fff1e bx lr + 1095ec: 00203928 .word 0x00203928 + 1095f0: 002039b0 .word 0x002039b0 + +001095f4 : + +int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags) +{ + 1095f4: e92d4070 push {r4, r5, r6, lr} + u_int16_t rx_len = sizeof(spi_inbuf); + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + 1095f8: e59f0050 ldr r0, [pc, #80] ; 109650 + return spi_transceive(regset_buf, j, spi_inbuf, &rx_len); +} + +int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags) +{ + 1095fc: e24dd008 sub sp, sp, #8 + u_int16_t rx_len = sizeof(spi_inbuf); + 109600: e3510040 cmp r1, #64 ; 0x40 + 109604: 31a06001 movcc r6, r1 + 109608: 23a06040 movcs r6, #64 ; 0x40 + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + 10960c: e1a05000 mov r5, r0 +} + +int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags) +{ + u_int16_t rx_len = sizeof(spi_inbuf); + 109610: e28d4008 add r4, sp, #8 + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + memcpy(&spi_outbuf[1], data, len); + 109614: e1a01002 mov r1, r2 +{ + u_int16_t rx_len = sizeof(spi_inbuf); + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + 109618: e3a03004 mov r3, #4 +} + +int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags) +{ + u_int16_t rx_len = sizeof(spi_inbuf); + 10961c: e3a02041 mov r2, #65 ; 0x41 + 109620: e16420b2 strh r2, [r4, #-2]! + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + 109624: e5e53044 strb r3, [r5, #68]! ; 0x44 + memcpy(&spi_outbuf[1], data, len); + 109628: e1a02006 mov r2, r6 + 10962c: e2800045 add r0, r0, #69 ; 0x45 + 109630: eb0002b5 bl 10a10c + + DEBUG632("[FIFO] <= %s", hexdump(data, len)); + + return spi_transceive(spi_outbuf, len+1, spi_inbuf, &rx_len); + 109634: e1a00005 mov r0, r5 + 109638: e2861001 add r1, r6, #1 + 10963c: e1a02004 mov r2, r4 + 109640: ebffff7f bl 109444 +} + 109644: e28dd008 add sp, sp, #8 + 109648: e8bd4070 pop {r4, r5, r6, lr} + 10964c: e12fff1e bx lr + 109650: 00203928 .word 0x00203928 + +00109654 : + +int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t *val) +{ + 109654: e92d4070 push {r4, r5, r6, lr} + 109658: e24dd008 sub sp, sp, #8 + u_int16_t rx_len = 2; + 10965c: e3a0e002 mov lr, #2 + 109660: e28dc008 add ip, sp, #8 + + addr = (addr << 1) & 0x7e; + 109664: e1a05081 lsl r5, r1, #1 + + spi_outbuf[0] = addr | 0x80; + 109668: e59f4044 ldr r4, [pc, #68] ; 1096b4 +} + +int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t *val) +{ + u_int16_t rx_len = 2; + 10966c: e16ce0b2 strh lr, [ip, #-2]! + + addr = (addr << 1) & 0x7e; + 109670: e205107e and r1, r5, #126 ; 0x7e + + spi_outbuf[0] = addr | 0x80; + 109674: e1e00c81 mvn r0, r1, lsl #25 + 109678: e1e03ca0 mvn r3, r0, lsr #25 + return spi_transceive(spi_outbuf, len+1, spi_inbuf, &rx_len); +} + +int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t *val) +{ + 10967c: e1a06002 mov r6, r2 + u_int16_t rx_len = 2; + + addr = (addr << 1) & 0x7e; + + spi_outbuf[0] = addr | 0x80; + spi_outbuf[1] = 0x00; + 109680: e3a05000 mov r5, #0 + + spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 109684: e2840044 add r0, r4, #68 ; 0x44 + 109688: e1a0100e mov r1, lr + 10968c: e1a0200c mov r2, ip +{ + u_int16_t rx_len = 2; + + addr = (addr << 1) & 0x7e; + + spi_outbuf[0] = addr | 0x80; + 109690: e5c43044 strb r3, [r4, #68] ; 0x44 + spi_outbuf[1] = 0x00; + 109694: e5c45045 strb r5, [r4, #69] ; 0x45 + + spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 109698: ebffff69 bl 109444 + *val = spi_inbuf[1]; + 10969c: e5d43001 ldrb r3, [r4, #1] + + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + 1096a0: e1a00005 mov r0, r5 + + spi_outbuf[0] = addr | 0x80; + spi_outbuf[1] = 0x00; + + spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + *val = spi_inbuf[1]; + 1096a4: e5c63000 strb r3, [r6] + + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + 1096a8: e28dd008 add sp, sp, #8 + 1096ac: e8bd4070 pop {r4, r5, r6, lr} + 1096b0: e12fff1e bx lr + 1096b4: 00203928 .word 0x00203928 + +001096b8 : +} + +/* RC632 interrupt handling */ + +static void rc632_irq(void) +{ + 1096b8: e52de004 push {lr} ; (str lr, [sp, #-4]!) + struct req_ctx *irq_rctx; + struct openpcd_hdr *irq_opcdh; + u_int8_t cause; + + /* CL RC632 has interrupted us */ + opcd_rc632_reg_read(NULL, RC632_REG_INTERRUPT_RQ, &cause); + 1096bc: e3a01007 mov r1, #7 +} + +/* RC632 interrupt handling */ + +static void rc632_irq(void) +{ + 1096c0: e24dd00c sub sp, sp, #12 + struct req_ctx *irq_rctx; + struct openpcd_hdr *irq_opcdh; + u_int8_t cause; + + /* CL RC632 has interrupted us */ + opcd_rc632_reg_read(NULL, RC632_REG_INTERRUPT_RQ, &cause); + 1096c4: e08d2001 add r2, sp, r1 + 1096c8: e3a00000 mov r0, #0 + 1096cc: ebffffe0 bl 109654 + + /* ACK all interrupts */ + //rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, cause); + opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, RC632_INT_TIMER); + 1096d0: e3a01007 mov r1, #7 + 1096d4: e3a02020 mov r2, #32 + 1096d8: e3a00000 mov r0, #0 + 1096dc: ebffff8a bl 10950c + DEBUGP("RxComplete "); + if (cause & RC632_INT_TX) + DEBUGP("TxComplete "); + + + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 1096e0: e59f3064 ldr r3, [pc, #100] ; 10974c + 1096e4: e3a00000 mov r0, #0 + 1096e8: e3a010fe mov r1, #254 ; 0xfe + 1096ec: e3a02004 mov r2, #4 + 1096f0: e1a0e00f mov lr, pc + 1096f4: e12fff13 bx r3 + RCTX_STATE_RC632IRQ_BUSY); + if (!irq_rctx) { + 1096f8: e2503000 subs r3, r0, #0 + 1096fc: 0a00000d beq 109738 + /* disable rc632 interrupt until RCTX is free */ + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + return; + } + + irq_opcdh = (struct openpcd_hdr *) irq_rctx->data; + 109700: e593e008 ldr lr, [r3, #8] + + /* initialize static part of openpcd_hdr for USB IRQ reporting */ + irq_opcdh->cmd = OPENPCD_CMD_IRQ; + irq_opcdh->flags = 0x00; + irq_opcdh->reg = 0x07; + 109704: e3a01007 mov r1, #7 + } + + irq_opcdh = (struct openpcd_hdr *) irq_rctx->data; + + /* initialize static part of openpcd_hdr for USB IRQ reporting */ + irq_opcdh->cmd = OPENPCD_CMD_IRQ; + 109708: e3a0201a mov r2, #26 + irq_opcdh->flags = 0x00; + 10970c: e3a03000 mov r3, #0 + irq_opcdh->reg = 0x07; + 109710: e5ce1002 strb r1, [lr, #2] + } + + irq_opcdh = (struct openpcd_hdr *) irq_rctx->data; + + /* initialize static part of openpcd_hdr for USB IRQ reporting */ + irq_opcdh->cmd = OPENPCD_CMD_IRQ; + 109714: e5ce2000 strb r2, [lr] + irq_opcdh->flags = 0x00; + 109718: e5ce3001 strb r3, [lr, #1] + irq_opcdh->reg = 0x07; + irq_opcdh->val = cause; + 10971c: e5ddc007 ldrb ip, [sp, #7] + + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 109720: e3a01012 mov r1, #18 + + /* initialize static part of openpcd_hdr for USB IRQ reporting */ + irq_opcdh->cmd = OPENPCD_CMD_IRQ; + irq_opcdh->flags = 0x00; + irq_opcdh->reg = 0x07; + irq_opcdh->val = cause; + 109724: e5cec003 strb ip, [lr, #3] + + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 109728: ebfffa11 bl 107f74 + DEBUGPCR(""); +} + 10972c: e28dd00c add sp, sp, #12 + 109730: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 109734: e12fff1e bx lr + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + unsigned int mask = 0x1 << irq_id; + //* Disable the interrupt on the interrupt controller + pAic->AIC_IDCR = mask ; + 109738: e3e00c0f mvn r0, #3840 ; 0xf00 + 10973c: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 109740: e5802025 str r2, [r0, #37] ; 0x25 + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = mask ; + 109744: e5802029 str r2, [r0, #41] ; 0x29 + RCTX_STATE_RC632IRQ_BUSY); + if (!irq_rctx) { + DEBUGPCRF("NO RCTX!"); + /* disable rc632 interrupt until RCTX is free */ + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + return; + 109748: eafffff7 b 10972c + 10974c: 00200080 .word 0x00200080 + +00109750 : + AT91F_SPI_Disable(pSPI); +} +#endif + +#ifdef DEBUG +static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + 109750: e92d4030 push {r4, r5, lr} + u_int8_t reg, u_int8_t val) +{ + u_int8_t tmp; + + opcd_rc632_reg_write(hdl, reg, val); + 109754: e1a02001 mov r2, r1 + AT91F_SPI_Disable(pSPI); +} +#endif + +#ifdef DEBUG +static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + 109758: e24dd00c sub sp, sp, #12 + 10975c: e1a04001 mov r4, r1 + 109760: e1a05000 mov r5, r0 + u_int8_t reg, u_int8_t val) +{ + u_int8_t tmp; + + opcd_rc632_reg_write(hdl, reg, val); + 109764: e3a01021 mov r1, #33 ; 0x21 + 109768: ebffff67 bl 10950c + opcd_rc632_reg_read(hdl, reg, &tmp); + 10976c: e1a00005 mov r0, r5 + 109770: e3a01021 mov r1, #33 ; 0x21 + 109774: e28d2007 add r2, sp, #7 + 109778: ebffffb5 bl 109654 + + DEBUGPCRF("reg=0x%02x, write=0x%02x, read=0x%02x ", reg, val, tmp); + + return (val == tmp); + 10977c: e5dd1007 ldrb r1, [sp, #7] +} + 109780: e0643001 rsb r3, r4, r1 + 109784: e2730000 rsbs r0, r3, #0 + 109788: e0a00003 adc r0, r0, r3 + 10978c: e28dd00c add sp, sp, #12 + 109790: e8bd4030 pop {r4, r5, lr} + 109794: e12fff1e bx lr + +00109798 : + return 0; +} + +int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + u_int8_t max_len, u_int8_t *data) +{ + 109798: e92d4070 push {r4, r5, r6, lr} + 10979c: e24dd008 sub sp, sp, #8 + 1097a0: e1a04001 mov r4, r1 + 1097a4: e1a06002 mov r6, r2 + int ret; + u_int8_t fifo_length; + u_int8_t i; + u_int16_t rx_len; + + ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + 1097a8: e3a01004 mov r1, #4 + 1097ac: e28d2007 add r2, sp, #7 + 1097b0: ebffffa7 bl 109654 + if (ret < 0) + 1097b4: e2505000 subs r5, r0, #0 + 1097b8: ba00002e blt 109878 + return ret; + + rx_len = fifo_length+1; + 1097bc: e5ddc007 ldrb ip, [sp, #7] + + if (max_len < fifo_length) + 1097c0: e15c0004 cmp ip, r4 + + ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + if (ret < 0) + return ret; + + rx_len = fifo_length+1; + 1097c4: e28c1001 add r1, ip, #1 + + if (max_len < fifo_length) + fifo_length = max_len; + 1097c8: 81a0c004 movhi ip, r4 + + ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + if (ret < 0) + return ret; + + rx_len = fifo_length+1; + 1097cc: e1cd10b4 strh r1, [sp, #4] + + if (max_len < fifo_length) + fifo_length = max_len; + 1097d0: 85cd4007 strbhi r4, [sp, #7] + 1097d4: 82841001 addhi r1, r4, #1 + + for (i = 0; i < fifo_length; i++) + 1097d8: e35c0000 cmp ip, #0 + 1097dc: 0a000014 beq 109834 + 1097e0: e59fe0a0 ldr lr, [pc, #160] ; 109888 + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + +int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 1097e4: e24c0001 sub r0, ip, #1 + 1097e8: e20020ff and r2, r0, #255 ; 0xff + 1097ec: e1a0300e mov r3, lr + 1097f0: e082e00e add lr, r2, lr + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + spi_outbuf[i] = FIFO_ADDR; + 1097f4: e3a00004 mov r0, #4 + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + 1097f8: e153000e cmp r3, lr + 1097fc: e2022001 and r2, r2, #1 + spi_outbuf[i] = FIFO_ADDR; + 109800: e5c30000 strb r0, [r3] + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + 109804: 0a00000a beq 109834 + 109808: e3520000 cmp r2, #0 + 10980c: 0a000002 beq 10981c + spi_outbuf[i] = FIFO_ADDR; + 109810: e5e30001 strb r0, [r3, #1]! + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + 109814: e153000e cmp r3, lr + 109818: 0a000005 beq 109834 + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + +int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 10981c: e2834001 add r4, r3, #1 + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + spi_outbuf[i] = FIFO_ADDR; + 109820: e5c30001 strb r0, [r3, #1] + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + +int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 109824: e2833002 add r3, r3, #2 + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + 109828: e153000e cmp r3, lr + spi_outbuf[i] = FIFO_ADDR; + 10982c: e5c40001 strb r0, [r4, #1] + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + 109830: 1afffff9 bne 10981c + spi_outbuf[i] = FIFO_ADDR; + + spi_outbuf[0] |= 0x80; + 109834: e59f4050 ldr r4, [pc, #80] ; 10988c + 109838: e5d40044 ldrb r0, [r4, #68] ; 0x44 + 10983c: e1e02c80 mvn r2, r0, lsl #25 + 109840: e1e0eca2 mvn lr, r2, lsr #25 + spi_outbuf[fifo_length] = 0x00; + 109844: e084c00c add ip, r4, ip + 109848: e3a03000 mov r3, #0 + + spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 10984c: e28d2004 add r2, sp, #4 + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + spi_outbuf[i] = FIFO_ADDR; + + spi_outbuf[0] |= 0x80; + 109850: e5c4e044 strb lr, [r4, #68] ; 0x44 + spi_outbuf[fifo_length] = 0x00; + + spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 109854: e2840044 add r0, r4, #68 ; 0x44 + + for (i = 0; i < fifo_length; i++) + spi_outbuf[i] = FIFO_ADDR; + + spi_outbuf[0] |= 0x80; + spi_outbuf[fifo_length] = 0x00; + 109858: e5cc3044 strb r3, [ip, #68] ; 0x44 + + spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 10985c: ebfffef8 bl 109444 + memcpy(data, spi_inbuf+1, rx_len-1); + 109860: e1dd50b4 ldrh r5, [sp, #4] + 109864: e2455001 sub r5, r5, #1 + 109868: e1a00006 mov r0, r6 + 10986c: e2841001 add r1, r4, #1 + 109870: e1a02005 mov r2, r5 + 109874: eb000224 bl 10a10c + + DEBUG632("[FIFO] => %s", hexdump(data, rx_len-1)); + + return rx_len-1; +} + 109878: e1a00005 mov r0, r5 + 10987c: e28dd008 add sp, sp, #8 + 109880: e8bd4070 pop {r4, r5, r6, lr} + 109884: e12fff1e bx lr + 109888: 0020396c .word 0x0020396c + 10988c: 00203928 .word 0x00203928 + +00109890 : + +int opcd_rc632_set_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + 109890: e92d4070 push {r4, r5, r6, lr} + 109894: e24dd008 sub sp, sp, #8 + 109898: e1a06002 mov r6, r2 + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + 10989c: e28d2007 add r2, sp, #7 + return rx_len-1; +} + +int opcd_rc632_set_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + 1098a0: e1a05000 mov r5, r0 + 1098a4: e1a04001 mov r4, r1 + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + 1098a8: ebffff69 bl 109654 + if (ret < 0) + 1098ac: e3500000 cmp r0, #0 + 1098b0: ba000006 blt 1098d0 + return ret; + + val |= bits; + 1098b4: e5dd3007 ldrb r3, [sp, #7] + 1098b8: e1866003 orr r6, r6, r3 + + return opcd_rc632_reg_write(hdl, reg, val); + 1098bc: e1a00005 mov r0, r5 + 1098c0: e1a01004 mov r1, r4 + 1098c4: e1a02006 mov r2, r6 + + ret = opcd_rc632_reg_read(hdl, reg, &val); + if (ret < 0) + return ret; + + val |= bits; + 1098c8: e5cd6007 strb r6, [sp, #7] + + return opcd_rc632_reg_write(hdl, reg, val); + 1098cc: ebffff0e bl 10950c +} + 1098d0: e28dd008 add sp, sp, #8 + 1098d4: e8bd4070 pop {r4, r5, r6, lr} + 1098d8: e12fff1e bx lr + +001098dc : + +int opcd_rc632_clear_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + 1098dc: e92d4070 push {r4, r5, r6, lr} + 1098e0: e24dd008 sub sp, sp, #8 + 1098e4: e1a06002 mov r6, r2 + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + 1098e8: e28d2007 add r2, sp, #7 + return opcd_rc632_reg_write(hdl, reg, val); +} + +int opcd_rc632_clear_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + 1098ec: e1a05000 mov r5, r0 + 1098f0: e1a04001 mov r4, r1 + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + 1098f4: ebffff56 bl 109654 + if (ret < 0) + 1098f8: e3500000 cmp r0, #0 + 1098fc: ba000006 blt 10991c + return ret; + + val &= ~bits; + 109900: e5dd3007 ldrb r3, [sp, #7] + 109904: e1c36006 bic r6, r3, r6 + + return opcd_rc632_reg_write(hdl, reg, val); + 109908: e1a00005 mov r0, r5 + 10990c: e1a01004 mov r1, r4 + 109910: e1a02006 mov r2, r6 + + ret = opcd_rc632_reg_read(hdl, reg, &val); + if (ret < 0) + return ret; + + val &= ~bits; + 109914: e5cd6007 strb r6, [sp, #7] + + return opcd_rc632_reg_write(hdl, reg, val); + 109918: ebfffefb bl 10950c +} + 10991c: e28dd008 add sp, sp, #8 + 109920: e8bd4070 pop {r4, r5, r6, lr} + 109924: e12fff1e bx lr + +00109928 : + /* turn off register paging */ + opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + 109928: e92d4038 push {r3, r4, r5, lr} + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int16_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + 10992c: e3a03004 mov r3, #4 +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int16_t len = rctx->tot_len-sizeof(*poh); + 109930: e1d0c0b6 ldrh ip, [r0, #6] + opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 109934: e5904008 ldr r4, [r0, #8] + u_int16_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + 109938: e1c030b6 strh r3, [r0, #6] + /* turn off register paging */ + opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + 10993c: e1a05000 mov r5, r0 + u_int16_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + 109940: e5d40000 ldrb r0, [r4] +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int16_t len = rctx->tot_len-sizeof(*poh); + 109944: e24c1004 sub r1, ip, #4 + 109948: e1a02801 lsl r2, r1, #16 + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + 10994c: e2403011 sub r3, r0, #17 +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int16_t len = rctx->tot_len-sizeof(*poh); + 109950: e1a02822 lsr r2, r2, #16 + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + 109954: e353000a cmp r3, #10 + 109958: 979ff103 ldrls pc, [pc, r3, lsl #2] + 10995c: ea00000d b 109998 + 109960: 001099a0 .word 0x001099a0 + 109964: 001099c4 .word 0x001099c4 + 109968: 0010998c .word 0x0010998c + 10996c: 001099f4 .word 0x001099f4 + 109970: 00109a10 .word 0x00109a10 + 109974: 00109a2c .word 0x00109a2c + 109978: 00109a4c .word 0x00109a4c + 10997c: 0010998c .word 0x0010998c + 109980: 0010998c .word 0x0010998c + 109984: 00109998 .word 0x00109998 + 109988: 001099e0 .word 0x001099e0 + } + + return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; +not_impl: + DEBUGP("NOT IMPLEMENTED YET "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 10998c: e59f00f0 ldr r0, [pc, #240] ; 109a84 +} + 109990: e8bd4038 pop {r3, r4, r5, lr} + 109994: e12fff1e bx lr + DEBUGP("DUMP REGS "); + goto not_impl; + break; + default: + DEBUGP("UNKNOWN "); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + 109998: e59f00e8 ldr r0, [pc, #232] ; 109a88 + 10999c: eafffffb b 109990 + //} + } + break; + case OPENPCD_CMD_WRITE_REG: + DEBUGP("WRITE_REG(0x%02x, 0x%02x) ", poh->reg, poh->val); + opcd_rc632_reg_write(NULL, poh->reg, poh->val); + 1099a0: e3a00000 mov r0, #0 + 1099a4: e5d41002 ldrb r1, [r4, #2] + 1099a8: e5d42003 ldrb r2, [r4, #3] + 1099ac: ebfffed6 bl 10950c + 1099b0: e5d43001 ldrb r3, [r4, #1] + default: + DEBUGP("UNKNOWN "); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + } + + return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; + 1099b4: e2132001 ands r2, r3, #1 + 1099b8: 01a00002 moveq r0, r2 + 1099bc: 13a00c01 movne r0, #256 ; 0x100 + 1099c0: eafffff2 b 109990 + opcd_rc632_reg_write_set(NULL, poh->data, len); + break; + case OPENPCD_CMD_WRITE_FIFO: + DEBUGP("WRITE FIFO(len=%u): %s ", len, + hexdump(poh->data, len)); + opcd_rc632_fifo_write(NULL, len, poh->data, 0); + 1099c4: e3a00000 mov r0, #0 + 1099c8: e20210ff and r1, r2, #255 ; 0xff + 1099cc: e1a03000 mov r3, r0 + 1099d0: e2842004 add r2, r4, #4 + 1099d4: ebffff06 bl 1095f4 + 1099d8: e5d43001 ldrb r3, [r4, #1] + break; + 1099dc: eafffff4 b 1099b4 + DEBUGP("WRITE_REG(0x%02x, 0x%02x) ", poh->reg, poh->val); + opcd_rc632_reg_write(NULL, poh->reg, poh->val); + break; + case OPENPCD_CMD_WRITE_REG_SET: + DEBUGP("WRITE_REG_SET(%s) ", hexdump(poh->data, len)); + opcd_rc632_reg_write_set(NULL, poh->data, len); + 1099e0: e3a00000 mov r0, #0 + 1099e4: e2841004 add r1, r4, #4 + 1099e8: ebfffed9 bl 109554 + 1099ec: e5d43001 ldrb r3, [r4, #1] + break; + 1099f0: eaffffef b 1099b4 + DEBUGP("WRITE VFIFO "); + goto not_impl; + break; + case OPENPCD_CMD_REG_BITS_CLEAR: + DEBUGP("CLEAR BITS "); + poh->val = opcd_rc632_clear_bits(NULL, poh->reg, poh->val); + 1099f4: e3a00000 mov r0, #0 + 1099f8: e5d41002 ldrb r1, [r4, #2] + 1099fc: e5d42003 ldrb r2, [r4, #3] + 109a00: ebffffb5 bl 1098dc + 109a04: e5d43001 ldrb r3, [r4, #1] + 109a08: e5c40003 strb r0, [r4, #3] + break; + 109a0c: eaffffe8 b 1099b4 + case OPENPCD_CMD_REG_BITS_SET: + DEBUGP("SET BITS "); + poh->val = opcd_rc632_set_bits(NULL, poh->reg, poh->val); + 109a10: e3a00000 mov r0, #0 + 109a14: e5d41002 ldrb r1, [r4, #2] + 109a18: e5d42003 ldrb r2, [r4, #3] + 109a1c: ebffff9b bl 109890 + 109a20: e5d43001 ldrb r3, [r4, #1] + 109a24: e5c40003 strb r0, [r4, #3] + break; + 109a28: eaffffe1 b 1099b4 + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + case OPENPCD_CMD_READ_REG: + opcd_rc632_reg_read(NULL, poh->reg, &poh->val); + 109a2c: e2842003 add r2, r4, #3 + 109a30: e3a00000 mov r0, #0 + 109a34: e5d41002 ldrb r1, [r4, #2] + 109a38: ebffff05 bl 109654 + DEBUGP("READ REG(0x%02x)=0x%02x ", poh->reg, poh->val); + /* register read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + 109a3c: e5d42001 ldrb r2, [r4, #1] + 109a40: e2023001 and r3, r2, #1 + 109a44: e5c43001 strb r3, [r4, #1] + break; + 109a48: eaffffd9 b 1099b4 + case OPENPCD_CMD_READ_FIFO: + /* FIFO read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + 109a4c: e5d43001 ldrb r3, [r4, #1] + 109a50: e203e001 and lr, r3, #1 + hexdump(poh->data, pih_len)); + /* don't set state of second rctx, main function + * body will do this after switch statement */ + } else { +#endif + poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + 109a54: e5d41003 ldrb r1, [r4, #3] + /* register read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + break; + case OPENPCD_CMD_READ_FIFO: + /* FIFO read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + 109a58: e5c4e001 strb lr, [r4, #1] + hexdump(poh->data, pih_len)); + /* don't set state of second rctx, main function + * body will do this after switch statement */ + } else { +#endif + poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + 109a5c: e3a00000 mov r0, #0 + 109a60: e2842004 add r2, r4, #4 + 109a64: ebffff4b bl 109798 + 109a68: e20010ff and r1, r0, #255 ; 0xff + 109a6c: e5c41003 strb r1, [r4, #3] + rctx->tot_len += poh->val; + 109a70: e1d5c0b6 ldrh ip, [r5, #6] + 109a74: e081000c add r0, r1, ip + 109a78: e1c500b6 strh r0, [r5, #6] + 109a7c: e5d43001 ldrb r3, [r4, #1] + DEBUGP("READ FIFO(len=%u)=%s ", poh->val, + hexdump(poh->data, poh->val)); + //} + } + break; + 109a80: eaffffcb b 1099b4 + 109a84: 00000302 .word 0x00000302 + 109a88: 00000301 .word 0x00000301 + +00109a8c : +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 109a8c: e3a02102 mov r2, #-2147483648 ; 0x80000000 + 109a90: e3e03c0f mvn r3, #3840 ; 0xf00 + 109a94: e5832021 str r2, [r3, #33] ; 0x21 +} + +void rc632_unthrottle(void) +{ + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); +} + 109a98: e12fff1e bx lr + +00109a9c : + +void rc632_power(u_int8_t up) +{ + DEBUGPCRF("powering %s RC632", up ? "up" : "down"); + if (up) + 109a9c: e3500000 cmp r0, #0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 109aa0: e3a02020 mov r2, #32 + 109aa4: e3e03c0b mvn r3, #2816 ; 0xb00 + 109aa8: 150320cb strne r2, [r3, #-203] ; 0xffffff35 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_SetOutput( + const AT91PS_PIO pPio, // \arg pointer to a PIO controller + const unsigned int flag) // \arg output to be set +{ + pPio->PIO_SODR = flag; + 109aac: 050320cf streq r2, [r3, #-207] ; 0xffffff31 + 109ab0: e12fff1e bx lr + +00109ab4 : + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, + OPENPCD_PIO_RC632_RESET); +} + +void rc632_reset(void) +{ + 109ab4: e52de004 push {lr} ; (str lr, [sp, #-4]!) + 109ab8: e3a02020 mov r2, #32 + 109abc: e24dd00c sub sp, sp, #12 + 109ac0: e3e01c0b mvn r1, #2816 ; 0xb00 + volatile int i; + + rc632_power(0); + for (i = 0; i < 0xffff; i++) + 109ac4: e3a00000 mov r0, #0 + 109ac8: e50120cf str r2, [r1, #-207] ; 0xffffff31 + 109acc: e58d0000 str r0, [sp] + 109ad0: e59d3000 ldr r3, [sp] + 109ad4: e59f205c ldr r2, [pc, #92] ; 109b38 + 109ad8: e1530002 cmp r3, r2 + 109adc: ca000005 bgt 109af8 + 109ae0: e59d3000 ldr r3, [sp] + 109ae4: e283e001 add lr, r3, #1 + 109ae8: e58de000 str lr, [sp] + 109aec: e59dc000 ldr ip, [sp] + 109af0: e15c0002 cmp ip, r2 + 109af4: dafffff9 ble 109ae0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_ClearOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int flag) // \arg output to be cleared +{ + pPio->PIO_CODR = flag; + 109af8: e3a00020 mov r0, #32 + 109afc: e3e02c0b mvn r2, #2816 ; 0xb00 + 109b00: e50200cb str r0, [r2, #-203] ; 0xffffff35 + rc632_power(1); + + /* wait for startup phase to finish */ + while (1) { + u_int8_t val; + opcd_rc632_reg_read(NULL, RC632_REG_COMMAND, &val); + 109b04: e3a00000 mov r0, #0 + 109b08: e3a01001 mov r1, #1 + 109b0c: e28d2007 add r2, sp, #7 + 109b10: ebfffecf bl 109654 + if (val == 0x00) + 109b14: e5dd0007 ldrb r0, [sp, #7] + 109b18: e3500000 cmp r0, #0 + 109b1c: 1afffff8 bne 109b04 + break; + } + + /* turn off register paging */ + opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); + 109b20: e1a01000 mov r1, r0 + 109b24: e1a02000 mov r2, r0 + 109b28: ebfffe77 bl 10950c +} + 109b2c: e28dd00c add sp, sp, #12 + 109b30: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 109b34: e12fff1e bx lr + 109b38: 0000fffe .word 0x0000fffe + +00109b3c : + DEBUGP("NOT IMPLEMENTED YET "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); +} + +void rc632_init(void) +{ + 109b3c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} + + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + AT91C_PA11_NPCS0|AT91C_PA12_MISO| + AT91C_PA13_MOSI |AT91C_PA14_SPCK, 0); + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 109b40: e59f70ec ldr r7, [pc, #236] ; 109c34 + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + pPio->PIO_BSR = periphBEnable; + 109b44: e3a04000 mov r4, #0 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 109b48: e3a05020 mov r5, #32 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 109b4c: e3e06c0b mvn r6, #2816 ; 0xb00 + 109b50: e3a0ab1e mov sl, #30720 ; 0x7800 +//*---------------------------------------------------------------------------- +static inline void AT91F_PMC_EnablePeriphClock ( + AT91PS_PMC pPMC, // \arg pointer to PMC controller + unsigned int periphIds) // \arg IDs of peripherals to enable +{ + pPMC->PMC_PCER = periphIds; + 109b54: e3e0cc03 mvn ip, #768 ; 0x300 + 109b58: e59f80d8 ldr r8, [pc, #216] ; 109c38 + DEBUGP("NOT IMPLEMENTED YET "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); +} + +void rc632_init(void) +{ + 109b5c: e24dd00c sub sp, sp, #12 + 109b60: e50c50ef str r5, [ip, #-239] ; 0xffffff11 + + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + AT91C_PA11_NPCS0|AT91C_PA12_MISO| + AT91C_PA13_MOSI |AT91C_PA14_SPCK, 0); + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 109b64: e1a03004 mov r3, r4 + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int periphAEnable, // \arg PERIPH A to enable + unsigned int periphBEnable) // \arg PERIPH B to enable + +{ + pPio->PIO_ASR = periphAEnable; + 109b68: e506a08f str sl, [r6, #-143] ; 0xffffff71 + 109b6c: e3a01005 mov r1, #5 + pPio->PIO_BSR = periphBEnable; + 109b70: e506408b str r4, [r6, #-139] ; 0xffffff75 + 109b74: e3a02007 mov r2, #7 + pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 109b78: e506a0fb str sl, [r6, #-251] ; 0xffffff05 + 109b7c: e1a00007 mov r0, r7 + 109b80: e58d8000 str r8, [sp] + 109b84: ebffea80 bl 10458c +static inline void AT91F_SPI_EnableIt ( + AT91PS_SPI pSPI, // pointer to a SPI controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pSPI->SPI_IER = flag; + 109b88: e59fc0ac ldr ip, [pc, #172] ; 109c3c +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 109b8c: e3e08c0f mvn r8, #3840 ; 0xf00 +static inline void AT91F_SPI_EnableIt ( + AT91PS_SPI pSPI, // pointer to a SPI controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pSPI->SPI_IER = flag; + 109b90: e3a0e00c mov lr, #12 +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 109b94: e5885021 str r5, [r8, #33] ; 0x21 +static inline void AT91F_SPI_EnableIt ( + AT91PS_SPI pSPI, // pointer to a SPI controller + unsigned int flag) // IT to be enabled +{ + //* Write to the IER register + pSPI->SPI_IER = flag; + 109b98: e50ce0eb str lr, [ip, #-235] ; 0xffffff15 + 109b9c: e3a0e030 mov lr, #48 ; 0x30 + 109ba0: e50ce0eb str lr, [ip, #-235] ; 0xffffff15 +static inline void AT91F_SPI_CfgMode ( + AT91PS_SPI pSPI, // pointer to a SPI controller + int mode) // mode register +{ + //* Write to the MR register + pSPI->SPI_MR = mode; + 109ba4: e3a0e011 mov lr, #17 + 109ba8: e50ce0fb str lr, [ip, #-251] ; 0xffffff05 + AT91PS_SPI pSPI, // pointer to a SPI controller + int cs, // SPI cs number (0 to 3) + int val) // chip select register +{ + //* Write to the CSR register + *(pSPI->SPI_CSR + cs) = val; + 109bac: e59fe08c ldr lr, [pc, #140] ; 109c40 +static inline void AT91F_SPI_Enable ( + AT91PS_SPI pSPI // pointer to a SPI controller + ) +{ + //* Write to the CR register + pSPI->SPI_CR = AT91C_SPI_SPIEN; + 109bb0: e3a0a001 mov sl, #1 + AT91PS_SPI pSPI, // pointer to a SPI controller + int cs, // SPI cs number (0 to 3) + int val) // chip select register +{ + //* Write to the CSR register + *(pSPI->SPI_CSR + cs) = val; + 109bb4: e50ce0cf str lr, [ip, #-207] ; 0xffffff31 +static inline void AT91F_SPI_Enable ( + AT91PS_SPI pSPI // pointer to a SPI controller + ) +{ + //* Write to the CR register + pSPI->SPI_CR = AT91C_SPI_SPIEN; + 109bb8: e50ca0ff str sl, [ip, #-255] ; 0xffffff01 + AT91F_SPI_CfgCs(pSPI, 0, AT91C_SPI_BITS_8|AT91C_SPI_NCPHA|(0x7f<<8)); +#endif + AT91F_SPI_Enable(pSPI); + + /* Register rc632_irq */ + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632, + 109bbc: e59fc080 ldr ip, [pc, #128] ; 109c44 + 109bc0: e1a02004 mov r2, r4 + 109bc4: e1a03004 mov r3, r4 + 109bc8: e3a0101f mov r1, #31 + 109bcc: e1a00007 mov r0, r7 + 109bd0: e58dc000 str ip, [sp] + 109bd4: ebffea6c bl 10458c +static inline void AT91F_AIC_EnableIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id ) // \arg interrupt number to initialize +{ + //* Enable the interrupt on the interrupt controller + pAic->AIC_IECR = 0x1 << irq_id ; + 109bd8: e3a03102 mov r3, #-2147483648 ; 0x80000000 + 109bdc: e5883021 str r3, [r8, #33] ; 0x21 +//*---------------------------------------------------------------------------- +static inline void AT91F_PIO_CfgOutput( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pioEnable) // \arg PIO to be enabled +{ + pPio->PIO_PER = pioEnable; // Set in PIO mode + 109be0: e50650ff str r5, [r6, #-255] ; 0xffffff01 + pPio->PIO_OER = pioEnable; // Configure in Output + 109be4: e50650ef str r5, [r6, #-239] ; 0xffffff11 + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &rc632_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_RC632_RESET); + + rc632_reset(); + 109be8: ebffffb1 bl 109ab4 + + /* configure IRQ pin */ + opcd_rc632_reg_write(NULL, RC632_REG_IRQ_PIN_CONFIG, + 109bec: e1a00004 mov r0, r4 + 109bf0: e3a0102d mov r1, #45 ; 0x2d + 109bf4: e3a02003 mov r2, #3 + 109bf8: ebfffe43 bl 10950c + RC632_IRQCFG_CMOS|RC632_IRQCFG_INV); + /* enable interrupts */ + opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_EN, RC632_INT_TIMER); + 109bfc: e1a02005 mov r2, r5 + 109c00: e1a00004 mov r0, r4 + 109c04: e3a01006 mov r1, #6 + 109c08: ebfffe3f bl 10950c + + /* configure AUX to test signal four */ + opcd_rc632_reg_write(NULL, RC632_REG_TEST_ANA_SELECT, 0x04); + 109c0c: e1a00004 mov r0, r4 + 109c10: e3a0103a mov r1, #58 ; 0x3a + 109c14: e3a02004 mov r2, #4 + 109c18: ebfffe3b bl 10950c + + usb_hdlr_register(&rc632_usb_in, OPENPCD_CMD_CLS_RC632); + 109c1c: e1a0100a mov r1, sl + 109c20: e59f0020 ldr r0, [pc, #32] ; 109c48 + 109c24: ebfff98d bl 108260 +}; + 109c28: e28dd00c add sp, sp, #12 + 109c2c: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} + 109c30: e12fff1e bx lr + 109c34: fffff000 .word 0xfffff000 + 109c38: 0010940c .word 0x0010940c + 109c3c: fffe00ff .word 0xfffe00ff + 109c40: 00000a02 .word 0x00000a02 + 109c44: 001096b8 .word 0x001096b8 + 109c48: 00109928 .word 0x00109928 + +00109c4c : + + return (val == tmp); +} + +int rc632_dump(void) +{ + 109c4c: e92d40f0 push {r4, r5, r6, r7, lr} + 109c50: e59fc09c ldr ip, [pc, #156] ; 109cf4 + 109c54: e24dd00c sub sp, sp, #12 + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + 109c58: e3a01000 mov r1, #0 + 109c5c: e3a03041 mov r3, #65 ; 0x41 + 109c60: e1cd30b6 strh r3, [sp, #6] + 109c64: e3a00001 mov r0, #1 + for (i = 0; i <= 0x3f; i++) { + u_int8_t reg = i; + if (reg == RC632_REG_FIFO_DATA) + reg = 0x3e; + + spi_outbuf[i] = reg << 1; + 109c68: e28c7046 add r7, ip, #70 ; 0x46 + 109c6c: e3a0607c mov r6, #124 ; 0x7c + spi_inbuf[i] = 0x00; + 109c70: e1a05001 mov r5, r1 + 109c74: ea000008 b 109c9c +int rc632_dump(void) +{ + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + + for (i = 0; i <= 0x3f; i++) { + 109c78: e350003f cmp r0, #63 ; 0x3f + u_int8_t reg = i; + if (reg == RC632_REG_FIFO_DATA) + reg = 0x3e; + + spi_outbuf[i] = reg << 1; + 109c7c: e5ce4044 strb r4, [lr, #68] ; 0x44 + 109c80: e59f306c ldr r3, [pc, #108] ; 109cf4 + spi_inbuf[i] = 0x00; + 109c84: e3a04000 mov r4, #0 + 109c88: e7cc5002 strb r5, [ip, r2] +int rc632_dump(void) +{ + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + + for (i = 0; i <= 0x3f; i++) { + 109c8c: 8a00000a bhi 109cbc +} + +int rc632_dump(void) +{ + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + 109c90: e2800001 add r0, r0, #1 + 109c94: e2811001 add r1, r1, #1 + 109c98: e20000ff and r0, r0, #255 ; 0xff + 109c9c: e20120ff and r2, r1, #255 ; 0xff + + for (i = 0; i <= 0x3f; i++) { + u_int8_t reg = i; + if (reg == RC632_REG_FIFO_DATA) + 109ca0: e3520002 cmp r2, #2 + reg = 0x3e; + + spi_outbuf[i] = reg << 1; + 109ca4: e08ce002 add lr, ip, r2 + 109ca8: e1a04082 lsl r4, r2, #1 + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + + for (i = 0; i <= 0x3f; i++) { + u_int8_t reg = i; + if (reg == RC632_REG_FIFO_DATA) + 109cac: 1afffff1 bne 109c78 + reg = 0x3e; + + spi_outbuf[i] = reg << 1; + 109cb0: e5c76000 strb r6, [r7] + spi_inbuf[i] = 0x00; + 109cb4: e7cc5002 strb r5, [ip, r2] + 109cb8: eafffff4 b 109c90 + } + + /* MSB of first byte of read spi transfer is high */ + spi_outbuf[0] |= 0x80; + 109cbc: e5d32044 ldrb r2, [r3, #68] ; 0x44 + 109cc0: e1e01c82 mvn r1, r2, lsl #25 + 109cc4: e1e0cca1 mvn ip, r1, lsr #25 + + /* last byte of read spi transfer is 0x00 */ + spi_outbuf[0x40] = 0x00; + spi_inbuf[0x40] = 0x00; + + spi_transceive(spi_outbuf, 0x41, spi_inbuf, &rx_len); + 109cc8: e2830044 add r0, r3, #68 ; 0x44 + 109ccc: e3a01041 mov r1, #65 ; 0x41 + 109cd0: e28d2006 add r2, sp, #6 + spi_outbuf[i] = reg << 1; + spi_inbuf[i] = 0x00; + } + + /* MSB of first byte of read spi transfer is high */ + spi_outbuf[0] |= 0x80; + 109cd4: e5c3c044 strb ip, [r3, #68] ; 0x44 + + /* last byte of read spi transfer is 0x00 */ + spi_outbuf[0x40] = 0x00; + 109cd8: e5c34084 strb r4, [r3, #132] ; 0x84 + spi_inbuf[0x40] = 0x00; + 109cdc: e5c34040 strb r4, [r3, #64] ; 0x40 + + spi_transceive(spi_outbuf, 0x41, spi_inbuf, &rx_len); + 109ce0: ebfffdd7 bl 109444 + else + DEBUGPCR("REG 0x%02x = 0x%02x", i, spi_inbuf[i+1]); + } + + return 0; +} + 109ce4: e1a00004 mov r0, r4 + 109ce8: e28dd00c add sp, sp, #12 + 109cec: e8bd40f0 pop {r4, r5, r6, r7, lr} + 109cf0: e12fff1e bx lr + 109cf4: 00203928 .word 0x00203928 + +00109cf8 : + +int rc632_test(struct rfid_asic_handle *hdl) +{ + 109cf8: e92d4010 push {r4, lr} + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + 109cfc: e3a01055 mov r1, #85 ; 0x55 + + return 0; +} + +int rc632_test(struct rfid_asic_handle *hdl) +{ + 109d00: e1a04000 mov r4, r0 + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + 109d04: ebfffe91 bl 109750 + 109d08: e3500001 cmp r0, #1 + return -1; + 109d0c: 13e00000 mvnne r0, #0 + return 0; +} + +int rc632_test(struct rfid_asic_handle *hdl) +{ + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + 109d10: 0a000001 beq 109d1c + + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0xAA) != 1) + return -1; + + return 0; +} + 109d14: e8bd4010 pop {r4, lr} + 109d18: e12fff1e bx lr +int rc632_test(struct rfid_asic_handle *hdl) +{ + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + return -1; + + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0xAA) != 1) + 109d1c: e1a00004 mov r0, r4 + 109d20: e3a010aa mov r1, #170 ; 0xaa + 109d24: ebfffe89 bl 109750 + 109d28: e3500001 cmp r0, #1 + return -1; + 109d2c: 03a00000 moveq r0, #0 + 109d30: 13e00000 mvnne r0, #0 + 109d34: eafffff6 b 109d14 + +00109d38 : + return opcd_rc632_reg_write(handle, reg, (tmp & ~mask)|(val & mask)); +} + +int +rc632_turn_on_rf(struct rfid_asic_handle *handle) +{ + 109d38: e92d4008 push {r3, lr} + ENTER(); + return opcd_rc632_set_bits(handle, RC632_REG_TX_CONTROL, 0x03); + 109d3c: e3a01011 mov r1, #17 + 109d40: e3a02003 mov r2, #3 + 109d44: ebfffed1 bl 109890 +} + 109d48: e8bd4008 pop {r3, lr} + 109d4c: e12fff1e bx lr + +00109d50 : + +int +rc632_turn_off_rf(struct rfid_asic_handle *handle) +{ + 109d50: e92d4008 push {r3, lr} + ENTER(); + return opcd_rc632_clear_bits(handle, RC632_REG_TX_CONTROL, 0x03); + 109d54: e3a01011 mov r1, #17 + 109d58: e3a02003 mov r2, #3 + 109d5c: ebfffede bl 1098dc +} + 109d60: e8bd4008 pop {r3, lr} + 109d64: e12fff1e bx lr + +00109d68 : +#define MAX_WRITE_LEN 16 /* see Sec. 18.6.1.2 of RC632 Spec Rev. 3.2. */ + +int +rc632_write_eeprom(struct rfid_asic_handle *handle, + u_int16_t addr, u_int8_t len, u_int8_t *data) +{ + 109d68: e92d4030 push {r4, r5, lr} + u_int8_t sndbuf[MAX_WRITE_LEN + 2]; + u_int8_t reg; + int ret; + + if (len > MAX_WRITE_LEN) + 109d6c: e3520010 cmp r2, #16 +#define MAX_WRITE_LEN 16 /* see Sec. 18.6.1.2 of RC632 Spec Rev. 3.2. */ + +int +rc632_write_eeprom(struct rfid_asic_handle *handle, + u_int16_t addr, u_int8_t len, u_int8_t *data) +{ + 109d70: e24dd01c sub sp, sp, #28 + 109d74: e1a04002 mov r4, r2 + 109d78: e1a05000 mov r5, r0 + 109d7c: e1a0c001 mov ip, r1 + u_int8_t sndbuf[MAX_WRITE_LEN + 2]; + u_int8_t reg; + int ret; + + if (len > MAX_WRITE_LEN) + 109d80: 9a000003 bls 109d94 + return -EINVAL; + if (addr < 0x10) + return -EPERM; + if (addr > 0x1ff) + return -EINVAL; + 109d84: e3e00015 mvn r0, #21 + break; + } + } + + return ret; +} + 109d88: e28dd01c add sp, sp, #28 + 109d8c: e8bd4030 pop {r4, r5, lr} + 109d90: e12fff1e bx lr + u_int8_t reg; + int ret; + + if (len > MAX_WRITE_LEN) + return -EINVAL; + if (addr < 0x10) + 109d94: e351000f cmp r1, #15 + 109d98: 8a000001 bhi 109da4 + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_ACCESS_ERR) + return -EPERM; + 109d9c: e3e00000 mvn r0, #0 + 109da0: eafffff8 b 109d88 + + if (len > MAX_WRITE_LEN) + return -EINVAL; + if (addr < 0x10) + return -EPERM; + if (addr > 0x1ff) + 109da4: e3510c02 cmp r1, #512 ; 0x200 + 109da8: 2afffff5 bcs 109d84 + return -EINVAL; + + sndbuf[0] = addr & 0x00ff; /* LSB */ + sndbuf[1] = addr >> 8; /* MSB */ + 109dac: e1a0e421 lsr lr, r1, #8 + memcpy(&sndbuf[2], data, len); + 109db0: e28d0006 add r0, sp, #6 + 109db4: e1a01003 mov r1, r3 + if (addr < 0x10) + return -EPERM; + if (addr > 0x1ff) + return -EINVAL; + + sndbuf[0] = addr & 0x00ff; /* LSB */ + 109db8: e5cdc004 strb ip, [sp, #4] + sndbuf[1] = addr >> 8; /* MSB */ + 109dbc: e5cde005 strb lr, [sp, #5] + memcpy(&sndbuf[2], data, len); + 109dc0: eb0000d1 bl 10a10c + + ret = opcd_rc632_fifo_write(handle, len + 2, sndbuf, 0x03); + 109dc4: e2841002 add r1, r4, #2 + 109dc8: e1a00005 mov r0, r5 + 109dcc: e20110ff and r1, r1, #255 ; 0xff + 109dd0: e28d2004 add r2, sp, #4 + 109dd4: e3a03003 mov r3, #3 + 109dd8: ebfffe05 bl 1095f4 + if (ret < 0) + 109ddc: e3500000 cmp r0, #0 + 109de0: baffffe8 blt 109d88 + return ret; + + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_WRITE_E2); + 109de4: e3a01001 mov r1, #1 + 109de8: e1a00005 mov r0, r5 + 109dec: e1a02001 mov r2, r1 + 109df0: ebfffdc5 bl 10950c + if (ret < 0) + 109df4: e3500000 cmp r0, #0 + 109df8: baffffe2 blt 109d88 + return ret; + + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + 109dfc: e1a00005 mov r0, r5 + 109e00: e3a0100a mov r1, #10 + 109e04: e28d2017 add r2, sp, #23 + 109e08: ebfffe11 bl 109654 + if (ret < 0) + 109e0c: e3500000 cmp r0, #0 + 109e10: baffffdc blt 109d88 + return ret; + + if (reg & RC632_ERR_FLAG_ACCESS_ERR) + 109e14: e5dd3017 ldrb r3, [sp, #23] + 109e18: e3130020 tst r3, #32 + 109e1c: 1affffde bne 109d9c + return -EPERM; + + while (1) { + ret = opcd_rc632_reg_read(handle, RC632_REG_SECONDARY_STATUS, ®); + 109e20: e1a00005 mov r0, r5 + 109e24: e3a01005 mov r1, #5 + 109e28: e28d2017 add r2, sp, #23 + 109e2c: ebfffe08 bl 109654 + if (ret < 0) + 109e30: e3500000 cmp r0, #0 + 109e34: baffffd3 blt 109d88 + return ret; + + if (reg & RC632_SEC_ST_E2_READY) { + 109e38: e5dd0017 ldrb r0, [sp, #23] + 109e3c: e3100040 tst r0, #64 ; 0x40 + 109e40: 0afffff6 beq 109e20 + /* the E2Write command must be terminated, See sec. 18.6.1.3 */ + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + 109e44: e1a00005 mov r0, r5 + 109e48: e3a01001 mov r1, #1 + 109e4c: e3a02000 mov r2, #0 + 109e50: ebfffdad bl 10950c + break; + } + } + + return ret; + 109e54: eaffffcb b 109d88 + +00109e58 : +} + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf) +{ + 109e58: e92d4070 push {r4, r5, r6, lr} + 109e5c: e1a0c001 mov ip, r1 + 109e60: e24dd008 sub sp, sp, #8 + + sndbuf[0] = (addr & 0xff); + sndbuf[1] = addr >> 8; + sndbuf[2] = len; + + ret = opcd_rc632_fifo_write(handle, 3, sndbuf, 0x03); + 109e64: e3a01003 mov r1, #3 +} + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf) +{ + 109e68: e1a04002 mov r4, r2 + u_int8_t sndbuf[3]; + u_int8_t err; + int ret; + + sndbuf[0] = (addr & 0xff); + sndbuf[1] = addr >> 8; + 109e6c: e1a0e42c lsr lr, ip, #8 +} + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf) +{ + 109e70: e1a06003 mov r6, r3 + + sndbuf[0] = (addr & 0xff); + sndbuf[1] = addr >> 8; + sndbuf[2] = len; + + ret = opcd_rc632_fifo_write(handle, 3, sndbuf, 0x03); + 109e74: e28d2004 add r2, sp, #4 + 109e78: e1a03001 mov r3, r1 +} + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf) +{ + 109e7c: e1a05000 mov r5, r0 + u_int8_t sndbuf[3]; + u_int8_t err; + int ret; + + sndbuf[0] = (addr & 0xff); + 109e80: e5cdc004 strb ip, [sp, #4] + sndbuf[1] = addr >> 8; + 109e84: e5cde005 strb lr, [sp, #5] + sndbuf[2] = len; + 109e88: e5cd4006 strb r4, [sp, #6] + + ret = opcd_rc632_fifo_write(handle, 3, sndbuf, 0x03); + 109e8c: ebfffdd8 bl 1095f4 + if (ret < 0) + 109e90: e3500000 cmp r0, #0 + 109e94: ba000005 blt 109eb0 + return ret; + + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_READ_E2); + 109e98: e1a00005 mov r0, r5 + 109e9c: e3a01001 mov r1, #1 + 109ea0: e3a02003 mov r2, #3 + 109ea4: ebfffd98 bl 10950c + if (ret < 0) + 109ea8: e3500000 cmp r0, #0 + 109eac: aa000002 bge 109ebc + ret = opcd_rc632_fifo_read(handle, len, recvbuf); + if (ret < 0) + return ret; + + return len; +} + 109eb0: e28dd008 add sp, sp, #8 + 109eb4: e8bd4070 pop {r4, r5, r6, lr} + 109eb8: e12fff1e bx lr + if (ret < 0) + return ret; + + /* usleep(20000); */ + + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + 109ebc: e1a00005 mov r0, r5 + 109ec0: e3a0100a mov r1, #10 + 109ec4: e28d2007 add r2, sp, #7 + 109ec8: ebfffde1 bl 109654 + if (err & RC632_ERR_FLAG_ACCESS_ERR) + 109ecc: e5dd3007 ldrb r3, [sp, #7] + 109ed0: e3130020 tst r3, #32 + return -EPERM; + 109ed4: 13e00000 mvnne r0, #0 + return ret; + + /* usleep(20000); */ + + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + if (err & RC632_ERR_FLAG_ACCESS_ERR) + 109ed8: 1afffff4 bne 109eb0 + return -EPERM; + + ret = opcd_rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &err); + 109edc: e3a01004 mov r1, #4 + 109ee0: e28d2007 add r2, sp, #7 + 109ee4: e1a00005 mov r0, r5 + 109ee8: ebfffdd9 bl 109654 + 109eec: e5dd0007 ldrb r0, [sp, #7] + 109ef0: e1540000 cmp r4, r0 + 109ef4: 21a04000 movcs r4, r0 + if (err < len) + len = err; + + ret = opcd_rc632_fifo_read(handle, len, recvbuf); + 109ef8: e1a01004 mov r1, r4 + 109efc: e1a00005 mov r0, r5 + 109f00: e1a02006 mov r2, r6 + 109f04: ebfffe23 bl 109798 + if (ret < 0) + return ret; + + return len; + 109f08: e3500000 cmp r0, #0 + 109f0c: a1a00004 movge r0, r4 + 109f10: eaffffe6 b 109eb0 + +00109f14 : +#define RC632_E2_PRODUCT_SERIAL 8 +#define RC632_E2_RS_MAX_P 14 + +int rc632_get_serial(struct rfid_asic_handle *handle, + u_int32_t *serial) +{ + 109f14: e1a03001 mov r3, r1 + return rc632_read_eeprom(handle, RC632_E2_PRODUCT_SERIAL, + 109f18: e3a02004 mov r2, #4 + 109f1c: e3a01008 mov r1, #8 + 109f20: eaffffcc b 109e58 + +00109f24 <_init_func>: +#include + +#define RAH NULL + +void _init_func(void) +{ + 109f24: e92d4008 push {r3, lr} + rc632_init(); + 109f28: ebffff03 bl 109b3c +} + 109f2c: e8bd4008 pop {r3, lr} + 109f30: e12fff1e bx lr + +00109f34 <_main_dbgu>: + +int _main_dbgu(char key) +{ + 109f34: e52de004 push {lr} ; (str lr, [sp, #-4]!) + unsigned char value; + + switch (key) { + 109f38: e2400034 sub r0, r0, #52 ; 0x34 +{ + rc632_init(); +} + +int _main_dbgu(char key) +{ + 109f3c: e24dd00c sub sp, sp, #12 + unsigned char value; + + switch (key) { + 109f40: e350003c cmp r0, #60 ; 0x3c + 109f44: 979ff100 ldrls pc, [pc, r0, lsl #2] + 109f48: ea00003f b 10a04c <_main_dbgu+0x118> + 109f4c: 0010a068 .word 0x0010a068 + 109f50: 0010a08c .word 0x0010a08c + 109f54: 0010a0a0 .word 0x0010a0a0 + 109f58: 0010a0b4 .word 0x0010a0b4 + 109f5c: 0010a04c .word 0x0010a04c + 109f60: 0010a04c .word 0x0010a04c + 109f64: 0010a04c .word 0x0010a04c + 109f68: 0010a04c .word 0x0010a04c + 109f6c: 0010a04c .word 0x0010a04c + 109f70: 0010a04c .word 0x0010a04c + 109f74: 0010a04c .word 0x0010a04c + 109f78: 0010a04c .word 0x0010a04c + 109f7c: 0010a04c .word 0x0010a04c + 109f80: 0010a04c .word 0x0010a04c + 109f84: 0010a04c .word 0x0010a04c + 109f88: 0010a04c .word 0x0010a04c + 109f8c: 0010a04c .word 0x0010a04c + 109f90: 0010a04c .word 0x0010a04c + 109f94: 0010a04c .word 0x0010a04c + 109f98: 0010a04c .word 0x0010a04c + 109f9c: 0010a04c .word 0x0010a04c + 109fa0: 0010a04c .word 0x0010a04c + 109fa4: 0010a04c .word 0x0010a04c + 109fa8: 0010a04c .word 0x0010a04c + 109fac: 0010a04c .word 0x0010a04c + 109fb0: 0010a04c .word 0x0010a04c + 109fb4: 0010a04c .word 0x0010a04c + 109fb8: 0010a04c .word 0x0010a04c + 109fbc: 0010a040 .word 0x0010a040 + 109fc0: 0010a04c .word 0x0010a04c + 109fc4: 0010a04c .word 0x0010a04c + 109fc8: 0010a04c .word 0x0010a04c + 109fcc: 0010a04c .word 0x0010a04c + 109fd0: 0010a04c .word 0x0010a04c + 109fd4: 0010a04c .word 0x0010a04c + 109fd8: 0010a04c .word 0x0010a04c + 109fdc: 0010a04c .word 0x0010a04c + 109fe0: 0010a04c .word 0x0010a04c + 109fe4: 0010a04c .word 0x0010a04c + 109fe8: 0010a04c .word 0x0010a04c + 109fec: 0010a04c .word 0x0010a04c + 109ff0: 0010a04c .word 0x0010a04c + 109ff4: 0010a04c .word 0x0010a04c + 109ff8: 0010a04c .word 0x0010a04c + 109ffc: 0010a04c .word 0x0010a04c + 10a000: 0010a04c .word 0x0010a04c + 10a004: 0010a04c .word 0x0010a04c + 10a008: 0010a04c .word 0x0010a04c + 10a00c: 0010a04c .word 0x0010a04c + 10a010: 0010a04c .word 0x0010a04c + 10a014: 0010a04c .word 0x0010a04c + 10a018: 0010a04c .word 0x0010a04c + 10a01c: 0010a04c .word 0x0010a04c + 10a020: 0010a04c .word 0x0010a04c + 10a024: 0010a04c .word 0x0010a04c + 10a028: 0010a04c .word 0x0010a04c + 10a02c: 0010a04c .word 0x0010a04c + 10a030: 0010a04c .word 0x0010a04c + 10a034: 0010a04c .word 0x0010a04c + 10a038: 0010a04c .word 0x0010a04c + 10a03c: 0010a05c .word 0x0010a05c + break; + case '7': + rc632_dump(); + break; + case 'P': + rc632_power(1); + 10a040: e3a00001 mov r0, #1 + 10a044: ebfffe94 bl 109a9c + rc632_init(); + 10a048: ebfffebb bl 109b3c + rc632_power(0); + break; + } + + return -EINVAL; +} + 10a04c: e3e00015 mvn r0, #21 + 10a050: e28dd00c add sp, sp, #12 + 10a054: e49de004 pop {lr} ; (ldr lr, [sp], #4) + 10a058: e12fff1e bx lr + case 'P': + rc632_power(1); + rc632_init(); + break; + case 'p': + rc632_power(0); + 10a05c: e3a00000 mov r0, #0 + 10a060: ebfffe8d bl 109a9c + break; + 10a064: eafffff8 b 10a04c <_main_dbgu+0x118> +{ + unsigned char value; + + switch (key) { + case '4': + AT91F_DBGU_Printk("Testing RC632 : "); + 10a068: e59f004c ldr r0, [pc, #76] ; 10a0bc <_main_dbgu+0x188> + 10a06c: ebfff664 bl 107a04 + if (rc632_test(RAH) == 0) + 10a070: e3a00000 mov r0, #0 + 10a074: ebffff1f bl 109cf8 + 10a078: e3500000 cmp r0, #0 + AT91F_DBGU_Printk("SUCCESS!\n\r"); + 10a07c: 059f003c ldreq r0, [pc, #60] ; 10a0c0 <_main_dbgu+0x18c> + else + AT91F_DBGU_Printk("ERROR!\n\r"); + 10a080: 159f003c ldrne r0, [pc, #60] ; 10a0c4 <_main_dbgu+0x190> + 10a084: ebfff65e bl 107a04 + 10a088: eaffffef b 10a04c <_main_dbgu+0x118> + + break; + case '5': + opcd_rc632_reg_read(RAH, RC632_REG_RX_WAIT, &value); + 10a08c: e3a01021 mov r1, #33 ; 0x21 + 10a090: e28d2007 add r2, sp, #7 + 10a094: e3a00000 mov r0, #0 + 10a098: ebfffd6d bl 109654 + DEBUGPCR("Reading RC632 Reg RxWait: 0x%02xr", value); + + break; + 10a09c: eaffffea b 10a04c <_main_dbgu+0x118> + case '6': + DEBUGPCR("Writing RC632 Reg RxWait: 0x55"); + opcd_rc632_reg_write(RAH, RC632_REG_RX_WAIT, 0x55); + 10a0a0: e3a01021 mov r1, #33 ; 0x21 + 10a0a4: e3a02055 mov r2, #85 ; 0x55 + 10a0a8: e3a00000 mov r0, #0 + 10a0ac: ebfffd16 bl 10950c + break; + 10a0b0: eaffffe5 b 10a04c <_main_dbgu+0x118> + case '7': + rc632_dump(); + 10a0b4: ebfffee4 bl 109c4c + break; + 10a0b8: eaffffe3 b 10a04c <_main_dbgu+0x118> + 10a0bc: 0010ae18 .word 0x0010ae18 + 10a0c0: 0010ae2c .word 0x0010ae2c + 10a0c4: 0010ae38 .word 0x0010ae38 + +0010a0c8 <_main_func>: + + return -EINVAL; +} + +void _main_func(void) +{ + 10a0c8: e92d4010 push {r4, lr} + static int i; + + if(i<4096) + 10a0cc: e59f4034 ldr r4, [pc, #52] ; 10a108 <_main_func+0x40> + 10a0d0: e5943000 ldr r3, [r4] + 10a0d4: e3530a01 cmp r3, #4096 ; 0x1000 + i++; + 10a0d8: b2833001 addlt r3, r3, #1 + 10a0dc: b5843000 strlt r3, [r4] + +void _main_func(void) +{ + static int i; + + if(i<4096) + 10a0e0: ba000003 blt 10a0f4 <_main_func+0x2c> + i++; + else + { + led_toggle(1); + 10a0e4: e3a00001 mov r0, #1 + 10a0e8: ebfff77d bl 107ee4 + i=0; + 10a0ec: e3a00000 mov r0, #0 + 10a0f0: e5840000 str r0, [r4] + } + + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + 10a0f4: ebfff863 bl 108288 + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + 10a0f8: ebfff869 bl 1082a4 + + rc632_unthrottle(); + 10a0fc: ebfffe62 bl 109a8c +} + 10a100: e8bd4010 pop {r4, lr} + 10a104: e12fff1e bx lr + 10a108: 00203a10 .word 0x00203a10 + +0010a10c : + 10a10c: e3520003 cmp r2, #3 + 10a110: e92d01f0 push {r4, r5, r6, r7, r8} + 10a114: 8a000009 bhi 10a140 + 10a118: e3520000 cmp r2, #0 + 10a11c: 0a000005 beq 10a138 + 10a120: e3a03000 mov r3, #0 + 10a124: e7d1c003 ldrb ip, [r1, r3] + 10a128: e7c0c003 strb ip, [r0, r3] + 10a12c: e2833001 add r3, r3, #1 + 10a130: e1530002 cmp r3, r2 + 10a134: 1afffffa bne 10a124 + 10a138: e8bd01f0 pop {r4, r5, r6, r7, r8} + 10a13c: e12fff1e bx lr + 10a140: e1a03001 mov r3, r1 + 10a144: e0802002 add r2, r0, r2 + 10a148: e1a01000 mov r1, r0 + 10a14c: ea000002 b 10a15c + 10a150: e5dcc000 ldrb ip, [ip] + 10a154: e4c1c001 strb ip, [r1], #1 + 10a158: e2833001 add r3, r3, #1 + 10a15c: e3110003 tst r1, #3 + 10a160: e1a0c003 mov ip, r3 + 10a164: 1afffff9 bne 10a150 + 10a168: e2134003 ands r4, r3, #3 + 10a16c: 0a000034 beq 10a244 + 10a170: e2645000 rsb r5, r4, #0 + 10a174: e2647004 rsb r7, r4, #4 + 10a178: e7933005 ldr r3, [r3, r5] + 10a17c: e1a04184 lsl r4, r4, #3 + 10a180: e1a07187 lsl r7, r7, #3 + 10a184: ea000005 b 10a1a0 + 10a188: e28cc004 add ip, ip, #4 + 10a18c: e79c6005 ldr r6, [ip, r5] + 10a190: e1a08716 lsl r8, r6, r7 + 10a194: e1883433 orr r3, r8, r3, lsr r4 + 10a198: e4813004 str r3, [r1], #4 + 10a19c: e1a03006 mov r3, r6 + 10a1a0: e0616002 rsb r6, r1, r2 + 10a1a4: e3560003 cmp r6, #3 + 10a1a8: cafffff6 bgt 10a188 + 10a1ac: ea000001 b 10a1b8 + 10a1b0: e4dc3001 ldrb r3, [ip], #1 + 10a1b4: e4c13001 strb r3, [r1], #1 + 10a1b8: e1520001 cmp r2, r1 + 10a1bc: 8afffffb bhi 10a1b0 + 10a1c0: eaffffdc b 10a138 + 10a1c4: e513c040 ldr ip, [r3, #-64] ; 0xffffffc0 + 10a1c8: e501c040 str ip, [r1, #-64] ; 0xffffffc0 + 10a1cc: e513c03c ldr ip, [r3, #-60] ; 0xffffffc4 + 10a1d0: e501c03c str ip, [r1, #-60] ; 0xffffffc4 + 10a1d4: e513c038 ldr ip, [r3, #-56] ; 0xffffffc8 + 10a1d8: e501c038 str ip, [r1, #-56] ; 0xffffffc8 + 10a1dc: e513c034 ldr ip, [r3, #-52] ; 0xffffffcc + 10a1e0: e501c034 str ip, [r1, #-52] ; 0xffffffcc + 10a1e4: e513c030 ldr ip, [r3, #-48] ; 0xffffffd0 + 10a1e8: e501c030 str ip, [r1, #-48] ; 0xffffffd0 + 10a1ec: e513c02c ldr ip, [r3, #-44] ; 0xffffffd4 + 10a1f0: e501c02c str ip, [r1, #-44] ; 0xffffffd4 + 10a1f4: e513c028 ldr ip, [r3, #-40] ; 0xffffffd8 + 10a1f8: e501c028 str ip, [r1, #-40] ; 0xffffffd8 + 10a1fc: e513c024 ldr ip, [r3, #-36] ; 0xffffffdc + 10a200: e501c024 str ip, [r1, #-36] ; 0xffffffdc + 10a204: e513c020 ldr ip, [r3, #-32] ; 0xffffffe0 + 10a208: e501c020 str ip, [r1, #-32] ; 0xffffffe0 + 10a20c: e513c01c ldr ip, [r3, #-28] ; 0xffffffe4 + 10a210: e501c01c str ip, [r1, #-28] ; 0xffffffe4 + 10a214: e513c018 ldr ip, [r3, #-24] ; 0xffffffe8 + 10a218: e501c018 str ip, [r1, #-24] ; 0xffffffe8 + 10a21c: e513c014 ldr ip, [r3, #-20] ; 0xffffffec + 10a220: e501c014 str ip, [r1, #-20] ; 0xffffffec + 10a224: e513c010 ldr ip, [r3, #-16] + 10a228: e501c010 str ip, [r1, #-16] + 10a22c: e513c00c ldr ip, [r3, #-12] + 10a230: e501c00c str ip, [r1, #-12] + 10a234: e513c008 ldr ip, [r3, #-8] + 10a238: e501c008 str ip, [r1, #-8] + 10a23c: e513c004 ldr ip, [r3, #-4] + 10a240: e501c004 str ip, [r1, #-4] + 10a244: e061c002 rsb ip, r1, r2 + 10a248: e35c003f cmp ip, #63 ; 0x3f + 10a24c: e1a04003 mov r4, r3 + 10a250: e1a0c001 mov ip, r1 + 10a254: e2833040 add r3, r3, #64 ; 0x40 + 10a258: e2811040 add r1, r1, #64 ; 0x40 + 10a25c: caffffd8 bgt 10a1c4 + 10a260: e1a03004 mov r3, r4 + 10a264: ea000007 b 10a288 + 10a268: e5131010 ldr r1, [r3, #-16] + 10a26c: e50c1010 str r1, [ip, #-16] + 10a270: e513100c ldr r1, [r3, #-12] + 10a274: e50c100c str r1, [ip, #-12] + 10a278: e5131008 ldr r1, [r3, #-8] + 10a27c: e50c1008 str r1, [ip, #-8] + 10a280: e5131004 ldr r1, [r3, #-4] + 10a284: e50c1004 str r1, [ip, #-4] + 10a288: e1a0100c mov r1, ip + 10a28c: e06cc002 rsb ip, ip, r2 + 10a290: e35c000f cmp ip, #15 + 10a294: e1a04003 mov r4, r3 + 10a298: e281c010 add ip, r1, #16 + 10a29c: e2833010 add r3, r3, #16 + 10a2a0: cafffff0 bgt 10a268 + 10a2a4: e1a03004 mov r3, r4 + 10a2a8: ea000002 b 10a2b8 + 10a2ac: e59cc000 ldr ip, [ip] + 10a2b0: e481c004 str ip, [r1], #4 + 10a2b4: e2833004 add r3, r3, #4 + 10a2b8: e061c002 rsb ip, r1, r2 + 10a2bc: e35c0003 cmp ip, #3 + 10a2c0: e1a0c003 mov ip, r3 + 10a2c4: cafffff8 bgt 10a2ac + 10a2c8: eaffffba b 10a1b8 + +0010a2cc : + 10a2cc: e3520003 cmp r2, #3 + 10a2d0: e52d4004 push {r4} ; (str r4, [sp, #-4]!) + 10a2d4: e20110ff and r1, r1, #255 ; 0xff + 10a2d8: 8a000008 bhi 10a300 + 10a2dc: e3520000 cmp r2, #0 + 10a2e0: 0a000004 beq 10a2f8 + 10a2e4: e1a03000 mov r3, r0 + 10a2e8: e0822000 add r2, r2, r0 + 10a2ec: e4c31001 strb r1, [r3], #1 + 10a2f0: e1530002 cmp r3, r2 + 10a2f4: 1afffffc bne 10a2ec + 10a2f8: e49d4004 pop {r4} ; (ldr r4, [sp], #4) + 10a2fc: e12fff1e bx lr + 10a300: e0802002 add r2, r0, r2 + 10a304: e1a0c000 mov ip, r0 + 10a308: ea000000 b 10a310 + 10a30c: e4cc1001 strb r1, [ip], #1 + 10a310: e31c0003 tst ip, #3 + 10a314: 1afffffc bne 10a30c + 10a318: e0813401 add r3, r1, r1, lsl #8 + 10a31c: e0833803 add r3, r3, r3, lsl #16 + 10a320: ea00000f b 10a364 + 10a324: e50c3040 str r3, [ip, #-64] ; 0xffffffc0 + 10a328: e50c303c str r3, [ip, #-60] ; 0xffffffc4 + 10a32c: e50c3038 str r3, [ip, #-56] ; 0xffffffc8 + 10a330: e50c3034 str r3, [ip, #-52] ; 0xffffffcc + 10a334: e50c3030 str r3, [ip, #-48] ; 0xffffffd0 + 10a338: e50c302c str r3, [ip, #-44] ; 0xffffffd4 + 10a33c: e50c3028 str r3, [ip, #-40] ; 0xffffffd8 + 10a340: e50c3024 str r3, [ip, #-36] ; 0xffffffdc + 10a344: e50c3020 str r3, [ip, #-32] ; 0xffffffe0 + 10a348: e50c301c str r3, [ip, #-28] ; 0xffffffe4 + 10a34c: e50c3018 str r3, [ip, #-24] ; 0xffffffe8 + 10a350: e50c3014 str r3, [ip, #-20] ; 0xffffffec + 10a354: e50c3010 str r3, [ip, #-16] + 10a358: e50c300c str r3, [ip, #-12] + 10a35c: e50c3008 str r3, [ip, #-8] + 10a360: e50c3004 str r3, [ip, #-4] + 10a364: e06c4002 rsb r4, ip, r2 + 10a368: e354003f cmp r4, #63 ; 0x3f + 10a36c: e1a0400c mov r4, ip + 10a370: e28cc040 add ip, ip, #64 ; 0x40 + 10a374: caffffea bgt 10a324 + 10a378: e1a0c004 mov ip, r4 + 10a37c: ea000003 b 10a390 + 10a380: e50c3010 str r3, [ip, #-16] + 10a384: e50c300c str r3, [ip, #-12] + 10a388: e50c3008 str r3, [ip, #-8] + 10a38c: e50c3004 str r3, [ip, #-4] + 10a390: e06c4002 rsb r4, ip, r2 + 10a394: e354000f cmp r4, #15 + 10a398: e1a0400c mov r4, ip + 10a39c: e28cc010 add ip, ip, #16 + 10a3a0: cafffff6 bgt 10a380 + 10a3a4: ea000000 b 10a3ac + 10a3a8: e4843004 str r3, [r4], #4 + 10a3ac: e064c002 rsb ip, r4, r2 + 10a3b0: e35c0003 cmp ip, #3 + 10a3b4: cafffffb bgt 10a3a8 + 10a3b8: ea000000 b 10a3c0 + 10a3bc: e4c41001 strb r1, [r4], #1 + 10a3c0: e1540002 cmp r4, r2 + 10a3c4: 3afffffc bcc 10a3bc + 10a3c8: eaffffca b 10a2f8 + +0010a3cc : + 10a3cc: e3c01003 bic r1, r0, #3 + 10a3d0: e2100003 ands r0, r0, #3 + 10a3d4: e2600000 rsb r0, r0, #0 + 10a3d8: e4913004 ldr r3, [r1], #4 + 10a3dc: e280c004 add ip, r0, #4 + 10a3e0: e1a0c18c lsl ip, ip, #3 + 10a3e4: e3e02000 mvn r2, #0 + 10a3e8: 11833c32 orrne r3, r3, r2, lsr ip + 10a3ec: e3a0c001 mov ip, #1 + 10a3f0: e18cc40c orr ip, ip, ip, lsl #8 + 10a3f4: e18cc80c orr ip, ip, ip, lsl #16 + 10a3f8: e043200c sub r2, r3, ip + 10a3fc: e1c22003 bic r2, r2, r3 + 10a400: e012238c ands r2, r2, ip, lsl #7 + 10a404: 04913004 ldreq r3, [r1], #4 + 10a408: 02800004 addeq r0, r0, #4 + 10a40c: 0afffff9 beq 10a3f8 + 10a410: e31300ff tst r3, #255 ; 0xff + 10a414: 12800001 addne r0, r0, #1 + 10a418: 13130cff tstne r3, #65280 ; 0xff00 + 10a41c: 12800001 addne r0, r0, #1 + 10a420: 131308ff tstne r3, #16711680 ; 0xff0000 + 10a424: 12800001 addne r0, r0, #1 + 10a428: e12fff1e bx lr + +0010a42c <__aeabi_uidiv>: + 10a42c: e2512001 subs r2, r1, #1 + 10a430: 012fff1e bxeq lr + 10a434: 3a000036 bcc 10a514 <__aeabi_uidiv+0xe8> + 10a438: e1500001 cmp r0, r1 + 10a43c: 9a000022 bls 10a4cc <__aeabi_uidiv+0xa0> + 10a440: e1110002 tst r1, r2 + 10a444: 0a000023 beq 10a4d8 <__aeabi_uidiv+0xac> + 10a448: e311020e tst r1, #-536870912 ; 0xe0000000 + 10a44c: 01a01181 lsleq r1, r1, #3 + 10a450: 03a03008 moveq r3, #8 + 10a454: 13a03001 movne r3, #1 + 10a458: e3510201 cmp r1, #268435456 ; 0x10000000 + 10a45c: 31510000 cmpcc r1, r0 + 10a460: 31a01201 lslcc r1, r1, #4 + 10a464: 31a03203 lslcc r3, r3, #4 + 10a468: 3afffffa bcc 10a458 <__aeabi_uidiv+0x2c> + 10a46c: e3510102 cmp r1, #-2147483648 ; 0x80000000 + 10a470: 31510000 cmpcc r1, r0 + 10a474: 31a01081 lslcc r1, r1, #1 + 10a478: 31a03083 lslcc r3, r3, #1 + 10a47c: 3afffffa bcc 10a46c <__aeabi_uidiv+0x40> + 10a480: e3a02000 mov r2, #0 + 10a484: e1500001 cmp r0, r1 + 10a488: 20400001 subcs r0, r0, r1 + 10a48c: 21822003 orrcs r2, r2, r3 + 10a490: e15000a1 cmp r0, r1, lsr #1 + 10a494: 204000a1 subcs r0, r0, r1, lsr #1 + 10a498: 218220a3 orrcs r2, r2, r3, lsr #1 + 10a49c: e1500121 cmp r0, r1, lsr #2 + 10a4a0: 20400121 subcs r0, r0, r1, lsr #2 + 10a4a4: 21822123 orrcs r2, r2, r3, lsr #2 + 10a4a8: e15001a1 cmp r0, r1, lsr #3 + 10a4ac: 204001a1 subcs r0, r0, r1, lsr #3 + 10a4b0: 218221a3 orrcs r2, r2, r3, lsr #3 + 10a4b4: e3500000 cmp r0, #0 + 10a4b8: 11b03223 lsrsne r3, r3, #4 + 10a4bc: 11a01221 lsrne r1, r1, #4 + 10a4c0: 1affffef bne 10a484 <__aeabi_uidiv+0x58> + 10a4c4: e1a00002 mov r0, r2 + 10a4c8: e12fff1e bx lr + 10a4cc: 03a00001 moveq r0, #1 + 10a4d0: 13a00000 movne r0, #0 + 10a4d4: e12fff1e bx lr + 10a4d8: e3510801 cmp r1, #65536 ; 0x10000 + 10a4dc: 21a01821 lsrcs r1, r1, #16 + 10a4e0: 23a02010 movcs r2, #16 + 10a4e4: 33a02000 movcc r2, #0 + 10a4e8: e3510c01 cmp r1, #256 ; 0x100 + 10a4ec: 21a01421 lsrcs r1, r1, #8 + 10a4f0: 22822008 addcs r2, r2, #8 + 10a4f4: e3510010 cmp r1, #16 + 10a4f8: 21a01221 lsrcs r1, r1, #4 + 10a4fc: 22822004 addcs r2, r2, #4 + 10a500: e3510004 cmp r1, #4 + 10a504: 82822003 addhi r2, r2, #3 + 10a508: 908220a1 addls r2, r2, r1, lsr #1 + 10a50c: e1a00230 lsr r0, r0, r2 + 10a510: e12fff1e bx lr + 10a514: e3500000 cmp r0, #0 + 10a518: 13e00000 mvnne r0, #0 + 10a51c: ea000007 b 10a540 <__aeabi_idiv0> + +0010a520 <__aeabi_uidivmod>: + 10a520: e3510000 cmp r1, #0 + 10a524: 0afffffa beq 10a514 <__aeabi_uidiv+0xe8> + 10a528: e92d4003 push {r0, r1, lr} + 10a52c: ebffffbe bl 10a42c <__aeabi_uidiv> + 10a530: e8bd4006 pop {r1, r2, lr} + 10a534: e0030092 mul r3, r2, r0 + 10a538: e0411003 sub r1, r1, r3 + 10a53c: e12fff1e bx lr + +0010a540 <__aeabi_idiv0>: + 10a540: e12fff1e bx lr + +0010a544 <__ffssi2>: + 10a544: e3500000 cmp r0, #0 + 10a548: e92d4008 push {r3, lr} + 10a54c: 0a000003 beq 10a560 <__ffssi2+0x1c> + 10a550: e2603000 rsb r3, r0, #0 + 10a554: e0030000 and r0, r3, r0 + 10a558: eb000002 bl 10a568 <__clzsi2> + 10a55c: e2600020 rsb r0, r0, #32 + 10a560: e8bd4008 pop {r3, lr} + 10a564: e12fff1e bx lr + +0010a568 <__clzsi2>: + 10a568: e3a0101c mov r1, #28 + 10a56c: e3500801 cmp r0, #65536 ; 0x10000 + 10a570: 21a00820 lsrcs r0, r0, #16 + 10a574: 22411010 subcs r1, r1, #16 + 10a578: e3500c01 cmp r0, #256 ; 0x100 + 10a57c: 21a00420 lsrcs r0, r0, #8 + 10a580: 22411008 subcs r1, r1, #8 + 10a584: e3500010 cmp r0, #16 + 10a588: 21a00220 lsrcs r0, r0, #4 + 10a58c: 22411004 subcs r1, r1, #4 + 10a590: e28f2008 add r2, pc, #8 + 10a594: e7d20000 ldrb r0, [r2, r0] + 10a598: e0800001 add r0, r0, r1 + 10a59c: e12fff1e bx lr + 10a5a0: 02020304 .word 0x02020304 + 10a5a4: 01010101 .word 0x01010101 + ... + +0010a5b0 : + 10a5b0: 33323130 37363534 42413938 46454443 0123456789ABCDEF + 10a5c0: 4a494847 4e4d4c4b 5251504f 56555453 GHIJKLMNOPQRSTUV + 10a5d0: 5a595857 00000000 WXYZ.... + +0010a5d8 : + 10a5d8: 33323130 37363534 62613938 66656463 0123456789abcdef + 10a5e8: 6a696867 6e6d6c6b 7271706f 76757473 ghijklmnopqrstuv + 10a5f8: 7a797877 00000000 wxyz.... + +0010a600 : + 10a600: 000000ff 00000000 000000ff 00000000 ................ + 10a610: 00000011 00000010 00000013 00000012 ................ + +0010a620 : + 10a620: 01000112 08ffffff 076b16c0 00000030 ..........k.0... + 10a630: 00000100 .... + +0010a634 : + 10a634: 00390209 80000103 000409fa 00ff0300 ..9............. + 10a644: 050700ff 00400201 82050700 00004002 ......@......@.. + 10a654: 03830507 09ff0040 00000104 000101fe ....@........... + 10a664: 00020409 0101fe00 00000000 ............ + +0010a670 <__FUNCTION__.6158>: + 10a670: 5f706475 6e65706f 00000000 646e6573 udp_open....send + 10a680: 7461645f 25203a61 79622075 20736574 _data: %u bytes + 10a690: 00000000 6f666966 6c69665f 0000206c ....fifo_fill .. + 10a6a0: 74696177 6378745f 5f706d6f 61656c63 wait_txcomp_clea + 10a6b0: 00002072 5f746573 6b707874 79647274 r ..set_txpktrdy + 10a6c0: 00000020 74696177 6378745f 20706d6f ...wait_txcomp + 10a6d0: 00000000 706f7473 20646570 73207962 ....stopped by s + 10a6e0: 75746174 756f2073 00002074 61656c63 tatus out ..clea + 10a6f0: 78745f72 706d6f63 00000020 656e6f64 r_txcomp ...done + 10a700: 00000020 3d525343 30257830 00207834 ...CSR=0x%04x . + 10a710: 5f4b4341 4c415453 4e45534c 00002054 ACK_STALLSENT .. + 10a720: 5f4b4341 4b4e4142 00002030 73206f6e ACK_BANK0 ..no s + 10a730: 70757465 63617020 2074656b 00000000 etup packet .... + 10a740: 3d6e656c 00206425 74706d65 61702079 len=%d .empty pa + 10a750: 74656b63 00000020 65526d62 73657571 cket ...bmReques + 10a760: 70795474 78303d65 20783225 00000000 tType=0x%2x .... + 10a770: 41544144 3d4e495f 00002031 5f756664 DATA_IN=1 ..dfu_ + 10a780: 74617473 203d2065 00207525 5f544547 state = %u .GET_ + 10a790: 43534544 54504952 7728524f 756c6156 DESCRIPTOR(wValu + 10a7a0: 78303d65 78343025 4977202c 7865646e e=0x%04x, wIndex + 10a7b0: 2578303d 29783430 00000020 5f544553 =0x%04x) ...SET_ + 10a7c0: 52444441 20535345 00000000 5f544553 ADDRESS ....SET_ + 10a7d0: 464e4f43 00204749 554c4156 303d3d45 CONFIG .VALUE==0 + 10a7e0: 00000020 554c4156 303d2145 00000020 ...VALUE!=0 ... + 10a7f0: 5f544547 464e4f43 00204749 5f544547 GET_CONFIG .GET_ + 10a800: 45544e49 43414652 00002045 5f544547 INTERFACE ..GET_ + 10a810: 54415453 5a5f5355 204f5245 00000000 STATUS_ZERO .... + 10a820: 5f544547 54415453 495f5355 5245544e GET_STATUS_INTER + 10a830: 45434146 00000020 5f544547 54415453 FACE ...GET_STAT + 10a840: 455f5355 4f50444e 28544e49 64695045 US_ENDPOINT(EPid + 10a850: 75253d78 00002029 5f544553 54414546 x=%u) ..SET_FEAT + 10a860: 5f455255 4f52455a 00000020 5f544553 URE_ZERO ...SET_ + 10a870: 54414546 5f455255 45544e49 43414652 FEATURE_INTERFAC + 10a880: 00002045 5f544553 54414546 5f455255 E ..SET_FEATURE_ + 10a890: 50444e45 544e494f 00000020 41454c43 ENDPOINT ...CLEA + 10a8a0: 45465f52 52555441 455a5f45 00204f52 R_FEATURE_ZERO . + 10a8b0: 41454c43 45465f52 52555441 4e495f45 CLEAR_FEATURE_IN + 10a8c0: 46524554 20454341 00000000 41454c43 TERFACE ....CLEA + 10a8d0: 45465f52 52555441 4e455f45 494f5044 R_FEATURE_ENDPOI + 10a8e0: 4528544e 78646950 2975253d 00000020 NT(EPidx=%u) ... + 10a8f0: 20544553 45544e49 43414652 00002045 SET INTERFACE .. + 10a900: 41464544 28544c55 3d716572 30257830 DEFAULT(req=0x%0 + 10a910: 202c7832 65707974 2578303d 29783230 2x, type=0x%02x) + 10a920: 00000020 4c415453 2021214c 00000000 ...STALL!! .... + 10a930: 525f4f4e 5f585443 49415641 0020214c NO_RCTX_AVAIL! . + 10a940: 25287325 203a2964 65746e65 676e6972 %s(%d): entering + 10a950: 00000a0d 50415257 52554420 20474e49 ....WRAP DURING + 10a960: 45505041 0a0d444e 00000000 61656c43 APPEND......Clea + 10a970: 75502072 75206c6c 000d0a70 20746553 r Pull up...Set + 10a980: 6c6c7550 0a707520 0000000d 67676f54 Pull up.....Togg + 10a990: 676e696c 44454c20 0d0a3120 00000000 ling LED 1...... + 10a9a0: 67676f54 676e696c 44454c20 0d0a3220 Toggling LED 2.. + 10a9b0: 00000000 65736552 6e697474 41532067 ....Resetting SA + 10a9c0: 0d0a374d 00000000 32302520 00000078 M7...... %02x... + 10a9d0: 20294328 36303032 20796220 61726148 (C) 2006 by Hara + 10a9e0: 5720646c 65746c65 77683c20 65746c65 ld Welte ..This softwa + 10aa10: 69206572 52462073 53204545 5754464f re is FREE SOFTW + 10aa20: 20455241 6563696c 6465736e 646e7520 ARE licensed und + 10aa30: 47207265 4720554e 0d0a4c50 00000000 er GNU GPL...... + 10aa40: 73726556 206e6f69 2d353934 6c636e75 Version 495-uncl + 10aa50: 206e6165 706d6f63 64656c69 31303220 ean compiled 201 + 10aa60: 31353031 36312d30 33303630 20796220 10510-160603 by + 10aa70: 7a74656e 756c4240 69466262 0d0a6873 netz@BlubbFish.. + 10aa80: 00000d0a 45440d0a 20475542 65746e49 ......DEBUG Inte + 10aa90: 63616672 0d0a3a65 53202930 50207465 rface:..0) Set P + 10aaa0: 2d6c6c75 31207075 6c432029 20726165 ull-up 1) Clear + 10aab0: 6c6c7550 2070752d 54202932 6c67676f Pull-up 2) Toggl + 10aac0: 454c2065 33203144 6f542029 656c6767 e LED1 3) Toggle + 10aad0: 44454c20 390a0d32 65522029 0a746573 LED2..9) Reset. + 10aae0: 0000000d 204e454c 5942203e 5f534554 ....LEN > BYTES_ + 10aaf0: 5446454c 00000a0d LEFT.... + +0010aaf8 : + 10aaf8: 00000000 02000000 04000000 ............ + +0010ab04 <__FUNCTION__.6256>: + 10ab04: 6e69616d 00000000 main.... + +0010ab0c : + 10ab0c: 2d353934 6c636e75 006e6165 00000000 495-unclean..... + 10ab1c: 7a74656e 756c4240 69466262 00006873 netz@BlubbFish.. + 10ab2c: 31313032 30313530 3036312d 00333036 20110510-160603. + 10ab3c: 25287325 203a2964 65746e65 676e6972 %s(%d): entering + 10ab4c: 69616d20 6928206e 29656c64 6f6f6c20 main (idle) loo + 10ab5c: 000a0d70 68206f6e 6c646e61 66207265 p...no handler f + 10ab6c: 7420726f 20736968 73616c63 0a0d2073 or this class .. + 10ab7c: 00000000 54425355 5f545345 00204e49 ....USBTEST_IN . + 10ab8c: 52204f4e 20585443 00000000 5f424354 NO RCTX ....TCB_ + 10ab9c: 3d524d42 30257830 00207838 5f304354 BMR=0x%08x .TC0_ + 10abac: 303d5643 38302578 00002078 5f304354 CV=0x%08x ..TC0_ + 10abbc: 3d524d43 30257830 00207838 5f304354 CMR=0x%08x .TC0_ + 10abcc: 303d5253 38302578 000a0d78 5f304354 SR=0x%08x...TC0_ + 10abdc: 303d4152 34302578 54202c78 525f3043 RA=0x%04x, TC0_R + 10abec: 78303d42 78343025 4354202c 43525f30 B=0x%04x, TC0_RC + 10abfc: 2578303d 0d783430 0000000a =0x%04x..... + +0010ac08 <__FUNCTION__.6063>: + 10ac08: 5f6d7770 71657266 7465735f 00000000 pwm_freq_set.... + +0010ac18 <__FUNCTION__.6075>: + 10ac18: 5f6d7770 79747564 7465735f 7265705f pwm_duty_set_per + 10ac28: 746e6563 00000000 25287325 203a2964 cent....%s(%d): + 10ac38: 6b6c636d 2c75253d 65726620 75253d71 mclk=%u, freq=%u + 10ac48: 766f202c 6c617265 69645f6c 75253d76 , overall_div=%u + 10ac58: 00000a0d 25287325 203a2964 65727063 ....%s(%d): cpre + 10ac68: 2c75253d 72706320 75253d64 00000a0d =%u, cprd=%u.... + 10ac78: 25287325 203a2964 74697257 20676e69 %s(%d): Writing + 10ac88: 74207525 7055206f 65746164 67657220 %u to Update reg + 10ac98: 65747369 0a0d0a72 00000000 ister....... + +0010aca4 <__FUNCTION__.5785>: + 10aca4: 69705f5f 72695f6f 65645f71 0078756d __pio_irq_demux. + +0010acb4 <__FUNCTION__.5807>: + 10acb4: 5f6f6970 5f717269 69676572 72657473 pio_irq_register + 10acc4: 00000000 25287325 203a2964 5f4f4950 ....%s(%d): PIO_ + 10acd4: 5f525349 54415453 3d205355 25783020 ISR_STATUS = 0x% + 10ace4: 0d783830 0000000a 25287325 203a2964 08x.....%s(%d): + 10acf4: 69676572 72657473 20676e69 646e6168 registering hand + 10ad04: 2072656c 66207025 5020726f 20414f49 ler %p for PIOA + 10ad14: 0a0d7525 00000000 %u...... + +0010ad1c <__FUNCTION__.5603>: + 10ad1c: 5f746477 00717269 25287325 203a2964 wdt_irq.%s(%d): + 10ad2c: 3d3d3d3d 3d3d3d3d 3d3d3d3d 3d3d3d3d ================ + 10ad3c: 4157203e 44484354 4520474f 52495058 > WATCHDOG EXPIR + 10ad4c: 21204445 21212121 00000a0d ED !!!!!.... + +0010ad58 <__FUNCTION__.4079>: + 10ad58: 6e696c62 646f636b 62635f65 00000000 blinkcode_cb.... + +0010ad68 <__FUNCTION__.4091>: + 10ad68: 6e696c62 646f636b 65735f65 00000074 blinkcode_set... + 10ad78: 25287325 203a2964 66696a28 73656966 %s(%d): (jiffies + 10ad88: 756c253d 6164202c 253d6174 73202c70 =%lu, data=%p, s + 10ad98: 65746174 2975253d 00000a0d 25287325 tate=%u)....%s(% + 10ada8: 203a2964 66696a28 73656966 756c253d d): (jiffies=%lu + 10adb8: 656c202c 75253d64 756e202c 75253d6d , led=%u, num=%u + 10adc8: 000a0d29 73616c66 61705f68 30286567 )...flash_page(0 + 10add8: 3d782578 20297525 00000000 6f6c6e75 x%x=%u) ....unlo + 10ade8: 6e696b63 00002067 5f544f4e 53414c46 cking ..NOT_FLAS + 10adf8: 474e4948 00000020 66726570 696d726f HING ...performi + 10ae08: 7320676e 74726174 6f72705f 00002067 ng start_prog .. + 10ae18: 74736554 20676e69 33364352 203a2032 Testing RC632 : + 10ae28: 00000000 43435553 21535345 00000d0a ....SUCCESS!.... + 10ae38: 4f525245 0d0a2152 00000000 ERROR!...... + +Disassembly of section .data: + +00200028 <_data>: + r12 AT91C_BASE_TC0 + r13 stack + r14 lr + */ + + ldr r8, [r10, #PIOA_ISR] + 200028: e59a804c ldr r8, [sl, #76] ; 0x4c + tst r8, #PIO_DATA /* check for PIO_DATA change */ + 20002c: e3180302 tst r8, #134217728 ; 0x8000000 + ldrne r11, [r10, #PIOA_PDSR] + 200030: 159ab03c ldrne fp, [sl, #60] ; 0x3c + tstne r11, #PIO_DATA /* check for PIO_DATA == 1 */ + 200034: 131b0302 tstne fp, #134217728 ; 0x8000000 + strne r9, [r12, #TC_CCR] /* software trigger */ + 200038: 158c9000 strne r9, [ip] +#ifdef LED_TRIGGER + movne r11, #PIO_LED1 + 20003c: 13a0b402 movne fp, #33554432 ; 0x2000000 + strne r11, [r10, #PIOA_CODR] /* enable LED */ + 200040: 158ab034 strne fp, [sl, #52] ; 0x34 +#endif + +#if 1 + movne r11, #PIO_DATA + 200044: 13a0b302 movne fp, #134217728 ; 0x8000000 + strne r11, [r10, #PIOA_IDR] /* disable further PIO_DATA FIQ */ + 200048: 158ab044 strne fp, [sl, #68] ; 0x44 +#endif + + /*- Mark the End of Interrupt on the AIC */ + ldr r11, =AT91C_BASE_AIC + 20004c: e59fb024 ldr fp, [pc, #36] ; 200078 <_data+0x50> + str r11, [r11, #AIC_EOICR] + 200050: e58bb130 str fp, [fp, #304] ; 0x130 + +#ifdef LED_TRIGGER + mov r11, #PIO_LED1 + 200054: e3a0b402 mov fp, #33554432 ; 0x2000000 + str r11, [r10, #PIOA_SODR] /* disable LED */ + 200058: e58ab030 str fp, [sl, #48] ; 0x30 +#endif + +#ifdef CALL_PIO_IRQ_DEMUX + /* push r0, r1-r3, r12, r14 onto FIQ stack */ + stmfd sp!, { r0-r3, r12, lr} + 20005c: e92d500f push {r0, r1, r2, r3, ip, lr} + mov r0, r8 + 200060: e1a00008 mov r0, r8 + + /* enable interrupts while handling demux */ + /* msr CPSR_c, #F_BIT | ARM_MODE_SVC */ + + /* Call C function, give PIOA_ISR as argument */ + ldr r11, =__pio_irq_demux + 200064: e59fb010 ldr fp, [pc, #16] ; 20007c <_data+0x54> + mov r14, pc + 200068: e1a0e00f mov lr, pc + bx r11 + 20006c: e12fff1b bx fp + + /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ */ + ldmia sp!, { r0-r3, r12, lr } + 200070: e8bd500f pop {r0, r1, r2, r3, ip, lr} +#endif + + /*- Restore the Program Counter using the LR_fiq directly in the PC */ + subs pc, lr, #4 + 200074: e25ef004 subs pc, lr, #4 + 200078: fffff000 .word 0xfffff000 + 20007c: 002000e8 .word 0x002000e8 + +00200080 : +static struct req_ctx req_ctx[NUM_REQ_CTX]; + +struct req_ctx __ramfunc *req_ctx_find_get(int large, + unsigned long old_state, + unsigned long new_state) +{ + 200080: e92d0030 push {r4, r5} + unsigned long flags; + u_int8_t i; + + if (large) + i = NUM_RCTX_SMALL; + 200084: e3500000 cmp r0, #0 + 200088: e59f3054 ldr r3, [pc, #84] ; 2000e4 + 20008c: 13a00008 movne r0, #8 + 200090: 03a00000 moveq r0, #0 + else + i = 0; + + for (; i < NUM_REQ_CTX; i++) { + local_irq_save(flags); + 200094: e10f4000 mrs r4, CPSR + 200098: e384c080 orr ip, r4, #128 ; 0x80 + 20009c: e121f00c msr CPSR_c, ip + if (req_ctx[i].state == old_state) { + 2000a0: e080c080 add ip, r0, r0, lsl #1 + 2000a4: e793510c ldr r5, [r3, ip, lsl #2] + 2000a8: e1550001 cmp r5, r1 + 2000ac: e083c10c add ip, r3, ip, lsl #2 + 2000b0: 0a000007 beq 2000d4 + req_ctx[i].state = new_state; + local_irq_restore(flags); + return &req_ctx[i]; + } + local_irq_restore(flags); + 2000b4: e121f004 msr CPSR_c, r4 + if (large) + i = NUM_RCTX_SMALL; + else + i = 0; + + for (; i < NUM_REQ_CTX; i++) { + 2000b8: e2800001 add r0, r0, #1 + 2000bc: e20000ff and r0, r0, #255 ; 0xff + 2000c0: e350000b cmp r0, #11 + 2000c4: 9afffff2 bls 200094 + return &req_ctx[i]; + } + local_irq_restore(flags); + } + + return NULL; + 2000c8: e3a00000 mov r0, #0 +} + 2000cc: e8bd0030 pop {r4, r5} + 2000d0: e12fff1e bx lr + i = 0; + + for (; i < NUM_REQ_CTX; i++) { + local_irq_save(flags); + if (req_ctx[i].state == old_state) { + req_ctx[i].state = new_state; + 2000d4: e58c2000 str r2, [ip] + local_irq_restore(flags); + 2000d8: e121f004 msr CPSR_c, r4 + return &req_ctx[i]; + 2000dc: e1a0000c mov r0, ip + 2000e0: eafffff9 b 2000cc + 2000e4: 00201554 .word 0x00201554 + +002000e8 <__pio_irq_demux>: +static struct pioirq_state pirqs; + +/* low-level handler, used by Cstartup_app.S PIOA fast forcing and + * by regular interrupt handler below */ +void __ramfunc __pio_irq_demux(u_int32_t pio) +{ + 2000e8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} + 2000ec: e1a04000 mov r4, r0 + u_int8_t send_usb = 0; + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + 2000f0: e59f1104 ldr r1, [pc, #260] ; 2001fc <__pio_irq_demux+0x114> + 2000f4: e59f0104 ldr r0, [pc, #260] ; 200200 <__pio_irq_demux+0x118> + 2000f8: e3a0202b mov r2, #43 ; 0x2b + 2000fc: e1a03004 mov r3, r4 + 200100: ebfc1f45 bl 107e1c + 200104: e59f60f8 ldr r6, [pc, #248] ; 200204 <__pio_irq_demux+0x11c> + + for (i = 0; i < NR_PIO; i++) { + 200108: e3a00000 mov r0, #0 + +/* low-level handler, used by Cstartup_app.S PIOA fast forcing and + * by regular interrupt handler below */ +void __ramfunc __pio_irq_demux(u_int32_t pio) +{ + u_int8_t send_usb = 0; + 20010c: e1a0a000 mov sl, r0 + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + if (pio & (1 << i) && pirqs.handlers[i]) + 200110: e3a09001 mov r9, #1 + 200114: e1a08019 lsl r8, r9, r0 + u_int8_t send_usb = 0; + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + 200118: e2805001 add r5, r0, #1 + if (pio & (1 << i) && pirqs.handlers[i]) + 20011c: e1180004 tst r8, r4 + 200120: e1a07519 lsl r7, r9, r5 + 200124: 0a000003 beq 200138 <__pio_irq_demux+0x50> + 200128: e7963100 ldr r3, [r6, r0, lsl #2] + 20012c: e3530000 cmp r3, #0 + pirqs.handlers[i](i); + 200130: 11a0e00f movne lr, pc + 200134: 112fff13 bxne r3 + if (pirqs.usbmask & (1 << i)) + 200138: e5963080 ldr r3, [r6, #128] ; 0x80 + send_usb = 1; + 20013c: e1180003 tst r8, r3 + 200140: 13a0a001 movne sl, #1 + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + if (pio & (1 << i) && pirqs.handlers[i]) + 200144: e1170004 tst r7, r4 + 200148: 0a000004 beq 200160 <__pio_irq_demux+0x78> + 20014c: e7963105 ldr r3, [r6, r5, lsl #2] + 200150: e3530000 cmp r3, #0 + pirqs.handlers[i](i); + 200154: e1a00005 mov r0, r5 + 200158: 11a0e00f movne lr, pc + 20015c: 112fff13 bxne r3 + if (pirqs.usbmask & (1 << i)) + 200160: e596e080 ldr lr, [r6, #128] ; 0x80 + u_int8_t send_usb = 0; + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + 200164: e2850001 add r0, r5, #1 + if (pio & (1 << i) && pirqs.handlers[i]) + pirqs.handlers[i](i); + if (pirqs.usbmask & (1 << i)) + send_usb = 1; + 200168: e117000e tst r7, lr + 20016c: 13a0a001 movne sl, #1 + u_int8_t send_usb = 0; + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + 200170: e3500020 cmp r0, #32 + 200174: 1affffe6 bne 200114 <__pio_irq_demux+0x2c> + pirqs.handlers[i](i); + if (pirqs.usbmask & (1 << i)) + send_usb = 1; + } + + if (send_usb && !pirqs.usb_throttled) { + 200178: e35a0000 cmp sl, #0 + 20017c: 0a000002 beq 20018c <__pio_irq_demux+0xa4> + 200180: e5964084 ldr r4, [r6, #132] ; 0x84 + 200184: e3540000 cmp r4, #0 + 200188: 0a000004 beq 2001a0 <__pio_irq_demux+0xb8> +static inline void AT91F_AIC_ClearIt ( + AT91PS_AIC pAic, // \arg pointer to the AIC registers + unsigned int irq_id) // \arg interrupt number to initialize +{ + //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + pAic->AIC_ICCR = (0x1 << irq_id); + 20018c: e3a02004 mov r2, #4 + 200190: e3e03c0f mvn r3, #3840 ; 0xf00 + 200194: e5832029 str r2, [r3, #41] ; 0x29 + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + } + } + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_PIOA); +} + 200198: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr} + 20019c: e12fff1e bx lr + send_usb = 1; + } + + if (send_usb && !pirqs.usb_throttled) { + struct req_ctx *irq_rctx; + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 2001a0: e1a00004 mov r0, r4 + 2001a4: e3a010fe mov r1, #254 ; 0xfe + 2001a8: e3a02080 mov r2, #128 ; 0x80 + 2001ac: e59fc054 ldr ip, [pc, #84] ; 200208 <__pio_irq_demux+0x120> + 2001b0: e1a0e00f mov lr, pc + 2001b4: e12fff1c bx ip + RCTX_STATE_PIOIRQ_BUSY); + if (!irq_rctx) { + 2001b8: e2503000 subs r3, r0, #0 + 2001bc: 0a00000a beq 2001ec <__pio_irq_demux+0x104> + * non-usb listeners */ + pirqs.usb_throttled = 1; + } else { + struct openpcd_hdr *opcdh; + u_int32_t *regmask; + opcdh = (struct openpcd_hdr *) irq_rctx->data; + 2001c0: e593c008 ldr ip, [r3, #8] + regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); + opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + 2001c4: e3e0100c mvn r1, #12 + opcdh->reg = 0x00; + opcdh->flags = 0x00; + opcdh->val = 0x00; + + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + 2001c8: e3a0e008 mov lr, #8 + } else { + struct openpcd_hdr *opcdh; + u_int32_t *regmask; + opcdh = (struct openpcd_hdr *) irq_rctx->data; + regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); + opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + 2001cc: e5cc1000 strb r1, [ip] + opcdh->reg = 0x00; + 2001d0: e5cc4002 strb r4, [ip, #2] + opcdh->flags = 0x00; + 2001d4: e5cc4001 strb r4, [ip, #1] + opcdh->val = 0x00; + 2001d8: e5cc4003 strb r4, [ip, #3] + + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 2001dc: e3a01012 mov r1, #18 + opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + opcdh->reg = 0x00; + opcdh->flags = 0x00; + opcdh->val = 0x00; + + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + 2001e0: e1c3e0b6 strh lr, [r3, #6] + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 2001e4: ebfc1f62 bl 107f74 + 2001e8: eaffffe7 b 20018c <__pio_irq_demux+0xa4> + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_PIOIRQ_BUSY); + if (!irq_rctx) { + /* we cannot disable the interrupt, since we have + * non-usb listeners */ + pirqs.usb_throttled = 1; + 2001ec: e59f0010 ldr r0, [pc, #16] ; 200204 <__pio_irq_demux+0x11c> + 2001f0: e3a02001 mov r2, #1 + 2001f4: e5802084 str r2, [r0, #132] ; 0x84 + 2001f8: eaffffe3 b 20018c <__pio_irq_demux+0xa4> + 2001fc: 0010aca4 .word 0x0010aca4 + 200200: 0010acc8 .word 0x0010acc8 + 200204: 00203844 .word 0x00203844 + 200208: 00200080 .word 0x00200080 + +0020020c <_ctype>: + 20020c: 08080808 08080808 28282808 08082828 .........(((((.. + 20021c: 08080808 08080808 08080808 08080808 ................ + 20022c: 101010a0 10101010 10101010 10101010 ................ + 20023c: 04040404 04040404 10100404 10101010 ................ + 20024c: 41414110 01414141 01010101 01010101 .AAAAAA......... + 20025c: 01010101 01010101 10010101 10101010 ................ + 20026c: 42424210 02424242 02020202 02020202 .BBBBBB......... + 20027c: 02020202 02020202 10020202 08101010 ................ + ... + 2002ac: 101010a0 10101010 10101010 10101010 ................ + 2002bc: 10101010 10101010 10101010 10101010 ................ + 2002cc: 01010101 01010101 01010101 01010101 ................ + 2002dc: 01010101 10010101 01010101 02010101 ................ + 2002ec: 02020202 02020202 02020202 02020202 ................ + 2002fc: 02020202 10020202 02020202 02020202 ................ diff --git a/firmware/main_dumbreader.map b/firmware/main_dumbreader.map new file mode 100644 index 0000000..c930c55 --- /dev/null +++ b/firmware/main_dumbreader.map @@ -0,0 +1,1348 @@ +Archive member included because of file (symbol) + +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + src/os/fifo.o (memcpy) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + src/os/fifo.o (memset) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + src/os/dbgu.o (strlen) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + lib/lib_AT91SAM7.o (__aeabi_uidiv) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) (__aeabi_idiv0) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + src/os/pio_irq.o (__ffssi2) +e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) (__clzsi2) + +Allocating common symbols +Common symbol size file + +rc632 0x34 src/pcd/rc632_highlevel.o +config_stack 0x100 src/os/usbcmd_generic.o +jiffies 0x4 src/os/pit.o + +Memory Configuration + +Name Origin Length Attributes +FLASH 0x00104000 0x0001bc00 xr +DATA 0x00200028 0x00007fd8 rw +STACK 0x00208000 0x00000000 rw +*default* 0x00000000 0xffffffff + +Linker script and memory map + +LOAD src/start/Cstartup_app.o +LOAD lib/changebit.o +LOAD lib/clearbit.o +LOAD lib/setbit.o +LOAD lib/testchangebit.o +LOAD lib/testclearbit.o +LOAD lib/testsetbit.o +LOAD lib/lib1funcs.o +LOAD lib/div64.o +LOAD lib/lib_AT91SAM7.o +LOAD lib/vsprintf.o +LOAD lib/ctype.o +LOAD lib/string.o +LOAD src/os/pcd_enumerate.o +LOAD src/os/fifo.o +LOAD src/os/dbgu.o +LOAD src/os/led.o +LOAD src/os/req_ctx.o +LOAD src/os/trigger.o +LOAD src/os/main.o +LOAD src/os/syscalls.o +LOAD src/os/usb_handler.o +LOAD src/os/usb_benchmark.o +LOAD src/os/tc_cdiv.o +LOAD src/os/pit.o +LOAD src/os/pwm.o +LOAD src/os/pio_irq.o +LOAD src/os/usbcmd_generic.o +LOAD src/os/wdt.o +LOAD src/os/blinkcode.o +LOAD src/os/system_irq.o +LOAD src/os/flash.o +LOAD src/pcd/rc632.o +LOAD src/pcd/rc632_highlevel.o +LOAD src/pcd/main_dumbreader.o +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a +START GROUP +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a +LOAD e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a +END GROUP + 0x00000000 . = 0x0 + +.text 0x00104000 0x6e44 load address 0x00000000 + src/start/Cstartup_app.o(.text) + .text 0x00104000 0x80 src/start/Cstartup_app.o + 0x00104000 _startup + 0x00104058 exit + *(.text) + .text 0x00104080 0x2c lib/changebit.o + 0x00104080 _change_bit_be + 0x00104084 _change_bit_le + .text 0x001040ac 0x2c lib/clearbit.o + 0x001040ac _clear_bit_be + 0x001040b0 _clear_bit_le + .text 0x001040d8 0x2c lib/setbit.o + 0x001040d8 _set_bit_be + 0x001040dc _set_bit_le + .text 0x00104104 0x34 lib/testchangebit.o + 0x00104104 _test_and_change_bit_be + 0x00104108 _test_and_change_bit_le + .text 0x00104138 0x34 lib/testclearbit.o + 0x00104138 _test_and_clear_bit_be + 0x0010413c _test_and_clear_bit_le + .text 0x0010416c 0x34 lib/testsetbit.o + 0x0010416c _test_and_set_bit_be + 0x00104170 _test_and_set_bit_le + .text 0x001041a0 0x2bc lib/lib1funcs.o + 0x001041a0 __umodsi3 + 0x0010425c __divsi3 + 0x0010425c __aeabi_idiv + 0x00104374 __modsi3 + 0x00104458 __div0 + .text 0x0010445c 0x130 lib/div64.o + 0x0010445c __do_div64 + .text 0x0010458c 0x5f8 lib/lib_AT91SAM7.o + 0x0010458c AT91F_AIC_ConfigureIt + 0x001045c4 AT91F_AIC_SetExceptionVector + 0x001045f8 AT91F_AIC_Open + 0x001046bc AT91F_PDC_Open + 0x00104704 AT91F_PDC_Close + 0x0010473c AT91F_PDC_SendFrame + 0x00104788 AT91F_PDC_ReceiveFrame + 0x001047d4 AT91F_PMC_GetMasterClock + 0x0010487c AT91F_RTTReadValue + 0x001048ac AT91F_SPI_Close + 0x00104904 AT91F_ADC_CfgTimings + 0x00104974 AT91F_SSC_SetBaudrate + 0x001049c0 AT91F_SSC_Configure + 0x00104a84 AT91F_US_Configure + 0x00104b30 AT91F_US_Close + .text 0x00104b84 0x194c lib/vsprintf.o + 0x00104fe0 simple_strtoul + 0x00105140 simple_strtol + 0x0010516c simple_strtoull + 0x00105318 simple_strtoll + 0x00105350 vsnprintf + 0x00105bb4 vscnprintf + 0x00105bd0 snprintf + 0x00105c00 scnprintf + 0x00105c3c vsprintf + 0x00105c50 sprintf + 0x00105c84 vsscanf + 0x001064a0 sscanf + .text 0x001064d0 0x0 lib/ctype.o + .text 0x001064d0 0x88 lib/string.o + 0x001064d0 strnlen + .text 0x00106558 0x1160 src/os/pcd_enumerate.o + 0x00107540 udp_unthrottle + 0x00107558 udp_refill_ep + 0x00107578 udp_pullup_on + 0x00107590 udp_pullup_off + 0x001075a8 udp_open + 0x00107654 udp_reset + .text 0x001076b8 0x270 src/os/fifo.o + 0x001076b8 fifo_available + 0x001076d8 fifo_check_water + 0x00107728 fifo_check_raise_int + 0x00107750 fifo_data_put + 0x00107828 fifo_data_get + 0x001078d0 fifo_init + .text 0x00107928 0x558 src/os/dbgu.o + 0x001079c4 AT91F_DBGU_Ready + 0x001079d8 AT91F_DBGU_Fini + 0x00107a04 AT91F_DBGU_Printk + 0x00107a94 AT91F_DBGU_Frame + 0x00107c10 AT91F_DBGU_Get + 0x00107c30 hexdump + 0x00107cc4 dbgu_rb_init + 0x00107cfc AT91F_DBGU_Init + 0x00107da8 dbgu_rb_flush + 0x00107dac dbgu_rb_append + 0x00107e1c debugp + .text 0x00107e80 0xd0 src/os/led.o + 0x00107e80 led_switch + 0x00107eac led_get + 0x00107ee4 led_toggle + 0x00107f28 led_init + .text 0x00107f50 0x128 src/os/req_ctx.o + 0x00107f50 req_ctx_num + 0x00107f74 req_ctx_set_state + 0x00107f8c req_ctx_put + 0x00107fa8 req_ctx_init + .text 0x00108078 0x64 src/os/trigger.o + 0x00108078 trigger_init + 0x0010808c trigger_pulse + .text 0x001080dc 0x7c src/os/main.o + 0x001080dc main + .text 0x00108158 0x108 src/os/syscalls.o + 0x00108158 _read_r + 0x001081b0 _write_r + 0x00108210 _close_r + 0x00108218 _lseek_r + 0x00108220 _fstat_r + 0x00108230 isatty + 0x00108238 _sbrk_r + .text 0x00108260 0x11c src/os/usb_handler.o + 0x00108260 usb_hdlr_register + 0x00108274 usb_hdlr_unregister + 0x00108288 usb_out_process + 0x001082a4 usb_in_process + .text 0x0010837c 0x100 src/os/usb_benchmark.o + 0x00108438 usbtest_init + .text 0x0010847c 0x184 src/os/tc_cdiv.o + 0x0010847c tc_cdiv_set_divider + 0x001084a0 tc_cdiv_phase_add + 0x00108504 tc_cdiv_init + 0x00108574 tc_cdiv_print + 0x001085e0 tc_cdiv_fini + .text 0x00108600 0x234 src/os/pit.o + 0x00108600 timer_del + 0x00108700 timer_add + 0x00108778 pit_mdelay + 0x001087ac mdelay + 0x001087e0 usleep + 0x001087e4 pit_init + .text 0x00108834 0x2c0 src/os/pwm.o + 0x00108834 pwm_freq_set + 0x00108954 pwm_start + 0x0010896c pwm_stop + 0x00108984 pwm_duty_set_percent + 0x00108a88 pwm_init + 0x00108ad4 pwm_fini + .text 0x00108af4 0x14c src/os/pio_irq.o + 0x00108b18 pio_irq_enable + 0x00108b24 pio_irq_disable + 0x00108b30 pio_irq_register + 0x00108bb8 pio_irq_unregister + 0x00108bf4 pio_irq_init + .text 0x00108c40 0x1f8 src/os/usbcmd_generic.o + 0x00108e00 usbcmd_gen_init + .text 0x00108e38 0x64 src/os/wdt.o + 0x00108e5c wdt_restart + 0x00108e70 wdt_init + .text 0x00108e9c 0x230 src/os/blinkcode.o + 0x00108ff0 blinkcode_set + 0x00109080 blinkcode_init + .text 0x001090cc 0x28c src/os/system_irq.o + 0x00109300 sysirq_register + 0x00109314 sysirq_init + .text 0x00109358 0xb4 src/os/flash.o + 0x00109358 flash_page + 0x001093f8 flash_init + .text 0x0010940c 0x92c src/pcd/rc632.o + 0x0010950c opcd_rc632_reg_write + 0x00109554 opcd_rc632_reg_write_set + 0x001095f4 opcd_rc632_fifo_write + 0x00109654 opcd_rc632_reg_read + 0x00109798 opcd_rc632_fifo_read + 0x00109890 opcd_rc632_set_bits + 0x001098dc opcd_rc632_clear_bits + 0x00109a8c rc632_unthrottle + 0x00109a9c rc632_power + 0x00109ab4 rc632_reset + 0x00109b3c rc632_init + 0x00109c4c rc632_dump + 0x00109cf8 rc632_test + .text 0x00109d38 0x1ec src/pcd/rc632_highlevel.o + 0x00109d38 rc632_turn_on_rf + 0x00109d50 rc632_turn_off_rf + 0x00109d68 rc632_write_eeprom + 0x00109e58 rc632_read_eeprom + 0x00109f14 rc632_get_serial + .text 0x00109f24 0x1e8 src/pcd/main_dumbreader.o + 0x00109f24 _init_func + 0x00109f34 _main_dbgu + 0x0010a0c8 _main_func + .text 0x0010a10c 0x1c0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + 0x0010a10c memcpy + .text 0x0010a2cc 0x100 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + 0x0010a2cc memset + .text 0x0010a3cc 0x60 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + 0x0010a3cc strlen + .text 0x0010a42c 0x114 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + 0x0010a42c __aeabi_uidiv + 0x0010a42c __udivsi3 + 0x0010a520 __aeabi_uidivmod + .text 0x0010a540 0x4 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + 0x0010a540 __aeabi_idiv0 + 0x0010a540 __aeabi_ldiv0 + .text 0x0010a544 0x24 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + 0x0010a544 __ffssi2 + .text 0x0010a568 0x48 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + 0x0010a568 __clzsi2 + *(.rodata*) + .rodata 0x0010a5b0 0x50 lib/vsprintf.o + .rodata 0x0010a600 0x7c src/os/pcd_enumerate.o + 0x0010a620 dev_descriptor + 0x0010a634 cfg_descriptor + .rodata.str1.4 + 0x0010a67c 0x2d7 src/os/pcd_enumerate.o + 0x2d8 (size before relaxing) + *fill* 0x0010a953 0x1 00 + .rodata.str1.4 + 0x0010a954 0x1a3 src/os/dbgu.o + 0x1a8 (size before relaxing) + *fill* 0x0010aaf7 0x1 00 + .rodata 0x0010aaf8 0xc src/os/led.o + .rodata 0x0010ab04 0x38 src/os/main.o + 0x0010ab0c opcd_version + .rodata.str1.4 + 0x0010ab3c 0x24 src/os/main.o + .rodata.str1.4 + 0x0010ab60 0x1d src/os/usb_handler.o + 0x20 (size before relaxing) + *fill* 0x0010ab7d 0x3 00 + .rodata.str1.4 + 0x0010ab80 0x15 src/os/usb_benchmark.o + 0x18 (size before relaxing) + *fill* 0x0010ab95 0x3 00 + .rodata.str1.4 + 0x0010ab98 0x6e src/os/tc_cdiv.o + 0x70 (size before relaxing) + *fill* 0x0010ac06 0x2 00 + .rodata 0x0010ac08 0x28 src/os/pwm.o + .rodata.str1.4 + 0x0010ac30 0x71 src/os/pwm.o + 0x74 (size before relaxing) + *fill* 0x0010aca1 0x3 00 + .rodata 0x0010aca4 0x24 src/os/pio_irq.o + .rodata.str1.4 + 0x0010acc8 0x51 src/os/pio_irq.o + 0x54 (size before relaxing) + *fill* 0x0010ad19 0x3 00 + .rodata 0x0010ad1c 0x8 src/os/wdt.o + .rodata.str1.4 + 0x0010ad24 0x33 src/os/wdt.o + 0x34 (size before relaxing) + *fill* 0x0010ad57 0x1 00 + .rodata 0x0010ad58 0x20 src/os/blinkcode.o + .rodata.str1.4 + 0x0010ad78 0x54 src/os/blinkcode.o + .rodata.str1.4 + 0x0010adcc 0x4b src/os/flash.o + 0x4c (size before relaxing) + *fill* 0x0010ae17 0x1 00 + .rodata.str1.4 + 0x0010ae18 0x2c src/pcd/main_dumbreader.o + 0x0010ae44 . = ALIGN (0x4) + 0x0010ae44 _etext = . + 0x0010ae44 PROVIDE (etext, .) + +.glue_7 0x0010ae44 0x0 load address 0x00006e44 + .glue_7 0x00000000 0x0 linker stubs + +.glue_7t 0x0010ae44 0x0 load address 0x00006e44 + .glue_7t 0x00000000 0x0 linker stubs + +.vfp11_veneer 0x0010ae44 0x0 load address 0x00006e44 + .vfp11_veneer 0x00000000 0x0 linker stubs + +.v4_bx 0x0010ae44 0x0 load address 0x00006e44 + .v4_bx 0x00000000 0x0 linker stubs + +.data 0x00200028 0x2e4 load address 0x00006e44 + 0x00200028 _data = . + *(.fastrun) + .fastrun 0x00200028 0x58 src/start/Cstartup_app.o + 0x00200028 fiq_handler + .fastrun 0x00200080 0x68 src/os/req_ctx.o + 0x00200080 req_ctx_find_get + .fastrun 0x002000e8 0x124 src/os/pio_irq.o + 0x002000e8 __pio_irq_demux + *(.data) + .data 0x0020020c 0x0 src/start/Cstartup_app.o + .data 0x0020020c 0x0 lib/changebit.o + .data 0x0020020c 0x0 lib/clearbit.o + .data 0x0020020c 0x0 lib/setbit.o + .data 0x0020020c 0x0 lib/testchangebit.o + .data 0x0020020c 0x0 lib/testclearbit.o + .data 0x0020020c 0x0 lib/testsetbit.o + .data 0x0020020c 0x0 lib/lib1funcs.o + .data 0x0020020c 0x0 lib/div64.o + .data 0x0020020c 0x0 lib/lib_AT91SAM7.o + .data 0x0020020c 0x0 lib/vsprintf.o + .data 0x0020020c 0x100 lib/ctype.o + 0x0020020c _ctype + .data 0x0020030c 0x0 lib/string.o + .data 0x0020030c 0x0 src/os/pcd_enumerate.o + .data 0x0020030c 0x0 src/os/fifo.o + .data 0x0020030c 0x0 src/os/dbgu.o + .data 0x0020030c 0x0 src/os/led.o + .data 0x0020030c 0x0 src/os/req_ctx.o + .data 0x0020030c 0x0 src/os/trigger.o + .data 0x0020030c 0x0 src/os/main.o + .data 0x0020030c 0x0 src/os/syscalls.o + .data 0x0020030c 0x0 src/os/usb_handler.o + .data 0x0020030c 0x0 src/os/usb_benchmark.o + .data 0x0020030c 0x0 src/os/tc_cdiv.o + .data 0x0020030c 0x0 src/os/pit.o + .data 0x0020030c 0x0 src/os/pwm.o + .data 0x0020030c 0x0 src/os/pio_irq.o + .data 0x0020030c 0x0 src/os/usbcmd_generic.o + .data 0x0020030c 0x0 src/os/wdt.o + .data 0x0020030c 0x0 src/os/blinkcode.o + .data 0x0020030c 0x0 src/os/system_irq.o + .data 0x0020030c 0x0 src/os/flash.o + .data 0x0020030c 0x0 src/pcd/rc632.o + .data 0x0020030c 0x0 src/pcd/rc632_highlevel.o + .data 0x0020030c 0x0 src/pcd/main_dumbreader.o + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + .data 0x0020030c 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + 0x0020030c . = ALIGN (0x4) + 0x0020030c _edata = . + 0x0020030c PROVIDE (edata, .) + +.bss 0x0020030c 0x3840 load address 0x00007128 + 0x0020030c __bss_start = . + 0x0020030c __bss_start__ = . + *(.bss) + .bss 0x0020030c 0x0 src/start/Cstartup_app.o + .bss 0x0020030c 0x0 lib/changebit.o + .bss 0x0020030c 0x0 lib/clearbit.o + .bss 0x0020030c 0x0 lib/setbit.o + .bss 0x0020030c 0x0 lib/testchangebit.o + .bss 0x0020030c 0x0 lib/testclearbit.o + .bss 0x0020030c 0x0 lib/testsetbit.o + .bss 0x0020030c 0x0 lib/lib1funcs.o + .bss 0x0020030c 0x0 lib/div64.o + .bss 0x0020030c 0x0 lib/lib_AT91SAM7.o + .bss 0x0020030c 0x0 lib/vsprintf.o + .bss 0x0020030c 0x0 lib/ctype.o + .bss 0x0020030c 0x0 lib/string.o + .bss 0x0020030c 0x3c src/os/pcd_enumerate.o + .bss 0x00200348 0x0 src/os/fifo.o + .bss 0x00200348 0x120c src/os/dbgu.o + .bss 0x00201554 0x0 src/os/led.o + .bss 0x00201554 0x2290 src/os/req_ctx.o + .bss 0x002037e4 0x0 src/os/trigger.o + .bss 0x002037e4 0x0 src/os/main.o + .bss 0x002037e4 0x4 src/os/syscalls.o + .bss 0x002037e8 0x40 src/os/usb_handler.o + .bss 0x00203828 0x18 src/os/usb_benchmark.o + .bss 0x00203840 0x0 src/os/tc_cdiv.o + .bss 0x00203840 0x4 src/os/pit.o + .bss 0x00203844 0x0 src/os/pwm.o + .bss 0x00203844 0x88 src/os/pio_irq.o + .bss 0x002038cc 0x0 src/os/usbcmd_generic.o + .bss 0x002038cc 0x0 src/os/wdt.o + .bss 0x002038cc 0x40 src/os/blinkcode.o + .bss 0x0020390c 0x1c src/os/system_irq.o + .bss 0x00203928 0x0 src/os/flash.o + .bss 0x00203928 0xe8 src/pcd/rc632.o + .bss 0x00203a10 0x0 src/pcd/rc632_highlevel.o + .bss 0x00203a10 0x4 src/pcd/main_dumbreader.o + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + .bss 0x00203a14 0x0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + *(COMMON) + COMMON 0x00203a14 0x4 src/os/pit.o + 0x00203a14 jiffies + COMMON 0x00203a18 0x100 src/os/usbcmd_generic.o + 0x00203a18 config_stack + COMMON 0x00203b18 0x34 src/pcd/rc632_highlevel.o + 0x00203b18 rc632 + 0x00203b4c . = ALIGN (0x4) + 0x00203b4c __bss_end__ = . + 0x00203b4c __bss_end__ = . + 0x00203b4c PROVIDE (main, .) + 0x00203b4c _end = . + 0x00203b4c . = ALIGN (0x4) + +.int_data + *(.internal_ram_top) + 0x00203b4c PROVIDE (end, .) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.ARM.attributes + 0x00000000 0x2e + .ARM.attributes + 0x00000000 0x22 src/start/Cstartup_app.o + .ARM.attributes + 0x00000022 0x22 lib/changebit.o + .ARM.attributes + 0x00000044 0x22 lib/clearbit.o + .ARM.attributes + 0x00000066 0x22 lib/setbit.o + .ARM.attributes + 0x00000088 0x22 lib/testchangebit.o + .ARM.attributes + 0x000000aa 0x22 lib/testclearbit.o + .ARM.attributes + 0x000000cc 0x22 lib/testsetbit.o + .ARM.attributes + 0x000000ee 0x22 lib/lib1funcs.o + .ARM.attributes + 0x00000110 0x22 lib/div64.o + .ARM.attributes + 0x00000132 0x32 lib/lib_AT91SAM7.o + .ARM.attributes + 0x00000164 0x32 lib/vsprintf.o + .ARM.attributes + 0x00000196 0x32 lib/ctype.o + .ARM.attributes + 0x000001c8 0x32 lib/string.o + .ARM.attributes + 0x000001fa 0x32 src/os/pcd_enumerate.o + .ARM.attributes + 0x0000022c 0x32 src/os/fifo.o + .ARM.attributes + 0x0000025e 0x32 src/os/dbgu.o + .ARM.attributes + 0x00000290 0x32 src/os/led.o + .ARM.attributes + 0x000002c2 0x32 src/os/req_ctx.o + .ARM.attributes + 0x000002f4 0x32 src/os/trigger.o + .ARM.attributes + 0x00000326 0x32 src/os/main.o + .ARM.attributes + 0x00000358 0x32 src/os/syscalls.o + .ARM.attributes + 0x0000038a 0x32 src/os/usb_handler.o + .ARM.attributes + 0x000003bc 0x32 src/os/usb_benchmark.o + .ARM.attributes + 0x000003ee 0x32 src/os/tc_cdiv.o + .ARM.attributes + 0x00000420 0x32 src/os/pit.o + .ARM.attributes + 0x00000452 0x32 src/os/pwm.o + .ARM.attributes + 0x00000484 0x32 src/os/pio_irq.o + .ARM.attributes + 0x000004b6 0x32 src/os/usbcmd_generic.o + .ARM.attributes + 0x000004e8 0x32 src/os/wdt.o + .ARM.attributes + 0x0000051a 0x32 src/os/blinkcode.o + .ARM.attributes + 0x0000054c 0x32 src/os/system_irq.o + .ARM.attributes + 0x0000057e 0x32 src/os/flash.o + .ARM.attributes + 0x000005b0 0x32 src/pcd/rc632.o + .ARM.attributes + 0x000005e2 0x32 src/pcd/rc632_highlevel.o + .ARM.attributes + 0x00000614 0x32 src/pcd/main_dumbreader.o + .ARM.attributes + 0x00000646 0x34 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + .ARM.attributes + 0x0000067a 0x34 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + .ARM.attributes + 0x000006ae 0x34 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + .ARM.attributes + 0x000006e2 0x1a e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .ARM.attributes + 0x000006fc 0x18 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + .ARM.attributes + 0x00000714 0x34 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + .ARM.attributes + 0x00000748 0x1a e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + +.comment 0x00000000 0x2a + *(.comment) + .comment 0x00000000 0x2a lib/lib_AT91SAM7.o + 0x2b (size before relaxing) + .comment 0x00000000 0x2b lib/vsprintf.o + .comment 0x00000000 0x2b lib/ctype.o + .comment 0x00000000 0x2b lib/string.o + .comment 0x00000000 0x2b src/os/pcd_enumerate.o + .comment 0x00000000 0x2b src/os/fifo.o + .comment 0x00000000 0x2b src/os/dbgu.o + .comment 0x00000000 0x2b src/os/led.o + .comment 0x00000000 0x2b src/os/req_ctx.o + .comment 0x00000000 0x2b src/os/trigger.o + .comment 0x00000000 0x2b src/os/main.o + .comment 0x00000000 0x2b src/os/syscalls.o + .comment 0x00000000 0x2b src/os/usb_handler.o + .comment 0x00000000 0x2b src/os/usb_benchmark.o + .comment 0x00000000 0x2b src/os/tc_cdiv.o + .comment 0x00000000 0x2b src/os/pit.o + .comment 0x00000000 0x2b src/os/pwm.o + .comment 0x00000000 0x2b src/os/pio_irq.o + .comment 0x00000000 0x2b src/os/usbcmd_generic.o + .comment 0x00000000 0x2b src/os/wdt.o + .comment 0x00000000 0x2b src/os/blinkcode.o + .comment 0x00000000 0x2b src/os/system_irq.o + .comment 0x00000000 0x2b src/os/flash.o + .comment 0x00000000 0x2b src/pcd/rc632.o + .comment 0x00000000 0x2b src/pcd/rc632_highlevel.o + .comment 0x00000000 0x2b src/pcd/main_dumbreader.o + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0x458 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x28 src/start/Cstartup_app.o + .debug_aranges + 0x00000028 0x20 lib/changebit.o + .debug_aranges + 0x00000048 0x20 lib/clearbit.o + .debug_aranges + 0x00000068 0x20 lib/setbit.o + .debug_aranges + 0x00000088 0x20 lib/testchangebit.o + .debug_aranges + 0x000000a8 0x20 lib/testclearbit.o + .debug_aranges + 0x000000c8 0x20 lib/testsetbit.o + .debug_aranges + 0x000000e8 0x20 lib/lib1funcs.o + .debug_aranges + 0x00000108 0x20 lib/div64.o + .debug_aranges + 0x00000128 0x20 lib/lib_AT91SAM7.o + .debug_aranges + 0x00000148 0x20 lib/vsprintf.o + .debug_aranges + 0x00000168 0x20 lib/string.o + .debug_aranges + 0x00000188 0x20 src/os/pcd_enumerate.o + .debug_aranges + 0x000001a8 0x20 src/os/fifo.o + .debug_aranges + 0x000001c8 0x20 src/os/dbgu.o + .debug_aranges + 0x000001e8 0x20 src/os/led.o + .debug_aranges + 0x00000208 0x28 src/os/req_ctx.o + .debug_aranges + 0x00000230 0x20 src/os/trigger.o + .debug_aranges + 0x00000250 0x20 src/os/main.o + .debug_aranges + 0x00000270 0x20 src/os/syscalls.o + .debug_aranges + 0x00000290 0x20 src/os/usb_handler.o + .debug_aranges + 0x000002b0 0x20 src/os/usb_benchmark.o + .debug_aranges + 0x000002d0 0x20 src/os/tc_cdiv.o + .debug_aranges + 0x000002f0 0x20 src/os/pit.o + .debug_aranges + 0x00000310 0x20 src/os/pwm.o + .debug_aranges + 0x00000330 0x28 src/os/pio_irq.o + .debug_aranges + 0x00000358 0x20 src/os/usbcmd_generic.o + .debug_aranges + 0x00000378 0x20 src/os/wdt.o + .debug_aranges + 0x00000398 0x20 src/os/blinkcode.o + .debug_aranges + 0x000003b8 0x20 src/os/system_irq.o + .debug_aranges + 0x000003d8 0x20 src/os/flash.o + .debug_aranges + 0x000003f8 0x20 src/pcd/rc632.o + .debug_aranges + 0x00000418 0x20 src/pcd/rc632_highlevel.o + .debug_aranges + 0x00000438 0x20 src/pcd/main_dumbreader.o + +.debug_pubnames + 0x00000000 0xb4c + *(.debug_pubnames) + .debug_pubnames + 0x00000000 0x177 lib/lib_AT91SAM7.o + .debug_pubnames + 0x00000177 0xc6 lib/vsprintf.o + .debug_pubnames + 0x0000023d 0x1d lib/ctype.o + .debug_pubnames + 0x0000025a 0x1e lib/string.o + .debug_pubnames + 0x00000278 0x9d src/os/pcd_enumerate.o + .debug_pubnames + 0x00000315 0x85 src/os/fifo.o + .debug_pubnames + 0x0000039a 0xda src/os/dbgu.o + .debug_pubnames + 0x00000474 0x49 src/os/led.o + .debug_pubnames + 0x000004bd 0x6e src/os/req_ctx.o + .debug_pubnames + 0x0000052b 0x35 src/os/trigger.o + .debug_pubnames + 0x00000560 0x2c src/os/main.o + .debug_pubnames + 0x0000058c 0x69 src/os/syscalls.o + .debug_pubnames + 0x000005f5 0x67 src/os/usb_handler.o + .debug_pubnames + 0x0000065c 0x23 src/os/usb_benchmark.o + .debug_pubnames + 0x0000067f 0x74 src/os/tc_cdiv.o + .debug_pubnames + 0x000006f3 0x6c src/os/pit.o + .debug_pubnames + 0x0000075f 0x71 src/os/pwm.o + .debug_pubnames + 0x000007d0 0x8a src/os/pio_irq.o + .debug_pubnames + 0x0000085a 0x37 src/os/usbcmd_generic.o + .debug_pubnames + 0x00000891 0x2f src/os/wdt.o + .debug_pubnames + 0x000008c0 0x37 src/os/blinkcode.o + .debug_pubnames + 0x000008f7 0x36 src/os/system_irq.o + .debug_pubnames + 0x0000092d 0x30 src/os/flash.o + .debug_pubnames + 0x0000095d 0x127 src/pcd/rc632.o + .debug_pubnames + 0x00000a84 0x89 src/pcd/rc632_highlevel.o + .debug_pubnames + 0x00000b0d 0x3f src/pcd/main_dumbreader.o + +.debug_info 0x00000000 0xe685 + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x00000000 0x6e src/start/Cstartup_app.o + .debug_info 0x0000006e 0x69 lib/changebit.o + .debug_info 0x000000d7 0x68 lib/clearbit.o + .debug_info 0x0000013f 0x66 lib/setbit.o + .debug_info 0x000001a5 0x6d lib/testchangebit.o + .debug_info 0x00000212 0x6c lib/testclearbit.o + .debug_info 0x0000027e 0x6a lib/testsetbit.o + .debug_info 0x000002e8 0x69 lib/lib1funcs.o + .debug_info 0x00000351 0x65 lib/div64.o + .debug_info 0x000003b6 0x1dc6 lib/lib_AT91SAM7.o + .debug_info 0x0000217c 0xacc lib/vsprintf.o + .debug_info 0x00002c48 0x63 lib/ctype.o + .debug_info 0x00002cab 0xf6 lib/string.o + .debug_info 0x00002da1 0x16e2 src/os/pcd_enumerate.o + .debug_info 0x00004483 0x386 src/os/fifo.o + .debug_info 0x00004809 0x1163 src/os/dbgu.o + .debug_info 0x0000596c 0x6d7 src/os/led.o + .debug_info 0x00006043 0x2fa src/os/req_ctx.o + .debug_info 0x0000633d 0x411 src/os/trigger.o + .debug_info 0x0000674e 0x371 src/os/main.o + .debug_info 0x00006abf 0x12bf src/os/syscalls.o + .debug_info 0x00007d7e 0x2c8 src/os/usb_handler.o + .debug_info 0x00008046 0x23e src/os/usb_benchmark.o + .debug_info 0x00008284 0x7cf src/os/tc_cdiv.o + .debug_info 0x00008a53 0x753 src/os/pit.o + .debug_info 0x000091a6 0xca6 src/os/pwm.o + .debug_info 0x00009e4c 0xc0d src/os/pio_irq.o + .debug_info 0x0000aa59 0x438 src/os/usbcmd_generic.o + .debug_info 0x0000ae91 0x201 src/os/wdt.o + .debug_info 0x0000b092 0x2b0 src/os/blinkcode.o + .debug_info 0x0000b342 0x392 src/os/system_irq.o + .debug_info 0x0000b6d4 0x36a src/os/flash.o + .debug_info 0x0000ba3e 0x1ec1 src/pcd/rc632.o + .debug_info 0x0000d8ff 0xb59 src/pcd/rc632_highlevel.o + .debug_info 0x0000e458 0x22d src/pcd/main_dumbreader.o + +.debug_abbrev 0x00000000 0x3579 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x12 src/start/Cstartup_app.o + .debug_abbrev 0x00000012 0x14 lib/changebit.o + .debug_abbrev 0x00000026 0x14 lib/clearbit.o + .debug_abbrev 0x0000003a 0x14 lib/setbit.o + .debug_abbrev 0x0000004e 0x14 lib/testchangebit.o + .debug_abbrev 0x00000062 0x14 lib/testclearbit.o + .debug_abbrev 0x00000076 0x14 lib/testsetbit.o + .debug_abbrev 0x0000008a 0x14 lib/lib1funcs.o + .debug_abbrev 0x0000009e 0x14 lib/div64.o + .debug_abbrev 0x000000b2 0x334 lib/lib_AT91SAM7.o + .debug_abbrev 0x000003e6 0x286 lib/vsprintf.o + .debug_abbrev 0x0000066c 0x53 lib/ctype.o + .debug_abbrev 0x000006bf 0xac lib/string.o + .debug_abbrev 0x0000076b 0x3f0 src/os/pcd_enumerate.o + .debug_abbrev 0x00000b5b 0x1bf src/os/fifo.o + .debug_abbrev 0x00000d1a 0x426 src/os/dbgu.o + .debug_abbrev 0x00001140 0x201 src/os/led.o + .debug_abbrev 0x00001341 0x1bb src/os/req_ctx.o + .debug_abbrev 0x000014fc 0x102 src/os/trigger.o + .debug_abbrev 0x000015fe 0x157 src/os/main.o + .debug_abbrev 0x00001755 0x2db src/os/syscalls.o + .debug_abbrev 0x00001a30 0x1b1 src/os/usb_handler.o + .debug_abbrev 0x00001be1 0x111 src/os/usb_benchmark.o + .debug_abbrev 0x00001cf2 0x197 src/os/tc_cdiv.o + .debug_abbrev 0x00001e89 0x2ff src/os/pit.o + .debug_abbrev 0x00002188 0x295 src/os/pwm.o + .debug_abbrev 0x0000241d 0x2eb src/os/pio_irq.o + .debug_abbrev 0x00002708 0x1fa src/os/usbcmd_generic.o + .debug_abbrev 0x00002902 0x13f src/os/wdt.o + .debug_abbrev 0x00002a41 0x159 src/os/blinkcode.o + .debug_abbrev 0x00002b9a 0x166 src/os/system_irq.o + .debug_abbrev 0x00002d00 0x1c5 src/os/flash.o + .debug_abbrev 0x00002ec5 0x45e src/pcd/rc632.o + .debug_abbrev 0x00003323 0x1a4 src/pcd/rc632_highlevel.o + .debug_abbrev 0x000034c7 0xb2 src/pcd/main_dumbreader.o + +.debug_line 0x00000000 0x3414 + *(.debug_line) + .debug_line 0x00000000 0x84 src/start/Cstartup_app.o + .debug_line 0x00000084 0x40 lib/changebit.o + .debug_line 0x000000c4 0x3f lib/clearbit.o + .debug_line 0x00000103 0x3d lib/setbit.o + .debug_line 0x00000140 0x44 lib/testchangebit.o + .debug_line 0x00000184 0x43 lib/testclearbit.o + .debug_line 0x000001c7 0x41 lib/testsetbit.o + .debug_line 0x00000208 0x99 lib/lib1funcs.o + .debug_line 0x000002a1 0x8c lib/div64.o + .debug_line 0x0000032d 0x3bf lib/lib_AT91SAM7.o + .debug_line 0x000006ec 0x6a4 lib/vsprintf.o + .debug_line 0x00000d90 0x43 lib/ctype.o + .debug_line 0x00000dd3 0x154 lib/string.o + .debug_line 0x00000f27 0x4f2 src/os/pcd_enumerate.o + .debug_line 0x00001419 0x14b src/os/fifo.o + .debug_line 0x00001564 0x31e src/os/dbgu.o + .debug_line 0x00001882 0xda src/os/led.o + .debug_line 0x0000195c 0x11b src/os/req_ctx.o + .debug_line 0x00001a77 0xa1 src/os/trigger.o + .debug_line 0x00001b18 0xab src/os/main.o + .debug_line 0x00001bc3 0x264 src/os/syscalls.o + .debug_line 0x00001e27 0x11e src/os/usb_handler.o + .debug_line 0x00001f45 0x112 src/os/usb_benchmark.o + .debug_line 0x00002057 0x145 src/os/tc_cdiv.o + .debug_line 0x0000219c 0x1c2 src/os/pit.o + .debug_line 0x0000235e 0x1e4 src/os/pwm.o + .debug_line 0x00002542 0x20e src/os/pio_irq.o + .debug_line 0x00002750 0x171 src/os/usbcmd_generic.o + .debug_line 0x000028c1 0x104 src/os/wdt.o + .debug_line 0x000029c5 0x12f src/os/blinkcode.o + .debug_line 0x00002af4 0x171 src/os/system_irq.o + .debug_line 0x00002c65 0x12f src/os/flash.o + .debug_line 0x00002d94 0x441 src/pcd/rc632.o + .debug_line 0x000031d5 0x1b8 src/pcd/rc632_highlevel.o + .debug_line 0x0000338d 0x87 src/pcd/main_dumbreader.o + +.debug_frame 0x00000000 0x1244 + *(.debug_frame) + .debug_frame 0x00000000 0x174 lib/lib_AT91SAM7.o + .debug_frame 0x00000174 0x1fc lib/vsprintf.o + .debug_frame 0x00000370 0x28 lib/string.o + .debug_frame 0x00000398 0x14c src/os/pcd_enumerate.o + .debug_frame 0x000004e4 0xc8 src/os/fifo.o + .debug_frame 0x000005ac 0x1a4 src/os/dbgu.o + .debug_frame 0x00000750 0x50 src/os/led.o + .debug_frame 0x000007a0 0x88 src/os/req_ctx.o + .debug_frame 0x00000828 0x34 src/os/trigger.o + .debug_frame 0x0000085c 0x2c src/os/main.o + .debug_frame 0x00000888 0x8c src/os/syscalls.o + .debug_frame 0x00000914 0x74 src/os/usb_handler.o + .debug_frame 0x00000988 0x4c src/os/usb_benchmark.o + .debug_frame 0x000009d4 0x7c src/os/tc_cdiv.o + .debug_frame 0x00000a50 0xa8 src/os/pit.o + .debug_frame 0x00000af8 0xcc src/os/pwm.o + .debug_frame 0x00000bc4 0xd8 src/os/pio_irq.o + .debug_frame 0x00000c9c 0x50 src/os/usbcmd_generic.o + .debug_frame 0x00000cec 0x58 src/os/wdt.o + .debug_frame 0x00000d44 0x64 src/os/blinkcode.o + .debug_frame 0x00000da8 0x58 src/os/system_irq.o + .debug_frame 0x00000e00 0x48 src/os/flash.o + .debug_frame 0x00000e48 0x23c src/pcd/rc632.o + .debug_frame 0x00001084 0x9c src/pcd/rc632_highlevel.o + .debug_frame 0x00001120 0x64 src/pcd/main_dumbreader.o + .debug_frame 0x00001184 0x30 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + .debug_frame 0x000011b4 0x28 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + .debug_frame 0x000011dc 0x20 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + .debug_frame 0x000011fc 0x20 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + .debug_frame 0x0000121c 0x28 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + +.debug_str 0x00000000 0x3811 + *(.debug_str) + .debug_str 0x00000000 0xabc lib/lib_AT91SAM7.o + 0xb13 (size before relaxing) + .debug_str 0x00000abc 0x118 lib/vsprintf.o + 0x246 (size before relaxing) + .debug_str 0x00000bd4 0xc lib/ctype.o + 0x6a (size before relaxing) + .debug_str 0x00000be0 0x15 lib/string.o + 0xee (size before relaxing) + .debug_str 0x00000bf5 0x8fe src/os/pcd_enumerate.o + 0xb1e (size before relaxing) + .debug_str 0x000014f3 0xb2 src/os/fifo.o + 0x19b (size before relaxing) + .debug_str 0x000015a5 0x3ff src/os/dbgu.o + 0x897 (size before relaxing) + .debug_str 0x000019a4 0x5a src/os/led.o + 0x2c4 (size before relaxing) + .debug_str 0x000019fe 0x87 src/os/req_ctx.o + 0x19a (size before relaxing) + .debug_str 0x00001a85 0x2c src/os/trigger.o + 0x291 (size before relaxing) + .debug_str 0x00001ab1 0x77 src/os/main.o + 0x25c (size before relaxing) + .debug_str 0x00001b28 0x4cd src/os/syscalls.o + 0x822 (size before relaxing) + .debug_str 0x00001ff5 0xbc src/os/usb_handler.o + 0x1db (size before relaxing) + .debug_str 0x000020b1 0x128 src/os/usb_benchmark.o + 0x282 (size before relaxing) + .debug_str 0x000021d9 0x105 src/os/tc_cdiv.o + 0x42a (size before relaxing) + .debug_str 0x000022de 0x13d src/os/pit.o + 0x3c8 (size before relaxing) + .debug_str 0x0000241b 0x1d9 src/os/pwm.o + 0x681 (size before relaxing) + .debug_str 0x000025f4 0x11d src/os/pio_irq.o + 0x660 (size before relaxing) + .debug_str 0x00002711 0x56 src/os/usbcmd_generic.o + 0x314 (size before relaxing) + .debug_str 0x00002767 0x88 src/os/wdt.o + 0x215 (size before relaxing) + .debug_str 0x000027ef 0x150 src/os/blinkcode.o + 0x25f (size before relaxing) + .debug_str 0x0000293f 0x51 src/os/system_irq.o + 0x2cf (size before relaxing) + .debug_str 0x00002990 0x11b src/os/flash.o + 0x21e (size before relaxing) + .debug_str 0x00002aab 0xa78 src/pcd/rc632.o + 0x122c (size before relaxing) + .debug_str 0x00003523 0x2b3 src/pcd/rc632_highlevel.o + 0xb8e (size before relaxing) + .debug_str 0x000037d6 0x3b src/pcd/main_dumbreader.o + 0x58e (size before relaxing) + +.debug_loc 0x00000000 0x5011 + *(.debug_loc) + .debug_loc 0x00000000 0x8d4 lib/lib_AT91SAM7.o + .debug_loc 0x000008d4 0x18be lib/vsprintf.o + .debug_loc 0x00002192 0x90 lib/string.o + .debug_loc 0x00002222 0x7e2 src/os/pcd_enumerate.o + .debug_loc 0x00002a04 0x24a src/os/fifo.o + .debug_loc 0x00002c4e 0x411 src/os/dbgu.o + .debug_loc 0x0000305f 0xd9 src/os/led.o + .debug_loc 0x00003138 0x111 src/os/req_ctx.o + .debug_loc 0x00003249 0x3f src/os/trigger.o + .debug_loc 0x00003288 0x20 src/os/main.o + .debug_loc 0x000032a8 0x234 src/os/syscalls.o + .debug_loc 0x000034dc 0x13b src/os/usb_handler.o + .debug_loc 0x00003617 0xa6 src/os/usb_benchmark.o + .debug_loc 0x000036bd 0x53 src/os/tc_cdiv.o + .debug_loc 0x00003710 0x1f1 src/os/pit.o + .debug_loc 0x00003901 0x32a src/os/pwm.o + .debug_loc 0x00003c2b 0x278 src/os/pio_irq.o + .debug_loc 0x00003ea3 0x237 src/os/usbcmd_generic.o + .debug_loc 0x000040da 0x53 src/os/wdt.o + .debug_loc 0x0000412d 0x120 src/os/blinkcode.o + .debug_loc 0x0000424d 0x144 src/os/system_irq.o + .debug_loc 0x00004391 0xc9 src/os/flash.o + .debug_loc 0x0000445a 0x861 src/pcd/rc632.o + .debug_loc 0x00004cbb 0x2d7 src/pcd/rc632_highlevel.o + .debug_loc 0x00004f92 0x7f src/pcd/main_dumbreader.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) +OUTPUT(main_dumbreader.elf elf32-littlearm) + +.debug_ranges 0x00000000 0xf50 + .debug_ranges 0x00000000 0x20 src/start/Cstartup_app.o + .debug_ranges 0x00000020 0x4f0 lib/lib_AT91SAM7.o + .debug_ranges 0x00000510 0x78 lib/vsprintf.o + .debug_ranges 0x00000588 0x1f8 src/os/pcd_enumerate.o + .debug_ranges 0x00000780 0x98 src/os/fifo.o + .debug_ranges 0x00000818 0x120 src/os/dbgu.o + .debug_ranges 0x00000938 0x90 src/os/led.o + .debug_ranges 0x000009c8 0x18 src/os/req_ctx.o + .debug_ranges 0x000009e0 0x18 src/os/trigger.o + .debug_ranges 0x000009f8 0x70 src/os/syscalls.o + .debug_ranges 0x00000a68 0x40 src/os/usb_handler.o + .debug_ranges 0x00000aa8 0x48 src/os/tc_cdiv.o + .debug_ranges 0x00000af0 0x98 src/os/pit.o + .debug_ranges 0x00000b88 0xf0 src/os/pwm.o + .debug_ranges 0x00000c78 0xa8 src/os/pio_irq.o + .debug_ranges 0x00000d20 0x18 src/os/usbcmd_generic.o + .debug_ranges 0x00000d38 0x18 src/os/flash.o + .debug_ranges 0x00000d50 0x200 src/pcd/rc632.o + +.debug_pubtypes + 0x00000000 0x12b0 + .debug_pubtypes + 0x00000000 0x128 lib/lib_AT91SAM7.o + .debug_pubtypes + 0x00000128 0x4a lib/vsprintf.o + .debug_pubtypes + 0x00000172 0x1d lib/string.o + .debug_pubtypes + 0x0000018f 0x1ba src/os/pcd_enumerate.o + .debug_pubtypes + 0x00000349 0x36 src/os/fifo.o + .debug_pubtypes + 0x0000037f 0x11e src/os/dbgu.o + .debug_pubtypes + 0x0000049d 0x30 src/os/led.o + .debug_pubtypes + 0x000004cd 0x47 src/os/req_ctx.o + .debug_pubtypes + 0x00000514 0x30 src/os/trigger.o + .debug_pubtypes + 0x00000544 0x6c src/os/main.o + .debug_pubtypes + 0x000005b0 0x1d1 src/os/syscalls.o + .debug_pubtypes + 0x00000781 0x75 src/os/usb_handler.o + .debug_pubtypes + 0x000007f6 0x7c src/os/usb_benchmark.o + .debug_pubtypes + 0x00000872 0xa1 src/os/tc_cdiv.o + .debug_pubtypes + 0x00000913 0x86 src/os/pit.o + .debug_pubtypes + 0x00000999 0xee src/os/pwm.o + .debug_pubtypes + 0x00000a87 0xea src/os/pio_irq.o + .debug_pubtypes + 0x00000b71 0xb8 src/os/usbcmd_generic.o + .debug_pubtypes + 0x00000c29 0x4c src/os/wdt.o + .debug_pubtypes + 0x00000c75 0x60 src/os/blinkcode.o + .debug_pubtypes + 0x00000cd5 0x67 src/os/system_irq.o + .debug_pubtypes + 0x00000d3c 0x57 src/os/flash.o + .debug_pubtypes + 0x00000d93 0x2d9 src/pcd/rc632.o + .debug_pubtypes + 0x0000106c 0x21e src/pcd/rc632_highlevel.o + .debug_pubtypes + 0x0000128a 0x26 src/pcd/main_dumbreader.o + +Cross Reference Table + +Symbol File +AT91F_ADC_CfgTimings lib/lib_AT91SAM7.o +AT91F_AIC_ConfigureIt lib/lib_AT91SAM7.o + src/pcd/rc632.o + src/os/system_irq.o + src/os/pio_irq.o + src/os/pcd_enumerate.o +AT91F_AIC_Open lib/lib_AT91SAM7.o +AT91F_AIC_SetExceptionVector lib/lib_AT91SAM7.o +AT91F_DBGU_Fini src/os/dbgu.o +AT91F_DBGU_Frame src/os/dbgu.o +AT91F_DBGU_Get src/os/dbgu.o +AT91F_DBGU_Init src/os/dbgu.o + src/os/main.o +AT91F_DBGU_Printk src/os/dbgu.o + src/pcd/main_dumbreader.o +AT91F_DBGU_Ready src/os/dbgu.o +AT91F_PDC_Close lib/lib_AT91SAM7.o +AT91F_PDC_Open lib/lib_AT91SAM7.o +AT91F_PDC_ReceiveFrame lib/lib_AT91SAM7.o + src/pcd/rc632.o +AT91F_PDC_SendFrame lib/lib_AT91SAM7.o + src/pcd/rc632.o + src/os/dbgu.o +AT91F_PMC_GetMasterClock lib/lib_AT91SAM7.o +AT91F_RTTReadValue lib/lib_AT91SAM7.o +AT91F_SPI_Close lib/lib_AT91SAM7.o +AT91F_SSC_Configure lib/lib_AT91SAM7.o +AT91F_SSC_SetBaudrate lib/lib_AT91SAM7.o +AT91F_US_Close lib/lib_AT91SAM7.o +AT91F_US_Configure lib/lib_AT91SAM7.o + src/os/dbgu.o +__aeabi_idiv lib/lib1funcs.o +__aeabi_idiv0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) +__aeabi_ldiv0 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_dvmd_tls.o) +__aeabi_uidiv e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + src/os/pwm.o + lib/lib_AT91SAM7.o +__aeabi_uidivmod e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) + src/os/tc_cdiv.o +__bss_end__ src/start/Cstartup_app.o +__bss_start__ src/start/Cstartup_app.o +__clzsi2 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_clzsi2.o) + e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) +__div0 lib/lib1funcs.o + lib/div64.o +__divsi3 lib/lib1funcs.o +__do_div64 lib/div64.o + lib/vsprintf.o +__ffssi2 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_ffssi2.o) + src/os/pio_irq.o +__modsi3 lib/lib1funcs.o +__pio_irq_demux src/os/pio_irq.o + src/start/Cstartup_app.o +__udivsi3 e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2\libgcc.a(_udivsi3.o) +__umodsi3 lib/lib1funcs.o +_change_bit_be lib/changebit.o +_change_bit_le lib/changebit.o +_clear_bit_be lib/clearbit.o +_clear_bit_le lib/clearbit.o +_close_r src/os/syscalls.o +_ctype lib/ctype.o + lib/vsprintf.o +_data src/start/Cstartup_app.o +_edata src/start/Cstartup_app.o +_etext src/start/Cstartup_app.o +_fstat_r src/os/syscalls.o +_init_func src/pcd/main_dumbreader.o + src/os/main.o +_lseek_r src/os/syscalls.o +_main_dbgu src/pcd/main_dumbreader.o + src/os/dbgu.o +_main_func src/pcd/main_dumbreader.o + src/os/main.o +_read_r src/os/syscalls.o +_sbrk_r src/os/syscalls.o +_set_bit_be lib/setbit.o +_set_bit_le lib/setbit.o +_startup src/start/Cstartup_app.o +_test_and_change_bit_be lib/testchangebit.o +_test_and_change_bit_le lib/testchangebit.o +_test_and_clear_bit_be lib/testclearbit.o +_test_and_clear_bit_le lib/testclearbit.o +_test_and_set_bit_be lib/testsetbit.o +_test_and_set_bit_le lib/testsetbit.o +_write_r src/os/syscalls.o +blinkcode_init src/os/blinkcode.o + src/os/main.o +blinkcode_set src/os/blinkcode.o +cfg_descriptor src/os/pcd_enumerate.o +config_stack src/os/usbcmd_generic.o +dbgu_rb_append src/os/dbgu.o +dbgu_rb_flush src/os/dbgu.o + src/os/main.o +dbgu_rb_init src/os/dbgu.o +debugp src/os/dbgu.o + src/os/flash.o + src/os/blinkcode.o + src/os/wdt.o + src/os/pio_irq.o + src/os/pwm.o + src/os/tc_cdiv.o + src/os/usb_benchmark.o + src/os/usb_handler.o + src/os/main.o + src/os/pcd_enumerate.o +dev_descriptor src/os/pcd_enumerate.o +end src/os/syscalls.o +exit src/start/Cstartup_app.o +fifo_available src/os/fifo.o +fifo_check_raise_int src/os/fifo.o +fifo_check_water src/os/fifo.o +fifo_data_get src/os/fifo.o +fifo_data_put src/os/fifo.o +fifo_init src/os/fifo.o +fiq_handler src/start/Cstartup_app.o +flash_init src/os/flash.o + src/os/usbcmd_generic.o +flash_page src/os/flash.o + src/os/usbcmd_generic.o +hexdump src/os/dbgu.o +isatty src/os/syscalls.o +jiffies src/os/blinkcode.o + src/os/pit.o +led_get src/os/led.o +led_init src/os/led.o + src/os/main.o +led_switch src/os/led.o + src/os/blinkcode.o + src/os/usbcmd_generic.o + src/os/main.o +led_toggle src/os/led.o + src/pcd/main_dumbreader.o + src/os/usb_benchmark.o + src/os/dbgu.o +main src/os/main.o + src/start/Cstartup_app.o +mdelay src/os/pit.o +memcpy e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memcpy.o) + src/pcd/rc632_highlevel.o + src/pcd/rc632.o + src/os/usbcmd_generic.o + src/os/dbgu.o + src/os/fifo.o +memset e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-memset.o) + src/os/usb_benchmark.o + src/os/dbgu.o + src/os/fifo.o +opcd_rc632_clear_bits src/pcd/rc632.o + src/pcd/rc632_highlevel.o +opcd_rc632_fifo_read src/pcd/rc632.o + src/pcd/rc632_highlevel.o +opcd_rc632_fifo_write src/pcd/rc632.o + src/pcd/rc632_highlevel.o +opcd_rc632_reg_read src/pcd/rc632.o + src/pcd/main_dumbreader.o + src/pcd/rc632_highlevel.o +opcd_rc632_reg_write src/pcd/rc632.o + src/pcd/main_dumbreader.o + src/pcd/rc632_highlevel.o +opcd_rc632_reg_write_set src/pcd/rc632.o +opcd_rc632_set_bits src/pcd/rc632.o + src/pcd/rc632_highlevel.o +opcd_version src/os/main.o + src/os/usbcmd_generic.o +pio_irq_disable src/os/pio_irq.o +pio_irq_enable src/os/pio_irq.o +pio_irq_init src/os/pio_irq.o +pio_irq_register src/os/pio_irq.o +pio_irq_unregister src/os/pio_irq.o +pit_init src/os/pit.o + src/os/main.o +pit_mdelay src/os/pit.o +pwm_duty_set_percent src/os/pwm.o +pwm_fini src/os/pwm.o +pwm_freq_set src/os/pwm.o +pwm_init src/os/pwm.o +pwm_start src/os/pwm.o +pwm_stop src/os/pwm.o +rc632 src/pcd/rc632_highlevel.o +rc632_dump src/pcd/rc632.o + src/pcd/main_dumbreader.o +rc632_get_serial src/pcd/rc632_highlevel.o + src/os/usbcmd_generic.o +rc632_init src/pcd/rc632.o + src/pcd/main_dumbreader.o +rc632_power src/pcd/rc632.o + src/pcd/main_dumbreader.o +rc632_read_eeprom src/pcd/rc632_highlevel.o +rc632_reset src/pcd/rc632.o +rc632_test src/pcd/rc632.o + src/pcd/main_dumbreader.o +rc632_turn_off_rf src/pcd/rc632_highlevel.o +rc632_turn_on_rf src/pcd/rc632_highlevel.o +rc632_unthrottle src/pcd/rc632.o + src/pcd/main_dumbreader.o +rc632_write_eeprom src/pcd/rc632_highlevel.o +req_ctx_find_get src/os/req_ctx.o + src/pcd/rc632.o + src/os/pio_irq.o + src/os/usb_benchmark.o + src/os/usb_handler.o + src/os/pcd_enumerate.o +req_ctx_init src/os/req_ctx.o + src/os/main.o +req_ctx_num src/os/req_ctx.o +req_ctx_put src/os/req_ctx.o + src/os/pwm.o + src/os/usb_benchmark.o + src/os/pcd_enumerate.o +req_ctx_set_state src/os/req_ctx.o + src/pcd/rc632.o + src/os/pio_irq.o + src/os/pwm.o + src/os/usb_benchmark.o + src/os/usb_handler.o + src/os/pcd_enumerate.o +scnprintf lib/vsprintf.o +simple_strtol lib/vsprintf.o +simple_strtoll lib/vsprintf.o +simple_strtoul lib/vsprintf.o +simple_strtoull lib/vsprintf.o +snprintf lib/vsprintf.o + src/os/dbgu.o +sprintf lib/vsprintf.o +sscanf lib/vsprintf.o +strlen e:/programme/mingw/libexec/arm/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib\libc.a(lib_a-strlen.o) + src/os/dbgu.o +strnlen lib/string.o + lib/vsprintf.o +sysirq_init src/os/system_irq.o + src/os/main.o +sysirq_register src/os/system_irq.o + src/os/wdt.o + src/os/pit.o + src/os/dbgu.o +tc_cdiv_fini src/os/tc_cdiv.o +tc_cdiv_init src/os/tc_cdiv.o +tc_cdiv_phase_add src/os/tc_cdiv.o +tc_cdiv_print src/os/tc_cdiv.o +tc_cdiv_set_divider src/os/tc_cdiv.o +timer_add src/os/pit.o + src/os/blinkcode.o +timer_del src/os/pit.o + src/os/blinkcode.o +trigger_init src/os/trigger.o +trigger_pulse src/os/trigger.o +udp_open src/os/pcd_enumerate.o + src/os/main.o +udp_pullup_off src/os/pcd_enumerate.o + src/os/dbgu.o +udp_pullup_on src/os/pcd_enumerate.o + src/os/dbgu.o +udp_refill_ep src/os/pcd_enumerate.o + src/os/pwm.o + src/os/usb_handler.o +udp_reset src/os/pcd_enumerate.o +udp_unthrottle src/os/pcd_enumerate.o + src/os/usb_handler.o +usb_hdlr_register src/os/usb_handler.o + src/pcd/rc632.o + src/os/usbcmd_generic.o + src/os/pwm.o + src/os/usb_benchmark.o +usb_hdlr_unregister src/os/usb_handler.o + src/os/pwm.o +usb_in_process src/os/usb_handler.o + src/pcd/main_dumbreader.o +usb_out_process src/os/usb_handler.o + src/pcd/main_dumbreader.o +usbcmd_gen_init src/os/usbcmd_generic.o + src/os/main.o +usbtest_init src/os/usb_benchmark.o +usleep src/os/pit.o +vscnprintf lib/vsprintf.o +vsnprintf lib/vsprintf.o + src/os/dbgu.o +vsprintf lib/vsprintf.o +vsscanf lib/vsprintf.o +wdt_init src/os/wdt.o + src/os/main.o +wdt_restart src/os/wdt.o + src/os/main.o diff --git a/firmware/main_dumbreader.samba b/firmware/main_dumbreader.samba new file mode 100644 index 0000000..cf6917f Binary files /dev/null and b/firmware/main_dumbreader.samba differ diff --git a/firmware/main_dumbreader.sym b/firmware/main_dumbreader.sym new file mode 100644 index 0000000..781be8c --- /dev/null +++ b/firmware/main_dumbreader.sym @@ -0,0 +1,240 @@ +00000011 a ARM_MODE_FIQ +00000012 a ARM_MODE_IRQ +00000013 a ARM_MODE_SVC +00000040 a F_BIT +00000080 a I_BIT +00000104 a AIC_FVR +00000130 a AIC_EOICR +00104000 T _startup +0010400c t loop_r +00104028 t loop_z +00104058 T exit +00104080 T _change_bit_be +00104084 T _change_bit_le +001040ac T _clear_bit_be +001040b0 T _clear_bit_le +001040d8 T _set_bit_be +001040dc T _set_bit_le +00104104 T _test_and_change_bit_be +00104108 T _test_and_change_bit_le +00104138 T _test_and_clear_bit_be +0010413c T _test_and_clear_bit_le +0010416c T _test_and_set_bit_be +00104170 T _test_and_set_bit_le +001041a0 T __umodsi3 +0010425c T __aeabi_idiv +0010425c T __divsi3 +00104374 T __modsi3 +00104448 t Ldiv0 +00104458 T __div0 +0010445c T __do_div64 +0010458c T AT91F_AIC_ConfigureIt +001045c4 T AT91F_AIC_SetExceptionVector +001045f8 T AT91F_AIC_Open +001046bc T AT91F_PDC_Open +00104704 T AT91F_PDC_Close +0010473c T AT91F_PDC_SendFrame +00104788 T AT91F_PDC_ReceiveFrame +001047d4 T AT91F_PMC_GetMasterClock +0010487c T AT91F_RTTReadValue +001048ac T AT91F_SPI_Close +00104904 T AT91F_ADC_CfgTimings +00104974 T AT91F_SSC_SetBaudrate +001049c0 T AT91F_SSC_Configure +00104a84 T AT91F_US_Configure +00104b30 T AT91F_US_Close +00104b84 t number +00104fe0 T simple_strtoul +00105140 T simple_strtol +0010516c T simple_strtoull +00105318 T simple_strtoll +00105350 T vsnprintf +00105bb4 T vscnprintf +00105bd0 T snprintf +00105c00 T scnprintf +00105c3c T vsprintf +00105c50 T sprintf +00105c84 T vsscanf +001064a0 T sscanf +001064d0 T strnlen +00106558 t udp_ep0_send_data +001066e8 t reset_ep +00106798 t __udp_refill_ep +00106978 t udp_irq +00107540 T udp_unthrottle +00107558 T udp_refill_ep +00107578 T udp_pullup_on +00107590 T udp_pullup_off +001075a8 T udp_open +00107654 T udp_reset +001076b8 T fifo_available +001076d8 T fifo_check_water +00107728 T fifo_check_raise_int +00107750 T fifo_data_put +00107828 T fifo_data_get +001078d0 T fifo_init +00107928 t __rb_flush +001079c4 T AT91F_DBGU_Ready +001079d8 T AT91F_DBGU_Fini +00107a04 T AT91F_DBGU_Printk +00107a34 t __dbgu_rb_append +00107a94 T AT91F_DBGU_Frame +00107aec t DBGU_irq_handler +00107c10 T AT91F_DBGU_Get +00107c30 T hexdump +00107cc4 T dbgu_rb_init +00107cfc T AT91F_DBGU_Init +00107da8 T dbgu_rb_flush +00107dac T dbgu_rb_append +00107e1c T debugp +00107e80 T led_switch +00107eac T led_get +00107ee4 T led_toggle +00107f28 T led_init +00107f50 T req_ctx_num +00107f74 T req_ctx_set_state +00107f8c T req_ctx_put +00107fa8 T req_ctx_init +00108078 T trigger_init +0010808c T trigger_pulse +001080dc T main +00108158 T _read_r +001081b0 T _write_r +00108210 T _close_r +00108218 T _lseek_r +00108220 T _fstat_r +00108230 T isatty +00108238 T _sbrk_r +00108260 T usb_hdlr_register +00108274 T usb_hdlr_unregister +00108288 T usb_out_process +001082a4 T usb_in_process +0010837c t usbtest_rx +00108438 T usbtest_init +0010847c T tc_cdiv_set_divider +001084a0 T tc_cdiv_phase_add +00108504 T tc_cdiv_init +00108574 T tc_cdiv_print +001085e0 T tc_cdiv_fini +00108600 T timer_del +00108678 t pit_irq +00108700 T timer_add +00108778 T pit_mdelay +001087ac T mdelay +001087e0 T usleep +001087e4 T pit_init +00108834 T pwm_freq_set +00108954 T pwm_start +0010896c T pwm_stop +00108984 T pwm_duty_set_percent +001089e0 t pwm_usb_in +00108a88 T pwm_init +00108ad4 T pwm_fini +00108af4 t pio_irq_demux +00108b18 T pio_irq_enable +00108b24 T pio_irq_disable +00108b30 T pio_irq_register +00108bb8 T pio_irq_unregister +00108bf4 T pio_irq_init +00108c40 t gen_usb_rx +00108e00 T usbcmd_gen_init +00108e38 t wdt_irq +00108e5c T wdt_restart +00108e70 T wdt_init +00108e9c t blinkcode_cb +00108ff0 T blinkcode_set +00109080 T blinkcode_init +001090cc t sys_irq +00109300 T sysirq_register +00109314 T sysirq_init +00109358 T flash_page +001093f8 T flash_init +0010940c t spi_irq +00109444 t spi_transceive.clone.1 +0010950c T opcd_rc632_reg_write +00109554 T opcd_rc632_reg_write_set +001095f4 T opcd_rc632_fifo_write +00109654 T opcd_rc632_reg_read +001096b8 t rc632_irq +00109750 t rc632_reg_write_verify.clone.0 +00109798 T opcd_rc632_fifo_read +00109890 T opcd_rc632_set_bits +001098dc T opcd_rc632_clear_bits +00109928 t rc632_usb_in +00109a8c T rc632_unthrottle +00109a9c T rc632_power +00109ab4 T rc632_reset +00109b3c T rc632_init +00109c4c T rc632_dump +00109cf8 T rc632_test +00109d38 T rc632_turn_on_rf +00109d50 T rc632_turn_off_rf +00109d68 T rc632_write_eeprom +00109e58 T rc632_read_eeprom +00109f14 T rc632_get_serial +00109f24 T _init_func +00109f34 T _main_dbgu +0010a0c8 T _main_func +0010a10c T memcpy +0010a2cc T memset +0010a3cc T strlen +0010a42c t .udivsi3_skip_div0_test +0010a42c T __aeabi_uidiv +0010a42c T __udivsi3 +0010a520 T __aeabi_uidivmod +0010a540 W __aeabi_idiv0 +0010a540 W __aeabi_ldiv0 +0010a544 T __ffssi2 +0010a568 T __clzsi2 +0010a5b0 t large_digits.4362 +0010a5d8 t small_digits.4361 +0010a600 t epstate +0010a620 T dev_descriptor +0010a634 T cfg_descriptor +0010a670 t __FUNCTION__.6158 +0010aaf8 t ledport +0010ab04 t __FUNCTION__.6256 +0010ab0c T opcd_version +0010ac08 t __FUNCTION__.6063 +0010ac18 t __FUNCTION__.6075 +0010aca4 t __FUNCTION__.5785 +0010acb4 t __FUNCTION__.5807 +0010ad1c t __FUNCTION__.5603 +0010ad58 t __FUNCTION__.4079 +0010ad68 t __FUNCTION__.4091 +0010ae44 A _etext +00200028 D _data +00200028 D fiq_handler +00200080 D req_ctx_find_get +002000e8 D __pio_irq_demux +0020020c D _ctype +0020030c B __bss_start +0020030c B __bss_start__ +0020030c A _edata +0020030c b upcd +00200348 b dbgu +00201350 b value.5922 +00201354 b string.6944 +00201454 b dbg_buf +00201554 b req_ctx +002015e4 b rctx_data +002017e4 b rctx_data_large +002037e4 b heap_ptr +002037e8 b cmd_hdlrs +00203828 b dummy_rctx +00203834 b empty_rctx +00203840 b timers +00203844 b pirqs +002038cc b blink_state +0020390c b sysirq_hdlrs +00203928 b spi_inbuf +0020396c b spi_outbuf +002039b0 b regset_buf +00203a10 b i.7466 +00203a14 B jiffies +00203a18 B config_stack +00203b18 B rc632 +00203b4c A __bss_end__ +00203b4c A _end +00203b4c A end +fffff000 a AT91C_BASE_AIC diff --git a/firmware/scripts/mkcompile_h b/firmware/scripts/mkcompile_h new file mode 100644 index 0000000..22ac262 --- /dev/null +++ b/firmware/scripts/mkcompile_h @@ -0,0 +1,24 @@ +#!/bin/sh + +MAX_LEN=32 +TRUNCATE="sed -e s/\(.\{1,$MAX_LEN\}\).*/\1/" + +DATE=`LC_ALL=C LANG=C date +%Y%m%d-%H%M%S` +BY=`whoami` +HOST=`hostname | $TRUNCATE` +BYHOST=`echo ${BY}@${HOST} | $TRUNCATE` +SVNREV=`svn info | grep \^Revision: | cut -c 11-` + +svn st | grep \^M >/dev/null + +[ "$?" -eq "0" ] && SVNREV=${SVNREV}-unclean + +echo "#ifndef _COMPILE_H" +echo "#define _COMPILE_H" +echo +echo /\* This file is auto generated \*/ +echo \#define COMPILE_DATE \"${DATE}\" +echo \#define COMPILE_BY \"${BYHOST}\" +echo \#define COMPILE_SVNREV \"${SVNREV}\" +echo +echo "#endif /* _COMPILE_H */" diff --git a/firmware/scripts/usbstring.c b/firmware/scripts/usbstring.c new file mode 100644 index 0000000..b101523 --- /dev/null +++ b/firmware/scripts/usbstring.c @@ -0,0 +1,201 @@ +/* AT91SAM7 USB string descriptor builder + * (C) 2006 by Harald Welte + * + * 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 + */ + +/* Based on existing utf8_to_utf16le() function, + * Copyright (C) 2003 David Brownell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include + +static int utf8_to_utf16le(const char *s, uint16_t *cp, unsigned len) +{ + int count = 0; + uint8_t c; + uint16_t uchar; + + /* this insists on correct encodings, though not minimal ones. + * BUT it currently rejects legit 4-byte UTF-8 code points, + * which need surrogate pairs. (Unicode 3.1 can use them.) + */ + while (len != 0 && (c = (uint8_t) *s++) != 0) { + if (c & 0x80) { + // 2-byte sequence: + // 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx + if ((c & 0xe0) == 0xc0) { + uchar = (c & 0x1f) << 6; + + c = (uint8_t) *s++; + if ((c & 0xc0) != 0xc0) + goto fail; + c &= 0x3f; + uchar |= c; + + // 3-byte sequence (most CJKV characters): + // zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx + } else if ((c & 0xf0) == 0xe0) { + uchar = (c & 0x0f) << 12; + + c = (uint8_t) *s++; + if ((c & 0xc0) != 0xc0) + goto fail; + c &= 0x3f; + uchar |= c << 6; + + c = (uint8_t) *s++; + if ((c & 0xc0) != 0xc0) + goto fail; + c &= 0x3f; + uchar |= c; + + /* no bogus surrogates */ + if (0xd800 <= uchar && uchar <= 0xdfff) + goto fail; + + // 4-byte sequence (surrogate pairs, currently rare): + // 11101110wwwwzzzzyy + 110111yyyyxxxxxx + // = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx + // (uuuuu = wwww + 1) + // FIXME accept the surrogate code points (only) + + } else + goto fail; + } else + uchar = c; + + *cp++ = uchar; + count++; + len--; + } + return count; +fail: + return -1; +} + +#define COLUMNS 6 +static int print_array16(uint16_t *buf, int len) +{ + int i; + for (i = 0; i < len; i++) { + int mod = i % COLUMNS; + char *suffix; + char *prefix; + + switch (mod) { + case 0: + if (i == 0) + prefix = "\t"; + else + prefix= "\t\t\t"; + suffix = ", "; + break; + case COLUMNS-1: + prefix = ""; + suffix = ",\n"; + break; + default: + prefix = ""; + suffix = ", "; + break; + } + + printf("%s0x%04x%s", prefix, buf[i], suffix); + } +} + +static void print_structhdr(int i, int size) +{ + printf( "static const struct {\n" + "\tstruct usb_descriptor_header hdr;\n" + "\tu_int16_t wData[];\n" + "} __attribute__((packed)) string%d = {\n" + "\t.hdr = {\n" + "\t\t.bLength = sizeof(struct usb_descriptor_header) + %u * sizeof(u_int16_t),\n" + "\t\t.bDescriptorType = USB_DT_STRING,\n" + "\t},\n" + "\t.wData = {", i, size); +} +static void print_structftr(void) +{ + printf("},\n};\n\n"); +} + +int main(int argc, char **argv) +{ + char asciibuf[512+1]; + uint16_t utf16buf[1024+1]; + int len; + int j, i = 1; + + printf("#ifndef _USB_STRINGS_H\n#define _USB_STRINGS_H\n\n"); + printf("/* THIS FILE IS AUTOGENERATED, DO NOT MODIFY MANUALLY */\n\n"); + printf("#include \n"); + printf("#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))\n\n"); + + print_structhdr(0, 1); + printf("0x0409 /* English */ "); + print_structftr(); +#if 0 + printf("static const struct usb_string_descriptor string0 = {\n" + "\t.bLength = sizeof(string0) + 1 * sizeof(u_int16_t),\n" + "\t.bDescriptorType = USB_DT_STRING,\n" + "\t.wData[0] = 0x0409, /* English */\n" + "};\n\n"); +#endif + + while (scanf("%512[^\n]\n", asciibuf) != EOF) { + len = strlen(asciibuf); + printf("/* String %u \"%s\" */\n", i, asciibuf); + + /* FIXME: check return value */ + utf8_to_utf16le(asciibuf, utf16buf, len); + + print_structhdr(i, len); +#if 0 + printf("static const struct usb_string_descriptor string%d = {\n" + "\t.bLength = sizeof(string%d) + %d * sizeof(u_int16_t),\n" + "\t.bDescriptorType = USB_DT_STRING,\n" + "\t.wData = {", i, i, len); +#endif + + print_array16(utf16buf, len); + + print_structftr(); +#if 0 + printf("},\n};\n\n"); +#endif + + i++; + } + + printf("static const struct usb_descriptor_header *usb_strings[] = {\n"); + for (j = 0; j < i; j++) + printf("\t(struct usb_descriptor_header *) &string%d,\n", j); + printf("};\n\n"); + printf("#endif /* _USB_STRINGS_H */\n"); + + exit(0); +} diff --git a/firmware/scripts/usbstring.exe b/firmware/scripts/usbstring.exe new file mode 100644 index 0000000..1c3b5c7 Binary files /dev/null and b/firmware/scripts/usbstring.exe differ diff --git a/firmware/src/config.h b/firmware/src/config.h new file mode 100644 index 0000000..92918e4 --- /dev/null +++ b/firmware/src/config.h @@ -0,0 +1,4 @@ +#ifndef _CONFIG_H +//#define CONFIG_USB_STRING + +#endif diff --git a/firmware/src/dfu/dbgu.c b/firmware/src/dfu/dbgu.c new file mode 100644 index 0000000..f77600d --- /dev/null +++ b/firmware/src/dfu/dbgu.c @@ -0,0 +1,140 @@ +/* AT91SAM7 debug function implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include + +#define USART_SYS_LEVEL 4 +void AT91F_DBGU_Ready(void) +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; +} + +static void DBGU_irq_handler(void) +{ + static char value; + + AT91F_DBGU_Get(&value); + switch (value) { + case '9': + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + AT91F_DBGU_Printk("\n\r"); + } +} + +void AT91F_DBGU_Init(void) +{ + /* Open PIO for DBGU */ + AT91F_DBGU_CfgPIO(); + /* Enable Transmitter & receivier */ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + AT91C_US_RSTTX | AT91C_US_RSTRX; + + /* Configure DBGU */ + AT91F_US_Configure(AT91C_BASE_DBGU, + MCK, AT91C_US_ASYNC_MODE, + AT91C_DBGU_BAUD, 0); + + /* Enable Transmitter & receivier */ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + AT91C_US_RXEN | AT91C_US_TXEN; + + /* Enable USART IT error and AT91C_US_ENDRX */ + AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + + /* open interrupt */ + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, USART_SYS_LEVEL, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + DBGU_irq_handler); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); + +} + +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, *buffer++); + } +} + +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + return (-1); + } +} + +#ifdef DEBUG + +void AT91F_DBGU_Frame(char *buffer) +{ + unsigned char len; + + for (len = 0; buffer[len] != '\0'; len++) { } + + AT91F_US_SendFrame((AT91PS_USART) AT91C_BASE_DBGU, + (unsigned char *)buffer, len, 0, 0); +} + + +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[256]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +static char dbg_buf[2048]; +void debugp(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + va_end(ap); + + dbg_buf[sizeof(dbg_buf)-1] = '\0'; + //AT91F_DBGU_Frame(dbg_buf); + AT91F_DBGU_Printk(dbg_buf); +} + +#endif diff --git a/firmware/src/dfu/dbgu.h b/firmware/src/dfu/dbgu.h new file mode 100644 index 0000000..5ec8a49 --- /dev/null +++ b/firmware/src/dfu/dbgu.h @@ -0,0 +1,25 @@ +#ifndef dbgu_h +#define dbgu_h + +#define AT91C_DBGU_BAUD 115200 + +#define DEBUGP(x, args ...) debugp(x, ## args) +#define DEBUGPCR(x, args ...) DEBUGP(x "\r\n", ## args) +#define DEBUGPCRF(x, args ...) DEBUGPCR("%s(%d): " x, __FUNCTION__, __LINE__, ## args) + +extern void AT91F_DBGU_Init(void); +extern void AT91F_DBGU_Printk(char *buffer); +extern int AT91F_DBGU_Get(char *val); +extern void AT91F_DBGU_Ready(void); + +#ifdef DEBUG +extern void debugp(const char *format, ...); +extern const char *hexdump(const void *data, unsigned int len); +extern void AT91F_DBGU_Frame(char *buffer); +#else +#define debugp(x, args ...) +#define hexdump(x, args ...) +#define AT91F_DBGU_Frame(x) +#endif + +#endif /* dbgu_h */ diff --git a/firmware/src/dfu/dbgu.lst b/firmware/src/dfu/dbgu.lst new file mode 100644 index 0000000..36e4013 --- /dev/null +++ b/firmware/src/dfu/dbgu.lst @@ -0,0 +1,2877 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "dbgu.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global AT91F_DBGU_Ready + 24 AT91F_DBGU_Ready: + 25 .LFB273: + 26 .file 1 "src/dfu/dbgu.c" + 1:src/dfu/dbgu.c **** /* AT91SAM7 debug function implementation for OpenPCD + 2:src/dfu/dbgu.c **** * (C) 2006 by Harald Welte + 3:src/dfu/dbgu.c **** * + 4:src/dfu/dbgu.c **** * This program is free software; you can redistribute it and/or modify + 5:src/dfu/dbgu.c **** * it under the terms of the GNU General Public License as published by + 6:src/dfu/dbgu.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/dfu/dbgu.c **** * (at your option) any later version. + 8:src/dfu/dbgu.c **** * + 9:src/dfu/dbgu.c **** * This program is distributed in the hope that it will be useful, + 10:src/dfu/dbgu.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/dfu/dbgu.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/dfu/dbgu.c **** * GNU General Public License for more details. + 13:src/dfu/dbgu.c **** * + 14:src/dfu/dbgu.c **** * You should have received a copy of the GNU General Public License + 15:src/dfu/dbgu.c **** * along with this program; if not, write to the Free Software + 16:src/dfu/dbgu.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/dfu/dbgu.c **** * + 18:src/dfu/dbgu.c **** */ + 19:src/dfu/dbgu.c **** + 20:src/dfu/dbgu.c **** #include + 21:src/dfu/dbgu.c **** #include + 22:src/dfu/dbgu.c **** #include + 23:src/dfu/dbgu.c **** #include + 24:src/dfu/dbgu.c **** #include + 25:src/dfu/dbgu.c **** #include + 26:src/dfu/dbgu.c **** + 27:src/dfu/dbgu.c **** #define USART_SYS_LEVEL 4 + 28:src/dfu/dbgu.c **** void AT91F_DBGU_Ready(void) + 29:src/dfu/dbgu.c **** { + 27 .loc 1 29 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .L2: + 30:src/dfu/dbgu.c **** while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 34 .loc 1 30 0 discriminator 1 + 35 0000 0D3CE0E3 mvn r3, #3328 + 36 0004 EB3013E5 ldr r3, [r3, #-235] + 37 0008 020C13E3 tst r3, #512 + 38 000c FBFFFF0A beq .L2 + 31:src/dfu/dbgu.c **** } + 39 .loc 1 31 0 + 40 0010 1EFF2FE1 bx lr + 41 .cfi_endproc + 42 .LFE273: + 44 .align 2 + 45 .global AT91F_DBGU_Init + 47 AT91F_DBGU_Init: + 48 .LFB275: + 32:src/dfu/dbgu.c **** + 33:src/dfu/dbgu.c **** static void DBGU_irq_handler(void) + 34:src/dfu/dbgu.c **** { + 35:src/dfu/dbgu.c **** static char value; + 36:src/dfu/dbgu.c **** + 37:src/dfu/dbgu.c **** AT91F_DBGU_Get(&value); + 38:src/dfu/dbgu.c **** switch (value) { + 39:src/dfu/dbgu.c **** case '9': + 40:src/dfu/dbgu.c **** AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 41:src/dfu/dbgu.c **** AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 42:src/dfu/dbgu.c **** AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + 43:src/dfu/dbgu.c **** break; + 44:src/dfu/dbgu.c **** default: + 45:src/dfu/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 46:src/dfu/dbgu.c **** } + 47:src/dfu/dbgu.c **** } + 48:src/dfu/dbgu.c **** + 49:src/dfu/dbgu.c **** void AT91F_DBGU_Init(void) + 50:src/dfu/dbgu.c **** { + 49 .loc 1 50 0 + 50 .cfi_startproc + 51 @ Function supports interworking. + 52 @ args = 0, pretend = 0, frame = 0 + 53 @ frame_needed = 0, uses_anonymous_args = 0 + 54 .LVL0: + 55 0014 37402DE9 stmfd sp!, {r0, r1, r2, r4, r5, lr} + 56 .LCFI0: + 57 .cfi_def_cfa_offset 24 + 58 .LBB10: + 59 .LBB11: + 60 .LBB12: + 61 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 62 .loc 2 391 0 + 63 0018 0B3CE0E3 mvn r3, #2816 + 64 001c 062CA0E3 mov r2, #1536 + 65 .cfi_offset 14, -4 + 66 .cfi_offset 5, -8 + 67 .cfi_offset 4, -12 + 68 .cfi_offset 2, -16 + 69 .cfi_offset 1, -20 + 70 .cfi_offset 0, -24 + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 71 .loc 2 392 0 + 72 0020 0040A0E3 mov r4, #0 + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 73 .loc 2 391 0 + 74 0024 8F2003E5 str r2, [r3, #-143] + 75 .LBE12: + 76 .LBE11: + 77 .LBE10: + 51:src/dfu/dbgu.c **** /* Open PIO for DBGU */ + 52:src/dfu/dbgu.c **** AT91F_DBGU_CfgPIO(); + 53:src/dfu/dbgu.c **** /* Enable Transmitter & receivier */ + 54:src/dfu/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 78 .loc 1 54 0 + 79 0028 0D5CE0E3 mvn r5, #3328 + 80 .LBB15: + 81 .LBB14: + 82 .LBB13: + 83 .loc 2 392 0 + 84 002c 8B4003E5 str r4, [r3, #-139] + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 85 .loc 2 393 0 + 86 0030 FB2003E5 str r2, [r3, #-251] + 87 .LBE13: + 88 .LBE14: + 89 .LBE15: + 90 .loc 1 54 0 + 91 0034 0C30A0E3 mov r3, #12 + 92 0038 FF3005E5 str r3, [r5, #-255] + 55:src/dfu/dbgu.c **** AT91C_US_RSTTX | AT91C_US_RSTRX; + 56:src/dfu/dbgu.c **** + 57:src/dfu/dbgu.c **** /* Configure DBGU */ + 58:src/dfu/dbgu.c **** AT91F_US_Configure(AT91C_BASE_DBGU, + 93 .loc 1 58 0 + 94 003c 4C009FE5 ldr r0, .L4 + 95 0040 4C109FE5 ldr r1, .L4+4 + 96 0044 0B2D82E2 add r2, r2, #704 + 97 0048 48309FE5 ldr r3, .L4+8 + 98 004c 00408DE5 str r4, [sp, #0] + 99 0050 FEFFFFEB bl AT91F_US_Configure + 59:src/dfu/dbgu.c **** MCK, AT91C_US_ASYNC_MODE, + 60:src/dfu/dbgu.c **** AT91C_DBGU_BAUD, 0); + 61:src/dfu/dbgu.c **** + 62:src/dfu/dbgu.c **** /* Enable Transmitter & receivier */ + 63:src/dfu/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 100 .loc 1 63 0 + 101 0054 5030A0E3 mov r3, #80 + 102 0058 FF3005E5 str r3, [r5, #-255] + 103 .LVL1: + 64:src/dfu/dbgu.c **** AT91C_US_RXEN | AT91C_US_TXEN; + 65:src/dfu/dbgu.c **** + 66:src/dfu/dbgu.c **** /* Enable USART IT error and AT91C_US_ENDRX */ + 67:src/dfu/dbgu.c **** AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + 68:src/dfu/dbgu.c **** + 69:src/dfu/dbgu.c **** /* open interrupt */ + 70:src/dfu/dbgu.c **** + 71:src/dfu/dbgu.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, USART_SYS_LEVEL, + 104 .loc 1 71 0 + 105 005c 38309FE5 ldr r3, .L4+12 + 106 .LBB16: + 107 .LBB17: + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:include/lib_AT91SAM7.h **** } +1574:include/lib_AT91SAM7.h **** +1575:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:include/lib_AT91SAM7.h **** { +1583:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:include/lib_AT91SAM7.h **** } +1585:include/lib_AT91SAM7.h **** +1586:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:include/lib_AT91SAM7.h **** { +1594:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:include/lib_AT91SAM7.h **** } +1596:include/lib_AT91SAM7.h **** +1597:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:include/lib_AT91SAM7.h **** int val) // chip select register +1608:include/lib_AT91SAM7.h **** { +1609:include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:include/lib_AT91SAM7.h **** } +1612:include/lib_AT91SAM7.h **** +1613:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:include/lib_AT91SAM7.h **** { +1621:include/lib_AT91SAM7.h **** //* Write to the IER register +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:include/lib_AT91SAM7.h **** } +1624:include/lib_AT91SAM7.h **** +1625:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:include/lib_AT91SAM7.h **** { +1633:include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:include/lib_AT91SAM7.h **** } +1636:include/lib_AT91SAM7.h **** +1637:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:include/lib_AT91SAM7.h **** ) +1644:include/lib_AT91SAM7.h **** { +1645:include/lib_AT91SAM7.h **** //* Write to the CR register +1646:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:include/lib_AT91SAM7.h **** } +1648:include/lib_AT91SAM7.h **** +1649:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:include/lib_AT91SAM7.h **** ) +1656:include/lib_AT91SAM7.h **** { +1657:include/lib_AT91SAM7.h **** //* Write to the CR register +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:include/lib_AT91SAM7.h **** } +1660:include/lib_AT91SAM7.h **** +1661:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:include/lib_AT91SAM7.h **** ) +1668:include/lib_AT91SAM7.h **** { +1669:include/lib_AT91SAM7.h **** //* Write to the CR register +1670:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:include/lib_AT91SAM7.h **** } +1672:include/lib_AT91SAM7.h **** +1673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:include/lib_AT91SAM7.h **** int mode) // mode register +1680:include/lib_AT91SAM7.h **** { +1681:include/lib_AT91SAM7.h **** //* Write to the MR register +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:include/lib_AT91SAM7.h **** } +1684:include/lib_AT91SAM7.h **** +1685:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:include/lib_AT91SAM7.h **** { +1693:include/lib_AT91SAM7.h **** //* Write to the MR register +1694:include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:include/lib_AT91SAM7.h **** } +1697:include/lib_AT91SAM7.h **** +1698:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:include/lib_AT91SAM7.h **** { +1709:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +1710:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:include/lib_AT91SAM7.h **** pBuffer, +1712:include/lib_AT91SAM7.h **** szBuffer, +1713:include/lib_AT91SAM7.h **** pNextBuffer, +1714:include/lib_AT91SAM7.h **** szNextBuffer); +1715:include/lib_AT91SAM7.h **** } +1716:include/lib_AT91SAM7.h **** +1717:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:include/lib_AT91SAM7.h **** { +1728:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +1729:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1730:include/lib_AT91SAM7.h **** pBuffer, +1731:include/lib_AT91SAM7.h **** szBuffer, +1732:include/lib_AT91SAM7.h **** pNextBuffer, +1733:include/lib_AT91SAM7.h **** szNextBuffer); +1734:include/lib_AT91SAM7.h **** } +1735:include/lib_AT91SAM7.h **** +1736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1737:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Close +1738:include/lib_AT91SAM7.h **** //* \brief Close SPI: disable IT disable transfert, close PDC +1739:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1740:include/lib_AT91SAM7.h **** extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller +1741:include/lib_AT91SAM7.h **** +1742:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1743:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_PutChar +1744:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +1745:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1746:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_PutChar ( +1747:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1748:include/lib_AT91SAM7.h **** unsigned int character, +1749:include/lib_AT91SAM7.h **** unsigned int cs_number ) +1750:include/lib_AT91SAM7.h **** { +1751:include/lib_AT91SAM7.h **** unsigned int value_for_cs; +1752:include/lib_AT91SAM7.h **** value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +1753:include/lib_AT91SAM7.h **** pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +1754:include/lib_AT91SAM7.h **** } +1755:include/lib_AT91SAM7.h **** +1756:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1757:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetChar +1758:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +1759:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1760:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_GetChar ( +1761:include/lib_AT91SAM7.h **** const AT91PS_SPI pSPI) +1762:include/lib_AT91SAM7.h **** { +1763:include/lib_AT91SAM7.h **** return((pSPI->SPI_RDR) & 0xFFFF); +1764:include/lib_AT91SAM7.h **** } +1765:include/lib_AT91SAM7.h **** +1766:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1767:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetInterruptMaskStatus +1768:include/lib_AT91SAM7.h **** //* \brief Return SPI Interrupt Mask Status +1769:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1770:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +1771:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi) // \arg pointer to a SPI controller +1772:include/lib_AT91SAM7.h **** { +1773:include/lib_AT91SAM7.h **** return pSpi->SPI_IMR; +1774:include/lib_AT91SAM7.h **** } +1775:include/lib_AT91SAM7.h **** +1776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1777:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_IsInterruptMasked +1778:include/lib_AT91SAM7.h **** //* \brief Test if SPI Interrupt is Masked +1779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1780:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_IsInterruptMasked( +1781:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi, // \arg pointer to a SPI controller +1782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1783:include/lib_AT91SAM7.h **** { +1784:include/lib_AT91SAM7.h **** return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +1785:include/lib_AT91SAM7.h **** } +1786:include/lib_AT91SAM7.h **** +1787:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1788:include/lib_AT91SAM7.h **** SOFTWARE API FOR ADC +1789:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1791:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableIt +1792:include/lib_AT91SAM7.h **** //* \brief Enable ADC interrupt +1793:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1794:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableIt ( +1795:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1796:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1797:include/lib_AT91SAM7.h **** { +1798:include/lib_AT91SAM7.h **** //* Write to the IER register +1799:include/lib_AT91SAM7.h **** pADC->ADC_IER = flag; +1800:include/lib_AT91SAM7.h **** } +1801:include/lib_AT91SAM7.h **** +1802:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1803:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableIt +1804:include/lib_AT91SAM7.h **** //* \brief Disable ADC interrupt +1805:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1806:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableIt ( +1807:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1808:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1809:include/lib_AT91SAM7.h **** { +1810:include/lib_AT91SAM7.h **** //* Write to the IDR register +1811:include/lib_AT91SAM7.h **** pADC->ADC_IDR = flag; +1812:include/lib_AT91SAM7.h **** } +1813:include/lib_AT91SAM7.h **** +1814:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1815:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetStatus +1816:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Status +1817:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1818:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +1819:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1820:include/lib_AT91SAM7.h **** { +1821:include/lib_AT91SAM7.h **** return pADC->ADC_SR; +1822:include/lib_AT91SAM7.h **** } +1823:include/lib_AT91SAM7.h **** +1824:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1825:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetInterruptMaskStatus +1826:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Mask Status +1827:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1828:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +1829:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1830:include/lib_AT91SAM7.h **** { +1831:include/lib_AT91SAM7.h **** return pADC->ADC_IMR; +1832:include/lib_AT91SAM7.h **** } +1833:include/lib_AT91SAM7.h **** +1834:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1835:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsInterruptMasked +1836:include/lib_AT91SAM7.h **** //* \brief Test if ADC Interrupt is Masked +1837:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1838:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsInterruptMasked( +1839:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1840:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1841:include/lib_AT91SAM7.h **** { +1842:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +1843:include/lib_AT91SAM7.h **** } +1844:include/lib_AT91SAM7.h **** +1845:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1846:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsStatusSet +1847:include/lib_AT91SAM7.h **** //* \brief Test if ADC Status is Set +1848:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1849:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsStatusSet( +1850:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1851:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1852:include/lib_AT91SAM7.h **** { +1853:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetStatus(pADC) & flag); +1854:include/lib_AT91SAM7.h **** } +1855:include/lib_AT91SAM7.h **** +1856:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1857:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgModeReg +1858:include/lib_AT91SAM7.h **** //* \brief Configure the Mode Register of the ADC controller +1859:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1860:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_CfgModeReg ( +1861:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1862:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1863:include/lib_AT91SAM7.h **** { +1864:include/lib_AT91SAM7.h **** //* Write to the MR register +1865:include/lib_AT91SAM7.h **** pADC->ADC_MR = mode; +1866:include/lib_AT91SAM7.h **** } +1867:include/lib_AT91SAM7.h **** +1868:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1869:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetModeReg +1870:include/lib_AT91SAM7.h **** //* \brief Return the Mode Register of the ADC controller value +1871:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1872:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetModeReg ( +1873:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1874:include/lib_AT91SAM7.h **** ) +1875:include/lib_AT91SAM7.h **** { +1876:include/lib_AT91SAM7.h **** return pADC->ADC_MR; +1877:include/lib_AT91SAM7.h **** } +1878:include/lib_AT91SAM7.h **** +1879:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1880:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgTimings +1881:include/lib_AT91SAM7.h **** //* \brief Configure the different necessary timings of the ADC controller +1882:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1883:include/lib_AT91SAM7.h **** extern void AT91F_ADC_CfgTimings ( +1884:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1885:include/lib_AT91SAM7.h **** unsigned int mck_clock, // in MHz +1886:include/lib_AT91SAM7.h **** unsigned int adc_clock, // in MHz +1887:include/lib_AT91SAM7.h **** unsigned int startup_time, // in us +1888:include/lib_AT91SAM7.h **** unsigned int sample_and_hold_time); // in ns +1889:include/lib_AT91SAM7.h **** +1890:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1891:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableChannel +1892:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1893:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1894:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableChannel ( +1895:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1896:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1897:include/lib_AT91SAM7.h **** { +1898:include/lib_AT91SAM7.h **** //* Write to the CHER register +1899:include/lib_AT91SAM7.h **** pADC->ADC_CHER = channel; +1900:include/lib_AT91SAM7.h **** } +1901:include/lib_AT91SAM7.h **** +1902:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1903:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableChannel +1904:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1905:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1906:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableChannel ( +1907:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1908:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1909:include/lib_AT91SAM7.h **** { +1910:include/lib_AT91SAM7.h **** //* Write to the CHDR register +1911:include/lib_AT91SAM7.h **** pADC->ADC_CHDR = channel; +1912:include/lib_AT91SAM7.h **** } +1913:include/lib_AT91SAM7.h **** +1914:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1915:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetChannelStatus +1916:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1917:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1918:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetChannelStatus ( +1919:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1920:include/lib_AT91SAM7.h **** ) +1921:include/lib_AT91SAM7.h **** { +1922:include/lib_AT91SAM7.h **** return pADC->ADC_CHSR; +1923:include/lib_AT91SAM7.h **** } +1924:include/lib_AT91SAM7.h **** +1925:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1926:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_StartConversion +1927:include/lib_AT91SAM7.h **** //* \brief Software request for a analog to digital conversion +1928:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1929:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_StartConversion ( +1930:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1931:include/lib_AT91SAM7.h **** ) +1932:include/lib_AT91SAM7.h **** { +1933:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_START; +1934:include/lib_AT91SAM7.h **** } +1935:include/lib_AT91SAM7.h **** +1936:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1937:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_SoftReset +1938:include/lib_AT91SAM7.h **** //* \brief Software reset +1939:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1940:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_SoftReset ( +1941:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1942:include/lib_AT91SAM7.h **** ) +1943:include/lib_AT91SAM7.h **** { +1944:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_SWRST; +1945:include/lib_AT91SAM7.h **** } +1946:include/lib_AT91SAM7.h **** +1947:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1948:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetLastConvertedData +1949:include/lib_AT91SAM7.h **** //* \brief Return the Last Converted Data +1950:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1951:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetLastConvertedData ( +1952:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1953:include/lib_AT91SAM7.h **** ) +1954:include/lib_AT91SAM7.h **** { +1955:include/lib_AT91SAM7.h **** return pADC->ADC_LCDR; +1956:include/lib_AT91SAM7.h **** } +1957:include/lib_AT91SAM7.h **** +1958:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1959:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH0 +1960:include/lib_AT91SAM7.h **** //* \brief Return the Channel 0 Converted Data +1961:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1962:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +1963:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1964:include/lib_AT91SAM7.h **** ) +1965:include/lib_AT91SAM7.h **** { +1966:include/lib_AT91SAM7.h **** return pADC->ADC_CDR0; +1967:include/lib_AT91SAM7.h **** } +1968:include/lib_AT91SAM7.h **** +1969:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1970:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH1 +1971:include/lib_AT91SAM7.h **** //* \brief Return the Channel 1 Converted Data +1972:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1973:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +1974:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1975:include/lib_AT91SAM7.h **** ) +1976:include/lib_AT91SAM7.h **** { +1977:include/lib_AT91SAM7.h **** return pADC->ADC_CDR1; +1978:include/lib_AT91SAM7.h **** } +1979:include/lib_AT91SAM7.h **** +1980:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1981:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH2 +1982:include/lib_AT91SAM7.h **** //* \brief Return the Channel 2 Converted Data +1983:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1984:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +1985:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1986:include/lib_AT91SAM7.h **** ) +1987:include/lib_AT91SAM7.h **** { +1988:include/lib_AT91SAM7.h **** return pADC->ADC_CDR2; +1989:include/lib_AT91SAM7.h **** } +1990:include/lib_AT91SAM7.h **** +1991:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1992:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH3 +1993:include/lib_AT91SAM7.h **** //* \brief Return the Channel 3 Converted Data +1994:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1995:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +1996:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1997:include/lib_AT91SAM7.h **** ) +1998:include/lib_AT91SAM7.h **** { +1999:include/lib_AT91SAM7.h **** return pADC->ADC_CDR3; +2000:include/lib_AT91SAM7.h **** } +2001:include/lib_AT91SAM7.h **** +2002:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2003:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH4 +2004:include/lib_AT91SAM7.h **** //* \brief Return the Channel 4 Converted Data +2005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2006:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +2007:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2008:include/lib_AT91SAM7.h **** ) +2009:include/lib_AT91SAM7.h **** { +2010:include/lib_AT91SAM7.h **** return pADC->ADC_CDR4; +2011:include/lib_AT91SAM7.h **** } +2012:include/lib_AT91SAM7.h **** +2013:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2014:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH5 +2015:include/lib_AT91SAM7.h **** //* \brief Return the Channel 5 Converted Data +2016:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2017:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +2018:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2019:include/lib_AT91SAM7.h **** ) +2020:include/lib_AT91SAM7.h **** { +2021:include/lib_AT91SAM7.h **** return pADC->ADC_CDR5; +2022:include/lib_AT91SAM7.h **** } +2023:include/lib_AT91SAM7.h **** +2024:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2025:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH6 +2026:include/lib_AT91SAM7.h **** //* \brief Return the Channel 6 Converted Data +2027:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2028:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +2029:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2030:include/lib_AT91SAM7.h **** ) +2031:include/lib_AT91SAM7.h **** { +2032:include/lib_AT91SAM7.h **** return pADC->ADC_CDR6; +2033:include/lib_AT91SAM7.h **** } +2034:include/lib_AT91SAM7.h **** +2035:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2036:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH7 +2037:include/lib_AT91SAM7.h **** //* \brief Return the Channel 7 Converted Data +2038:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2039:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +2040:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2041:include/lib_AT91SAM7.h **** ) +2042:include/lib_AT91SAM7.h **** { +2043:include/lib_AT91SAM7.h **** return pADC->ADC_CDR7; +2044:include/lib_AT91SAM7.h **** } +2045:include/lib_AT91SAM7.h **** +2046:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2047:include/lib_AT91SAM7.h **** SOFTWARE API FOR SSC +2048:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2049:include/lib_AT91SAM7.h **** //* Define the standard I2S mode configuration +2050:include/lib_AT91SAM7.h **** +2051:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Clock Mode Register +2052:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2053:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2054:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2055:include/lib_AT91SAM7.h **** AT91C_SSC_CKS_DIV +\ +2056:include/lib_AT91SAM7.h **** AT91C_SSC_CKO_CONTINOUS +\ +2057:include/lib_AT91SAM7.h **** AT91C_SSC_CKG_NONE +\ +2058:include/lib_AT91SAM7.h **** AT91C_SSC_START_FALL_RF +\ +2059:include/lib_AT91SAM7.h **** AT91C_SSC_STTOUT +\ +2060:include/lib_AT91SAM7.h **** ((1<<16) & AT91C_SSC_STTDLY) +\ +2061:include/lib_AT91SAM7.h **** ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +2062:include/lib_AT91SAM7.h **** +2063:include/lib_AT91SAM7.h **** +2064:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Frame Mode Register +2065:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2066:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2067:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2068:include/lib_AT91SAM7.h **** (nb_bit_by_slot-1) +\ +2069:include/lib_AT91SAM7.h **** AT91C_SSC_MSBF +\ +2070:include/lib_AT91SAM7.h **** (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +2071:include/lib_AT91SAM7.h **** (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +2072:include/lib_AT91SAM7.h **** AT91C_SSC_FSOS_NEGATIVE) +2073:include/lib_AT91SAM7.h **** +2074:include/lib_AT91SAM7.h **** +2075:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2076:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SetBaudrate +2077:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2078:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2079:include/lib_AT91SAM7.h **** extern void AT91F_SSC_SetBaudrate ( +2080:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2081:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2082:include/lib_AT91SAM7.h **** unsigned int speed); // \arg SSC baudrate +2083:include/lib_AT91SAM7.h **** +2084:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2085:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_Configure +2086:include/lib_AT91SAM7.h **** //* \brief Configure SSC +2087:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2088:include/lib_AT91SAM7.h **** extern void AT91F_SSC_Configure ( +2089:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2090:include/lib_AT91SAM7.h **** unsigned int syst_clock, // \arg System Clock Frequency +2091:include/lib_AT91SAM7.h **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency +2092:include/lib_AT91SAM7.h **** unsigned int clock_rx, // \arg Receiver Clock Parameters +2093:include/lib_AT91SAM7.h **** unsigned int mode_rx, // \arg mode Register to be programmed +2094:include/lib_AT91SAM7.h **** unsigned int clock_tx, // \arg Transmitter Clock Parameters +2095:include/lib_AT91SAM7.h **** unsigned int mode_tx); // \arg mode Register to be programmed +2096:include/lib_AT91SAM7.h **** +2097:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2098:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableRx +2099:include/lib_AT91SAM7.h **** //* \brief Enable receiving datas +2100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2101:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableRx ( +2102:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2103:include/lib_AT91SAM7.h **** { +2104:include/lib_AT91SAM7.h **** //* Enable receiver +2105:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXEN; +2106:include/lib_AT91SAM7.h **** } +2107:include/lib_AT91SAM7.h **** +2108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2109:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableRx +2110:include/lib_AT91SAM7.h **** //* \brief Disable receiving datas +2111:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2112:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableRx ( +2113:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2114:include/lib_AT91SAM7.h **** { +2115:include/lib_AT91SAM7.h **** //* Disable receiver +2116:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXDIS; +2117:include/lib_AT91SAM7.h **** } +2118:include/lib_AT91SAM7.h **** +2119:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2120:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableTx +2121:include/lib_AT91SAM7.h **** //* \brief Enable sending datas +2122:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2123:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableTx ( +2124:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2125:include/lib_AT91SAM7.h **** { +2126:include/lib_AT91SAM7.h **** //* Enable transmitter +2127:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXEN; +2128:include/lib_AT91SAM7.h **** } +2129:include/lib_AT91SAM7.h **** +2130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2131:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableTx +2132:include/lib_AT91SAM7.h **** //* \brief Disable sending datas +2133:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2134:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableTx ( +2135:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2136:include/lib_AT91SAM7.h **** { +2137:include/lib_AT91SAM7.h **** //* Disable transmitter +2138:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXDIS; +2139:include/lib_AT91SAM7.h **** } +2140:include/lib_AT91SAM7.h **** +2141:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2142:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableIt +2143:include/lib_AT91SAM7.h **** //* \brief Enable SSC IT +2144:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2145:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableIt ( +2146:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2147:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2148:include/lib_AT91SAM7.h **** { +2149:include/lib_AT91SAM7.h **** //* Write to the IER register +2150:include/lib_AT91SAM7.h **** pSSC->SSC_IER = flag; +2151:include/lib_AT91SAM7.h **** } +2152:include/lib_AT91SAM7.h **** +2153:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2154:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableIt +2155:include/lib_AT91SAM7.h **** //* \brief Disable SSC IT +2156:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2157:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableIt ( +2158:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2159:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2160:include/lib_AT91SAM7.h **** { +2161:include/lib_AT91SAM7.h **** //* Write to the IDR register +2162:include/lib_AT91SAM7.h **** pSSC->SSC_IDR = flag; +2163:include/lib_AT91SAM7.h **** } +2164:include/lib_AT91SAM7.h **** +2165:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2166:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_ReceiveFrame +2167:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2168:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2169:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_ReceiveFrame ( +2170:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2171:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2172:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2173:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2174:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2175:include/lib_AT91SAM7.h **** { +2176:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2177:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2178:include/lib_AT91SAM7.h **** pBuffer, +2179:include/lib_AT91SAM7.h **** szBuffer, +2180:include/lib_AT91SAM7.h **** pNextBuffer, +2181:include/lib_AT91SAM7.h **** szNextBuffer); +2182:include/lib_AT91SAM7.h **** } +2183:include/lib_AT91SAM7.h **** +2184:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2185:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SendFrame +2186:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2187:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2188:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_SendFrame( +2189:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2190:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2191:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2192:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2193:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2194:include/lib_AT91SAM7.h **** { +2195:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2196:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2197:include/lib_AT91SAM7.h **** pBuffer, +2198:include/lib_AT91SAM7.h **** szBuffer, +2199:include/lib_AT91SAM7.h **** pNextBuffer, +2200:include/lib_AT91SAM7.h **** szNextBuffer); +2201:include/lib_AT91SAM7.h **** } +2202:include/lib_AT91SAM7.h **** +2203:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2204:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_GetInterruptMaskStatus +2205:include/lib_AT91SAM7.h **** //* \brief Return SSC Interrupt Mask Status +2206:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2207:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +2208:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc) // \arg pointer to a SSC controller +2209:include/lib_AT91SAM7.h **** { +2210:include/lib_AT91SAM7.h **** return pSsc->SSC_IMR; +2211:include/lib_AT91SAM7.h **** } +2212:include/lib_AT91SAM7.h **** +2213:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2214:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_IsInterruptMasked +2215:include/lib_AT91SAM7.h **** //* \brief Test if SSC Interrupt is Masked +2216:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2217:include/lib_AT91SAM7.h **** static inline int AT91F_SSC_IsInterruptMasked( +2218:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc, // \arg pointer to a SSC controller +2219:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2220:include/lib_AT91SAM7.h **** { +2221:include/lib_AT91SAM7.h **** return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +2222:include/lib_AT91SAM7.h **** } +2223:include/lib_AT91SAM7.h **** +2224:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2225:include/lib_AT91SAM7.h **** SOFTWARE API FOR USART +2226:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2228:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2229:include/lib_AT91SAM7.h **** //* \brief Calculate the baudrate +2230:include/lib_AT91SAM7.h **** //* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +2231:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +2232:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2233:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2234:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2235:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2236:include/lib_AT91SAM7.h **** +2237:include/lib_AT91SAM7.h **** //* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +2238:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +2239:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2240:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2241:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2242:include/lib_AT91SAM7.h **** AT91C_US_CLKS_EXT ) +2243:include/lib_AT91SAM7.h **** +2244:include/lib_AT91SAM7.h **** //* Standard Synchronous Mode : 8 bits , 1 stop , no parity +2245:include/lib_AT91SAM7.h **** #define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +2246:include/lib_AT91SAM7.h **** AT91C_US_USMODE_NORMAL + \ +2247:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2248:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2249:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2250:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2251:include/lib_AT91SAM7.h **** +2252:include/lib_AT91SAM7.h **** //* SCK used Label +2253:include/lib_AT91SAM7.h **** #define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +2254:include/lib_AT91SAM7.h **** +2255:include/lib_AT91SAM7.h **** //* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +2256:include/lib_AT91SAM7.h **** #define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +2257:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK +\ +2258:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2259:include/lib_AT91SAM7.h **** AT91C_US_PAR_EVEN + \ +2260:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2261:include/lib_AT91SAM7.h **** AT91C_US_CKLO +\ +2262:include/lib_AT91SAM7.h **** AT91C_US_OVER) +2263:include/lib_AT91SAM7.h **** +2264:include/lib_AT91SAM7.h **** //* Standard IRDA mode +2265:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +2266:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2267:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2268:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2269:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2270:include/lib_AT91SAM7.h **** +2271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2272:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2273:include/lib_AT91SAM7.h **** //* \brief Caluculate baud_value according to the main clock and the baud rate +2274:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2275:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Baudrate ( +2276:include/lib_AT91SAM7.h **** const unsigned int main_clock, // \arg peripheral clock +2277:include/lib_AT91SAM7.h **** const unsigned int baud_rate) // \arg UART baudrate +2278:include/lib_AT91SAM7.h **** { +2279:include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +2280:include/lib_AT91SAM7.h **** if ((baud_value % 10) >= 5) +2281:include/lib_AT91SAM7.h **** baud_value = (baud_value / 10) + 1; +2282:include/lib_AT91SAM7.h **** else +2283:include/lib_AT91SAM7.h **** baud_value /= 10; +2284:include/lib_AT91SAM7.h **** return baud_value; +2285:include/lib_AT91SAM7.h **** } +2286:include/lib_AT91SAM7.h **** +2287:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2288:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetBaudrate +2289:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2290:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2291:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetBaudrate ( +2292:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2293:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2294:include/lib_AT91SAM7.h **** unsigned int speed) // \arg UART baudrate +2295:include/lib_AT91SAM7.h **** { +2296:include/lib_AT91SAM7.h **** //* Define the baud rate divisor register +2297:include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +2298:include/lib_AT91SAM7.h **** } +2299:include/lib_AT91SAM7.h **** +2300:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2301:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetTimeguard +2302:include/lib_AT91SAM7.h **** //* \brief Set USART timeguard +2303:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2304:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetTimeguard ( +2305:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2306:include/lib_AT91SAM7.h **** unsigned int timeguard) // \arg timeguard value +2307:include/lib_AT91SAM7.h **** { +2308:include/lib_AT91SAM7.h **** //* Write the Timeguard Register +2309:include/lib_AT91SAM7.h **** pUSART->US_TTGR = timeguard ; +2310:include/lib_AT91SAM7.h **** } +2311:include/lib_AT91SAM7.h **** +2312:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2313:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableIt +2314:include/lib_AT91SAM7.h **** //* \brief Enable USART IT +2315:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2316:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableIt ( +2317:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2318:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2319:include/lib_AT91SAM7.h **** { +2320:include/lib_AT91SAM7.h **** //* Write to the IER register +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; + 108 .loc 2 2321 0 + 109 0060 0110A0E3 mov r1, #1 + 110 0064 F71005E5 str r1, [r5, #-247] + 111 .LBE17: + 112 .LBE16: + 113 .loc 1 71 0 + 114 0068 0420A0E3 mov r2, #4 + 115 006c 00308DE5 str r3, [sp, #0] + 116 0070 28009FE5 ldr r0, .L4+16 + 117 0074 0430A0E1 mov r3, r4 + 118 0078 FEFFFFEB bl AT91F_AIC_ConfigureIt + 119 .LVL2: + 120 .LBB18: + 121 .LBB19: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 122 .loc 2 70 0 + 123 007c 0220A0E3 mov r2, #2 + 124 0080 0F3CE0E3 mvn r3, #3840 + 125 0084 212083E5 str r2, [r3, #33] + 126 .LBE19: + 127 .LBE18: + 72:src/dfu/dbgu.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + 73:src/dfu/dbgu.c **** DBGU_irq_handler); + 74:src/dfu/dbgu.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); + 75:src/dfu/dbgu.c **** + 76:src/dfu/dbgu.c **** } + 128 .loc 1 76 0 + 129 0088 3E40BDE8 ldmfd sp!, {r1, r2, r3, r4, r5, lr} + 130 008c 1EFF2FE1 bx lr + 131 .L5: + 132 .align 2 + 133 .L4: + 134 0090 00F2FFFF .word -3584 + 135 0094 0040DB02 .word 47923200 + 136 0098 00C20100 .word 115200 + 137 009c 00000000 .word DBGU_irq_handler + 138 00a0 00F0FFFF .word -4096 + 139 .cfi_endproc + 140 .LFE275: + 142 .align 2 + 143 .global AT91F_DBGU_Printk + 145 AT91F_DBGU_Printk: + 146 .LFB276: + 77:src/dfu/dbgu.c **** + 78:src/dfu/dbgu.c **** void AT91F_DBGU_Printk(char *buffer) + 79:src/dfu/dbgu.c **** { + 147 .loc 1 79 0 + 148 .cfi_startproc + 149 @ Function supports interworking. + 150 @ args = 0, pretend = 0, frame = 0 + 151 @ frame_needed = 0, uses_anonymous_args = 0 + 152 @ link register save eliminated. + 153 .LVL3: + 80:src/dfu/dbgu.c **** while (*buffer != '\0') { + 154 .loc 1 80 0 + 155 00a4 040000EA b .L7 + 156 .LVL4: + 157 .L8: + 158 .LBB24: + 159 .LBB25: +2322:include/lib_AT91SAM7.h **** } +2323:include/lib_AT91SAM7.h **** +2324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2325:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableIt +2326:include/lib_AT91SAM7.h **** //* \brief Disable USART IT +2327:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2328:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableIt ( +2329:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2330:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2331:include/lib_AT91SAM7.h **** { +2332:include/lib_AT91SAM7.h **** //* Write to the IER register +2333:include/lib_AT91SAM7.h **** pUSART->US_IDR = flag; +2334:include/lib_AT91SAM7.h **** } +2335:include/lib_AT91SAM7.h **** +2336:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2337:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Configure +2338:include/lib_AT91SAM7.h **** //* \brief Configure USART +2339:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2340:include/lib_AT91SAM7.h **** extern void AT91F_US_Configure ( +2341:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2342:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2343:include/lib_AT91SAM7.h **** unsigned int mode , // \arg mode Register to be programmed +2344:include/lib_AT91SAM7.h **** unsigned int baudRate , // \arg baudrate to be programmed +2345:include/lib_AT91SAM7.h **** unsigned int timeguard ); // \arg timeguard to be programmed +2346:include/lib_AT91SAM7.h **** +2347:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2348:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableRx +2349:include/lib_AT91SAM7.h **** //* \brief Enable receiving characters +2350:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2351:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableRx ( +2352:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2353:include/lib_AT91SAM7.h **** { +2354:include/lib_AT91SAM7.h **** //* Enable receiver +2355:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2356:include/lib_AT91SAM7.h **** } +2357:include/lib_AT91SAM7.h **** +2358:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2359:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableTx +2360:include/lib_AT91SAM7.h **** //* \brief Enable sending characters +2361:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2362:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableTx ( +2363:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2364:include/lib_AT91SAM7.h **** { +2365:include/lib_AT91SAM7.h **** //* Enable transmitter +2366:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2367:include/lib_AT91SAM7.h **** } +2368:include/lib_AT91SAM7.h **** +2369:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2370:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetRx +2371:include/lib_AT91SAM7.h **** //* \brief Reset Receiver and re-enable it +2372:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2373:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetRx ( +2374:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2375:include/lib_AT91SAM7.h **** { +2376:include/lib_AT91SAM7.h **** //* Reset receiver +2377:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTRX; +2378:include/lib_AT91SAM7.h **** //* Re-Enable receiver +2379:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2380:include/lib_AT91SAM7.h **** } +2381:include/lib_AT91SAM7.h **** +2382:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2383:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetTx +2384:include/lib_AT91SAM7.h **** //* \brief Reset Transmitter and re-enable it +2385:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2386:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetTx ( +2387:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2388:include/lib_AT91SAM7.h **** { +2389:include/lib_AT91SAM7.h **** //* Reset transmitter +2390:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTTX; +2391:include/lib_AT91SAM7.h **** //* Enable transmitter +2392:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2393:include/lib_AT91SAM7.h **** } +2394:include/lib_AT91SAM7.h **** +2395:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2396:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableRx +2397:include/lib_AT91SAM7.h **** //* \brief Disable Receiver +2398:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2399:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableRx ( +2400:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2401:include/lib_AT91SAM7.h **** { +2402:include/lib_AT91SAM7.h **** //* Disable receiver +2403:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXDIS; +2404:include/lib_AT91SAM7.h **** } +2405:include/lib_AT91SAM7.h **** +2406:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2407:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableTx +2408:include/lib_AT91SAM7.h **** //* \brief Disable Transmitter +2409:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2410:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableTx ( +2411:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2412:include/lib_AT91SAM7.h **** { +2413:include/lib_AT91SAM7.h **** //* Disable transmitter +2414:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXDIS; +2415:include/lib_AT91SAM7.h **** } +2416:include/lib_AT91SAM7.h **** +2417:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2418:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Close +2419:include/lib_AT91SAM7.h **** //* \brief Close USART: disable IT disable receiver and transmitter, close PDC +2420:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2421:include/lib_AT91SAM7.h **** extern void AT91F_US_Close(AT91PS_USART pUSART); // \arg pointer to a USART controller +2422:include/lib_AT91SAM7.h **** +2423:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2424:include/lib_AT91SAM7.h **** //* \fn AT91F_US_TxReady +2425:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be written in US_THR +2426:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2427:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_TxReady ( +2428:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2429:include/lib_AT91SAM7.h **** { +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 160 .loc 2 2430 0 discriminator 1 + 161 00a8 0D2CE0E3 mvn r2, #3328 + 162 00ac EB1012E5 ldr r1, [r2, #-235] + 163 .LBE25: + 164 .LBE24: + 81:src/dfu/dbgu.c **** while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 165 .loc 1 81 0 discriminator 1 + 166 00b0 020011E3 tst r1, #2 + 167 00b4 FBFFFF0A beq .L8 + 168 .LVL5: + 169 .LBB26: + 170 .LBB27: +2431:include/lib_AT91SAM7.h **** } +2432:include/lib_AT91SAM7.h **** +2433:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2434:include/lib_AT91SAM7.h **** //* \fn AT91F_US_RxReady +2435:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be read in US_RHR +2436:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2437:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_RxReady ( +2438:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2439:include/lib_AT91SAM7.h **** { +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); +2441:include/lib_AT91SAM7.h **** } +2442:include/lib_AT91SAM7.h **** +2443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2444:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Error +2445:include/lib_AT91SAM7.h **** //* \brief Return the error flag +2446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2447:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Error ( +2448:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2449:include/lib_AT91SAM7.h **** { +2450:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & +2451:include/lib_AT91SAM7.h **** (AT91C_US_OVRE | // Overrun error +2452:include/lib_AT91SAM7.h **** AT91C_US_FRAME | // Framing error +2453:include/lib_AT91SAM7.h **** AT91C_US_PARE)); // Parity error +2454:include/lib_AT91SAM7.h **** } +2455:include/lib_AT91SAM7.h **** +2456:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2457:include/lib_AT91SAM7.h **** //* \fn AT91F_US_PutChar +2458:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +2459:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2460:include/lib_AT91SAM7.h **** static inline void AT91F_US_PutChar ( +2461:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2462:include/lib_AT91SAM7.h **** int character ) +2463:include/lib_AT91SAM7.h **** { +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); + 171 .loc 2 2464 0 + 172 00b8 E33002E5 str r3, [r2, #-227] + 173 .LVL6: + 174 .L7: + 175 .LBE27: + 176 .LBE26: + 80:src/dfu/dbgu.c **** while (*buffer != '\0') { + 177 .loc 1 80 0 discriminator 1 + 178 00bc 0130D0E4 ldrb r3, [r0], #1 @ zero_extendqisi2 + 179 00c0 000053E3 cmp r3, #0 + 180 00c4 F7FFFF1A bne .L8 + 82:src/dfu/dbgu.c **** AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, *buffer++); + 83:src/dfu/dbgu.c **** } + 84:src/dfu/dbgu.c **** } + 181 .loc 1 84 0 + 182 00c8 1EFF2FE1 bx lr + 183 .cfi_endproc + 184 .LFE276: + 186 .align 2 + 187 .global AT91F_DBGU_Get + 189 AT91F_DBGU_Get: + 190 .LFB277: + 85:src/dfu/dbgu.c **** + 86:src/dfu/dbgu.c **** int AT91F_DBGU_Get(char *val) + 87:src/dfu/dbgu.c **** { + 191 .loc 1 87 0 + 192 .cfi_startproc + 193 @ Function supports interworking. + 194 @ args = 0, pretend = 0, frame = 0 + 195 @ frame_needed = 0, uses_anonymous_args = 0 + 196 @ link register save eliminated. + 197 .LVL7: + 198 .LBB32: + 199 .LBB33: +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); + 200 .loc 2 2440 0 + 201 00cc 0D3CE0E3 mvn r3, #3328 + 202 00d0 EB2013E5 ldr r2, [r3, #-235] + 203 .LBE33: + 204 .LBE32: + 88:src/dfu/dbgu.c **** if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 205 .loc 1 88 0 + 206 00d4 012012E2 ands r2, r2, #1 + 207 .LVL8: + 208 .LBB34: + 209 .LBB35: +2465:include/lib_AT91SAM7.h **** } +2466:include/lib_AT91SAM7.h **** +2467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2468:include/lib_AT91SAM7.h **** //* \fn AT91F_US_GetChar +2469:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +2470:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2471:include/lib_AT91SAM7.h **** static inline int AT91F_US_GetChar ( +2472:include/lib_AT91SAM7.h **** const AT91PS_USART pUSART) +2473:include/lib_AT91SAM7.h **** { +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); + 210 .loc 2 2474 0 + 211 00d8 E7301315 ldrne r3, [r3, #-231] + 212 .LBE35: + 213 .LBE34: + 89:src/dfu/dbgu.c **** return (0); + 214 .loc 1 89 0 + 215 00dc 0200A001 moveq r0, r2 + 216 .LVL9: + 90:src/dfu/dbgu.c **** else { + 91:src/dfu/dbgu.c **** *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 217 .loc 1 91 0 + 218 00e0 0030C015 strneb r3, [r0, #0] + 92:src/dfu/dbgu.c **** return (-1); + 219 .loc 1 92 0 + 220 00e4 0000E013 mvnne r0, #0 + 93:src/dfu/dbgu.c **** } + 94:src/dfu/dbgu.c **** } + 221 .loc 1 94 0 + 222 00e8 1EFF2FE1 bx lr + 223 .cfi_endproc + 224 .LFE277: + 226 .align 2 + 228 DBGU_irq_handler: + 229 .LFB274: + 34:src/dfu/dbgu.c **** { + 230 .loc 1 34 0 + 231 .cfi_startproc + 232 @ Function supports interworking. + 233 @ args = 0, pretend = 0, frame = 0 + 234 @ frame_needed = 0, uses_anonymous_args = 0 + 235 00ec 10402DE9 stmfd sp!, {r4, lr} + 236 .LCFI1: + 237 .cfi_def_cfa_offset 8 + 37:src/dfu/dbgu.c **** AT91F_DBGU_Get(&value); + 238 .loc 1 37 0 + 239 00f0 38409FE5 ldr r4, .L17 + 240 .cfi_offset 14, -4 + 241 .cfi_offset 4, -8 + 242 00f4 0400A0E1 mov r0, r4 + 243 00f8 FEFFFFEB bl AT91F_DBGU_Get + 38:src/dfu/dbgu.c **** switch (value) { + 244 .loc 1 38 0 + 245 00fc 0030D4E5 ldrb r3, [r4, #0] @ zero_extendqisi2 + 246 0100 390053E3 cmp r3, #57 + 247 0104 0600001A bne .L16 + 40:src/dfu/dbgu.c **** AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 248 .loc 1 40 0 + 249 0108 24009FE5 ldr r0, .L17+4 + 250 010c FEFFFFEB bl AT91F_DBGU_Printk + 251 .LVL10: + 252 .LBB38: + 253 .LBB39: +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); + 254 .loc 2 1193 0 + 255 0110 20209FE5 ldr r2, .L17+8 + 256 0114 023CE0E3 mvn r3, #512 + 257 0118 FF2003E5 str r2, [r3, #-255] + 258 .LBE39: + 259 .LBE38: + 47:src/dfu/dbgu.c **** } + 260 .loc 1 47 0 + 261 011c 1040BDE8 ldmfd sp!, {r4, lr} + 262 0120 1EFF2FE1 bx lr + 263 .LVL11: + 264 .L16: + 45:src/dfu/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 265 .loc 1 45 0 + 266 0124 10009FE5 ldr r0, .L17+12 + 47:src/dfu/dbgu.c **** } + 267 .loc 1 47 0 + 268 0128 1040BDE8 ldmfd sp!, {r4, lr} + 45:src/dfu/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 269 .loc 1 45 0 + 270 012c FEFFFFEA b AT91F_DBGU_Printk + 271 .L18: + 272 .align 2 + 273 .L17: + 274 0130 00000000 .word .LANCHOR0 + 275 0134 00000000 .word .LC0 + 276 0138 0D0000A5 .word -1526726643 + 277 013c 11000000 .word .LC1 + 278 .cfi_endproc + 279 .LFE274: + 281 .section .rodata.str1.1,"aMS",%progbits,1 + 282 .LC0: + 283 0000 52657365 .ascii "Resetting SAM7\012\015\000" + 283 7474696E + 283 67205341 + 283 4D370A0D + 283 00 + 284 .LC1: + 285 0011 0A0D00 .ascii "\012\015\000" + 286 .bss + 287 .set .LANCHOR0,. + 0 + 290 value.6564: + 291 0000 00 .space 1 + 292 .text + 293 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 dbgu.c +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:24 .text:00000000 AT91F_DBGU_Ready +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:47 .text:00000014 AT91F_DBGU_Init +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:134 .text:00000090 $d +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:228 .text:000000ec DBGU_irq_handler +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:142 .text:000000a4 $a +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:145 .text:000000a4 AT91F_DBGU_Printk +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:189 .text:000000cc AT91F_DBGU_Get +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:274 .text:00000130 $d +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:290 .bss:00000000 value.6564 +C:\Users\netz\AppData\Local\Temp\cciDDdGw.s:291 .bss:00000000 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +AT91F_US_Configure +AT91F_AIC_ConfigureIt diff --git a/firmware/src/dfu/dfu.c b/firmware/src/dfu/dfu.c new file mode 100644 index 0000000..f740800 --- /dev/null +++ b/firmware/src/dfu/dfu.c @@ -0,0 +1,954 @@ +/* USB Device Firmware Update Implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * This ought to be compliant to the USB DFU Spec 1.0 as available from + * http://www.usb.org/developers/devclass_docs/usbdfu10.pdf + * + * 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 + * + */ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include "../openpcd.h" + +#include + +#define SAM7DFU_SIZE 0x4000 + +/* If debug is enabled, we need to access debug functions from flash + * and therefore have to omit flashing */ +//#define DEBUG_DFU_NOFLASH + +#ifdef DEBUG +#define DEBUG_DFU_EP0 +//#define DEBUG_DFU_RECV +#endif + +#ifdef DEBUG_DFU_EP0 +#define DEBUGE DEBUGP +#else +#define DEBUGE(x, args ...) +#endif + +#ifdef DEBUG_DFU_RECV +#define DEBUGR DEBUGP +#else +#define DEBUGR(x, args ...) +#endif + +#define RET_NOTHING 0 +#define RET_ZLP 1 +#define RET_STALL 2 + +#define led1on() AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1) +#define led1off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1) + +#define led2on() AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) +#define led2off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) + +static void __dfufunc udp_init(void) +{ + /* Set the PLL USB Divider */ + AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + + /* Enables the 48MHz USB clock UDPCK and System Peripheral USB Clock */ + AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP; + AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_UDP); + + /* Enable UDP PullUp (USB_DP_PUP) : enable & Clear of the + * corresponding PIO Set in PIO mode and Configure in Output */ +#if defined(PCD) + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +/* Send Data through the control endpoint */ +static void __dfufunc udp_ep0_send_data(const char *pData, u_int32_t length) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + u_int32_t cpt = 0; + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + + do { + cpt = MIN(length, 8); + length -= cpt; + + while (cpt--) + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + do { + csr = pUdp->UDP_CSR[0]; + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + DEBUGE("stopped by status out "); + return; + } + } while (!(csr & AT91C_UDP_TXCOMP)); + + } while (length); + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } +} + +static void udp_ep0_recv_clean(void) +{ + unsigned int i; + u_int8_t dummy; + const AT91PS_UDP pUdp = AT91C_BASE_UDP; + + while (!(pUdp->UDP_CSR[0] & AT91C_UDP_RX_DATA_BK0)) ; + + for (i = 0; i < (pUdp->UDP_CSR[0] >> 16); i++) + dummy = pUdp->UDP_FDR[0]; + + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); +} + +/* receive data from EP0 */ +static int __dfufunc udp_ep0_recv_data(u_int8_t *data, u_int16_t len) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + AT91_REG csr; + u_int16_t i, num_rcv; + u_int32_t num_rcv_total = 0; + + do { + /* FIXME: do we need to check whether we've been interrupted + * by a RX SETUP stage? */ + do { + csr = pUdp->UDP_CSR[0]; + DEBUGR("CSR=%08x ", csr); + } while (!(csr & AT91C_UDP_RX_DATA_BK0)) ; + + num_rcv = pUdp->UDP_CSR[0] >> 16; + + /* make sure we don't read more than requested */ + if (num_rcv_total + num_rcv > len) + num_rcv = num_rcv_total - len; + + DEBUGR("num_rcv = %u ", num_rcv); + for (i = 0; i < num_rcv; i++) + *data++ = pUdp->UDP_FDR[0]; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + + num_rcv_total += num_rcv; + + /* we need to continue to pull data until we either receive + * a packet < endpoint size or == 0 */ + } while (num_rcv == 8 && num_rcv_total < len); + + DEBUGE("ep0_rcv_returning(%u total) ", num_rcv_total); + + return num_rcv_total; +} + +/* Send zero length packet through the control endpoint */ +static void __dfufunc udp_ep0_send_zlp(void) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + while (!(pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP)) ; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; +} + +/* Stall the control endpoint */ +static void __dfufunc udp_ep0_send_stall(void) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + pUdp->UDP_CSR[0] |= AT91C_UDP_FORCESTALL; + while (!(pUdp->UDP_CSR[0] & AT91C_UDP_ISOERROR)) ; + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR); + while (pUdp->UDP_CSR[0] & (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR)) ; +} + + +static u_int8_t *ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; +static __dfudata u_int8_t dfu_status; +__dfudata u_int32_t dfu_state = DFU_STATE_appIDLE; +static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + +static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) +{ + volatile u_int32_t *p = (volatile u_int32_t *)ptr; + u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + int i; + + DEBUGE("download "); + + if (len > AT91C_IFLASH_PAGE_SIZE) { + /* Too big. Not that we'd really care, but it's a + * DFU protocol violation */ + DEBUGP("length exceeds flash page size "); + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + return RET_STALL; + } + if (len & 0x3) { + /* reject non-four-byte-aligned writes */ + DEBUGP("not four-byte-aligned length "); + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + return RET_STALL; + } + if (len == 0) { + DEBUGP("zero-size write -> MANIFEST_SYNC "); + flash_page(p); + dfu_state = DFU_STATE_dfuMANIFEST_SYNC; + return RET_ZLP; + } + if (ptr + len >= (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE ) { + DEBUGP("end of write exceeds flash end "); + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + return RET_STALL; + } + + DEBUGP("try_to_recv=%u ", len); + udp_ep0_recv_data(pagebuf, len); + + DEBUGR(hexdump(pagebuf, len)); + + /* we can only access the write buffer with correctly aligned + * 32bit writes ! */ +#ifndef DEBUG_DFU_NOFLASH + DEBUGP("copying "); + for (i = 0; i < len/4; i++) { + *p++ = pagebuf32[i]; + /* If we have filled a page buffer, flash it */ + if (((unsigned long)p % AT91C_IFLASH_PAGE_SIZE) == 0) { + DEBUGP("page_full "); + flash_page(p-1); + } + } + ptr = (u_int8_t *) p; +#endif + + return RET_ZLP; +} + +#define AT91C_IFLASH_END ((u_int8_t *)AT91C_IFLASH + AT91C_IFLASH_SIZE) +static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) +{ + DEBUGE("upload "); + if (len > AT91C_IFLASH_PAGE_SIZE) { + /* Too big */ + dfu_state = DFU_STATE_dfuERROR; + dfu_status = DFU_STATUS_errADDRESS; + udp_ep0_send_stall(); + return -EINVAL; + } + + if (ptr + len > AT91C_IFLASH_END) + len = AT91C_IFLASH_END - (u_int8_t *)ptr; + + udp_ep0_send_data((char *)ptr, len); + ptr+= len; + + return len; +} + +static __dfufunc void handle_getstatus(void) +{ + struct dfu_status dstat; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + + DEBUGE("getstatus(fsr=0x%08x) ", fsr); + + switch (dfu_state) { + case DFU_STATE_dfuDNLOAD_SYNC: + case DFU_STATE_dfuDNBUSY: + if (fsr & AT91C_MC_PROGE) { + DEBUGE("errPROG "); + dfu_status = DFU_STATUS_errPROG; + dfu_state = DFU_STATE_dfuERROR; + } else if (fsr & AT91C_MC_LOCKE) { + DEBUGE("errWRITE "); + dfu_status = DFU_STATUS_errWRITE; + dfu_state = DFU_STATE_dfuERROR; + } else if (fsr & AT91C_MC_FRDY) { + DEBUGE("DNLOAD_IDLE "); + dfu_state = DFU_STATE_dfuDNLOAD_IDLE; + } else { + DEBUGE("DNBUSY "); + dfu_state = DFU_STATE_dfuDNBUSY; + } + break; + case DFU_STATE_dfuMANIFEST_SYNC: + dfu_state = DFU_STATE_dfuMANIFEST; + break; + } + + /* send status response */ + dstat.bStatus = dfu_status; + dstat.bState = dfu_state; + dstat.iString = 0; + /* FIXME: set dstat.bwPollTimeout */ + + udp_ep0_send_data((char *)&dstat, sizeof(dstat)); +} + +static void __dfufunc handle_getstate(void) +{ + u_int8_t u8 = dfu_state; + DEBUGE("getstate "); + + udp_ep0_send_data((char *)&u8, sizeof(u8)); +} + +/* callback function for DFU requests */ +int __dfufunc dfu_ep0_handler(u_int8_t req_type, u_int8_t req, + u_int16_t val, u_int16_t len) +{ + int rc, ret = RET_NOTHING; + + DEBUGE("old_state = %u ", dfu_state); + + switch (dfu_state) { + case DFU_STATE_appIDLE: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + case USB_REQ_DFU_DETACH: + dfu_state = DFU_STATE_appDETACH; + ret = RET_ZLP; + goto out; + break; + default: + ret = RET_STALL; + } + break; + case DFU_STATE_appDETACH: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_appIDLE; + ret = RET_STALL; + goto out; + break; + } + /* FIXME: implement timer to return to appIDLE */ + break; + case DFU_STATE_dfuIDLE: + switch (req) { + case USB_REQ_DFU_DNLOAD: + if (len == 0) { + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + goto out; + } + dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + ret = handle_dnload(val, len); + break; + case USB_REQ_DFU_UPLOAD: + ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + dfu_state = DFU_STATE_dfuUPLOAD_IDLE; + handle_upload(val, len); + break; + case USB_REQ_DFU_ABORT: + /* no zlp? */ + ret = RET_ZLP; + break; + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + goto out; + break; + } + break; + case DFU_STATE_dfuDNLOAD_SYNC: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + /* FIXME: state transition depending on block completeness */ + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + goto out; + } + break; + case DFU_STATE_dfuDNBUSY: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + /* FIXME: only accept getstatus if bwPollTimeout + * has elapsed */ + handle_getstatus(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + goto out; + } + break; + case DFU_STATE_dfuDNLOAD_IDLE: + switch (req) { + case USB_REQ_DFU_DNLOAD: + dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + ret = handle_dnload(val, len); + break; + case USB_REQ_DFU_ABORT: + dfu_state = DFU_STATE_dfuIDLE; + ret = RET_ZLP; + break; + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuMANIFEST_SYNC: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuMANIFEST: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + dfu_state = DFU_STATE_dfuIDLE; + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuMANIFEST_WAIT_RST: + /* we should never go here */ + break; + case DFU_STATE_dfuUPLOAD_IDLE: + switch (req) { + case USB_REQ_DFU_UPLOAD: + /* state transition if less data then requested */ + rc = handle_upload(val, len); + if (rc >= 0 && rc < len) + dfu_state = DFU_STATE_dfuIDLE; + break; + case USB_REQ_DFU_ABORT: + dfu_state = DFU_STATE_dfuIDLE; + /* no zlp? */ + ret = RET_ZLP; + break; + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + break; + } + break; + case DFU_STATE_dfuERROR: + switch (req) { + case USB_REQ_DFU_GETSTATUS: + handle_getstatus(); + break; + case USB_REQ_DFU_GETSTATE: + handle_getstate(); + break; + case USB_REQ_DFU_CLRSTATUS: + dfu_state = DFU_STATE_dfuIDLE; + dfu_status = DFU_STATUS_OK; + /* no zlp? */ + ret = RET_ZLP; + break; + default: + dfu_state = DFU_STATE_dfuERROR; + ret = RET_STALL; + break; + } + break; + } + +out: + DEBUGE("new_state = %u\r\n", dfu_state); + + switch (ret) { + case RET_NOTHING: + break; + case RET_ZLP: + udp_ep0_send_zlp(); + break; + case RET_STALL: + udp_ep0_send_stall(); + break; + } + return 0; +} + +static u_int8_t cur_config; + +/* USB DFU Device descriptor in DFU mode */ +__dfustruct const struct usb_device_descriptor dfu_dev_descriptor = { + .bLength = USB_DT_DEVICE_SIZE, + .bDescriptorType = USB_DT_DEVICE, + .bcdUSB = 0x0100, + .bDeviceClass = 0x00, + .bDeviceSubClass = 0x00, + .bDeviceProtocol = 0x00, + .bMaxPacketSize0 = 8, + .idVendor = USB_VENDOR_ID, + .idProduct = USB_PRODUCT_ID, + .bcdDevice = 0x0000, +#ifdef CONFIG_USB_STRING + .iManufacturer = 1, + .iProduct = 2, +#else + .iManufacturer = 0, + .iProduct = 0, +#endif + .iSerialNumber = 0x00, + .bNumConfigurations = 0x01, +}; + +/* USB DFU Config descriptor in DFU mode */ +__dfustruct const struct _dfu_desc dfu_cfg_descriptor = { + .ucfg = { + .bLength = USB_DT_CONFIG_SIZE, + .bDescriptorType = USB_DT_CONFIG, + .wTotalLength = USB_DT_CONFIG_SIZE + + 2* USB_DT_INTERFACE_SIZE + + USB_DT_DFU_SIZE, + .bNumInterfaces = 1, + .bConfigurationValue = 1, +#ifdef CONFIG_USB_STRING + .iConfiguration = 3, +#else + .iConfiguration = 0, +#endif + .bmAttributes = USB_CONFIG_ATT_ONE, + .bMaxPower = 100, + }, + .uif[0] = { + .bLength = USB_DT_INTERFACE_SIZE, + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x00, + .bInterfaceClass = 0xfe, + .bInterfaceSubClass = 0x01, + .bInterfaceProtocol = 0x02, +#ifdef CONFIG_USB_STRING + .iInterface = 4, +#else + .iInterface = 0, +#endif + }, + .uif[1] = { + .bLength = USB_DT_INTERFACE_SIZE, + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x01, + .bNumEndpoints = 0x00, + .bInterfaceClass = 0xfe, + .bInterfaceSubClass = 0x01, + .bInterfaceProtocol = 0x02, +#ifdef CONFIG_USB_STRING + .iInterface = 5, +#else + .iInterface = 0, +#endif + }, + + .func_dfu = DFU_FUNC_DESC, +}; + + +/* minimal USB EP0 handler in DFU mode */ +static __dfufunc void dfu_udp_ep0_handler(void) +{ + AT91PS_UDP pUDP = AT91C_BASE_UDP; + u_int8_t bmRequestType, bRequest; + u_int16_t wValue, wIndex, wLength, wStatus; + u_int32_t csr = pUDP->UDP_CSR[0]; + + DEBUGE("CSR=0x%04x ", csr); + + if (csr & AT91C_UDP_STALLSENT) { + DEBUGE("ACK_STALLSENT "); + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + } + + if (csr & AT91C_UDP_RX_DATA_BK0) { + DEBUGE("ACK_BANK0 "); + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + } + + if (!(csr & AT91C_UDP_RXSETUP)) { + DEBUGE("no setup packet\r\n"); + return; + } + + DEBUGE("len=%d ", csr >> 16); + if (csr >> 16 == 0) { + DEBUGE("empty packet\r\n"); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + DEBUGE("DATA_IN=1 "); + pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + } + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR "); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + switch (desc_type) { + case USB_DT_DEVICE: + /* Return Device Descriptor */ + udp_ep0_send_data((const char *) + &dfu_dev_descriptor, + MIN(sizeof(dfu_dev_descriptor), + wLength)); + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ + udp_ep0_send_data((const char *) + &dfu_cfg_descriptor, + MIN(sizeof(dfu_cfg_descriptor), + wLength)); + break; + case USB_DT_STRING: + /* Return String Descriptor */ + if (desc_index > ARRAY_SIZE(usb_strings)) { + udp_ep0_send_stall(); + break; + } + DEBUGE("bLength=%u, wLength=%u ", + usb_strings[desc_index]->bLength, wLength); + udp_ep0_send_data((const char *) usb_strings[desc_index], + MIN(usb_strings[desc_index]->bLength, + wLength)); + break; + case USB_DT_CS_DEVICE: + /* Return Function descriptor */ + udp_ep0_send_data((const char *) &dfu_cfg_descriptor.func_dfu, + MIN(sizeof(dfu_cfg_descriptor.func_dfu), + wLength)); + break; + default: + udp_ep0_send_stall(); + break; + } + break; + case STD_SET_ADDRESS: + DEBUGE("SET_ADDRESS "); + udp_ep0_send_zlp(); + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + break; + case STD_SET_CONFIGURATION: + DEBUGE("SET_CONFIG "); + if (wValue) + DEBUGE("VALUE!=0 "); + cur_config = wValue; + udp_ep0_send_zlp(); + pUDP->UDP_GLBSTATE = + (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 0; + pUDP->UDP_CSR[2] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + pUDP->UDP_CSR[3] = + (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN) : 0; + pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + AT91C_UDP_EPINT2|AT91C_UDP_EPINT3); + break; + case STD_GET_CONFIGURATION: + DEBUGE("GET_CONFIG "); + udp_ep0_send_data((char *)&(cur_config), + sizeof(cur_config)); + break; + case STD_GET_STATUS_ZERO: + DEBUGE("GET_STATUS_ZERO "); + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_INTERFACE: + DEBUGE("GET_STATUS_INTERFACE "); + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + && (wIndex == 0)) { + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else + udp_ep0_send_stall(); + break; + case STD_SET_FEATURE_ZERO: + DEBUGE("SET_FEATURE_ZERO "); + udp_ep0_send_stall(); + break; + case STD_SET_FEATURE_INTERFACE: + DEBUGE("SET_FEATURE_INTERFACE "); + udp_ep0_send_zlp(); + break; + case STD_SET_FEATURE_ENDPOINT: + DEBUGE("SET_FEATURE_ENDPOINT "); + udp_ep0_send_stall(); + break; + case STD_CLEAR_FEATURE_ZERO: + DEBUGE("CLEAR_FEATURE_ZERO "); + udp_ep0_send_stall(); + break; + case STD_CLEAR_FEATURE_INTERFACE: + DEBUGE("CLEAR_FEATURE_INTERFACE "); + udp_ep0_send_zlp(); + break; + case STD_CLEAR_FEATURE_ENDPOINT: + DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + udp_ep0_send_stall(); + break; + case STD_SET_INTERFACE: + DEBUGE("SET INTERFACE "); + /* FIXME: store the interface number somewhere, once + * we need to support DFU flashing DFU */ + udp_ep0_send_zlp(); + break; + default: + DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + bRequest, bmRequestType); + if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + dfu_ep0_handler(bmRequestType, bRequest, + wValue, wLength); + } else + udp_ep0_send_stall(); + break; + } + DEBUGE("\r\n"); +} + +/* minimal USB IRQ handler in DFU mode */ +static __dfufunc void dfu_udp_irq(void) +{ + AT91PS_UDP pUDP = AT91C_BASE_UDP; + AT91_REG isr = pUDP->UDP_ISR; + led1on(); + + if (isr & AT91C_UDP_ENDBUSRES) { + led2on(); + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + cur_config = 0; + + if (dfu_state == DFU_STATE_dfuMANIFEST_WAIT_RST || + dfu_state == DFU_STATE_dfuMANIFEST) { + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST| + AT91C_RSTC_EXTRST); + } + + } + + if (isr & AT91C_UDP_EPINT0) + dfu_udp_ep0_handler(); + + /* clear all interrupts */ + pUDP->UDP_ICR = isr; + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); + + led1off(); +} + +/* this is only called once before DFU mode, no __dfufunc required */ +static void dfu_switch(void) +{ + AT91PS_AIC pAic = AT91C_BASE_AIC; + + DEBUGE("\r\nsam7dfu: switching to DFU mode\r\n"); + + dfu_state = DFU_STATE_appDETACH; + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + + /* We should never reach here, but anyway avoid returning to the + * caller since he doesn't expect us to do so */ + while (1) ; +} + +void __dfufunc dfu_main(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + led1off(); + led2off(); + + AT91F_DBGU_Init(); + AT91F_DBGU_Printk("\n\r\n\rsam7dfu - AT91SAM7 USB DFU bootloader\n\r" + "(C) 2006-2008 by Harald Welte \n\r" + "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + AT91F_DBGU_Printk("Version " COMPILE_SVNREV + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + + udp_init(); + + dfu_state = DFU_STATE_dfuIDLE; + + /* This implements + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + OPENPCD_IRQ_PRIO_UDP, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, dfu_udp_irq); + */ + AT91PS_AIC pAic = AT91C_BASE_AIC; + pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; + pAic->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | + OPENPCD_IRQ_PRIO_UDP; + pAic->AIC_ICCR = 1 << AT91C_ID_UDP; + + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_UDP); + + /* End-of-Bus-Reset is always enabled */ + + /* Clear for set the Pull up resistor */ +#if defined(PCD) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + + flash_init(); + + AT91F_DBGU_Printk("You may now start the DFU up/download process\r\n"); + /* do nothing, since all of DFU is interrupt driven */ + int i = 0; + while (1) { + /* Occasionally reset watchdog */ + i = (i+1) % 10000; + if( i== 0) { + AT91F_WDTRestart(AT91C_BASE_WDTC); + } + } +} + +const struct dfuapi __dfufunctab dfu_api = { + .udp_init = &udp_init, + .ep0_send_data = &udp_ep0_send_data, + .ep0_send_zlp = &udp_ep0_send_zlp, + .ep0_send_stall = &udp_ep0_send_stall, + .dfu_ep0_handler = &dfu_ep0_handler, + .dfu_switch = &dfu_switch, + .dfu_state = &dfu_state, + .dfu_dev_descriptor = &dfu_dev_descriptor, + .dfu_cfg_descriptor = &dfu_cfg_descriptor, +}; + +/* just for testing */ +int foo = 12345; diff --git a/firmware/src/dfu/dfu.h b/firmware/src/dfu/dfu.h new file mode 100644 index 0000000..a4184b4 --- /dev/null +++ b/firmware/src/dfu/dfu.h @@ -0,0 +1,119 @@ +#ifndef _DFU_H +#define _DFU_H + +/* USB Device Firmware Update Implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * This ought to be compliant to the USB DFU Spec 1.0 as available from + * http://www.usb.org/developers/devclass_docs/usbdfu10.pdf + * + * 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 + + */ + +#include +#include +#include +#include "../config.h" + +/* USB DFU functional descriptor */ +#define DFU_FUNC_DESC { \ + .bLength = USB_DT_DFU_SIZE, \ + .bDescriptorType = USB_DT_DFU, \ + .bmAttributes = USB_DFU_CAN_UPLOAD | USB_DFU_CAN_DOWNLOAD, \ + .wDetachTimeOut = 0xff00, \ + .wTransferSize = AT91C_IFLASH_PAGE_SIZE, \ + .bcdDFUVersion = 0x0100, \ +} + +/* USB Interface descriptor in Runtime mode */ +#ifdef CONFIG_USB_STRING +#define DFU_RT_IF_DESC { \ + { \ + .bLength = USB_DT_INTERFACE_SIZE, \ + .bDescriptorType = USB_DT_INTERFACE, \ + .bInterfaceNumber = 0x01, \ + .bAlternateSetting = 0x00, \ + .bNumEndpoints = 0x00, \ + .bInterfaceClass = 0xfe, \ + .bInterfaceSubClass = 0x01, \ + .bInterfaceProtocol = 0x01, \ + .iInterface = 1, \ + }, { \ + .bLength = USB_DT_INTERFACE_SIZE, \ + .bDescriptorType = USB_DT_INTERFACE, \ + .bInterfaceNumber = 0x02, \ + .bAlternateSetting = 0x00, \ + .bNumEndpoints = 0x00, \ + .bInterfaceClass = 0xfe, \ + .bInterfaceSubClass = 0x01, \ + .bInterfaceProtocol = 0x01, \ + .iInterface = 2, \ + }, \ +} +#else +#define DFU_RT_IF_DESC { \ + { \ + .bLength = USB_DT_INTERFACE_SIZE, \ + .bDescriptorType = USB_DT_INTERFACE, \ + .bInterfaceNumber = 0x01, \ + .bAlternateSetting = 0x00, \ + .bNumEndpoints = 0x00, \ + .bInterfaceClass = 0xfe, \ + .bInterfaceSubClass = 0x01, \ + .bInterfaceProtocol = 0x01, \ + .iInterface = 0, \ + }, { \ + .bLength = USB_DT_INTERFACE_SIZE, \ + .bDescriptorType = USB_DT_INTERFACE, \ + .bInterfaceNumber = 0x02, \ + .bAlternateSetting = 0x00, \ + .bNumEndpoints = 0x00, \ + .bInterfaceClass = 0xfe, \ + .bInterfaceSubClass = 0x01, \ + .bInterfaceProtocol = 0x01, \ + .iInterface = 0, \ + }, \ +} +#endif + +#define __dfufunctab __attribute__ ((section (".dfu.functab"))) +#define __dfudata __attribute__ ((section (".data.shared"))) +#define __dfufunc +#define __dfustruct const + +#define DFU_API_LOCATION ((const struct dfuapi *) 0x00103fd0) + +struct _dfu_desc { + struct usb_config_descriptor ucfg; + struct usb_interface_descriptor uif[2]; + struct usb_dfu_func_descriptor func_dfu; +}; + +struct dfuapi { + void (*udp_init)(void); + void (*ep0_send_data)(const char *data, u_int32_t len); + void (*ep0_send_zlp)(void); + void (*ep0_send_stall)(void); + int (*dfu_ep0_handler)(u_int8_t req_type, u_int8_t req, + u_int16_t val, u_int16_t len); + void (*dfu_switch)(void); + u_int32_t *dfu_state; + const struct usb_device_descriptor *dfu_dev_descriptor; + const struct _dfu_desc *dfu_cfg_descriptor; +}; + + +#endif /* _DFU_H */ diff --git a/firmware/src/dfu/dfu.lst b/firmware/src/dfu/dfu.lst new file mode 100644 index 0000000..2dfb0fd --- /dev/null +++ b/firmware/src/dfu/dfu.lst @@ -0,0 +1,4708 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "dfu.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 udp_ep0_send_data: + 24 .LFB279: + 25 .file 1 "src/dfu/dfu.c" + 1:src/dfu/dfu.c **** /* USB Device Firmware Update Implementation for OpenPCD + 2:src/dfu/dfu.c **** * (C) 2006 by Harald Welte + 3:src/dfu/dfu.c **** * + 4:src/dfu/dfu.c **** * This ought to be compliant to the USB DFU Spec 1.0 as available from + 5:src/dfu/dfu.c **** * http://www.usb.org/developers/devclass_docs/usbdfu10.pdf + 6:src/dfu/dfu.c **** * + 7:src/dfu/dfu.c **** * This program is free software; you can redistribute it and/or modify + 8:src/dfu/dfu.c **** * it under the terms of the GNU General Public License as published by + 9:src/dfu/dfu.c **** * the Free Software Foundation; either version 2 of the License, or + 10:src/dfu/dfu.c **** * (at your option) any later version. + 11:src/dfu/dfu.c **** * + 12:src/dfu/dfu.c **** * This program is distributed in the hope that it will be useful, + 13:src/dfu/dfu.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 14:src/dfu/dfu.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 15:src/dfu/dfu.c **** * GNU General Public License for more details. + 16:src/dfu/dfu.c **** * + 17:src/dfu/dfu.c **** * You should have received a copy of the GNU General Public License + 18:src/dfu/dfu.c **** * along with this program; if not, write to the Free Software + 19:src/dfu/dfu.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 20:src/dfu/dfu.c **** * + 21:src/dfu/dfu.c **** */ + 22:src/dfu/dfu.c **** + 23:src/dfu/dfu.c **** #include + 24:src/dfu/dfu.c **** #include + 25:src/dfu/dfu.c **** #include + 26:src/dfu/dfu.c **** #include + 27:src/dfu/dfu.c **** #include + 28:src/dfu/dfu.c **** + 29:src/dfu/dfu.c **** #include + 30:src/dfu/dfu.c **** + 31:src/dfu/dfu.c **** #include + 32:src/dfu/dfu.c **** #include + 33:src/dfu/dfu.c **** #include + 34:src/dfu/dfu.c **** #include + 35:src/dfu/dfu.c **** #include "../openpcd.h" + 36:src/dfu/dfu.c **** + 37:src/dfu/dfu.c **** #include + 38:src/dfu/dfu.c **** + 39:src/dfu/dfu.c **** #define SAM7DFU_SIZE 0x4000 + 40:src/dfu/dfu.c **** + 41:src/dfu/dfu.c **** /* If debug is enabled, we need to access debug functions from flash + 42:src/dfu/dfu.c **** * and therefore have to omit flashing */ + 43:src/dfu/dfu.c **** //#define DEBUG_DFU_NOFLASH + 44:src/dfu/dfu.c **** + 45:src/dfu/dfu.c **** #ifdef DEBUG + 46:src/dfu/dfu.c **** #define DEBUG_DFU_EP0 + 47:src/dfu/dfu.c **** //#define DEBUG_DFU_RECV + 48:src/dfu/dfu.c **** #endif + 49:src/dfu/dfu.c **** + 50:src/dfu/dfu.c **** #ifdef DEBUG_DFU_EP0 + 51:src/dfu/dfu.c **** #define DEBUGE DEBUGP + 52:src/dfu/dfu.c **** #else + 53:src/dfu/dfu.c **** #define DEBUGE(x, args ...) + 54:src/dfu/dfu.c **** #endif + 55:src/dfu/dfu.c **** + 56:src/dfu/dfu.c **** #ifdef DEBUG_DFU_RECV + 57:src/dfu/dfu.c **** #define DEBUGR DEBUGP + 58:src/dfu/dfu.c **** #else + 59:src/dfu/dfu.c **** #define DEBUGR(x, args ...) + 60:src/dfu/dfu.c **** #endif + 61:src/dfu/dfu.c **** + 62:src/dfu/dfu.c **** #define RET_NOTHING 0 + 63:src/dfu/dfu.c **** #define RET_ZLP 1 + 64:src/dfu/dfu.c **** #define RET_STALL 2 + 65:src/dfu/dfu.c **** + 66:src/dfu/dfu.c **** #define led1on() AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1) + 67:src/dfu/dfu.c **** #define led1off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1) + 68:src/dfu/dfu.c **** + 69:src/dfu/dfu.c **** #define led2on() AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) + 70:src/dfu/dfu.c **** #define led2off() AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2) + 71:src/dfu/dfu.c **** + 72:src/dfu/dfu.c **** static void __dfufunc udp_init(void) + 73:src/dfu/dfu.c **** { + 74:src/dfu/dfu.c **** /* Set the PLL USB Divider */ + 75:src/dfu/dfu.c **** AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + 76:src/dfu/dfu.c **** + 77:src/dfu/dfu.c **** /* Enables the 48MHz USB clock UDPCK and System Peripheral USB Clock */ + 78:src/dfu/dfu.c **** AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP; + 79:src/dfu/dfu.c **** AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_UDP); + 80:src/dfu/dfu.c **** + 81:src/dfu/dfu.c **** /* Enable UDP PullUp (USB_DP_PUP) : enable & Clear of the + 82:src/dfu/dfu.c **** * corresponding PIO Set in PIO mode and Configure in Output */ + 83:src/dfu/dfu.c **** #if defined(PCD) + 84:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 85:src/dfu/dfu.c **** #endif + 86:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 87:src/dfu/dfu.c **** } + 88:src/dfu/dfu.c **** + 89:src/dfu/dfu.c **** /* Send Data through the control endpoint */ + 90:src/dfu/dfu.c **** static void __dfufunc udp_ep0_send_data(const char *pData, u_int32_t length) + 91:src/dfu/dfu.c **** { + 26 .loc 1 91 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 8 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 32 .LVL0: + 33 0000 33002DE9 stmfd sp!, {r0, r1, r4, r5} + 34 .LCFI0: + 35 .cfi_def_cfa_offset 16 + 36 .LVL1: + 37 .L9: + 92:src/dfu/dfu.c **** AT91PS_UDP pUdp = AT91C_BASE_UDP; + 93:src/dfu/dfu.c **** u_int32_t cpt = 0; + 94:src/dfu/dfu.c **** AT91_REG csr; + 95:src/dfu/dfu.c **** + 96:src/dfu/dfu.c **** DEBUGE("send_data: %u bytes ", length); + 97:src/dfu/dfu.c **** + 98:src/dfu/dfu.c **** do { + 99:src/dfu/dfu.c **** cpt = MIN(length, 8); + 38 .loc 1 99 0 + 39 0004 080051E3 cmp r1, #8 + 40 0008 0120A031 movcc r2, r1 + 41 000c 0820A023 movcs r2, #8 + 42 .LVL2: + 43 0010 02C0A0E1 mov ip, r2 + 100:src/dfu/dfu.c **** length -= cpt; + 101:src/dfu/dfu.c **** + 102:src/dfu/dfu.c **** while (cpt--) + 44 .loc 1 102 0 + 45 0014 0040A0E1 mov r4, r0 + 46 .cfi_offset 5, -4 + 47 .cfi_offset 4, -8 + 48 .cfi_offset 1, -12 + 49 .cfi_offset 0, -16 + 50 0018 010000EA b .L2 + 51 .LVL3: + 52 .L3: + 103:src/dfu/dfu.c **** pUdp->UDP_FDR[0] = *pData++; + 53 .loc 1 103 0 + 54 001c 0150D4E4 ldrb r5, [r4], #1 @ zero_extendqisi2 + 55 .LVL4: + 56 0020 AF5003E5 str r5, [r3, #-175] + 57 .LVL5: + 58 .L2: + 102:src/dfu/dfu.c **** while (cpt--) + 59 .loc 1 102 0 discriminator 1 + 60 0024 01C04CE2 sub ip, ip, #1 + 61 .LVL6: + 62 0028 01007CE3 cmn ip, #1 + 63 002c A4309FE5 ldr r3, .L11 + 64 0030 F9FFFF1A bne .L3 + 104:src/dfu/dfu.c **** + 105:src/dfu/dfu.c **** if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 65 .loc 1 105 0 + 66 0034 CFC013E5 ldr ip, [r3, #-207] + 67 .LVL7: + 68 0038 01001CE3 tst ip, #1 + 102:src/dfu/dfu.c **** while (cpt--) + 69 .loc 1 102 0 + 70 003c 020080E0 add r0, r0, r2 + 71 .loc 1 105 0 + 72 0040 0600000A beq .L4 + 106:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 73 .loc 1 106 0 + 74 0044 CFC013E5 ldr ip, [r3, #-207] + 75 0048 01C0CCE3 bic ip, ip, #1 + 76 004c CFC003E5 str ip, [r3, #-207] + 77 .L5: + 107:src/dfu/dfu.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 78 .loc 1 107 0 discriminator 1 + 79 0050 80309FE5 ldr r3, .L11 + 80 0054 CF3013E5 ldr r3, [r3, #-207] + 81 0058 010013E3 tst r3, #1 + 82 005c FBFFFF1A bne .L5 + 83 .L4: + 108:src/dfu/dfu.c **** } + 109:src/dfu/dfu.c **** + 110:src/dfu/dfu.c **** pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 84 .loc 1 110 0 + 85 0060 70309FE5 ldr r3, .L11 + 86 0064 CFC013E5 ldr ip, [r3, #-207] + 87 0068 10C08CE3 orr ip, ip, #16 + 88 006c CFC003E5 str ip, [r3, #-207] + 89 .L8: + 111:src/dfu/dfu.c **** do { + 112:src/dfu/dfu.c **** csr = pUdp->UDP_CSR[0]; + 90 .loc 1 112 0 + 91 0070 60309FE5 ldr r3, .L11 + 92 0074 CFC013E5 ldr ip, [r3, #-207] + 93 .LVL8: + 94 0078 04C08DE5 str ip, [sp, #4] + 113:src/dfu/dfu.c **** + 114:src/dfu/dfu.c **** /* Data IN stage has been stopped by a status OUT */ + 115:src/dfu/dfu.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 95 .loc 1 115 0 + 96 007c 04C09DE5 ldr ip, [sp, #4] + 97 .LVL9: + 98 0080 02001CE3 tst ip, #2 + 116:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 99 .loc 1 116 0 + 100 0084 CF201315 ldrne r2, [r3, #-207] + 101 .LVL10: + 102 0088 0220C213 bicne r2, r2, #2 + 103 008c CF200315 strne r2, [r3, #-207] + 117:src/dfu/dfu.c **** DEBUGE("stopped by status out "); + 118:src/dfu/dfu.c **** return; + 104 .loc 1 118 0 + 105 0090 0E00001A bne .L1 + 106 .LVL11: + 107 .L6: + 119:src/dfu/dfu.c **** } + 120:src/dfu/dfu.c **** } while (!(csr & AT91C_UDP_TXCOMP)); + 108 .loc 1 120 0 + 109 0094 04C09DE5 ldr ip, [sp, #4] + 110 0098 01001CE3 tst ip, #1 + 111 009c F3FFFF0A beq .L8 + 121:src/dfu/dfu.c **** + 122:src/dfu/dfu.c **** } while (length); + 112 .loc 1 122 0 + 113 00a0 021051E0 subs r1, r1, r2 + 114 .LVL12: + 115 00a4 D6FFFF1A bne .L9 + 123:src/dfu/dfu.c **** + 124:src/dfu/dfu.c **** if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 116 .loc 1 124 0 + 117 00a8 CF2013E5 ldr r2, [r3, #-207] + 118 00ac 010012E3 tst r2, #1 + 119 00b0 0600000A beq .L1 + 125:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 120 .loc 1 125 0 + 121 00b4 CF2013E5 ldr r2, [r3, #-207] + 122 00b8 0120C2E3 bic r2, r2, #1 + 123 00bc CF2003E5 str r2, [r3, #-207] + 124 .L10: + 126:src/dfu/dfu.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 125 .loc 1 126 0 discriminator 1 + 126 00c0 10309FE5 ldr r3, .L11 + 127 00c4 CF3013E5 ldr r3, [r3, #-207] + 128 00c8 010013E3 tst r3, #1 + 129 00cc FBFFFF1A bne .L10 + 130 .L1: + 127:src/dfu/dfu.c **** } + 128:src/dfu/dfu.c **** } + 131 .loc 1 128 0 + 132 00d0 3C00BDE8 ldmfd sp!, {r2, r3, r4, r5} + 133 00d4 1EFF2FE1 bx lr + 134 .L12: + 135 .align 2 + 136 .L11: + 137 00d8 FF00FBFF .word -327425 + 138 .cfi_endproc + 139 .LFE279: + 141 .align 2 + 143 udp_ep0_send_zlp: + 144 .LFB282: + 129:src/dfu/dfu.c **** + 130:src/dfu/dfu.c **** static void udp_ep0_recv_clean(void) + 131:src/dfu/dfu.c **** { + 132:src/dfu/dfu.c **** unsigned int i; + 133:src/dfu/dfu.c **** u_int8_t dummy; + 134:src/dfu/dfu.c **** const AT91PS_UDP pUdp = AT91C_BASE_UDP; + 135:src/dfu/dfu.c **** + 136:src/dfu/dfu.c **** while (!(pUdp->UDP_CSR[0] & AT91C_UDP_RX_DATA_BK0)) ; + 137:src/dfu/dfu.c **** + 138:src/dfu/dfu.c **** for (i = 0; i < (pUdp->UDP_CSR[0] >> 16); i++) + 139:src/dfu/dfu.c **** dummy = pUdp->UDP_FDR[0]; + 140:src/dfu/dfu.c **** + 141:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 142:src/dfu/dfu.c **** } + 143:src/dfu/dfu.c **** + 144:src/dfu/dfu.c **** /* receive data from EP0 */ + 145:src/dfu/dfu.c **** static int __dfufunc udp_ep0_recv_data(u_int8_t *data, u_int16_t len) + 146:src/dfu/dfu.c **** { + 147:src/dfu/dfu.c **** AT91PS_UDP pUdp = AT91C_BASE_UDP; + 148:src/dfu/dfu.c **** AT91_REG csr; + 149:src/dfu/dfu.c **** u_int16_t i, num_rcv; + 150:src/dfu/dfu.c **** u_int32_t num_rcv_total = 0; + 151:src/dfu/dfu.c **** + 152:src/dfu/dfu.c **** do { + 153:src/dfu/dfu.c **** /* FIXME: do we need to check whether we've been interrupted + 154:src/dfu/dfu.c **** * by a RX SETUP stage? */ + 155:src/dfu/dfu.c **** do { + 156:src/dfu/dfu.c **** csr = pUdp->UDP_CSR[0]; + 157:src/dfu/dfu.c **** DEBUGR("CSR=%08x ", csr); + 158:src/dfu/dfu.c **** } while (!(csr & AT91C_UDP_RX_DATA_BK0)) ; + 159:src/dfu/dfu.c **** + 160:src/dfu/dfu.c **** num_rcv = pUdp->UDP_CSR[0] >> 16; + 161:src/dfu/dfu.c **** + 162:src/dfu/dfu.c **** /* make sure we don't read more than requested */ + 163:src/dfu/dfu.c **** if (num_rcv_total + num_rcv > len) + 164:src/dfu/dfu.c **** num_rcv = num_rcv_total - len; + 165:src/dfu/dfu.c **** + 166:src/dfu/dfu.c **** DEBUGR("num_rcv = %u ", num_rcv); + 167:src/dfu/dfu.c **** for (i = 0; i < num_rcv; i++) + 168:src/dfu/dfu.c **** *data++ = pUdp->UDP_FDR[0]; + 169:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 170:src/dfu/dfu.c **** + 171:src/dfu/dfu.c **** num_rcv_total += num_rcv; + 172:src/dfu/dfu.c **** + 173:src/dfu/dfu.c **** /* we need to continue to pull data until we either receive + 174:src/dfu/dfu.c **** * a packet < endpoint size or == 0 */ + 175:src/dfu/dfu.c **** } while (num_rcv == 8 && num_rcv_total < len); + 176:src/dfu/dfu.c **** + 177:src/dfu/dfu.c **** DEBUGE("ep0_rcv_returning(%u total) ", num_rcv_total); + 178:src/dfu/dfu.c **** + 179:src/dfu/dfu.c **** return num_rcv_total; + 180:src/dfu/dfu.c **** } + 181:src/dfu/dfu.c **** + 182:src/dfu/dfu.c **** /* Send zero length packet through the control endpoint */ + 183:src/dfu/dfu.c **** static void __dfufunc udp_ep0_send_zlp(void) + 184:src/dfu/dfu.c **** { + 145 .loc 1 184 0 + 146 .cfi_startproc + 147 @ Function supports interworking. + 148 @ args = 0, pretend = 0, frame = 0 + 149 @ frame_needed = 0, uses_anonymous_args = 0 + 150 @ link register save eliminated. + 151 .LVL13: + 185:src/dfu/dfu.c **** AT91PS_UDP pUdp = AT91C_BASE_UDP; + 186:src/dfu/dfu.c **** pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 152 .loc 1 186 0 + 153 00dc 38309FE5 ldr r3, .L16 + 154 00e0 CF2013E5 ldr r2, [r3, #-207] + 155 00e4 102082E3 orr r2, r2, #16 + 156 00e8 CF2003E5 str r2, [r3, #-207] + 157 .L14: + 187:src/dfu/dfu.c **** while (!(pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP)) ; + 158 .loc 1 187 0 discriminator 1 + 159 00ec CF1013E5 ldr r1, [r3, #-207] + 160 00f0 010011E3 tst r1, #1 + 161 00f4 20209FE5 ldr r2, .L16 + 162 00f8 FBFFFF0A beq .L14 + 188:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 163 .loc 1 188 0 + 164 00fc CF3012E5 ldr r3, [r2, #-207] + 165 0100 0130C3E3 bic r3, r3, #1 + 166 0104 CF3002E5 str r3, [r2, #-207] + 167 .L15: + 189:src/dfu/dfu.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 168 .loc 1 189 0 discriminator 1 + 169 0108 0C309FE5 ldr r3, .L16 + 170 010c CF3013E5 ldr r3, [r3, #-207] + 171 0110 010013E3 tst r3, #1 + 172 0114 FBFFFF1A bne .L15 + 190:src/dfu/dfu.c **** } + 173 .loc 1 190 0 + 174 0118 1EFF2FE1 bx lr + 175 .L17: + 176 .align 2 + 177 .L16: + 178 011c FF00FBFF .word -327425 + 179 .cfi_endproc + 180 .LFE282: + 182 .align 2 + 184 udp_ep0_send_stall: + 185 .LFB283: + 191:src/dfu/dfu.c **** + 192:src/dfu/dfu.c **** /* Stall the control endpoint */ + 193:src/dfu/dfu.c **** static void __dfufunc udp_ep0_send_stall(void) + 194:src/dfu/dfu.c **** { + 186 .loc 1 194 0 + 187 .cfi_startproc + 188 @ Function supports interworking. + 189 @ args = 0, pretend = 0, frame = 0 + 190 @ frame_needed = 0, uses_anonymous_args = 0 + 191 @ link register save eliminated. + 192 .LVL14: + 195:src/dfu/dfu.c **** AT91PS_UDP pUdp = AT91C_BASE_UDP; + 196:src/dfu/dfu.c **** pUdp->UDP_CSR[0] |= AT91C_UDP_FORCESTALL; + 193 .loc 1 196 0 + 194 0120 38309FE5 ldr r3, .L21 + 195 0124 CF2013E5 ldr r2, [r3, #-207] + 196 0128 202082E3 orr r2, r2, #32 + 197 012c CF2003E5 str r2, [r3, #-207] + 198 .L19: + 197:src/dfu/dfu.c **** while (!(pUdp->UDP_CSR[0] & AT91C_UDP_ISOERROR)) ; + 199 .loc 1 197 0 discriminator 1 + 200 0130 CF1013E5 ldr r1, [r3, #-207] + 201 0134 080011E3 tst r1, #8 + 202 0138 20209FE5 ldr r2, .L21 + 203 013c FBFFFF0A beq .L19 + 198:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR); + 204 .loc 1 198 0 + 205 0140 CF3012E5 ldr r3, [r2, #-207] + 206 0144 2830C3E3 bic r3, r3, #40 + 207 0148 CF3002E5 str r3, [r2, #-207] + 208 .L20: + 199:src/dfu/dfu.c **** while (pUdp->UDP_CSR[0] & (AT91C_UDP_FORCESTALL | AT91C_UDP_ISOERROR)) ; + 209 .loc 1 199 0 discriminator 1 + 210 014c 0C309FE5 ldr r3, .L21 + 211 0150 CF3013E5 ldr r3, [r3, #-207] + 212 0154 280013E3 tst r3, #40 + 213 0158 FBFFFF1A bne .L20 + 200:src/dfu/dfu.c **** } + 214 .loc 1 200 0 + 215 015c 1EFF2FE1 bx lr + 216 .L22: + 217 .align 2 + 218 .L21: + 219 0160 FF00FBFF .word -327425 + 220 .cfi_endproc + 221 .LFE283: + 223 .align 2 + 225 handle_getstate: + 226 .LFB287: + 201:src/dfu/dfu.c **** + 202:src/dfu/dfu.c **** + 203:src/dfu/dfu.c **** static u_int8_t *ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + 204:src/dfu/dfu.c **** static __dfudata u_int8_t dfu_status; + 205:src/dfu/dfu.c **** __dfudata u_int32_t dfu_state = DFU_STATE_appIDLE; + 206:src/dfu/dfu.c **** static u_int32_t pagebuf32[AT91C_IFLASH_PAGE_SIZE/4]; + 207:src/dfu/dfu.c **** + 208:src/dfu/dfu.c **** static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) + 209:src/dfu/dfu.c **** { + 210:src/dfu/dfu.c **** volatile u_int32_t *p = (volatile u_int32_t *)ptr; + 211:src/dfu/dfu.c **** u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + 212:src/dfu/dfu.c **** int i; + 213:src/dfu/dfu.c **** + 214:src/dfu/dfu.c **** DEBUGE("download "); + 215:src/dfu/dfu.c **** + 216:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 217:src/dfu/dfu.c **** /* Too big. Not that we'd really care, but it's a + 218:src/dfu/dfu.c **** * DFU protocol violation */ + 219:src/dfu/dfu.c **** DEBUGP("length exceeds flash page size "); + 220:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 221:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 222:src/dfu/dfu.c **** return RET_STALL; + 223:src/dfu/dfu.c **** } + 224:src/dfu/dfu.c **** if (len & 0x3) { + 225:src/dfu/dfu.c **** /* reject non-four-byte-aligned writes */ + 226:src/dfu/dfu.c **** DEBUGP("not four-byte-aligned length "); + 227:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 228:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 229:src/dfu/dfu.c **** return RET_STALL; + 230:src/dfu/dfu.c **** } + 231:src/dfu/dfu.c **** if (len == 0) { + 232:src/dfu/dfu.c **** DEBUGP("zero-size write -> MANIFEST_SYNC "); + 233:src/dfu/dfu.c **** flash_page(p); + 234:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuMANIFEST_SYNC; + 235:src/dfu/dfu.c **** return RET_ZLP; + 236:src/dfu/dfu.c **** } + 237:src/dfu/dfu.c **** if (ptr + len >= (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE ) { + 238:src/dfu/dfu.c **** DEBUGP("end of write exceeds flash end "); + 239:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 240:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 241:src/dfu/dfu.c **** return RET_STALL; + 242:src/dfu/dfu.c **** } + 243:src/dfu/dfu.c **** + 244:src/dfu/dfu.c **** DEBUGP("try_to_recv=%u ", len); + 245:src/dfu/dfu.c **** udp_ep0_recv_data(pagebuf, len); + 246:src/dfu/dfu.c **** + 247:src/dfu/dfu.c **** DEBUGR(hexdump(pagebuf, len)); + 248:src/dfu/dfu.c **** + 249:src/dfu/dfu.c **** /* we can only access the write buffer with correctly aligned + 250:src/dfu/dfu.c **** * 32bit writes ! */ + 251:src/dfu/dfu.c **** #ifndef DEBUG_DFU_NOFLASH + 252:src/dfu/dfu.c **** DEBUGP("copying "); + 253:src/dfu/dfu.c **** for (i = 0; i < len/4; i++) { + 254:src/dfu/dfu.c **** *p++ = pagebuf32[i]; + 255:src/dfu/dfu.c **** /* If we have filled a page buffer, flash it */ + 256:src/dfu/dfu.c **** if (((unsigned long)p % AT91C_IFLASH_PAGE_SIZE) == 0) { + 257:src/dfu/dfu.c **** DEBUGP("page_full "); + 258:src/dfu/dfu.c **** flash_page(p-1); + 259:src/dfu/dfu.c **** } + 260:src/dfu/dfu.c **** } + 261:src/dfu/dfu.c **** ptr = (u_int8_t *) p; + 262:src/dfu/dfu.c **** #endif + 263:src/dfu/dfu.c **** + 264:src/dfu/dfu.c **** return RET_ZLP; + 265:src/dfu/dfu.c **** } + 266:src/dfu/dfu.c **** + 267:src/dfu/dfu.c **** #define AT91C_IFLASH_END ((u_int8_t *)AT91C_IFLASH + AT91C_IFLASH_SIZE) + 268:src/dfu/dfu.c **** static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) + 269:src/dfu/dfu.c **** { + 270:src/dfu/dfu.c **** DEBUGE("upload "); + 271:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 272:src/dfu/dfu.c **** /* Too big */ + 273:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 274:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 275:src/dfu/dfu.c **** udp_ep0_send_stall(); + 276:src/dfu/dfu.c **** return -EINVAL; + 277:src/dfu/dfu.c **** } + 278:src/dfu/dfu.c **** + 279:src/dfu/dfu.c **** if (ptr + len > AT91C_IFLASH_END) + 280:src/dfu/dfu.c **** len = AT91C_IFLASH_END - (u_int8_t *)ptr; + 281:src/dfu/dfu.c **** + 282:src/dfu/dfu.c **** udp_ep0_send_data((char *)ptr, len); + 283:src/dfu/dfu.c **** ptr+= len; + 284:src/dfu/dfu.c **** + 285:src/dfu/dfu.c **** return len; + 286:src/dfu/dfu.c **** } + 287:src/dfu/dfu.c **** + 288:src/dfu/dfu.c **** static __dfufunc void handle_getstatus(void) + 289:src/dfu/dfu.c **** { + 290:src/dfu/dfu.c **** struct dfu_status dstat; + 291:src/dfu/dfu.c **** u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + 292:src/dfu/dfu.c **** + 293:src/dfu/dfu.c **** DEBUGE("getstatus(fsr=0x%08x) ", fsr); + 294:src/dfu/dfu.c **** + 295:src/dfu/dfu.c **** switch (dfu_state) { + 296:src/dfu/dfu.c **** case DFU_STATE_dfuDNLOAD_SYNC: + 297:src/dfu/dfu.c **** case DFU_STATE_dfuDNBUSY: + 298:src/dfu/dfu.c **** if (fsr & AT91C_MC_PROGE) { + 299:src/dfu/dfu.c **** DEBUGE("errPROG "); + 300:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errPROG; + 301:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 302:src/dfu/dfu.c **** } else if (fsr & AT91C_MC_LOCKE) { + 303:src/dfu/dfu.c **** DEBUGE("errWRITE "); + 304:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errWRITE; + 305:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 306:src/dfu/dfu.c **** } else if (fsr & AT91C_MC_FRDY) { + 307:src/dfu/dfu.c **** DEBUGE("DNLOAD_IDLE "); + 308:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNLOAD_IDLE; + 309:src/dfu/dfu.c **** } else { + 310:src/dfu/dfu.c **** DEBUGE("DNBUSY "); + 311:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNBUSY; + 312:src/dfu/dfu.c **** } + 313:src/dfu/dfu.c **** break; + 314:src/dfu/dfu.c **** case DFU_STATE_dfuMANIFEST_SYNC: + 315:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuMANIFEST; + 316:src/dfu/dfu.c **** break; + 317:src/dfu/dfu.c **** } + 318:src/dfu/dfu.c **** + 319:src/dfu/dfu.c **** /* send status response */ + 320:src/dfu/dfu.c **** dstat.bStatus = dfu_status; + 321:src/dfu/dfu.c **** dstat.bState = dfu_state; + 322:src/dfu/dfu.c **** dstat.iString = 0; + 323:src/dfu/dfu.c **** /* FIXME: set dstat.bwPollTimeout */ + 324:src/dfu/dfu.c **** + 325:src/dfu/dfu.c **** udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + 326:src/dfu/dfu.c **** } + 327:src/dfu/dfu.c **** + 328:src/dfu/dfu.c **** static void __dfufunc handle_getstate(void) + 329:src/dfu/dfu.c **** { + 227 .loc 1 329 0 + 228 .cfi_startproc + 229 @ Function supports interworking. + 230 @ args = 0, pretend = 0, frame = 8 + 231 @ frame_needed = 0, uses_anonymous_args = 0 + 232 0164 07402DE9 stmfd sp!, {r0, r1, r2, lr} + 233 .LCFI1: + 234 .cfi_def_cfa_offset 16 + 330:src/dfu/dfu.c **** u_int8_t u8 = dfu_state; + 235 .loc 1 330 0 + 236 0168 18309FE5 ldr r3, .L24 + 237 016c 003093E5 ldr r3, [r3, #0] + 238 0170 08008DE2 add r0, sp, #8 + 239 .cfi_offset 14, -4 + 240 .cfi_offset 2, -8 + 241 .cfi_offset 1, -12 + 242 .cfi_offset 0, -16 + 243 0174 013060E5 strb r3, [r0, #-1]! + 244 .LVL15: + 331:src/dfu/dfu.c **** DEBUGE("getstate "); + 332:src/dfu/dfu.c **** + 333:src/dfu/dfu.c **** udp_ep0_send_data((char *)&u8, sizeof(u8)); + 245 .loc 1 333 0 + 246 0178 0110A0E3 mov r1, #1 + 247 017c 9FFFFFEB bl udp_ep0_send_data + 334:src/dfu/dfu.c **** } + 248 .loc 1 334 0 + 249 0180 0E40BDE8 ldmfd sp!, {r1, r2, r3, lr} + 250 0184 1EFF2FE1 bx lr + 251 .L25: + 252 .align 2 + 253 .L24: + 254 0188 00000000 .word .LANCHOR0 + 255 .cfi_endproc + 256 .LFE287: + 258 .align 2 + 260 handle_upload.clone.0: + 261 .LFB293: + 268:src/dfu/dfu.c **** static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) + 262 .loc 1 268 0 + 263 .cfi_startproc + 264 @ Function supports interworking. + 265 @ args = 0, pretend = 0, frame = 0 + 266 @ frame_needed = 0, uses_anonymous_args = 0 + 267 .LVL16: + 271:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 268 .loc 1 271 0 + 269 018c 010C50E3 cmp r0, #256 + 268:src/dfu/dfu.c **** static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) + 270 .loc 1 268 0 + 271 0190 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 272 .LCFI2: + 273 .cfi_def_cfa_offset 16 + 268:src/dfu/dfu.c **** static __dfufunc int handle_upload(u_int16_t val, u_int16_t len) + 274 .loc 1 268 0 + 275 0194 0040A0E1 mov r4, r0 + 276 .cfi_offset 14, -4 + 277 .cfi_offset 6, -8 + 278 .cfi_offset 5, -12 + 279 .cfi_offset 4, -16 + 271:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 280 .loc 1 271 0 + 281 0198 0700009A bls .L27 + 273:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 282 .loc 1 273 0 + 283 019c 54309FE5 ldr r3, .L30 + 284 01a0 0A20A0E3 mov r2, #10 + 285 01a4 002083E5 str r2, [r3, #0] + 274:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 286 .loc 1 274 0 + 287 01a8 0820A0E3 mov r2, #8 + 288 01ac 0420C3E5 strb r2, [r3, #4] + 275:src/dfu/dfu.c **** udp_ep0_send_stall(); + 289 .loc 1 275 0 + 290 01b0 DAFFFFEB bl udp_ep0_send_stall + 291 .LVL17: + 276:src/dfu/dfu.c **** return -EINVAL; + 292 .loc 1 276 0 + 293 01b4 1500E0E3 mvn r0, #21 + 294 01b8 0C0000EA b .L28 + 295 .LVL18: + 296 .L27: + 279:src/dfu/dfu.c **** if (ptr + len > AT91C_IFLASH_END) + 297 .loc 1 279 0 + 298 01bc 38609FE5 ldr r6, .L30+4 + 299 01c0 005096E5 ldr r5, [r6, #0] + 300 01c4 003085E0 add r3, r5, r0 + 301 01c8 120853E3 cmp r3, #1179648 + 280:src/dfu/dfu.c **** len = AT91C_IFLASH_END - (u_int8_t *)ptr; + 302 .loc 1 280 0 + 303 01cc 00406582 rsbhi r4, r5, #0 + 304 01d0 0448A081 movhi r4, r4, asl #16 + 305 01d4 2448A081 movhi r4, r4, lsr #16 + 306 .LVL19: + 282:src/dfu/dfu.c **** udp_ep0_send_data((char *)ptr, len); + 307 .loc 1 282 0 + 308 01d8 0500A0E1 mov r0, r5 + 309 01dc 0410A0E1 mov r1, r4 + 283:src/dfu/dfu.c **** ptr+= len; + 310 .loc 1 283 0 + 311 01e0 045085E0 add r5, r5, r4 + 282:src/dfu/dfu.c **** udp_ep0_send_data((char *)ptr, len); + 312 .loc 1 282 0 + 313 01e4 85FFFFEB bl udp_ep0_send_data + 283:src/dfu/dfu.c **** ptr+= len; + 314 .loc 1 283 0 + 315 01e8 005086E5 str r5, [r6, #0] + 285:src/dfu/dfu.c **** return len; + 316 .loc 1 285 0 + 317 01ec 0400A0E1 mov r0, r4 + 318 .LVL20: + 319 .L28: + 286:src/dfu/dfu.c **** } + 320 .loc 1 286 0 + 321 01f0 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 322 01f4 1EFF2FE1 bx lr + 323 .L31: + 324 .align 2 + 325 .L30: + 326 01f8 00000000 .word .LANCHOR0 + 327 01fc 00000000 .word .LANCHOR1 + 328 .cfi_endproc + 329 .LFE293: + 331 .align 2 + 333 handle_dnload.clone.1: + 334 .LFB294: + 208:src/dfu/dfu.c **** static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) + 335 .loc 1 208 0 + 336 .cfi_startproc + 337 @ Function supports interworking. + 338 @ args = 0, pretend = 0, frame = 8 + 339 @ frame_needed = 0, uses_anonymous_args = 0 + 340 .LVL21: + 210:src/dfu/dfu.c **** volatile u_int32_t *p = (volatile u_int32_t *)ptr; + 341 .loc 1 210 0 + 342 0200 34319FE5 ldr r3, .L52 + 216:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 343 .loc 1 216 0 + 344 0204 010C50E3 cmp r0, #256 + 208:src/dfu/dfu.c **** static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len) + 345 .loc 1 208 0 + 346 0208 F3412DE9 stmfd sp!, {r0, r1, r4, r5, r6, r7, r8, lr} + 347 .LCFI3: + 348 .cfi_def_cfa_offset 32 + 210:src/dfu/dfu.c **** volatile u_int32_t *p = (volatile u_int32_t *)ptr; + 349 .loc 1 210 0 + 350 020c 004093E5 ldr r4, [r3, #0] + 351 .cfi_offset 14, -4 + 352 .cfi_offset 8, -8 + 353 .cfi_offset 7, -12 + 354 .cfi_offset 6, -16 + 355 .cfi_offset 5, -20 + 356 .cfi_offset 4, -24 + 357 .cfi_offset 1, -28 + 358 .cfi_offset 0, -32 + 359 .LVL22: + 216:src/dfu/dfu.c **** if (len > AT91C_IFLASH_PAGE_SIZE) { + 360 .loc 1 216 0 + 361 0210 0D00008A bhi .L50 + 362 .L33: + 224:src/dfu/dfu.c **** if (len & 0x3) { + 363 .loc 1 224 0 + 364 0214 033010E2 ands r3, r0, #3 + 365 0218 0B00001A bne .L50 + 366 .L35: + 231:src/dfu/dfu.c **** if (len == 0) { + 367 .loc 1 231 0 + 368 021c 000050E3 cmp r0, #0 + 369 0220 0500001A bne .L36 + 233:src/dfu/dfu.c **** flash_page(p); + 370 .loc 1 233 0 + 371 0224 0400A0E1 mov r0, r4 + 372 .LVL23: + 373 0228 FEFFFFEB bl flash_page + 374 .LVL24: + 234:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuMANIFEST_SYNC; + 375 .loc 1 234 0 + 376 022c 0C319FE5 ldr r3, .L52+4 + 377 0230 0620A0E3 mov r2, #6 + 378 0234 002083E5 str r2, [r3, #0] + 379 0238 3C0000EA b .L51 + 380 .LVL25: + 381 .L36: + 237:src/dfu/dfu.c **** if (ptr + len >= (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE ) { + 382 .loc 1 237 0 + 383 023c 00219FE5 ldr r2, .L52+8 + 384 0240 001084E0 add r1, r4, r0 + 385 0244 020051E1 cmp r1, r2 + 386 0248 0600009A bls .L37 + 387 .L50: + 239:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 388 .loc 1 239 0 + 389 024c EC309FE5 ldr r3, .L52+4 + 390 0250 0A20A0E3 mov r2, #10 + 391 0254 002083E5 str r2, [r3, #0] + 240:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errADDRESS; + 392 .loc 1 240 0 + 393 0258 0820A0E3 mov r2, #8 + 394 025c 0420C3E5 strb r2, [r3, #4] + 241:src/dfu/dfu.c **** return RET_STALL; + 395 .loc 1 241 0 + 396 0260 0200A0E3 mov r0, #2 + 397 .LVL26: + 398 0264 320000EA b .L34 + 399 .LVL27: + 400 .L37: + 211:src/dfu/dfu.c **** u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + 401 .loc 1 211 0 + 402 0268 D8109FE5 ldr r1, .L52+12 + 403 .LVL28: + 404 .L48: + 405 .LBB4: + 406 .LBB5: + 156:src/dfu/dfu.c **** csr = pUdp->UDP_CSR[0]; + 407 .loc 1 156 0 + 408 026c D8209FE5 ldr r2, .L52+16 + 409 0270 CFC012E5 ldr ip, [r2, #-207] + 410 0274 04C08DE5 str ip, [sp, #4] + 158:src/dfu/dfu.c **** } while (!(csr & AT91C_UDP_RX_DATA_BK0)) ; + 411 .loc 1 158 0 + 412 0278 04C09DE5 ldr ip, [sp, #4] + 413 027c 02001CE3 tst ip, #2 + 414 0280 F9FFFF0A beq .L48 + 160:src/dfu/dfu.c **** num_rcv = pUdp->UDP_CSR[0] >> 16; + 415 .loc 1 160 0 + 416 0284 CF5012E5 ldr r5, [r2, #-207] + 417 0288 2558A0E1 mov r5, r5, lsr #16 + 418 .LVL29: + 163:src/dfu/dfu.c **** if (num_rcv_total + num_rcv > len) + 419 .loc 1 163 0 + 420 028c 052083E0 add r2, r3, r5 + 421 0290 000052E1 cmp r2, r0 + 164:src/dfu/dfu.c **** num_rcv = num_rcv_total - len; + 422 .loc 1 164 0 + 423 0294 03506080 rsbhi r5, r0, r3 + 424 .LVL30: + 425 0298 0558A081 movhi r5, r5, asl #16 + 426 029c 2558A081 movhi r5, r5, lsr #16 + 427 .LVL31: + 428 .LBE5: + 429 .LBE4: + 211:src/dfu/dfu.c **** u_int8_t *pagebuf = (u_int8_t *) pagebuf32; + 430 .loc 1 211 0 + 431 02a0 0160A0E1 mov r6, r1 + 167:src/dfu/dfu.c **** for (i = 0; i < num_rcv; i++) + 432 .loc 1 167 0 + 433 02a4 0020A0E3 mov r2, #0 + 434 02a8 040000EA b .L40 + 435 .LVL32: + 436 .L41: + 437 .LBB7: + 438 .LBB6: + 168:src/dfu/dfu.c **** *data++ = pUdp->UDP_FDR[0]; + 439 .loc 1 168 0 + 440 02ac AFC01CE5 ldr ip, [ip, #-175] + 167:src/dfu/dfu.c **** for (i = 0; i < num_rcv; i++) + 441 .loc 1 167 0 + 442 02b0 012082E2 add r2, r2, #1 + 443 .LVL33: + 444 02b4 0228A0E1 mov r2, r2, asl #16 + 445 .LVL34: + 168:src/dfu/dfu.c **** *data++ = pUdp->UDP_FDR[0]; + 446 .loc 1 168 0 + 447 02b8 01C0C6E4 strb ip, [r6], #1 + 448 .LVL35: + 167:src/dfu/dfu.c **** for (i = 0; i < num_rcv; i++) + 449 .loc 1 167 0 + 450 02bc 2228A0E1 mov r2, r2, lsr #16 + 451 .LVL36: + 452 .L40: + 453 02c0 050052E1 cmp r2, r5 + 454 02c4 80C09FE5 ldr ip, .L52+16 + 455 02c8 F7FFFF1A bne .L41 + 169:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 456 .loc 1 169 0 + 457 02cc CF501CE5 ldr r5, [ip, #-207] + 458 .LVL37: + 175:src/dfu/dfu.c **** } while (num_rcv == 8 && num_rcv_total < len); + 459 .loc 1 175 0 + 460 02d0 080052E3 cmp r2, #8 + 169:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 461 .loc 1 169 0 + 462 02d4 0250C5E3 bic r5, r5, #2 + 167:src/dfu/dfu.c **** for (i = 0; i < num_rcv; i++) + 463 .loc 1 167 0 + 464 02d8 021081E0 add r1, r1, r2 + 169:src/dfu/dfu.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 465 .loc 1 169 0 + 466 02dc CF500CE5 str r5, [ip, #-207] + 467 .LVL38: + 175:src/dfu/dfu.c **** } while (num_rcv == 8 && num_rcv_total < len); + 468 .loc 1 175 0 + 469 02e0 0200001A bne .L42 + 171:src/dfu/dfu.c **** num_rcv_total += num_rcv; + 470 .loc 1 171 0 + 471 02e4 083083E2 add r3, r3, #8 + 472 .LVL39: + 175:src/dfu/dfu.c **** } while (num_rcv == 8 && num_rcv_total < len); + 473 .loc 1 175 0 + 474 02e8 000053E1 cmp r3, r0 + 475 02ec DEFFFF3A bcc .L48 + 476 .LVL40: + 477 .L42: + 478 .LBE6: + 479 .LBE7: + 253:src/dfu/dfu.c **** for (i = 0; i < len/4; i++) { + 480 .loc 1 253 0 + 481 02f0 2071A0E1 mov r7, r0, lsr #2 + 482 02f4 54809FE5 ldr r8, .L52+20 + 483 02f8 0450A0E1 mov r5, r4 + 484 02fc 0060A0E3 mov r6, #0 + 485 .LVL41: + 486 0300 050000EA b .L44 + 487 .LVL42: + 488 .L46: + 254:src/dfu/dfu.c **** *p++ = pagebuf32[i]; + 489 .loc 1 254 0 + 490 0304 0430B8E5 ldr r3, [r8, #4]! + 491 0308 043085E4 str r3, [r5], #4 + 492 .LVL43: + 256:src/dfu/dfu.c **** if (((unsigned long)p % AT91C_IFLASH_PAGE_SIZE) == 0) { + 493 .loc 1 256 0 + 494 030c FF0015E3 tst r5, #255 + 258:src/dfu/dfu.c **** flash_page(p-1); + 495 .loc 1 258 0 + 496 0310 04004502 subeq r0, r5, #4 + 497 0314 FEFFFF0B bleq flash_page + 498 .L45: + 253:src/dfu/dfu.c **** for (i = 0; i < len/4; i++) { + 499 .loc 1 253 0 + 500 0318 016086E2 add r6, r6, #1 + 501 .LVL44: + 502 .L44: + 503 031c 070056E1 cmp r6, r7 + 504 0320 F7FFFFBA blt .L46 + 261:src/dfu/dfu.c **** ptr = (u_int8_t *) p; + 505 .loc 1 261 0 + 506 0324 10309FE5 ldr r3, .L52 + 507 0328 074184E0 add r4, r4, r7, asl #2 + 508 032c 004083E5 str r4, [r3, #0] + 509 .LVL45: + 510 .L51: + 264:src/dfu/dfu.c **** return RET_ZLP; + 511 .loc 1 264 0 + 512 0330 0100A0E3 mov r0, #1 + 513 .L34: + 265:src/dfu/dfu.c **** } + 514 .loc 1 265 0 + 515 0334 FC41BDE8 ldmfd sp!, {r2, r3, r4, r5, r6, r7, r8, lr} + 516 0338 1EFF2FE1 bx lr + 517 .L53: + 518 .align 2 + 519 .L52: + 520 033c 00000000 .word .LANCHOR1 + 521 0340 00000000 .word .LANCHOR0 + 522 0344 FFFE1100 .word 1179391 + 523 0348 00000000 .word .LANCHOR2 + 524 034c FF00FBFF .word -327425 + 525 0350 FCFFFFFF .word .LANCHOR2-4 + 526 .cfi_endproc + 527 .LFE294: + 529 .align 2 + 531 handle_getstatus: + 532 .LFB286: + 289:src/dfu/dfu.c **** { + 533 .loc 1 289 0 + 534 .cfi_startproc + 535 @ Function supports interworking. + 536 @ args = 0, pretend = 0, frame = 8 + 537 @ frame_needed = 0, uses_anonymous_args = 0 + 538 .LVL46: + 539 .LBB10: + 540 .LBB11: + 541 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; + 542 .loc 2 1572 0 + 543 0354 0030E0E3 mvn r3, #0 + 544 .LBE11: + 545 .LBE10: + 289:src/dfu/dfu.c **** { + 546 .loc 1 289 0 + 547 0358 07402DE9 stmfd sp!, {r0, r1, r2, lr} + 548 .LCFI4: + 549 .cfi_def_cfa_offset 16 + 550 .LBB13: + 551 .LBB12: + 552 .loc 2 1572 0 + 553 035c 972013E5 ldr r2, [r3, #-151] + 554 .cfi_offset 14, -4 + 555 .cfi_offset 2, -8 + 556 .cfi_offset 1, -12 + 557 .cfi_offset 0, -16 + 558 .LBE12: + 559 .LBE13: + 295:src/dfu/dfu.c **** switch (dfu_state) { + 560 .loc 1 295 0 + 561 0360 8C309FE5 ldr r3, .L63 + 562 0364 001093E5 ldr r1, [r3, #0] + 563 0368 030051E3 cmp r1, #3 + 564 036c 1400003A bcc .L55 + 565 0370 040051E3 cmp r1, #4 + 566 0374 0200009A bls .L56 + 567 0378 060051E3 cmp r1, #6 + 568 037c 1000001A bne .L55 + 569 0380 0D0000EA b .L62 + 570 .L56: + 298:src/dfu/dfu.c **** if (fsr & AT91C_MC_PROGE) { + 571 .loc 1 298 0 + 572 0384 080012E3 tst r2, #8 + 300:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errPROG; + 573 .loc 1 300 0 + 574 0388 0620A013 movne r2, #6 + 575 038c 0420C315 strneb r2, [r3, #4] + 301:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 576 .loc 1 301 0 + 577 0390 04208212 addne r2, r2, #4 + 298:src/dfu/dfu.c **** if (fsr & AT91C_MC_PROGE) { + 578 .loc 1 298 0 + 579 0394 0900001A bne .L61 + 302:src/dfu/dfu.c **** } else if (fsr & AT91C_MC_LOCKE) { + 580 .loc 1 302 0 + 581 0398 040012E3 tst r2, #4 + 304:src/dfu/dfu.c **** dfu_status = DFU_STATUS_errWRITE; + 582 .loc 1 304 0 + 583 039c 0320A013 movne r2, #3 + 584 03a0 0420C315 strneb r2, [r3, #4] + 305:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 585 .loc 1 305 0 + 586 03a4 07208212 addne r2, r2, #7 + 302:src/dfu/dfu.c **** } else if (fsr & AT91C_MC_LOCKE) { + 587 .loc 1 302 0 + 588 03a8 0400001A bne .L61 + 306:src/dfu/dfu.c **** } else if (fsr & AT91C_MC_FRDY) { + 589 .loc 1 306 0 + 590 03ac 010012E3 tst r2, #1 + 308:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNLOAD_IDLE; + 591 .loc 1 308 0 + 592 03b0 0520A013 movne r2, #5 + 311:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNBUSY; + 593 .loc 1 311 0 + 594 03b4 0420A003 moveq r2, #4 + 595 03b8 000000EA b .L61 + 596 .L62: + 315:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuMANIFEST; + 597 .loc 1 315 0 + 598 03bc 0720A0E3 mov r2, #7 + 599 .L61: + 600 03c0 002083E5 str r2, [r3, #0] + 601 .L55: + 320:src/dfu/dfu.c **** dstat.bStatus = dfu_status; + 602 .loc 1 320 0 + 603 03c4 28309FE5 ldr r3, .L63 + 604 03c8 0420D3E5 ldrb r2, [r3, #4] @ zero_extendqisi2 + 321:src/dfu/dfu.c **** dstat.bState = dfu_state; + 605 .loc 1 321 0 + 606 03cc 003093E5 ldr r3, [r3, #0] + 325:src/dfu/dfu.c **** udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + 607 .loc 1 325 0 + 608 03d0 0D00A0E1 mov r0, sp + 321:src/dfu/dfu.c **** dstat.bState = dfu_state; + 609 .loc 1 321 0 + 610 03d4 0430CDE5 strb r3, [sp, #4] + 325:src/dfu/dfu.c **** udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + 611 .loc 1 325 0 + 612 03d8 0610A0E3 mov r1, #6 + 322:src/dfu/dfu.c **** dstat.iString = 0; + 613 .loc 1 322 0 + 614 03dc 0030A0E3 mov r3, #0 + 320:src/dfu/dfu.c **** dstat.bStatus = dfu_status; + 615 .loc 1 320 0 + 616 03e0 0020CDE5 strb r2, [sp, #0] + 322:src/dfu/dfu.c **** dstat.iString = 0; + 617 .loc 1 322 0 + 618 03e4 0530CDE5 strb r3, [sp, #5] + 325:src/dfu/dfu.c **** udp_ep0_send_data((char *)&dstat, sizeof(dstat)); + 619 .loc 1 325 0 + 620 03e8 04FFFFEB bl udp_ep0_send_data + 326:src/dfu/dfu.c **** } + 621 .loc 1 326 0 + 622 03ec 0E40BDE8 ldmfd sp!, {r1, r2, r3, lr} + 623 03f0 1EFF2FE1 bx lr + 624 .L64: + 625 .align 2 + 626 .L63: + 627 03f4 00000000 .word .LANCHOR0 + 628 .cfi_endproc + 629 .LFE286: + 631 .align 2 + 632 .global dfu_ep0_handler + 634 dfu_ep0_handler: + 635 .LFB288: + 335:src/dfu/dfu.c **** + 336:src/dfu/dfu.c **** /* callback function for DFU requests */ + 337:src/dfu/dfu.c **** int __dfufunc dfu_ep0_handler(u_int8_t req_type, u_int8_t req, + 338:src/dfu/dfu.c **** u_int16_t val, u_int16_t len) + 339:src/dfu/dfu.c **** { + 636 .loc 1 339 0 + 637 .cfi_startproc + 638 @ Function supports interworking. + 639 @ args = 0, pretend = 0, frame = 0 + 640 @ frame_needed = 0, uses_anonymous_args = 0 + 641 .LVL47: + 642 03f8 10402DE9 stmfd sp!, {r4, lr} + 643 .LCFI5: + 644 .cfi_def_cfa_offset 8 + 645 .loc 1 339 0 + 646 03fc 0340A0E1 mov r4, r3 + 647 .cfi_offset 14, -4 + 648 .cfi_offset 4, -8 + 340:src/dfu/dfu.c **** int rc, ret = RET_NOTHING; + 341:src/dfu/dfu.c **** + 342:src/dfu/dfu.c **** DEBUGE("old_state = %u ", dfu_state); + 343:src/dfu/dfu.c **** + 344:src/dfu/dfu.c **** switch (dfu_state) { + 649 .loc 1 344 0 + 650 0400 04329FE5 ldr r3, .L143 + 651 .LVL48: + 652 0404 002093E5 ldr r2, [r3, #0] + 653 .LVL49: + 654 0408 0A0052E3 cmp r2, #10 + 655 040c 02F19F97 ldrls pc, [pc, r2, asl #2] + 656 0410 7A0000EA b .L81 + 657 .L77: + 658 0414 40040000 .word .L67 + 659 0418 60040000 .word .L68 + 660 041c 78040000 .word .L69 + 661 0420 20050000 .word .L73 + 662 0424 B0050000 .word .L137 + 663 0428 DC040000 .word .L72 + 664 042c 20050000 .word .L73 + 665 0430 2C050000 .word .L74 + 666 0434 00060000 .word .L81 + 667 0438 4C050000 .word .L75 + 668 043c A0050000 .word .L76 + 669 .L67: + 345:src/dfu/dfu.c **** case DFU_STATE_appIDLE: + 346:src/dfu/dfu.c **** switch (req) { + 670 .loc 1 346 0 + 671 0440 030051E3 cmp r1, #3 + 672 0444 5B00000A beq .L135 + 673 0448 050051E3 cmp r1, #5 + 674 044c 5B00000A beq .L120 + 675 0450 000051E3 cmp r1, #0 + 347:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 348:src/dfu/dfu.c **** handle_getstatus(); + 349:src/dfu/dfu.c **** break; + 350:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 351:src/dfu/dfu.c **** handle_getstate(); + 352:src/dfu/dfu.c **** break; + 353:src/dfu/dfu.c **** case USB_REQ_DFU_DETACH: + 354:src/dfu/dfu.c **** dfu_state = DFU_STATE_appDETACH; + 676 .loc 1 354 0 + 677 0454 0120A003 moveq r2, #1 + 346:src/dfu/dfu.c **** switch (req) { + 678 .loc 1 346 0 + 679 0458 4E00000A beq .L133 + 680 045c 660000EA b .L122 + 681 .L68: + 355:src/dfu/dfu.c **** ret = RET_ZLP; + 356:src/dfu/dfu.c **** goto out; + 357:src/dfu/dfu.c **** break; + 358:src/dfu/dfu.c **** default: + 359:src/dfu/dfu.c **** ret = RET_STALL; + 360:src/dfu/dfu.c **** } + 361:src/dfu/dfu.c **** break; + 362:src/dfu/dfu.c **** case DFU_STATE_appDETACH: + 363:src/dfu/dfu.c **** switch (req) { + 682 .loc 1 363 0 + 683 0460 030051E3 cmp r1, #3 + 684 0464 5300000A beq .L135 + 685 0468 050051E3 cmp r1, #5 + 364:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 365:src/dfu/dfu.c **** handle_getstatus(); + 366:src/dfu/dfu.c **** break; + 367:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 368:src/dfu/dfu.c **** handle_getstate(); + 369:src/dfu/dfu.c **** break; + 370:src/dfu/dfu.c **** default: + 371:src/dfu/dfu.c **** dfu_state = DFU_STATE_appIDLE; + 686 .loc 1 371 0 + 687 046c 0020A013 movne r2, #0 + 363:src/dfu/dfu.c **** switch (req) { + 688 .loc 1 363 0 + 689 0470 5A00001A bne .L134 + 690 0474 510000EA b .L120 + 691 .L69: + 372:src/dfu/dfu.c **** ret = RET_STALL; + 373:src/dfu/dfu.c **** goto out; + 374:src/dfu/dfu.c **** break; + 375:src/dfu/dfu.c **** } + 376:src/dfu/dfu.c **** /* FIXME: implement timer to return to appIDLE */ + 377:src/dfu/dfu.c **** break; + 378:src/dfu/dfu.c **** case DFU_STATE_dfuIDLE: + 379:src/dfu/dfu.c **** switch (req) { + 692 .loc 1 379 0 + 693 0478 011041E2 sub r1, r1, #1 + 694 .LVL50: + 695 047c 050051E3 cmp r1, #5 + 696 0480 01F19F97 ldrls pc, [pc, r1, asl #2] + 697 0484 540000EA b .L131 + 698 .L92: + 699 0488 A0040000 .word .L88 + 700 048c BC040000 .word .L89 + 701 0490 B8050000 .word .L135 + 702 0494 DC050000 .word .L131 + 703 0498 C0050000 .word .L120 + 704 049c F4050000 .word .L121 + 705 .L88: + 380:src/dfu/dfu.c **** case USB_REQ_DFU_DNLOAD: + 381:src/dfu/dfu.c **** if (len == 0) { + 706 .loc 1 381 0 + 707 04a0 000054E3 cmp r4, #0 + 708 04a4 4C00000A beq .L131 + 709 .L93: + 382:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 383:src/dfu/dfu.c **** ret = RET_STALL; + 384:src/dfu/dfu.c **** goto out; + 385:src/dfu/dfu.c **** } + 386:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + 710 .loc 1 386 0 + 711 04a8 0320A0E3 mov r2, #3 + 712 04ac 002083E5 str r2, [r3, #0] + 387:src/dfu/dfu.c **** ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + 713 .loc 1 387 0 + 714 04b0 4129A0E3 mov r2, #1064960 + 715 04b4 54319FE5 ldr r3, .L143+4 + 716 04b8 120000EA b .L132 + 717 .L89: + 388:src/dfu/dfu.c **** ret = handle_dnload(val, len); + 389:src/dfu/dfu.c **** break; + 390:src/dfu/dfu.c **** case USB_REQ_DFU_UPLOAD: + 391:src/dfu/dfu.c **** ptr = (u_int8_t *) AT91C_IFLASH + SAM7DFU_SIZE; + 718 .loc 1 391 0 + 719 04bc 4C219FE5 ldr r2, .L143+4 + 720 04c0 4119A0E3 mov r1, #1064960 + 721 04c4 001082E5 str r1, [r2, #0] + 392:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuUPLOAD_IDLE; + 722 .loc 1 392 0 + 723 04c8 0920A0E3 mov r2, #9 + 724 04cc 002083E5 str r2, [r3, #0] + 393:src/dfu/dfu.c **** handle_upload(val, len); + 725 .loc 1 393 0 + 726 04d0 0400A0E1 mov r0, r4 + 727 .LVL51: + 728 04d4 2CFFFFEB bl handle_upload.clone.0 + 394:src/dfu/dfu.c **** break; + 729 .loc 1 394 0 + 730 04d8 480000EA b .L81 + 731 .LVL52: + 732 .L72: + 395:src/dfu/dfu.c **** case USB_REQ_DFU_ABORT: + 396:src/dfu/dfu.c **** /* no zlp? */ + 397:src/dfu/dfu.c **** ret = RET_ZLP; + 398:src/dfu/dfu.c **** break; + 399:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 400:src/dfu/dfu.c **** handle_getstatus(); + 401:src/dfu/dfu.c **** break; + 402:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 403:src/dfu/dfu.c **** handle_getstate(); + 404:src/dfu/dfu.c **** break; + 405:src/dfu/dfu.c **** default: + 406:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 407:src/dfu/dfu.c **** ret = RET_STALL; + 408:src/dfu/dfu.c **** goto out; + 409:src/dfu/dfu.c **** break; + 410:src/dfu/dfu.c **** } + 411:src/dfu/dfu.c **** break; + 412:src/dfu/dfu.c **** case DFU_STATE_dfuDNLOAD_SYNC: + 413:src/dfu/dfu.c **** switch (req) { + 414:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 415:src/dfu/dfu.c **** handle_getstatus(); + 416:src/dfu/dfu.c **** /* FIXME: state transition depending on block completeness */ + 417:src/dfu/dfu.c **** break; + 418:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 419:src/dfu/dfu.c **** handle_getstate(); + 420:src/dfu/dfu.c **** break; + 421:src/dfu/dfu.c **** default: + 422:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 423:src/dfu/dfu.c **** ret = RET_STALL; + 424:src/dfu/dfu.c **** goto out; + 425:src/dfu/dfu.c **** } + 426:src/dfu/dfu.c **** break; + 427:src/dfu/dfu.c **** case DFU_STATE_dfuDNBUSY: + 428:src/dfu/dfu.c **** switch (req) { + 429:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 430:src/dfu/dfu.c **** /* FIXME: only accept getstatus if bwPollTimeout + 431:src/dfu/dfu.c **** * has elapsed */ + 432:src/dfu/dfu.c **** handle_getstatus(); + 433:src/dfu/dfu.c **** break; + 434:src/dfu/dfu.c **** default: + 435:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 436:src/dfu/dfu.c **** ret = RET_STALL; + 437:src/dfu/dfu.c **** goto out; + 438:src/dfu/dfu.c **** } + 439:src/dfu/dfu.c **** break; + 440:src/dfu/dfu.c **** case DFU_STATE_dfuDNLOAD_IDLE: + 441:src/dfu/dfu.c **** switch (req) { + 733 .loc 1 441 0 + 734 04dc 011041E2 sub r1, r1, #1 + 735 .LVL53: + 736 04e0 050051E3 cmp r1, #5 + 737 04e4 01F19F97 ldrls pc, [pc, r1, asl #2] + 738 04e8 3B0000EA b .L131 + 739 .L104: + 740 04ec 04050000 .word .L100 + 741 04f0 DC050000 .word .L131 + 742 04f4 B8050000 .word .L135 + 743 04f8 DC050000 .word .L131 + 744 04fc C0050000 .word .L120 + 745 0500 94050000 .word .L115 + 746 .L100: + 442:src/dfu/dfu.c **** case USB_REQ_DFU_DNLOAD: + 443:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuDNLOAD_SYNC; + 747 .loc 1 443 0 + 748 0504 0320A0E3 mov r2, #3 + 749 .L132: + 750 .L66: + 751 0508 002083E5 str r2, [r3, #0] + 444:src/dfu/dfu.c **** ret = handle_dnload(val, len); + 752 .loc 1 444 0 + 753 050c 0400A0E1 mov r0, r4 + 754 .LVL54: + 755 0510 3AFFFFEB bl handle_dnload.clone.1 + 756 .LVL55: + 445:src/dfu/dfu.c **** break; + 446:src/dfu/dfu.c **** case USB_REQ_DFU_ABORT: + 447:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 448:src/dfu/dfu.c **** ret = RET_ZLP; + 449:src/dfu/dfu.c **** break; + 450:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 451:src/dfu/dfu.c **** handle_getstatus(); + 452:src/dfu/dfu.c **** break; + 453:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 454:src/dfu/dfu.c **** handle_getstate(); + 455:src/dfu/dfu.c **** break; + 456:src/dfu/dfu.c **** default: + 457:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 458:src/dfu/dfu.c **** ret = RET_STALL; + 459:src/dfu/dfu.c **** break; + 460:src/dfu/dfu.c **** } + 461:src/dfu/dfu.c **** break; + 462:src/dfu/dfu.c **** case DFU_STATE_dfuMANIFEST_SYNC: + 463:src/dfu/dfu.c **** switch (req) { + 464:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 465:src/dfu/dfu.c **** handle_getstatus(); + 466:src/dfu/dfu.c **** break; + 467:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 468:src/dfu/dfu.c **** handle_getstate(); + 469:src/dfu/dfu.c **** break; + 470:src/dfu/dfu.c **** default: + 471:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 472:src/dfu/dfu.c **** ret = RET_STALL; + 473:src/dfu/dfu.c **** break; + 474:src/dfu/dfu.c **** } + 475:src/dfu/dfu.c **** break; + 476:src/dfu/dfu.c **** case DFU_STATE_dfuMANIFEST: + 477:src/dfu/dfu.c **** switch (req) { + 478:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 479:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 480:src/dfu/dfu.c **** handle_getstatus(); + 481:src/dfu/dfu.c **** break; + 482:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 483:src/dfu/dfu.c **** handle_getstate(); + 484:src/dfu/dfu.c **** break; + 485:src/dfu/dfu.c **** default: + 486:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 487:src/dfu/dfu.c **** ret = RET_STALL; + 488:src/dfu/dfu.c **** break; + 489:src/dfu/dfu.c **** } + 490:src/dfu/dfu.c **** break; + 491:src/dfu/dfu.c **** case DFU_STATE_dfuMANIFEST_WAIT_RST: + 492:src/dfu/dfu.c **** /* we should never go here */ + 493:src/dfu/dfu.c **** break; + 494:src/dfu/dfu.c **** case DFU_STATE_dfuUPLOAD_IDLE: + 495:src/dfu/dfu.c **** switch (req) { + 496:src/dfu/dfu.c **** case USB_REQ_DFU_UPLOAD: + 497:src/dfu/dfu.c **** /* state transition if less data then requested */ + 498:src/dfu/dfu.c **** rc = handle_upload(val, len); + 499:src/dfu/dfu.c **** if (rc >= 0 && rc < len) + 500:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 501:src/dfu/dfu.c **** break; + 502:src/dfu/dfu.c **** case USB_REQ_DFU_ABORT: + 503:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 504:src/dfu/dfu.c **** /* no zlp? */ + 505:src/dfu/dfu.c **** ret = RET_ZLP; + 506:src/dfu/dfu.c **** break; + 507:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 508:src/dfu/dfu.c **** handle_getstatus(); + 509:src/dfu/dfu.c **** break; + 510:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 511:src/dfu/dfu.c **** handle_getstate(); + 512:src/dfu/dfu.c **** break; + 513:src/dfu/dfu.c **** default: + 514:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 515:src/dfu/dfu.c **** ret = RET_STALL; + 516:src/dfu/dfu.c **** break; + 517:src/dfu/dfu.c **** } + 518:src/dfu/dfu.c **** break; + 519:src/dfu/dfu.c **** case DFU_STATE_dfuERROR: + 520:src/dfu/dfu.c **** switch (req) { + 521:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATUS: + 522:src/dfu/dfu.c **** handle_getstatus(); + 523:src/dfu/dfu.c **** break; + 524:src/dfu/dfu.c **** case USB_REQ_DFU_GETSTATE: + 525:src/dfu/dfu.c **** handle_getstate(); + 526:src/dfu/dfu.c **** break; + 527:src/dfu/dfu.c **** case USB_REQ_DFU_CLRSTATUS: + 528:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 529:src/dfu/dfu.c **** dfu_status = DFU_STATUS_OK; + 530:src/dfu/dfu.c **** /* no zlp? */ + 531:src/dfu/dfu.c **** ret = RET_ZLP; + 532:src/dfu/dfu.c **** break; + 533:src/dfu/dfu.c **** default: + 534:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 535:src/dfu/dfu.c **** ret = RET_STALL; + 536:src/dfu/dfu.c **** break; + 537:src/dfu/dfu.c **** } + 538:src/dfu/dfu.c **** break; + 539:src/dfu/dfu.c **** } + 540:src/dfu/dfu.c **** + 541:src/dfu/dfu.c **** out: + 542:src/dfu/dfu.c **** DEBUGE("new_state = %u\r\n", dfu_state); + 543:src/dfu/dfu.c **** + 544:src/dfu/dfu.c **** switch (ret) { + 757 .loc 1 544 0 + 758 0514 010050E3 cmp r0, #1 + 759 0518 3200001A bne .L142 + 760 051c 340000EA b .L121 + 761 .LVL56: + 762 .L73: + 463:src/dfu/dfu.c **** switch (req) { + 763 .loc 1 463 0 + 764 0520 030051E3 cmp r1, #3 + 765 0524 0200001A bne .L139 + 766 0528 220000EA b .L135 + 767 .L74: + 477:src/dfu/dfu.c **** switch (req) { + 768 .loc 1 477 0 + 769 052c 030051E3 cmp r1, #3 + 770 0530 0200000A beq .L109 + 771 .L139: + 772 0534 050051E3 cmp r1, #5 + 773 0538 2700001A bne .L131 + 774 053c 1F0000EA b .L120 + 775 .L109: + 479:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 776 .loc 1 479 0 + 777 0540 0220A0E3 mov r2, #2 + 778 0544 002083E5 str r2, [r3, #0] + 779 0548 1A0000EA b .L135 + 780 .L75: + 495:src/dfu/dfu.c **** switch (req) { + 781 .loc 1 495 0 + 782 054c 021041E2 sub r1, r1, #2 + 783 .LVL57: + 784 0550 040051E3 cmp r1, #4 + 785 0554 01F19F97 ldrls pc, [pc, r1, asl #2] + 786 0558 1F0000EA b .L131 + 787 .L116: + 788 055c 70050000 .word .L112 + 789 0560 B8050000 .word .L135 + 790 0564 DC050000 .word .L131 + 791 0568 C0050000 .word .L120 + 792 056c 94050000 .word .L115 + 793 .L112: + 498:src/dfu/dfu.c **** rc = handle_upload(val, len); + 794 .loc 1 498 0 + 795 0570 0400A0E1 mov r0, r4 + 796 .LVL58: + 797 0574 04FFFFEB bl handle_upload.clone.0 + 798 .LVL59: + 499:src/dfu/dfu.c **** if (rc >= 0 && rc < len) + 799 .loc 1 499 0 + 800 0578 000050E3 cmp r0, #0 + 801 057c 1F0000BA blt .L81 + 499:src/dfu/dfu.c **** if (rc >= 0 && rc < len) + 802 .loc 1 499 0 is_stmt 0 discriminator 1 + 803 0580 040050E1 cmp r0, r4 + 500:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 804 .loc 1 500 0 is_stmt 1 + 805 0584 80309FB5 ldrlt r3, .L143 + 806 0588 0220A0B3 movlt r2, #2 + 807 058c 002083B5 strlt r2, [r3, #0] + 808 0590 1A0000EA b .L81 + 809 .LVL60: + 810 .L115: + 503:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 811 .loc 1 503 0 + 812 0594 0220A0E3 mov r2, #2 + 813 .L133: + 814 0598 002083E5 str r2, [r3, #0] + 815 .LVL61: + 506:src/dfu/dfu.c **** break; + 816 .loc 1 506 0 + 817 059c 140000EA b .L121 + 818 .LVL62: + 819 .L76: + 520:src/dfu/dfu.c **** switch (req) { + 820 .loc 1 520 0 + 821 05a0 040051E3 cmp r1, #4 + 822 05a4 0700000A beq .L119 + 823 05a8 050051E3 cmp r1, #5 + 824 05ac 0300000A beq .L120 + 825 .L137: + 826 05b0 030051E3 cmp r1, #3 + 827 05b4 0800001A bne .L131 + 828 .LVL63: + 829 .L135: + 522:src/dfu/dfu.c **** handle_getstatus(); + 830 .loc 1 522 0 + 831 05b8 65FFFFEB bl handle_getstatus + 832 .LVL64: + 523:src/dfu/dfu.c **** break; + 833 .loc 1 523 0 + 834 05bc 0F0000EA b .L81 + 835 .LVL65: + 836 .L120: + 525:src/dfu/dfu.c **** handle_getstate(); + 837 .loc 1 525 0 + 838 05c0 E7FEFFEB bl handle_getstate + 839 .LVL66: + 526:src/dfu/dfu.c **** break; + 840 .loc 1 526 0 + 841 05c4 0D0000EA b .L81 + 842 .LVL67: + 843 .L119: + 528:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 844 .loc 1 528 0 + 845 05c8 0220A0E3 mov r2, #2 + 846 05cc 002083E5 str r2, [r3, #0] + 529:src/dfu/dfu.c **** dfu_status = DFU_STATUS_OK; + 847 .loc 1 529 0 + 848 05d0 0020A0E3 mov r2, #0 + 849 05d4 0420C3E5 strb r2, [r3, #4] + 850 .LVL68: + 851 05d8 050000EA b .L121 + 852 .LVL69: + 853 .L131: + 534:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuERROR; + 854 .loc 1 534 0 + 855 05dc 0A20A0E3 mov r2, #10 + 856 .L134: + 857 05e0 002083E5 str r2, [r3, #0] + 858 .LVL70: + 859 05e4 040000EA b .L122 + 860 .LVL71: + 861 .L142: + 862 .loc 1 544 0 + 863 05e8 020050E3 cmp r0, #2 + 864 05ec 0300001A bne .L81 + 865 05f0 010000EA b .L122 + 866 .LVL72: + 867 .L121: + 545:src/dfu/dfu.c **** case RET_NOTHING: + 546:src/dfu/dfu.c **** break; + 547:src/dfu/dfu.c **** case RET_ZLP: + 548:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 868 .loc 1 548 0 + 869 05f4 B8FEFFEB bl udp_ep0_send_zlp + 549:src/dfu/dfu.c **** break; + 870 .loc 1 549 0 + 871 05f8 000000EA b .L81 + 872 .L122: + 550:src/dfu/dfu.c **** case RET_STALL: + 551:src/dfu/dfu.c **** udp_ep0_send_stall(); + 873 .loc 1 551 0 + 874 05fc C7FEFFEB bl udp_ep0_send_stall + 875 .L81: + 552:src/dfu/dfu.c **** break; + 553:src/dfu/dfu.c **** } + 554:src/dfu/dfu.c **** return 0; + 555:src/dfu/dfu.c **** } + 876 .loc 1 555 0 + 877 0600 0000A0E3 mov r0, #0 + 878 0604 1040BDE8 ldmfd sp!, {r4, lr} + 879 0608 1EFF2FE1 bx lr + 880 .L144: + 881 .align 2 + 882 .L143: + 883 060c 00000000 .word .LANCHOR0 + 884 0610 00000000 .word .LANCHOR1 + 885 .cfi_endproc + 886 .LFE288: + 888 .align 2 + 890 AT91F_PIO_CfgOutput.clone.5: + 891 .LFB299: + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 892 .loc 2 400 0 + 893 .cfi_startproc + 894 @ Function supports interworking. + 895 @ args = 0, pretend = 0, frame = 0 + 896 @ frame_needed = 0, uses_anonymous_args = 0 + 897 @ link register save eliminated. + 898 .LVL73: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 899 .loc 2 404 0 + 900 0614 0B3CE0E3 mvn r3, #2816 + 901 0618 FF0003E5 str r0, [r3, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 902 .loc 2 405 0 + 903 061c EF0003E5 str r0, [r3, #-239] + 406:include/lib_AT91SAM7.h **** } + 904 .loc 2 406 0 + 905 0620 1EFF2FE1 bx lr + 906 .cfi_endproc + 907 .LFE299: + 909 .align 2 + 911 udp_init: + 912 .LFB278: + 73:src/dfu/dfu.c **** { + 913 .loc 1 73 0 + 914 .cfi_startproc + 915 @ Function supports interworking. + 916 @ args = 0, pretend = 0, frame = 0 + 917 @ frame_needed = 0, uses_anonymous_args = 0 + 75:src/dfu/dfu.c **** AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + 918 .loc 1 75 0 + 919 0624 033CE0E3 mvn r3, #768 + 920 0628 D32013E5 ldr r2, [r3, #-211] + 921 062c 012282E3 orr r2, r2, #268435456 + 73:src/dfu/dfu.c **** { + 922 .loc 1 73 0 + 923 0630 10402DE9 stmfd sp!, {r4, lr} + 924 .LCFI6: + 925 .cfi_def_cfa_offset 8 + 75:src/dfu/dfu.c **** AT91C_BASE_CKGR->CKGR_PLLR |= AT91C_CKGR_USBDIV_1; + 926 .loc 1 75 0 + 927 0634 D32003E5 str r2, [r3, #-211] + 78:src/dfu/dfu.c **** AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP; + 928 .loc 1 78 0 + 929 0638 8020A0E3 mov r2, #128 + 930 063c FF2003E5 str r2, [r3, #-255] + 79:src/dfu/dfu.c **** AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_UDP); + 931 .loc 1 79 0 + 932 0640 1E2D82E2 add r2, r2, #1920 + 933 0644 EF2003E5 str r2, [r3, #-239] + 84:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 934 .loc 1 84 0 + 935 0648 0105A0E3 mov r0, #4194304 + 936 .cfi_offset 14, -4 + 937 .cfi_offset 4, -8 + 938 064c F0FFFFEB bl AT91F_PIO_CfgOutput.clone.5 + 86:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 939 .loc 1 86 0 + 940 0650 0108A0E3 mov r0, #65536 + 87:src/dfu/dfu.c **** } + 941 .loc 1 87 0 + 942 0654 1040BDE8 ldmfd sp!, {r4, lr} + 86:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 943 .loc 1 86 0 + 944 0658 EDFFFFEA b AT91F_PIO_CfgOutput.clone.5 + 945 .cfi_endproc + 946 .LFE278: + 948 .align 2 + 950 AT91F_PIO_SetOutput.clone.6: + 951 .LFB298: + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 952 .loc 2 501 0 + 953 .cfi_startproc + 954 @ Function supports interworking. + 955 @ args = 0, pretend = 0, frame = 0 + 956 @ frame_needed = 0, uses_anonymous_args = 0 + 957 @ link register save eliminated. + 958 .LVL74: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 959 .loc 2 505 0 + 960 065c 0B3CE0E3 mvn r3, #2816 + 961 0660 CF0003E5 str r0, [r3, #-207] + 506:include/lib_AT91SAM7.h **** } + 962 .loc 2 506 0 + 963 0664 1EFF2FE1 bx lr + 964 .cfi_endproc + 965 .LFE298: + 967 .align 2 + 969 AT91F_PIO_ClearOutput.clone.7: + 970 .LFB297: + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 971 .loc 2 512 0 + 972 .cfi_startproc + 973 @ Function supports interworking. + 974 @ args = 0, pretend = 0, frame = 0 + 975 @ frame_needed = 0, uses_anonymous_args = 0 + 976 @ link register save eliminated. + 977 .LVL75: + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 978 .loc 2 516 0 + 979 0668 0B3CE0E3 mvn r3, #2816 + 980 066c CB0003E5 str r0, [r3, #-203] + 517:include/lib_AT91SAM7.h **** } + 981 .loc 2 517 0 + 982 0670 1EFF2FE1 bx lr + 983 .cfi_endproc + 984 .LFE297: + 986 .align 2 + 988 AT91F_RSTSoftReset.clone.8: + 989 .LFB296: +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( + 990 .loc 2 1189 0 + 991 .cfi_startproc + 992 @ Function supports interworking. + 993 @ args = 0, pretend = 0, frame = 0 + 994 @ frame_needed = 0, uses_anonymous_args = 0 + 995 @ link register save eliminated. + 996 .LVL76: +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); + 997 .loc 2 1193 0 + 998 0674 08209FE5 ldr r2, .L150 + 999 0678 023CE0E3 mvn r3, #512 + 1000 067c FF2003E5 str r2, [r3, #-255] +1194:include/lib_AT91SAM7.h **** } + 1001 .loc 2 1194 0 + 1002 0680 1EFF2FE1 bx lr + 1003 .L151: + 1004 .align 2 + 1005 .L150: + 1006 0684 0D0000A5 .word -1526726643 + 1007 .cfi_endproc + 1008 .LFE296: + 1010 .align 2 + 1012 dfu_udp_irq: + 1013 .LFB290: + 556:src/dfu/dfu.c **** + 557:src/dfu/dfu.c **** static u_int8_t cur_config; + 558:src/dfu/dfu.c **** + 559:src/dfu/dfu.c **** /* USB DFU Device descriptor in DFU mode */ + 560:src/dfu/dfu.c **** __dfustruct const struct usb_device_descriptor dfu_dev_descriptor = { + 561:src/dfu/dfu.c **** .bLength = USB_DT_DEVICE_SIZE, + 562:src/dfu/dfu.c **** .bDescriptorType = USB_DT_DEVICE, + 563:src/dfu/dfu.c **** .bcdUSB = 0x0100, + 564:src/dfu/dfu.c **** .bDeviceClass = 0x00, + 565:src/dfu/dfu.c **** .bDeviceSubClass = 0x00, + 566:src/dfu/dfu.c **** .bDeviceProtocol = 0x00, + 567:src/dfu/dfu.c **** .bMaxPacketSize0 = 8, + 568:src/dfu/dfu.c **** .idVendor = USB_VENDOR_ID, + 569:src/dfu/dfu.c **** .idProduct = USB_PRODUCT_ID, + 570:src/dfu/dfu.c **** .bcdDevice = 0x0000, + 571:src/dfu/dfu.c **** #ifdef CONFIG_USB_STRING + 572:src/dfu/dfu.c **** .iManufacturer = 1, + 573:src/dfu/dfu.c **** .iProduct = 2, + 574:src/dfu/dfu.c **** #else + 575:src/dfu/dfu.c **** .iManufacturer = 0, + 576:src/dfu/dfu.c **** .iProduct = 0, + 577:src/dfu/dfu.c **** #endif + 578:src/dfu/dfu.c **** .iSerialNumber = 0x00, + 579:src/dfu/dfu.c **** .bNumConfigurations = 0x01, + 580:src/dfu/dfu.c **** }; + 581:src/dfu/dfu.c **** + 582:src/dfu/dfu.c **** /* USB DFU Config descriptor in DFU mode */ + 583:src/dfu/dfu.c **** __dfustruct const struct _dfu_desc dfu_cfg_descriptor = { + 584:src/dfu/dfu.c **** .ucfg = { + 585:src/dfu/dfu.c **** .bLength = USB_DT_CONFIG_SIZE, + 586:src/dfu/dfu.c **** .bDescriptorType = USB_DT_CONFIG, + 587:src/dfu/dfu.c **** .wTotalLength = USB_DT_CONFIG_SIZE + + 588:src/dfu/dfu.c **** 2* USB_DT_INTERFACE_SIZE + + 589:src/dfu/dfu.c **** USB_DT_DFU_SIZE, + 590:src/dfu/dfu.c **** .bNumInterfaces = 1, + 591:src/dfu/dfu.c **** .bConfigurationValue = 1, + 592:src/dfu/dfu.c **** #ifdef CONFIG_USB_STRING + 593:src/dfu/dfu.c **** .iConfiguration = 3, + 594:src/dfu/dfu.c **** #else + 595:src/dfu/dfu.c **** .iConfiguration = 0, + 596:src/dfu/dfu.c **** #endif + 597:src/dfu/dfu.c **** .bmAttributes = USB_CONFIG_ATT_ONE, + 598:src/dfu/dfu.c **** .bMaxPower = 100, + 599:src/dfu/dfu.c **** }, + 600:src/dfu/dfu.c **** .uif[0] = { + 601:src/dfu/dfu.c **** .bLength = USB_DT_INTERFACE_SIZE, + 602:src/dfu/dfu.c **** .bDescriptorType = USB_DT_INTERFACE, + 603:src/dfu/dfu.c **** .bInterfaceNumber = 0x00, + 604:src/dfu/dfu.c **** .bAlternateSetting = 0x00, + 605:src/dfu/dfu.c **** .bNumEndpoints = 0x00, + 606:src/dfu/dfu.c **** .bInterfaceClass = 0xfe, + 607:src/dfu/dfu.c **** .bInterfaceSubClass = 0x01, + 608:src/dfu/dfu.c **** .bInterfaceProtocol = 0x02, + 609:src/dfu/dfu.c **** #ifdef CONFIG_USB_STRING + 610:src/dfu/dfu.c **** .iInterface = 4, + 611:src/dfu/dfu.c **** #else + 612:src/dfu/dfu.c **** .iInterface = 0, + 613:src/dfu/dfu.c **** #endif + 614:src/dfu/dfu.c **** }, + 615:src/dfu/dfu.c **** .uif[1] = { + 616:src/dfu/dfu.c **** .bLength = USB_DT_INTERFACE_SIZE, + 617:src/dfu/dfu.c **** .bDescriptorType = USB_DT_INTERFACE, + 618:src/dfu/dfu.c **** .bInterfaceNumber = 0x00, + 619:src/dfu/dfu.c **** .bAlternateSetting = 0x01, + 620:src/dfu/dfu.c **** .bNumEndpoints = 0x00, + 621:src/dfu/dfu.c **** .bInterfaceClass = 0xfe, + 622:src/dfu/dfu.c **** .bInterfaceSubClass = 0x01, + 623:src/dfu/dfu.c **** .bInterfaceProtocol = 0x02, + 624:src/dfu/dfu.c **** #ifdef CONFIG_USB_STRING + 625:src/dfu/dfu.c **** .iInterface = 5, + 626:src/dfu/dfu.c **** #else + 627:src/dfu/dfu.c **** .iInterface = 0, + 628:src/dfu/dfu.c **** #endif + 629:src/dfu/dfu.c **** }, + 630:src/dfu/dfu.c **** + 631:src/dfu/dfu.c **** .func_dfu = DFU_FUNC_DESC, + 632:src/dfu/dfu.c **** }; + 633:src/dfu/dfu.c **** + 634:src/dfu/dfu.c **** + 635:src/dfu/dfu.c **** /* minimal USB EP0 handler in DFU mode */ + 636:src/dfu/dfu.c **** static __dfufunc void dfu_udp_ep0_handler(void) + 637:src/dfu/dfu.c **** { + 638:src/dfu/dfu.c **** AT91PS_UDP pUDP = AT91C_BASE_UDP; + 639:src/dfu/dfu.c **** u_int8_t bmRequestType, bRequest; + 640:src/dfu/dfu.c **** u_int16_t wValue, wIndex, wLength, wStatus; + 641:src/dfu/dfu.c **** u_int32_t csr = pUDP->UDP_CSR[0]; + 642:src/dfu/dfu.c **** + 643:src/dfu/dfu.c **** DEBUGE("CSR=0x%04x ", csr); + 644:src/dfu/dfu.c **** + 645:src/dfu/dfu.c **** if (csr & AT91C_UDP_STALLSENT) { + 646:src/dfu/dfu.c **** DEBUGE("ACK_STALLSENT "); + 647:src/dfu/dfu.c **** pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + 648:src/dfu/dfu.c **** } + 649:src/dfu/dfu.c **** + 650:src/dfu/dfu.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 651:src/dfu/dfu.c **** DEBUGE("ACK_BANK0 "); + 652:src/dfu/dfu.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + 653:src/dfu/dfu.c **** } + 654:src/dfu/dfu.c **** + 655:src/dfu/dfu.c **** if (!(csr & AT91C_UDP_RXSETUP)) { + 656:src/dfu/dfu.c **** DEBUGE("no setup packet\r\n"); + 657:src/dfu/dfu.c **** return; + 658:src/dfu/dfu.c **** } + 659:src/dfu/dfu.c **** + 660:src/dfu/dfu.c **** DEBUGE("len=%d ", csr >> 16); + 661:src/dfu/dfu.c **** if (csr >> 16 == 0) { + 662:src/dfu/dfu.c **** DEBUGE("empty packet\r\n"); + 663:src/dfu/dfu.c **** return; + 664:src/dfu/dfu.c **** } + 665:src/dfu/dfu.c **** + 666:src/dfu/dfu.c **** bmRequestType = pUDP->UDP_FDR[0]; + 667:src/dfu/dfu.c **** bRequest = pUDP->UDP_FDR[0]; + 668:src/dfu/dfu.c **** wValue = (pUDP->UDP_FDR[0] & 0xFF); + 669:src/dfu/dfu.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 670:src/dfu/dfu.c **** wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 671:src/dfu/dfu.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 672:src/dfu/dfu.c **** wLength = (pUDP->UDP_FDR[0] & 0xFF); + 673:src/dfu/dfu.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 674:src/dfu/dfu.c **** + 675:src/dfu/dfu.c **** DEBUGE("bmRequestType=0x%2x ", bmRequestType); + 676:src/dfu/dfu.c **** + 677:src/dfu/dfu.c **** if (bmRequestType & 0x80) { + 678:src/dfu/dfu.c **** DEBUGE("DATA_IN=1 "); + 679:src/dfu/dfu.c **** pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 680:src/dfu/dfu.c **** while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 681:src/dfu/dfu.c **** } + 682:src/dfu/dfu.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + 683:src/dfu/dfu.c **** while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + 684:src/dfu/dfu.c **** + 685:src/dfu/dfu.c **** /* Handle supported standard device request Cf Table 9-3 in USB + 686:src/dfu/dfu.c **** * speciication Rev 1.1 */ + 687:src/dfu/dfu.c **** switch ((bRequest << 8) | bmRequestType) { + 688:src/dfu/dfu.c **** u_int8_t desc_type, desc_index; + 689:src/dfu/dfu.c **** case STD_GET_DESCRIPTOR: + 690:src/dfu/dfu.c **** DEBUGE("GET_DESCRIPTOR "); + 691:src/dfu/dfu.c **** desc_type = wValue >> 8; + 692:src/dfu/dfu.c **** desc_index = wValue & 0xff; + 693:src/dfu/dfu.c **** switch (desc_type) { + 694:src/dfu/dfu.c **** case USB_DT_DEVICE: + 695:src/dfu/dfu.c **** /* Return Device Descriptor */ + 696:src/dfu/dfu.c **** udp_ep0_send_data((const char *) + 697:src/dfu/dfu.c **** &dfu_dev_descriptor, + 698:src/dfu/dfu.c **** MIN(sizeof(dfu_dev_descriptor), + 699:src/dfu/dfu.c **** wLength)); + 700:src/dfu/dfu.c **** break; + 701:src/dfu/dfu.c **** case USB_DT_CONFIG: + 702:src/dfu/dfu.c **** /* Return Configuration Descriptor */ + 703:src/dfu/dfu.c **** udp_ep0_send_data((const char *) + 704:src/dfu/dfu.c **** &dfu_cfg_descriptor, + 705:src/dfu/dfu.c **** MIN(sizeof(dfu_cfg_descriptor), + 706:src/dfu/dfu.c **** wLength)); + 707:src/dfu/dfu.c **** break; + 708:src/dfu/dfu.c **** case USB_DT_STRING: + 709:src/dfu/dfu.c **** /* Return String Descriptor */ + 710:src/dfu/dfu.c **** if (desc_index > ARRAY_SIZE(usb_strings)) { + 711:src/dfu/dfu.c **** udp_ep0_send_stall(); + 712:src/dfu/dfu.c **** break; + 713:src/dfu/dfu.c **** } + 714:src/dfu/dfu.c **** DEBUGE("bLength=%u, wLength=%u ", + 715:src/dfu/dfu.c **** usb_strings[desc_index]->bLength, wLength); + 716:src/dfu/dfu.c **** udp_ep0_send_data((const char *) usb_strings[desc_index], + 717:src/dfu/dfu.c **** MIN(usb_strings[desc_index]->bLength, + 718:src/dfu/dfu.c **** wLength)); + 719:src/dfu/dfu.c **** break; + 720:src/dfu/dfu.c **** case USB_DT_CS_DEVICE: + 721:src/dfu/dfu.c **** /* Return Function descriptor */ + 722:src/dfu/dfu.c **** udp_ep0_send_data((const char *) &dfu_cfg_descriptor.func_dfu, + 723:src/dfu/dfu.c **** MIN(sizeof(dfu_cfg_descriptor.func_dfu), + 724:src/dfu/dfu.c **** wLength)); + 725:src/dfu/dfu.c **** break; + 726:src/dfu/dfu.c **** default: + 727:src/dfu/dfu.c **** udp_ep0_send_stall(); + 728:src/dfu/dfu.c **** break; + 729:src/dfu/dfu.c **** } + 730:src/dfu/dfu.c **** break; + 731:src/dfu/dfu.c **** case STD_SET_ADDRESS: + 732:src/dfu/dfu.c **** DEBUGE("SET_ADDRESS "); + 733:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 734:src/dfu/dfu.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 735:src/dfu/dfu.c **** pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + 736:src/dfu/dfu.c **** break; + 737:src/dfu/dfu.c **** case STD_SET_CONFIGURATION: + 738:src/dfu/dfu.c **** DEBUGE("SET_CONFIG "); + 739:src/dfu/dfu.c **** if (wValue) + 740:src/dfu/dfu.c **** DEBUGE("VALUE!=0 "); + 741:src/dfu/dfu.c **** cur_config = wValue; + 742:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 743:src/dfu/dfu.c **** pUDP->UDP_GLBSTATE = + 744:src/dfu/dfu.c **** (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + 745:src/dfu/dfu.c **** pUDP->UDP_CSR[1] = + 746:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 747:src/dfu/dfu.c **** 0; + 748:src/dfu/dfu.c **** pUDP->UDP_CSR[2] = + 749:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + 750:src/dfu/dfu.c **** pUDP->UDP_CSR[3] = + 751:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN) : 0; + 752:src/dfu/dfu.c **** pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + 753:src/dfu/dfu.c **** AT91C_UDP_EPINT2|AT91C_UDP_EPINT3); + 754:src/dfu/dfu.c **** break; + 755:src/dfu/dfu.c **** case STD_GET_CONFIGURATION: + 756:src/dfu/dfu.c **** DEBUGE("GET_CONFIG "); + 757:src/dfu/dfu.c **** udp_ep0_send_data((char *)&(cur_config), + 758:src/dfu/dfu.c **** sizeof(cur_config)); + 759:src/dfu/dfu.c **** break; + 760:src/dfu/dfu.c **** case STD_GET_STATUS_ZERO: + 761:src/dfu/dfu.c **** DEBUGE("GET_STATUS_ZERO "); + 762:src/dfu/dfu.c **** wStatus = 0; + 763:src/dfu/dfu.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 764:src/dfu/dfu.c **** break; + 765:src/dfu/dfu.c **** case STD_GET_STATUS_INTERFACE: + 766:src/dfu/dfu.c **** DEBUGE("GET_STATUS_INTERFACE "); + 767:src/dfu/dfu.c **** wStatus = 0; + 768:src/dfu/dfu.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 769:src/dfu/dfu.c **** break; + 770:src/dfu/dfu.c **** case STD_GET_STATUS_ENDPOINT: + 771:src/dfu/dfu.c **** DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + 772:src/dfu/dfu.c **** wStatus = 0; + 773:src/dfu/dfu.c **** wIndex &= 0x0F; + 774:src/dfu/dfu.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 775:src/dfu/dfu.c **** wStatus = + 776:src/dfu/dfu.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 777:src/dfu/dfu.c **** udp_ep0_send_data((char *)&wStatus, + 778:src/dfu/dfu.c **** sizeof(wStatus)); + 779:src/dfu/dfu.c **** } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 780:src/dfu/dfu.c **** && (wIndex == 0)) { + 781:src/dfu/dfu.c **** wStatus = + 782:src/dfu/dfu.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 783:src/dfu/dfu.c **** udp_ep0_send_data((char *)&wStatus, + 784:src/dfu/dfu.c **** sizeof(wStatus)); + 785:src/dfu/dfu.c **** } else + 786:src/dfu/dfu.c **** udp_ep0_send_stall(); + 787:src/dfu/dfu.c **** break; + 788:src/dfu/dfu.c **** case STD_SET_FEATURE_ZERO: + 789:src/dfu/dfu.c **** DEBUGE("SET_FEATURE_ZERO "); + 790:src/dfu/dfu.c **** udp_ep0_send_stall(); + 791:src/dfu/dfu.c **** break; + 792:src/dfu/dfu.c **** case STD_SET_FEATURE_INTERFACE: + 793:src/dfu/dfu.c **** DEBUGE("SET_FEATURE_INTERFACE "); + 794:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 795:src/dfu/dfu.c **** break; + 796:src/dfu/dfu.c **** case STD_SET_FEATURE_ENDPOINT: + 797:src/dfu/dfu.c **** DEBUGE("SET_FEATURE_ENDPOINT "); + 798:src/dfu/dfu.c **** udp_ep0_send_stall(); + 799:src/dfu/dfu.c **** break; + 800:src/dfu/dfu.c **** case STD_CLEAR_FEATURE_ZERO: + 801:src/dfu/dfu.c **** DEBUGE("CLEAR_FEATURE_ZERO "); + 802:src/dfu/dfu.c **** udp_ep0_send_stall(); + 803:src/dfu/dfu.c **** break; + 804:src/dfu/dfu.c **** case STD_CLEAR_FEATURE_INTERFACE: + 805:src/dfu/dfu.c **** DEBUGE("CLEAR_FEATURE_INTERFACE "); + 806:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 807:src/dfu/dfu.c **** break; + 808:src/dfu/dfu.c **** case STD_CLEAR_FEATURE_ENDPOINT: + 809:src/dfu/dfu.c **** DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + 810:src/dfu/dfu.c **** udp_ep0_send_stall(); + 811:src/dfu/dfu.c **** break; + 812:src/dfu/dfu.c **** case STD_SET_INTERFACE: + 813:src/dfu/dfu.c **** DEBUGE("SET INTERFACE "); + 814:src/dfu/dfu.c **** /* FIXME: store the interface number somewhere, once + 815:src/dfu/dfu.c **** * we need to support DFU flashing DFU */ + 816:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 817:src/dfu/dfu.c **** break; + 818:src/dfu/dfu.c **** default: + 819:src/dfu/dfu.c **** DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + 820:src/dfu/dfu.c **** bRequest, bmRequestType); + 821:src/dfu/dfu.c **** if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + 822:src/dfu/dfu.c **** dfu_ep0_handler(bmRequestType, bRequest, + 823:src/dfu/dfu.c **** wValue, wLength); + 824:src/dfu/dfu.c **** } else + 825:src/dfu/dfu.c **** udp_ep0_send_stall(); + 826:src/dfu/dfu.c **** break; + 827:src/dfu/dfu.c **** } + 828:src/dfu/dfu.c **** DEBUGE("\r\n"); + 829:src/dfu/dfu.c **** } + 830:src/dfu/dfu.c **** + 831:src/dfu/dfu.c **** /* minimal USB IRQ handler in DFU mode */ + 832:src/dfu/dfu.c **** static __dfufunc void dfu_udp_irq(void) + 833:src/dfu/dfu.c **** { + 1014 .loc 1 833 0 + 1015 .cfi_startproc + 1016 @ Function supports interworking. + 1017 @ args = 0, pretend = 0, frame = 8 + 1018 @ frame_needed = 0, uses_anonymous_args = 0 + 1019 .LVL77: + 1020 0688 37402DE9 stmfd sp!, {r0, r1, r2, r4, r5, lr} + 1021 .LCFI7: + 1022 .cfi_def_cfa_offset 24 + 834:src/dfu/dfu.c **** AT91PS_UDP pUDP = AT91C_BASE_UDP; + 835:src/dfu/dfu.c **** AT91_REG isr = pUDP->UDP_ISR; + 1023 .loc 1 835 0 + 1024 068c 84439FE5 ldr r4, .L209 + 1025 .cfi_offset 14, -4 + 1026 .cfi_offset 5, -8 + 1027 .cfi_offset 4, -12 + 1028 .cfi_offset 2, -16 + 1029 .cfi_offset 1, -20 + 1030 .cfi_offset 0, -24 + 1031 0690 E33014E5 ldr r3, [r4, #-227] + 1032 .LVL78: + 836:src/dfu/dfu.c **** led1on(); + 1033 .loc 1 836 0 + 1034 0694 0204A0E3 mov r0, #33554432 + 835:src/dfu/dfu.c **** AT91_REG isr = pUDP->UDP_ISR; + 1035 .loc 1 835 0 + 1036 0698 00308DE5 str r3, [sp, #0] + 1037 .loc 1 836 0 + 1038 069c F1FFFFEB bl AT91F_PIO_ClearOutput.clone.7 + 1039 .LVL79: + 837:src/dfu/dfu.c **** + 838:src/dfu/dfu.c **** if (isr & AT91C_UDP_ENDBUSRES) { + 1040 .loc 1 838 0 + 1041 06a0 00309DE5 ldr r3, [sp, #0] + 1042 06a4 010A13E3 tst r3, #4096 + 1043 06a8 1200000A beq .L153 + 839:src/dfu/dfu.c **** led2on(); + 1044 .loc 1 839 0 + 1045 06ac 0103A0E3 mov r0, #67108864 + 1046 06b0 ECFFFFEB bl AT91F_PIO_ClearOutput.clone.7 + 840:src/dfu/dfu.c **** pUDP->UDP_IER = AT91C_UDP_EPINT0; + 1047 .loc 1 840 0 + 1048 06b4 0130A0E3 mov r3, #1 + 1049 06b8 EF3004E5 str r3, [r4, #-239] + 841:src/dfu/dfu.c **** /* reset all endpoints */ + 842:src/dfu/dfu.c **** pUDP->UDP_RSTEP = (unsigned int)-1; + 1050 .loc 1 842 0 + 1051 06bc 0030E0E3 mvn r3, #0 + 1052 06c0 D73004E5 str r3, [r4, #-215] + 843:src/dfu/dfu.c **** pUDP->UDP_RSTEP = 0; + 844:src/dfu/dfu.c **** /* Enable the function */ + 845:src/dfu/dfu.c **** pUDP->UDP_FADDR = AT91C_UDP_FEN; + 1053 .loc 1 845 0 + 1054 06c4 012CA0E3 mov r2, #256 + 843:src/dfu/dfu.c **** pUDP->UDP_RSTEP = 0; + 1055 .loc 1 843 0 + 1056 06c8 013083E2 add r3, r3, #1 + 1057 06cc D73004E5 str r3, [r4, #-215] + 1058 .loc 1 845 0 + 1059 06d0 F72004E5 str r2, [r4, #-247] + 846:src/dfu/dfu.c **** /* Configure endpoint 0 */ + 847:src/dfu/dfu.c **** pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 1060 .loc 1 847 0 + 1061 06d4 7F2C82E2 add r2, r2, #32512 + 1062 06d8 CF2004E5 str r2, [r4, #-207] + 848:src/dfu/dfu.c **** cur_config = 0; + 1063 .loc 1 848 0 + 1064 06dc 38239FE5 ldr r2, .L209+4 + 1065 06e0 0031C2E5 strb r3, [r2, #256] + 849:src/dfu/dfu.c **** + 850:src/dfu/dfu.c **** if (dfu_state == DFU_STATE_dfuMANIFEST_WAIT_RST || + 1066 .loc 1 850 0 + 1067 06e4 34339FE5 ldr r3, .L209+8 + 1068 06e8 003093E5 ldr r3, [r3, #0] + 1069 06ec 073043E2 sub r3, r3, #7 + 1070 06f0 010053E3 cmp r3, #1 + 851:src/dfu/dfu.c **** dfu_state == DFU_STATE_dfuMANIFEST) { + 852:src/dfu/dfu.c **** AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 1071 .loc 1 852 0 + 1072 06f4 DEFFFF9B blls AT91F_RSTSoftReset.clone.8 + 1073 .L153: + 853:src/dfu/dfu.c **** AT91C_RSTC_PERRST| + 854:src/dfu/dfu.c **** AT91C_RSTC_EXTRST); + 855:src/dfu/dfu.c **** } + 856:src/dfu/dfu.c **** + 857:src/dfu/dfu.c **** } + 858:src/dfu/dfu.c **** + 859:src/dfu/dfu.c **** if (isr & AT91C_UDP_EPINT0) + 1074 .loc 1 859 0 + 1075 06f8 00309DE5 ldr r3, [sp, #0] + 1076 06fc 010013E3 tst r3, #1 + 1077 0700 BA00000A beq .L154 + 1078 .LVL80: + 1079 .LBB19: + 1080 .LBB20: + 641:src/dfu/dfu.c **** u_int32_t csr = pUDP->UDP_CSR[0]; + 1081 .loc 1 641 0 + 1082 0704 0C239FE5 ldr r2, .L209 + 1083 0708 CF3012E5 ldr r3, [r2, #-207] + 1084 .LVL81: + 645:src/dfu/dfu.c **** if (csr & AT91C_UDP_STALLSENT) { + 1085 .loc 1 645 0 + 1086 070c 080013E3 tst r3, #8 + 647:src/dfu/dfu.c **** pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + 1087 .loc 1 647 0 + 1088 0710 0810E013 mvnne r1, #8 + 1089 0714 CF100215 strne r1, [r2, #-207] + 650:src/dfu/dfu.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 1090 .loc 1 650 0 + 1091 0718 020013E3 tst r3, #2 + 652:src/dfu/dfu.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + 1092 .loc 1 652 0 + 1093 071c CF101215 ldrne r1, [r2, #-207] + 1094 0720 0210C113 bicne r1, r1, #2 + 1095 0724 CF100215 strne r1, [r2, #-207] + 655:src/dfu/dfu.c **** if (!(csr & AT91C_UDP_RXSETUP)) { + 1096 .loc 1 655 0 + 1097 0728 040013E3 tst r3, #4 + 1098 072c AF00000A beq .L154 + 661:src/dfu/dfu.c **** if (csr >> 16 == 0) { + 1099 .loc 1 661 0 + 1100 0730 2338B0E1 movs r3, r3, lsr #16 + 1101 .LVL82: + 1102 0734 AD00000A beq .L154 + 666:src/dfu/dfu.c **** bmRequestType = pUDP->UDP_FDR[0]; + 1103 .loc 1 666 0 + 1104 0738 D8229FE5 ldr r2, .L209 + 1105 073c AF0012E5 ldr r0, [r2, #-175] + 667:src/dfu/dfu.c **** bRequest = pUDP->UDP_FDR[0]; + 1106 .loc 1 667 0 + 1107 0740 AF1012E5 ldr r1, [r2, #-175] + 668:src/dfu/dfu.c **** wValue = (pUDP->UDP_FDR[0] & 0xFF); + 1108 .loc 1 668 0 + 1109 0744 AF4012E5 ldr r4, [r2, #-175] + 669:src/dfu/dfu.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1110 .loc 1 669 0 + 1111 0748 AF3012E5 ldr r3, [r2, #-175] + 668:src/dfu/dfu.c **** wValue = (pUDP->UDP_FDR[0] & 0xFF); + 1112 .loc 1 668 0 + 1113 074c FF4004E2 and r4, r4, #255 + 670:src/dfu/dfu.c **** wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 1114 .loc 1 670 0 + 1115 0750 AFE012E5 ldr lr, [r2, #-175] + 669:src/dfu/dfu.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1116 .loc 1 669 0 + 1117 0754 034484E1 orr r4, r4, r3, asl #8 + 671:src/dfu/dfu.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 1118 .loc 1 671 0 + 1119 0758 AF3012E5 ldr r3, [r2, #-175] + 672:src/dfu/dfu.c **** wLength = (pUDP->UDP_FDR[0] & 0xFF); + 1120 .loc 1 672 0 + 1121 075c AF3012E5 ldr r3, [r2, #-175] + 673:src/dfu/dfu.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1122 .loc 1 673 0 + 1123 0760 AFC012E5 ldr ip, [r2, #-175] + 672:src/dfu/dfu.c **** wLength = (pUDP->UDP_FDR[0] & 0xFF); + 1124 .loc 1 672 0 + 1125 0764 FF3003E2 and r3, r3, #255 + 666:src/dfu/dfu.c **** bmRequestType = pUDP->UDP_FDR[0]; + 1126 .loc 1 666 0 + 1127 0768 FF0000E2 and r0, r0, #255 + 1128 .LVL83: + 673:src/dfu/dfu.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1129 .loc 1 673 0 + 1130 076c 0C3483E1 orr r3, r3, ip, asl #8 + 669:src/dfu/dfu.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1131 .loc 1 669 0 + 1132 0770 0448A0E1 mov r4, r4, asl #16 + 673:src/dfu/dfu.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1133 .loc 1 673 0 + 1134 0774 0338A0E1 mov r3, r3, asl #16 + 677:src/dfu/dfu.c **** if (bmRequestType & 0x80) { + 1135 .loc 1 677 0 + 1136 0778 800010E3 tst r0, #128 + 667:src/dfu/dfu.c **** bRequest = pUDP->UDP_FDR[0]; + 1137 .loc 1 667 0 + 1138 077c FF1001E2 and r1, r1, #255 + 1139 .LVL84: + 669:src/dfu/dfu.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1140 .loc 1 669 0 + 1141 0780 2448A0E1 mov r4, r4, lsr #16 + 1142 .LVL85: + 673:src/dfu/dfu.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1143 .loc 1 673 0 + 1144 0784 2338A0E1 mov r3, r3, lsr #16 + 1145 .LVL86: + 677:src/dfu/dfu.c **** if (bmRequestType & 0x80) { + 1146 .loc 1 677 0 + 1147 0788 0500000A beq .L157 + 679:src/dfu/dfu.c **** pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 1148 .loc 1 679 0 + 1149 078c CFC012E5 ldr ip, [r2, #-207] + 1150 0790 80C08CE3 orr ip, ip, #128 + 1151 0794 CFC002E5 str ip, [r2, #-207] + 1152 .L158: + 680:src/dfu/dfu.c **** while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 1153 .loc 1 680 0 + 1154 0798 CFC012E5 ldr ip, [r2, #-207] + 1155 079c 80001CE3 tst ip, #128 + 1156 07a0 FCFFFF0A beq .L158 + 1157 .L157: + 682:src/dfu/dfu.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + 1158 .loc 1 682 0 + 1159 07a4 6C229FE5 ldr r2, .L209 + 1160 07a8 CFC012E5 ldr ip, [r2, #-207] + 1161 07ac 04C0CCE3 bic ip, ip, #4 + 1162 07b0 CFC002E5 str ip, [r2, #-207] + 1163 .L159: + 683:src/dfu/dfu.c **** while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + 1164 .loc 1 683 0 + 1165 07b4 CFC012E5 ldr ip, [r2, #-207] + 1166 07b8 04C01CE2 ands ip, ip, #4 + 1167 07bc 54529FE5 ldr r5, .L209 + 1168 07c0 FBFFFF1A bne .L159 + 687:src/dfu/dfu.c **** switch ((bRequest << 8) | bmRequestType) { + 1169 .loc 1 687 0 + 1170 07c4 012480E1 orr r2, r0, r1, asl #8 + 1171 07c8 030C52E3 cmp r2, #768 + 1172 07cc 8600000A beq .L194 + 1173 07d0 100000CA bgt .L175 + 1174 07d4 820052E3 cmp r2, #130 + 1175 07d8 6500000A beq .L163 + 1176 07dc 040000CA bgt .L176 + 1177 07e0 800052E3 cmp r2, #128 + 1178 07e4 5F00000A beq .L162 + 1179 07e8 810052E3 cmp r2, #129 + 1180 07ec 7800001A bne .L160 + 1181 07f0 5C0000EA b .L162 + 1182 .L176: + 1183 07f4 28C29FE5 ldr ip, .L209+12 + 1184 07f8 0C0052E1 cmp r2, ip + 1185 07fc 7200000A beq .L174 + 1186 0800 01C08CE2 add ip, ip, #1 + 1187 0804 0C0052E1 cmp r2, ip + 1188 0808 7700000A beq .L194 + 1189 080c 010C52E3 cmp r2, #256 + 1190 0810 6F00001A bne .L160 + 1191 0814 740000EA b .L194 + 1192 .L175: + 1193 0818 1A0D52E3 cmp r2, #1664 + 1194 081c 0F00000A beq .L171 + 1195 0820 060000CA bgt .L177 + 1196 0824 FCC19FE5 ldr ip, .L209+16 + 1197 0828 0C0052E1 cmp r2, ip + 1198 082c 6E00000A beq .L194 + 1199 0830 650000BA blt .L174 + 1200 0834 050C52E3 cmp r2, #1280 + 1201 0838 6500001A bne .L160 + 1202 083c 2D0000EA b .L205 + 1203 .L177: + 1204 0840 090C52E3 cmp r2, #2304 + 1205 0844 3200000A beq .L173 + 1206 0848 DCC19FE5 ldr ip, .L209+20 + 1207 084c 0C0052E1 cmp r2, ip + 1208 0850 5D00000A beq .L174 + 1209 0854 220D52E3 cmp r2, #2176 + 1210 0858 5D00001A bne .L160 + 1211 085c 3E0000EA b .L206 + 1212 .L171: + 1213 .LVL87: + 1214 .LBB21: + 693:src/dfu/dfu.c **** switch (desc_type) { + 1215 .loc 1 693 0 + 1216 0860 2424A0E1 mov r2, r4, lsr #8 + 1217 0864 020052E3 cmp r2, #2 + 1218 0868 0D00000A beq .L180 + 1219 086c 0200008A bhi .L183 + 1220 0870 010052E3 cmp r2, #1 + 1221 0874 5C00001A bne .L194 + 1222 0878 040000EA b .L207 + 1223 .L183: + 1224 087c 030052E3 cmp r2, #3 + 1225 0880 0D00000A beq .L181 + 1226 0884 210052E3 cmp r2, #33 + 1227 0888 5700001A bne .L194 + 1228 088c 140000EA b .L208 + 1229 .L207: + 696:src/dfu/dfu.c **** udp_ep0_send_data((const char *) + 1230 .loc 1 696 0 + 1231 0890 98019FE5 ldr r0, .L209+24 + 1232 .LVL88: + 1233 0894 120053E3 cmp r3, #18 + 1234 0898 0310A031 movcc r1, r3 + 1235 089c 1210A023 movcs r1, #18 + 1236 .LVL89: + 1237 08a0 030000EA b .L202 + 1238 .LVL90: + 1239 .L180: + 703:src/dfu/dfu.c **** udp_ep0_send_data((const char *) + 1240 .loc 1 703 0 + 1241 08a4 88019FE5 ldr r0, .L209+28 + 1242 .LVL91: + 1243 08a8 240053E3 cmp r3, #36 + 1244 08ac 0310A031 movcc r1, r3 + 1245 08b0 2410A023 movcs r1, #36 + 1246 .LVL92: + 1247 .L202: + 1248 08b4 D1FDFFEB bl udp_ep0_send_data + 1249 08b8 4C0000EA b .L154 + 1250 .LVL93: + 1251 .L181: + 692:src/dfu/dfu.c **** desc_index = wValue & 0xff; + 1252 .loc 1 692 0 + 1253 08bc FF4004E2 and r4, r4, #255 + 1254 .LVL94: + 710:src/dfu/dfu.c **** if (desc_index > ARRAY_SIZE(usb_strings)) { + 1255 .loc 1 710 0 + 1256 08c0 060054E3 cmp r4, #6 + 1257 08c4 4800008A bhi .L194 + 1258 .L186: + 716:src/dfu/dfu.c **** udp_ep0_send_data((const char *) usb_strings[desc_index], + 1259 .loc 1 716 0 + 1260 08c8 60219FE5 ldr r2, .L209+24 + 1261 08cc 044182E0 add r4, r2, r4, asl #2 + 1262 08d0 380094E5 ldr r0, [r4, #56] + 1263 .LVL95: + 717:src/dfu/dfu.c **** MIN(usb_strings[desc_index]->bLength, + 1264 .loc 1 717 0 + 1265 08d4 0010D0E5 ldrb r1, [r0, #0] @ zero_extendqisi2 + 1266 .LVL96: + 716:src/dfu/dfu.c **** udp_ep0_send_data((const char *) usb_strings[desc_index], + 1267 .loc 1 716 0 + 1268 08d8 010053E1 cmp r3, r1 + 1269 08dc 0310A031 movcc r1, r3 + 1270 08e0 F3FFFFEA b .L202 + 1271 .LVL97: + 1272 .L208: + 722:src/dfu/dfu.c **** udp_ep0_send_data((const char *) &dfu_cfg_descriptor.func_dfu, + 1273 .loc 1 722 0 + 1274 08e4 4C019FE5 ldr r0, .L209+32 + 1275 .LVL98: + 1276 08e8 090053E3 cmp r3, #9 + 1277 08ec 0310A031 movcc r1, r3 + 1278 08f0 0910A023 movcs r1, #9 + 1279 .LVL99: + 1280 08f4 EEFFFFEA b .L202 + 1281 .LVL100: + 1282 .L205: + 733:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 1283 .loc 1 733 0 + 1284 08f8 F7FDFFEB bl udp_ep0_send_zlp + 1285 .LVL101: + 734:src/dfu/dfu.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1286 .loc 1 734 0 + 1287 08fc 013C84E3 orr r3, r4, #256 + 735:src/dfu/dfu.c **** pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + 1288 .loc 1 735 0 + 1289 0900 004054E2 subs r4, r4, #0 + 1290 0904 0140A013 movne r4, #1 + 1291 .LVL102: + 734:src/dfu/dfu.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1292 .loc 1 734 0 + 1293 0908 F73005E5 str r3, [r5, #-247] + 735:src/dfu/dfu.c **** pUDP->UDP_GLBSTATE = (wValue) ? AT91C_UDP_FADDEN : 0; + 1294 .loc 1 735 0 + 1295 090c FB4005E5 str r4, [r5, #-251] + 1296 0910 360000EA b .L154 + 1297 .LVL103: + 1298 .L173: + 741:src/dfu/dfu.c **** cur_config = wValue; + 1299 .loc 1 741 0 + 1300 0914 00319FE5 ldr r3, .L209+4 + 1301 .LVL104: + 1302 0918 0041C3E5 strb r4, [r3, #256] + 742:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 1303 .loc 1 742 0 + 1304 091c EEFDFFEB bl udp_ep0_send_zlp + 1305 .LVL105: + 744:src/dfu/dfu.c **** (wValue) ? AT91C_UDP_CONFG : AT91C_UDP_FADDEN; + 1306 .loc 1 744 0 + 1307 0920 000054E3 cmp r4, #0 + 1308 0924 0130A003 moveq r3, #1 + 1309 0928 0230A013 movne r3, #2 + 743:src/dfu/dfu.c **** pUDP->UDP_GLBSTATE = + 1310 .loc 1 743 0 + 1311 092c FB3005E5 str r3, [r5, #-251] + 746:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_OUT) : + 1312 .loc 1 746 0 + 1313 0930 0430A001 moveq r3, r4 + 1314 0934 823CA013 movne r3, #33280 + 745:src/dfu/dfu.c **** pUDP->UDP_CSR[1] = + 1315 .loc 1 745 0 + 1316 0938 CB3005E5 str r3, [r5, #-203] + 749:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_BULK_IN) : 0; + 1317 .loc 1 749 0 + 1318 093c 0430A001 moveq r3, r4 + 1319 0940 863CA013 movne r3, #34304 + 748:src/dfu/dfu.c **** pUDP->UDP_CSR[2] = + 1320 .loc 1 748 0 + 1321 0944 C73005E5 str r3, [r5, #-199] + 751:src/dfu/dfu.c **** (wValue) ? (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_INT_IN) : 0; + 1322 .loc 1 751 0 + 1323 0948 874CA013 movne r4, #34560 + 1324 .LVL106: + 752:src/dfu/dfu.c **** pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + 1325 .loc 1 752 0 + 1326 094c 0F30A0E3 mov r3, #15 + 750:src/dfu/dfu.c **** pUDP->UDP_CSR[3] = + 1327 .loc 1 750 0 + 1328 0950 C34005E5 str r4, [r5, #-195] + 752:src/dfu/dfu.c **** pUDP->UDP_IER = (AT91C_UDP_EPINT0|AT91C_UDP_EPINT1| + 1329 .loc 1 752 0 + 1330 0954 EF3005E5 str r3, [r5, #-239] + 1331 0958 240000EA b .L154 + 1332 .LVL107: + 1333 .L206: + 757:src/dfu/dfu.c **** udp_ep0_send_data((char *)&(cur_config), + 1334 .loc 1 757 0 + 1335 095c D8009FE5 ldr r0, .L209+36 + 1336 .LVL108: + 1337 0960 0110A0E3 mov r1, #1 + 1338 .LVL109: + 1339 0964 D2FFFFEA b .L202 + 1340 .LVL110: + 1341 .L162: + 767:src/dfu/dfu.c **** wStatus = 0; + 1342 .loc 1 767 0 + 1343 0968 08008DE2 add r0, sp, #8 + 1344 .LVL111: + 1345 096c B2C060E1 strh ip, [r0, #-2]! @ movhi + 1346 .LVL112: + 1347 0970 130000EA b .L204 + 1348 .LVL113: + 1349 .L163: + 774:src/dfu/dfu.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 1350 .loc 1 774 0 + 1351 0974 FB3015E5 ldr r3, [r5, #-251] + 1352 .LVL114: + 1353 0978 020013E3 tst r3, #2 + 772:src/dfu/dfu.c **** wStatus = 0; + 1354 .loc 1 772 0 + 1355 097c B6C0CDE1 strh ip, [sp, #6] @ movhi + 1356 .LVL115: + 773:src/dfu/dfu.c **** wIndex &= 0x0F; + 1357 .loc 1 773 0 + 1358 0980 0F200EE2 and r2, lr, #15 + 1359 .LVL116: + 774:src/dfu/dfu.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 1360 .loc 1 774 0 + 1361 0984 0200000A beq .L192 + 1362 0988 000052E3 cmp r2, #0 + 776:src/dfu/dfu.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1363 .loc 1 776 0 + 1364 098c CF301505 ldreq r3, [r5, #-207] + 774:src/dfu/dfu.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex == 0)) { + 1365 .loc 1 774 0 + 1366 0990 0600000A beq .L203 + 1367 .L192: + 779:src/dfu/dfu.c **** } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 1368 .loc 1 779 0 + 1369 0994 7C309FE5 ldr r3, .L209 + 1370 0998 FB1013E5 ldr r1, [r3, #-251] + 1371 .LVL117: + 1372 099c 010011E3 tst r1, #1 + 1373 09a0 1100000A beq .L194 + 780:src/dfu/dfu.c **** && (wIndex == 0)) { + 1374 .loc 1 780 0 + 1375 09a4 000052E3 cmp r2, #0 + 1376 09a8 0F00001A bne .L194 + 782:src/dfu/dfu.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1377 .loc 1 782 0 + 1378 09ac CF3013E5 ldr r3, [r3, #-207] + 1379 .L203: + 1380 09b0 020913E3 tst r3, #32768 + 1381 09b4 0030A013 movne r3, #0 + 1382 09b8 0130A003 moveq r3, #1 + 1383 09bc 08008DE2 add r0, sp, #8 + 1384 .LVL118: + 1385 09c0 B23060E1 strh r3, [r0, #-2]! @ movhi + 1386 .LVL119: + 1387 .L204: + 783:src/dfu/dfu.c **** udp_ep0_send_data((char *)&wStatus, + 1388 .loc 1 783 0 + 1389 09c4 0210A0E3 mov r1, #2 + 1390 09c8 B9FFFFEA b .L202 + 1391 .LVL120: + 1392 .L174: + 816:src/dfu/dfu.c **** udp_ep0_send_zlp(); + 1393 .loc 1 816 0 + 1394 09cc C2FDFFEB bl udp_ep0_send_zlp + 1395 .LVL121: + 1396 09d0 060000EA b .L154 + 1397 .LVL122: + 1398 .L160: + 821:src/dfu/dfu.c **** if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + 1399 .loc 1 821 0 + 1400 09d4 3F2000E2 and r2, r0, #63 + 1401 09d8 210052E3 cmp r2, #33 + 1402 09dc 0200001A bne .L194 + 822:src/dfu/dfu.c **** dfu_ep0_handler(bmRequestType, bRequest, + 1403 .loc 1 822 0 + 1404 09e0 0420A0E1 mov r2, r4 + 1405 09e4 FEFFFFEB bl dfu_ep0_handler + 1406 .LVL123: + 1407 09e8 000000EA b .L154 + 1408 .LVL124: + 1409 .L194: + 825:src/dfu/dfu.c **** udp_ep0_send_stall(); + 1410 .loc 1 825 0 + 1411 09ec CBFDFFEB bl udp_ep0_send_stall + 1412 .LVL125: + 1413 .L154: + 1414 .LBE21: + 1415 .LBE20: + 1416 .LBE19: + 860:src/dfu/dfu.c **** dfu_udp_ep0_handler(); + 861:src/dfu/dfu.c **** + 862:src/dfu/dfu.c **** /* clear all interrupts */ + 863:src/dfu/dfu.c **** pUDP->UDP_ICR = isr; + 1417 .loc 1 863 0 + 1418 09f0 00209DE5 ldr r2, [sp, #0] + 1419 09f4 1C309FE5 ldr r3, .L209 + 1420 09f8 DF2003E5 str r2, [r3, #-223] + 1421 .LVL126: + 1422 .LBB22: + 1423 .LBB23: + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 1424 .loc 2 97 0 + 1425 09fc 022BA0E3 mov r2, #2048 + 1426 0a00 4F3A83E2 add r3, r3, #323584 + 1427 0a04 292083E5 str r2, [r3, #41] + 1428 .LBE23: + 1429 .LBE22: + 864:src/dfu/dfu.c **** + 865:src/dfu/dfu.c **** AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); + 866:src/dfu/dfu.c **** + 867:src/dfu/dfu.c **** led1off(); + 1430 .loc 1 867 0 + 1431 0a08 0204A0E3 mov r0, #33554432 + 1432 0a0c 12FFFFEB bl AT91F_PIO_SetOutput.clone.6 + 868:src/dfu/dfu.c **** } + 1433 .loc 1 868 0 + 1434 0a10 3E40BDE8 ldmfd sp!, {r1, r2, r3, r4, r5, lr} + 1435 0a14 1EFF2FE1 bx lr + 1436 .L210: + 1437 .align 2 + 1438 .L209: + 1439 0a18 FF00FBFF .word -327425 + 1440 0a1c 00000000 .word .LANCHOR2 + 1441 0a20 00000000 .word .LANCHOR0 + 1442 0a24 01010000 .word 257 + 1443 0a28 02030000 .word 770 + 1444 0a2c 010B0000 .word 2817 + 1445 0a30 00000000 .word .LANCHOR3 + 1446 0a34 12000000 .word .LANCHOR3+18 + 1447 0a38 2D000000 .word .LANCHOR3+45 + 1448 0a3c 00010000 .word .LANCHOR2+256 + 1449 .cfi_endproc + 1450 .LFE290: + 1452 .align 2 + 1454 dfu_switch: + 1455 .LFB291: + 869:src/dfu/dfu.c **** + 870:src/dfu/dfu.c **** /* this is only called once before DFU mode, no __dfufunc required */ + 871:src/dfu/dfu.c **** static void dfu_switch(void) + 872:src/dfu/dfu.c **** { + 1456 .loc 1 872 0 + 1457 .cfi_startproc + 1458 @ Function supports interworking. + 1459 @ args = 0, pretend = 0, frame = 0 + 1460 @ frame_needed = 0, uses_anonymous_args = 0 + 1461 .LVL127: + 1462 0a40 08402DE9 stmfd sp!, {r3, lr} + 1463 .LCFI8: + 1464 .cfi_def_cfa_offset 8 + 873:src/dfu/dfu.c **** AT91PS_AIC pAic = AT91C_BASE_AIC; + 874:src/dfu/dfu.c **** + 875:src/dfu/dfu.c **** DEBUGE("\r\nsam7dfu: switching to DFU mode\r\n"); + 876:src/dfu/dfu.c **** + 877:src/dfu/dfu.c **** dfu_state = DFU_STATE_appDETACH; + 1465 .loc 1 877 0 + 1466 0a44 0C309FE5 ldr r3, .L213 + 1467 .cfi_offset 14, -4 + 1468 .cfi_offset 3, -8 + 1469 0a48 0120A0E3 mov r2, #1 + 1470 0a4c 002083E5 str r2, [r3, #0] + 878:src/dfu/dfu.c **** AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 1471 .loc 1 878 0 + 1472 0a50 07FFFFEB bl AT91F_RSTSoftReset.clone.8 + 1473 .L212: + 1474 0a54 FEFFFFEA b .L212 + 1475 .L214: + 1476 .align 2 + 1477 .L213: + 1478 0a58 00000000 .word .LANCHOR0 + 1479 .cfi_endproc + 1480 .LFE291: + 1482 .global __aeabi_idivmod + 1483 .align 2 + 1484 .global dfu_main + 1486 dfu_main: + 1487 .LFB292: + 879:src/dfu/dfu.c **** AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + 880:src/dfu/dfu.c **** + 881:src/dfu/dfu.c **** /* We should never reach here, but anyway avoid returning to the + 882:src/dfu/dfu.c **** * caller since he doesn't expect us to do so */ + 883:src/dfu/dfu.c **** while (1) ; + 884:src/dfu/dfu.c **** } + 885:src/dfu/dfu.c **** + 886:src/dfu/dfu.c **** void __dfufunc dfu_main(void) + 887:src/dfu/dfu.c **** { + 1488 .loc 1 887 0 + 1489 .cfi_startproc + 1490 @ Function supports interworking. + 1491 @ args = 0, pretend = 0, frame = 0 + 1492 @ frame_needed = 0, uses_anonymous_args = 0 + 1493 0a5c 08402DE9 stmfd sp!, {r3, lr} + 1494 .LCFI9: + 1495 .cfi_def_cfa_offset 8 + 888:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + 1496 .loc 1 888 0 + 1497 0a60 0204A0E3 mov r0, #33554432 + 1498 .cfi_offset 14, -4 + 1499 .cfi_offset 3, -8 + 1500 0a64 EAFEFFEB bl AT91F_PIO_CfgOutput.clone.5 + 889:src/dfu/dfu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + 1501 .loc 1 889 0 + 1502 0a68 0103A0E3 mov r0, #67108864 + 1503 0a6c E8FEFFEB bl AT91F_PIO_CfgOutput.clone.5 + 890:src/dfu/dfu.c **** led1off(); + 1504 .loc 1 890 0 + 1505 0a70 0204A0E3 mov r0, #33554432 + 1506 0a74 F8FEFFEB bl AT91F_PIO_SetOutput.clone.6 + 891:src/dfu/dfu.c **** led2off(); + 1507 .loc 1 891 0 + 1508 0a78 0103A0E3 mov r0, #67108864 + 1509 0a7c F6FEFFEB bl AT91F_PIO_SetOutput.clone.6 + 892:src/dfu/dfu.c **** + 893:src/dfu/dfu.c **** AT91F_DBGU_Init(); + 1510 .loc 1 893 0 + 1511 0a80 FEFFFFEB bl AT91F_DBGU_Init + 894:src/dfu/dfu.c **** AT91F_DBGU_Printk("\n\r\n\rsam7dfu - AT91SAM7 USB DFU bootloader\n\r" + 1512 .loc 1 894 0 + 1513 0a84 78009FE5 ldr r0, .L220 + 1514 0a88 FEFFFFEB bl AT91F_DBGU_Printk + 895:src/dfu/dfu.c **** "(C) 2006-2008 by Harald Welte \n\r" + 896:src/dfu/dfu.c **** "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + 897:src/dfu/dfu.c **** AT91F_DBGU_Printk("Version " COMPILE_SVNREV + 1515 .loc 1 897 0 + 1516 0a8c 74009FE5 ldr r0, .L220+4 + 1517 0a90 FEFFFFEB bl AT91F_DBGU_Printk + 898:src/dfu/dfu.c **** " compiled " COMPILE_DATE + 899:src/dfu/dfu.c **** " by " COMPILE_BY "\n\r\n\r"); + 900:src/dfu/dfu.c **** + 901:src/dfu/dfu.c **** udp_init(); + 1518 .loc 1 901 0 + 1519 0a94 E2FEFFEB bl udp_init + 902:src/dfu/dfu.c **** + 903:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 1520 .loc 1 903 0 + 1521 0a98 6C309FE5 ldr r3, .L220+8 + 1522 0a9c 0210A0E3 mov r1, #2 + 904:src/dfu/dfu.c **** + 905:src/dfu/dfu.c **** /* This implements + 906:src/dfu/dfu.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 907:src/dfu/dfu.c **** OPENPCD_IRQ_PRIO_UDP, + 908:src/dfu/dfu.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, dfu_udp_irq); + 909:src/dfu/dfu.c **** */ + 910:src/dfu/dfu.c **** AT91PS_AIC pAic = AT91C_BASE_AIC; + 911:src/dfu/dfu.c **** pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + 912:src/dfu/dfu.c **** pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; + 1523 .loc 1 912 0 + 1524 0aa0 68009FE5 ldr r0, .L220+12 + 911:src/dfu/dfu.c **** pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + 1525 .loc 1 911 0 + 1526 0aa4 022BA0E3 mov r2, #2048 + 903:src/dfu/dfu.c **** dfu_state = DFU_STATE_dfuIDLE; + 1527 .loc 1 903 0 + 1528 0aa8 001083E5 str r1, [r3, #0] + 1529 .LVL128: + 911:src/dfu/dfu.c **** pAic->AIC_IDCR = 1 << AT91C_ID_UDP; + 1530 .loc 1 911 0 + 1531 0aac 0F3CE0E3 mvn r3, #3840 + 1532 0ab0 252083E5 str r2, [r3, #37] + 1533 .loc 1 912 0 + 1534 0ab4 530003E5 str r0, [r3, #-83] + 913:src/dfu/dfu.c **** pAic->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | + 1535 .loc 1 913 0 + 1536 0ab8 D31003E5 str r1, [r3, #-211] + 914:src/dfu/dfu.c **** OPENPCD_IRQ_PRIO_UDP; + 915:src/dfu/dfu.c **** pAic->AIC_ICCR = 1 << AT91C_ID_UDP; + 916:src/dfu/dfu.c **** + 917:src/dfu/dfu.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_UDP); + 918:src/dfu/dfu.c **** + 919:src/dfu/dfu.c **** /* End-of-Bus-Reset is always enabled */ + 920:src/dfu/dfu.c **** + 921:src/dfu/dfu.c **** /* Clear for set the Pull up resistor */ + 922:src/dfu/dfu.c **** #if defined(PCD) + 923:src/dfu/dfu.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 1537 .loc 1 923 0 + 1538 0abc 0105A0E3 mov r0, #4194304 + 915:src/dfu/dfu.c **** pAic->AIC_ICCR = 1 << AT91C_ID_UDP; + 1539 .loc 1 915 0 + 1540 0ac0 292083E5 str r2, [r3, #41] + 1541 .LVL129: + 1542 .LBB28: + 1543 .LBB29: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 1544 .loc 2 70 0 + 1545 0ac4 212083E5 str r2, [r3, #33] + 1546 .LBE29: + 1547 .LBE28: + 1548 .loc 1 923 0 + 1549 0ac8 E3FEFFEB bl AT91F_PIO_SetOutput.clone.6 + 924:src/dfu/dfu.c **** #endif + 925:src/dfu/dfu.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 1550 .loc 1 925 0 + 1551 0acc 0108A0E3 mov r0, #65536 + 1552 0ad0 E4FEFFEB bl AT91F_PIO_ClearOutput.clone.7 + 926:src/dfu/dfu.c **** + 927:src/dfu/dfu.c **** flash_init(); + 1553 .loc 1 927 0 + 1554 0ad4 FEFFFFEB bl flash_init + 928:src/dfu/dfu.c **** + 929:src/dfu/dfu.c **** AT91F_DBGU_Printk("You may now start the DFU up/download process\r\n"); + 1555 .loc 1 929 0 + 1556 0ad8 34009FE5 ldr r0, .L220+16 + 1557 0adc FEFFFFEB bl AT91F_DBGU_Printk + 1558 .LVL130: + 930:src/dfu/dfu.c **** /* do nothing, since all of DFU is interrupt driven */ + 931:src/dfu/dfu.c **** int i = 0; + 1559 .loc 1 931 0 + 1560 0ae0 0010A0E3 mov r1, #0 + 1561 .LVL131: + 1562 .L219: + 932:src/dfu/dfu.c **** while (1) { + 933:src/dfu/dfu.c **** /* Occasionally reset watchdog */ + 934:src/dfu/dfu.c **** i = (i+1) % 10000; + 1563 .loc 1 934 0 + 1564 0ae4 010081E2 add r0, r1, #1 + 1565 0ae8 28109FE5 ldr r1, .L220+20 + 1566 .LVL132: + 1567 0aec FEFFFFEB bl __aeabi_idivmod + 1568 .LVL133: + 935:src/dfu/dfu.c **** if( i== 0) { + 1569 .loc 1 935 0 + 1570 0af0 000051E3 cmp r1, #0 + 1571 .LVL134: + 1572 .LBB30: + 1573 .LBB31: +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; + 1574 .loc 2 1461 0 + 1575 0af4 20209F05 ldreq r2, .L220+24 + 1576 0af8 023CE003 mvneq r3, #512 + 1577 0afc BF200305 streq r2, [r3, #-191] + 1578 0b00 F7FFFFEA b .L219 + 1579 .L221: + 1580 .align 2 + 1581 .L220: + 1582 0b04 00000000 .word .LC0 + 1583 0b08 9D000000 .word .LC1 + 1584 0b0c 00000000 .word .LANCHOR0 + 1585 0b10 00000000 .word dfu_udp_irq + 1586 0b14 E0000000 .word .LC2 + 1587 0b18 10270000 .word 10000 + 1588 0b1c 010000A5 .word -1526726655 + 1589 .LBE31: + 1590 .LBE30: + 1591 .cfi_endproc + 1592 .LFE292: + 1594 .global dfu_state + 1595 .global dfu_dev_descriptor + 1596 .global dfu_cfg_descriptor + 1597 .global dfu_api + 1598 .global foo + 1599 .section .rodata + 1600 .align 2 + 1601 .set .LANCHOR3,. + 0 + 1604 dfu_dev_descriptor: + 1605 0000 12 .byte 18 + 1606 0001 01 .byte 1 + 1607 0002 0001 .2byte 256 + 1608 0004 00 .byte 0 + 1609 0005 00 .byte 0 + 1610 0006 00 .byte 0 + 1611 0007 08 .byte 8 + 1612 0008 C016 .2byte 5824 + 1613 000a 6B07 .2byte 1899 + 1614 000c 0000 .2byte 0 + 1615 000e 00 .byte 0 + 1616 000f 00 .byte 0 + 1617 0010 00 .byte 0 + 1618 0011 01 .byte 1 + 1621 dfu_cfg_descriptor: + 1622 0012 09 .byte 9 + 1623 0013 02 .byte 2 + 1624 0014 2400 .2byte 36 + 1625 0016 01 .byte 1 + 1626 0017 01 .byte 1 + 1627 0018 00 .byte 0 + 1628 0019 80 .byte -128 + 1629 001a 64 .byte 100 + 1630 001b 09 .byte 9 + 1631 001c 04 .byte 4 + 1632 001d 00 .byte 0 + 1633 001e 00 .byte 0 + 1634 001f 00 .byte 0 + 1635 0020 FE .byte -2 + 1636 0021 01 .byte 1 + 1637 0022 02 .byte 2 + 1638 0023 00 .byte 0 + 1639 0024 09 .byte 9 + 1640 0025 04 .byte 4 + 1641 0026 00 .byte 0 + 1642 0027 01 .byte 1 + 1643 0028 00 .byte 0 + 1644 0029 FE .byte -2 + 1645 002a 01 .byte 1 + 1646 002b 02 .byte 2 + 1647 002c 00 .byte 0 + 1648 002d 09 .byte 9 + 1649 002e 21 .byte 33 + 1650 002f 03 .byte 3 + 1651 0030 00FF .2byte -256 + 1652 0032 0001 .2byte 256 + 1653 0034 0001 .2byte 256 + 1654 0036 0000 .space 2 + 1657 usb_strings: + 1658 0038 50000000 .word string0 + 1659 003c 54000000 .word string1 + 1660 0040 BC000000 .word string2 + 1661 0044 FA000000 .word string3 + 1662 0048 2E010000 .word string4 + 1663 004c 8A010000 .word string5 + 1666 string0: + 1667 0050 04 .byte 4 + 1668 0051 03 .byte 3 + 1669 0052 0904 .2byte 1033 + 1672 string1: + 1673 0054 68 .byte 104 + 1674 0055 03 .byte 3 + 1675 0056 6200 .2byte 98 + 1676 0058 6900 .2byte 105 + 1677 005a 7400 .2byte 116 + 1678 005c 6D00 .2byte 109 + 1679 005e 6100 .2byte 97 + 1680 0060 6E00 .2byte 110 + 1681 0062 7500 .2byte 117 + 1682 0064 6600 .2byte 102 + 1683 0066 6100 .2byte 97 + 1684 0068 6B00 .2byte 107 + 1685 006a 7400 .2byte 116 + 1686 006c 7500 .2byte 117 + 1687 006e 7200 .2byte 114 + 1688 0070 2E00 .2byte 46 + 1689 0072 6400 .2byte 100 + 1690 0074 6500 .2byte 101 + 1691 0076 2000 .2byte 32 + 1692 0078 4900 .2byte 73 + 1693 007a 5400 .2byte 84 + 1694 007c 2000 .2byte 32 + 1695 007e 5300 .2byte 83 + 1696 0080 6F00 .2byte 111 + 1697 0082 6C00 .2byte 108 + 1698 0084 7500 .2byte 117 + 1699 0086 7400 .2byte 116 + 1700 0088 6900 .2byte 105 + 1701 008a 6F00 .2byte 111 + 1702 008c 6E00 .2byte 110 + 1703 008e 7300 .2byte 115 + 1704 0090 2000 .2byte 32 + 1705 0092 6100 .2byte 97 + 1706 0094 6E00 .2byte 110 + 1707 0096 6400 .2byte 100 + 1708 0098 2000 .2byte 32 + 1709 009a 6800 .2byte 104 + 1710 009c 6D00 .2byte 109 + 1711 009e 7700 .2byte 119 + 1712 00a0 2D00 .2byte 45 + 1713 00a2 6300 .2byte 99 + 1714 00a4 6F00 .2byte 111 + 1715 00a6 6E00 .2byte 110 + 1716 00a8 7300 .2byte 115 + 1717 00aa 7500 .2byte 117 + 1718 00ac 6C00 .2byte 108 + 1719 00ae 7400 .2byte 116 + 1720 00b0 6900 .2byte 105 + 1721 00b2 6E00 .2byte 110 + 1722 00b4 6700 .2byte 103 + 1723 00b6 2E00 .2byte 46 + 1724 00b8 6400 .2byte 100 + 1725 00ba 6500 .2byte 101 + 1728 string2: + 1729 00bc 3E .byte 62 + 1730 00bd 03 .byte 3 + 1731 00be 4F00 .2byte 79 + 1732 00c0 7000 .2byte 112 + 1733 00c2 6500 .2byte 101 + 1734 00c4 6E00 .2byte 110 + 1735 00c6 5000 .2byte 80 + 1736 00c8 4300 .2byte 67 + 1737 00ca 4400 .2byte 68 + 1738 00cc 2000 .2byte 32 + 1739 00ce 5200 .2byte 82 + 1740 00d0 4600 .2byte 70 + 1741 00d2 4900 .2byte 73 + 1742 00d4 4400 .2byte 68 + 1743 00d6 2000 .2byte 32 + 1744 00d8 5200 .2byte 82 + 1745 00da 6500 .2byte 101 + 1746 00dc 6100 .2byte 97 + 1747 00de 6400 .2byte 100 + 1748 00e0 6500 .2byte 101 + 1749 00e2 7200 .2byte 114 + 1750 00e4 2000 .2byte 32 + 1751 00e6 2D00 .2byte 45 + 1752 00e8 2000 .2byte 32 + 1753 00ea 4400 .2byte 68 + 1754 00ec 4600 .2byte 70 + 1755 00ee 5500 .2byte 85 + 1756 00f0 2000 .2byte 32 + 1757 00f2 4D00 .2byte 77 + 1758 00f4 6F00 .2byte 111 + 1759 00f6 6400 .2byte 100 + 1760 00f8 6500 .2byte 101 + 1763 string3: + 1764 00fa 34 .byte 52 + 1765 00fb 03 .byte 3 + 1766 00fc 4F00 .2byte 79 + 1767 00fe 7000 .2byte 112 + 1768 0100 6500 .2byte 101 + 1769 0102 6E00 .2byte 110 + 1770 0104 5000 .2byte 80 + 1771 0106 4300 .2byte 67 + 1772 0108 4400 .2byte 68 + 1773 010a 2000 .2byte 32 + 1774 010c 4400 .2byte 68 + 1775 010e 4600 .2byte 70 + 1776 0110 5500 .2byte 85 + 1777 0112 2000 .2byte 32 + 1778 0114 4300 .2byte 67 + 1779 0116 6F00 .2byte 111 + 1780 0118 6E00 .2byte 110 + 1781 011a 6600 .2byte 102 + 1782 011c 6900 .2byte 105 + 1783 011e 6700 .2byte 103 + 1784 0120 7500 .2byte 117 + 1785 0122 7200 .2byte 114 + 1786 0124 6100 .2byte 97 + 1787 0126 7400 .2byte 116 + 1788 0128 6900 .2byte 105 + 1789 012a 6F00 .2byte 111 + 1790 012c 6E00 .2byte 110 + 1793 string4: + 1794 012e 5C .byte 92 + 1795 012f 03 .byte 3 + 1796 0130 4F00 .2byte 79 + 1797 0132 7000 .2byte 112 + 1798 0134 6500 .2byte 101 + 1799 0136 6E00 .2byte 110 + 1800 0138 5000 .2byte 80 + 1801 013a 4300 .2byte 67 + 1802 013c 4400 .2byte 68 + 1803 013e 2000 .2byte 32 + 1804 0140 4400 .2byte 68 + 1805 0142 4600 .2byte 70 + 1806 0144 5500 .2byte 85 + 1807 0146 2000 .2byte 32 + 1808 0148 4900 .2byte 73 + 1809 014a 6E00 .2byte 110 + 1810 014c 7400 .2byte 116 + 1811 014e 6500 .2byte 101 + 1812 0150 7200 .2byte 114 + 1813 0152 6600 .2byte 102 + 1814 0154 6100 .2byte 97 + 1815 0156 6300 .2byte 99 + 1816 0158 6500 .2byte 101 + 1817 015a 2000 .2byte 32 + 1818 015c 2D00 .2byte 45 + 1819 015e 2000 .2byte 32 + 1820 0160 4100 .2byte 65 + 1821 0162 7000 .2byte 112 + 1822 0164 7000 .2byte 112 + 1823 0166 6C00 .2byte 108 + 1824 0168 6900 .2byte 105 + 1825 016a 6300 .2byte 99 + 1826 016c 6100 .2byte 97 + 1827 016e 7400 .2byte 116 + 1828 0170 6900 .2byte 105 + 1829 0172 6F00 .2byte 111 + 1830 0174 6E00 .2byte 110 + 1831 0176 2000 .2byte 32 + 1832 0178 5000 .2byte 80 + 1833 017a 6100 .2byte 97 + 1834 017c 7200 .2byte 114 + 1835 017e 7400 .2byte 116 + 1836 0180 6900 .2byte 105 + 1837 0182 7400 .2byte 116 + 1838 0184 6900 .2byte 105 + 1839 0186 6F00 .2byte 111 + 1840 0188 6E00 .2byte 110 + 1843 string5: + 1844 018a 5A .byte 90 + 1845 018b 03 .byte 3 + 1846 018c 4F00 .2byte 79 + 1847 018e 7000 .2byte 112 + 1848 0190 6500 .2byte 101 + 1849 0192 6E00 .2byte 110 + 1850 0194 5000 .2byte 80 + 1851 0196 4300 .2byte 67 + 1852 0198 4400 .2byte 68 + 1853 019a 2000 .2byte 32 + 1854 019c 4400 .2byte 68 + 1855 019e 4600 .2byte 70 + 1856 01a0 5500 .2byte 85 + 1857 01a2 2000 .2byte 32 + 1858 01a4 4900 .2byte 73 + 1859 01a6 6E00 .2byte 110 + 1860 01a8 7400 .2byte 116 + 1861 01aa 6500 .2byte 101 + 1862 01ac 7200 .2byte 114 + 1863 01ae 6600 .2byte 102 + 1864 01b0 6100 .2byte 97 + 1865 01b2 6300 .2byte 99 + 1866 01b4 6500 .2byte 101 + 1867 01b6 2000 .2byte 32 + 1868 01b8 2D00 .2byte 45 + 1869 01ba 2000 .2byte 32 + 1870 01bc 4200 .2byte 66 + 1871 01be 6F00 .2byte 111 + 1872 01c0 6F00 .2byte 111 + 1873 01c2 7400 .2byte 116 + 1874 01c4 6C00 .2byte 108 + 1875 01c6 6F00 .2byte 111 + 1876 01c8 6100 .2byte 97 + 1877 01ca 6400 .2byte 100 + 1878 01cc 6500 .2byte 101 + 1879 01ce 7200 .2byte 114 + 1880 01d0 2000 .2byte 32 + 1881 01d2 5000 .2byte 80 + 1882 01d4 6100 .2byte 97 + 1883 01d6 7200 .2byte 114 + 1884 01d8 7400 .2byte 116 + 1885 01da 6900 .2byte 105 + 1886 01dc 7400 .2byte 116 + 1887 01de 6900 .2byte 105 + 1888 01e0 6F00 .2byte 111 + 1889 01e2 6E00 .2byte 110 + 1890 .section .dfu.functab,"a",%progbits + 1891 .align 2 + 1894 dfu_api: + 1895 0000 00000000 .word udp_init + 1896 0004 00000000 .word udp_ep0_send_data + 1897 0008 00000000 .word udp_ep0_send_zlp + 1898 000c 00000000 .word udp_ep0_send_stall + 1899 0010 00000000 .word dfu_ep0_handler + 1900 0014 00000000 .word dfu_switch + 1901 0018 00000000 .word dfu_state + 1902 001c 00000000 .word dfu_dev_descriptor + 1903 0020 00000000 .word dfu_cfg_descriptor + 1904 .section .rodata.str1.1,"aMS",%progbits,1 + 1905 .LC0: + 1906 0000 0A0D0A0D .ascii "\012\015\012\015sam7dfu - AT91SAM7 USB DFU bootload" + 1906 73616D37 + 1906 64667520 + 1906 2D204154 + 1906 39315341 + 1907 0027 65720A0D .ascii "er\012\015(C) 2006-2008 by Harald Welte \012\015This software is FREE SOFTWA" + 1908 73756C74 + 1908 696E672E + 1908 64653E0A + 1908 0D546869 + 1909 0081 5245206C .ascii "RE licensed under GNU GPL\012\015\000" + 1909 6963656E + 1909 73656420 + 1909 756E6465 + 1909 7220474E + 1910 .LC1: + 1911 009d 56657273 .ascii "Version 495-unclean compiled 20110510-160907 by net" + 1911 696F6E20 + 1911 3439352D + 1911 756E636C + 1911 65616E20 + 1912 00d0 7A40426C .ascii "z@BlubbFish\012\015\012\015\000" + 1912 75626246 + 1912 6973680A + 1912 0D0A0D00 + 1913 .LC2: + 1914 00e0 596F7520 .ascii "You may now start the DFU up/download process\015\012" + 1914 6D617920 + 1914 6E6F7720 + 1914 73746172 + 1914 74207468 + 1915 010f 00 .ascii "\000" + 1916 .data + 1917 .align 2 + 1918 .set .LANCHOR1,. + 0 + 1921 ptr: + 1922 0000 00401000 .word 1064960 + 1925 foo: + 1926 0004 39300000 .word 12345 + 1927 .section .data.shared,"aw",%progbits + 1928 .align 2 + 1929 .set .LANCHOR0,. + 0 + 1932 dfu_state: + 1933 0000 00000000 .space 4 + 1936 dfu_status: + 1937 0004 00 .space 1 + 1938 0005 000000 .bss + 1939 .align 2 + 1940 .set .LANCHOR2,. + 0 + 1943 pagebuf32: + 1944 0000 00000000 .space 256 + 1944 00000000 + 1944 00000000 + 1944 00000000 + 1944 00000000 + 1947 cur_config: + 1948 0100 00 .space 1 + 1949 0101 000000 .text + 1950 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 dfu.c +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:23 .text:00000000 udp_ep0_send_data +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:137 .text:000000d8 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:141 .text:000000dc $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:143 .text:000000dc udp_ep0_send_zlp +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:178 .text:0000011c $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:182 .text:00000120 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:184 .text:00000120 udp_ep0_send_stall +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:219 .text:00000160 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:223 .text:00000164 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:225 .text:00000164 handle_getstate +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:254 .text:00000188 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:258 .text:0000018c $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:260 .text:0000018c handle_upload.clone.0 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:326 .text:000001f8 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:331 .text:00000200 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:333 .text:00000200 handle_dnload.clone.1 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:520 .text:0000033c $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:529 .text:00000354 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:531 .text:00000354 handle_getstatus +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:627 .text:000003f4 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:631 .text:000003f8 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:634 .text:000003f8 dfu_ep0_handler +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:658 .text:00000414 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:671 .text:00000440 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:699 .text:00000488 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:707 .text:000004a0 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:740 .text:000004ec $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:748 .text:00000504 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:788 .text:0000055c $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:795 .text:00000570 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:883 .text:0000060c $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:888 .text:00000614 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:890 .text:00000614 AT91F_PIO_CfgOutput.clone.5 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:911 .text:00000624 udp_init +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:950 .text:0000065c AT91F_PIO_SetOutput.clone.6 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:969 .text:00000668 AT91F_PIO_ClearOutput.clone.7 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:988 .text:00000674 AT91F_RSTSoftReset.clone.8 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1006 .text:00000684 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1010 .text:00000688 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1012 .text:00000688 dfu_udp_irq +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1439 .text:00000a18 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1452 .text:00000a40 $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1454 .text:00000a40 dfu_switch +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1478 .text:00000a58 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1483 .text:00000a5c $a +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1486 .text:00000a5c dfu_main +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1582 .text:00000b04 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1932 .data.shared:00000000 dfu_state +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1604 .rodata:00000000 dfu_dev_descriptor +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1621 .rodata:00000012 dfu_cfg_descriptor +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1894 .dfu.functab:00000000 dfu_api +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1925 .data:00000004 foo +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1600 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1657 .rodata:00000038 usb_strings +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1666 .rodata:00000050 string0 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1672 .rodata:00000054 string1 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1728 .rodata:000000bc string2 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1763 .rodata:000000fa string3 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1793 .rodata:0000012e string4 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1843 .rodata:0000018a string5 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1891 .dfu.functab:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1917 .data:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1921 .data:00000000 ptr +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1928 .data.shared:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1936 .data.shared:00000004 dfu_status +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1939 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1943 .bss:00000000 pagebuf32 +C:\Users\netz\AppData\Local\Temp\ccTN1aBu.s:1947 .bss:00000100 cur_config + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +flash_page +__aeabi_idivmod +AT91F_DBGU_Init +AT91F_DBGU_Printk +flash_init diff --git a/firmware/src/openpcd.h b/firmware/src/openpcd.h new file mode 100644 index 0000000..a65cd0e --- /dev/null +++ b/firmware/src/openpcd.h @@ -0,0 +1,174 @@ +#ifndef _OPENPCD_H +#define _OPENPCD_H + +#include + +#define Hz +#define kHz *1000 Hz +#define MHz *1000 kHz +#define MCLK (48 MHz) + +#define USB_VENDOR_ID OPENPCD_VENDOR_ID + +#ifdef OLIMEX +#define OPENPCD_PIO_LED2 AT91C_PIO_PA17 +#define OPENPCD_PIO_LED1 AT91C_PIO_PA18 +#define OPENPCD_PIO_UDP_CNX AT91C_PIO_PA24 +#define OPENPCD_PIO_UDP_PUP AT91C_PIO_PA16 +#else +#if defined(PCD) +#define OPENPCD_PIO_UDP_CNX AT91C_PIO_PA15 +#define OPENPCD_PIO_UDP_PUP AT91C_PIO_PA22 +#define OPENPCD_PIO_UDP_PUPv4 AT91C_PIO_PA16 +#define OPENPCD_PIO_LED1 AT91C_PIO_PA25 +#define OPENPCD_PIO_LED2 AT91C_PIO_PA26 +#define PIO_BOOTLDR AT91C_PIO_PA27 +#define USB_PRODUCT_ID OPENPCD_PRODUCT_ID +#elif defined(PICC) +#define OPENPCD_PIO_UDP_CNX NO_UDP_CNX +#define OPENPCD_PIO_UDP_PUPv4 AT91C_PIO_PA16 +#define OPENPCD_PIO_LED1 AT91C_PIO_PA25 +#define OPENPCD_PIO_LED2 AT91C_PIO_PA12 +#define PIO_BOOTLDR AT91C_PIO_PA6 +#define USB_PRODUCT_ID OPENPICC_PRODUCT_ID +#else +#error "unknown PCB" +#endif +#endif + + +#define OPENPCD_IRQ_RC632 AT91C_ID_IRQ1 + +/* PIO A mapping for OpenPCD v0.2 + * + * PA0 TIOA0 B O CARRIER_DIV_HELP + * PA1 TIOB1 B O CARRIER_DIV + * PA2 PA2 P I N/C + * PA3 TWD A I/O I2C + * + * PA4 TWCK A O I2C + * PA5 PA5 P O RFID_RESET + * PA6 PA6 P I N/C + * PA7 PA7 P I N/C + * + * PA8 PA8 P I N/C + * PA9 DRXD A I Debug + * PA10 DTXD A O Debug + * PA11 NPCS0 A O SPI Slave Select + * + * PA12 MISO A I SPi Master In + * PA13 MOSI A O SPI Maste Out + * PA14 SPCK A O SPI Clock + * PA15 P I N/C + * + * PA16 PA16 P O UDP_PUP (disabled) + * PA17 TD A O MFIN * + * PA18 RD A I MFOUT + * PA19 RK A I CARRIER_DIV + * + * PA20 PA20 P I AB_DETECT + * PA21 PA21 P I N/C + * PA22 PA22 P I UDP_PUP + * PA23 PWM0 B O MFIN * + * + * PA24 P I N/C + * PA25 PA25 P O LED1 + * PA26 PA26 P O LED2 + * PA27 PA27 P I BOOTLDR_SW + * + * PA28 TCLK1 B I PIO_CARRIER + * PA29 TCLK2 B I CARRIER_DIV_HELP + * PA30 IRQ1 A I RC632_IRQ + * PA31 PA31 P O TRIGGER + * + * => PIO_PSR = 0x8f7181e4 (= PIO_PER) + * => PIO_OSR = 0x86010020 (= PIO_OER) + * => PIO_ASR = 0x400e7e18 + * => PIO_BSR = 0x30800003 + * + * * MFIN connected to both SSC and PWM output !!! + */ + +#define OPENPCD_PIO_CDIV_HELP_OUT AT91C_PA0_TIOA0 +#define OPENPCD_PIO_CDIV_HELP_IN AT91C_PA29_TCLK2 +#define OPENPCD_PIO_MFIN_PWM AT91C_PA23_PWM0 +#define OPENPCD_PIO_CARRIER_DIV_OUT AT91C_PA1_TIOB0 +#define OPENPCD_PIO_MFIN_SSC_TX AT91C_PA17_TD +#define OPENPCD_PIO_MFOUT_SSC_RX AT91C_PA18_RD +#define OPENPCD_PIO_SSP_CKIN AT91C_PA19_RK +#define OPENPCD_PIO_RC632_RESET AT91C_PIO_PA5 +#define OPENPCD_PIO_TRIGGER AT91C_PIO_PA31 +#define OPENPCD_PIO_CARRIER_IN AT91C_PA28_TCLK1 + + +/* PIO Definition PICCSIM v0.3 (modified) + * + * PA0 TIOA0 B O CARRIER_DIV_HELP + * PA1 TIOB1 B O SSC_CLOCK + * PA2 PA2 P O LOAD1 + * PA3 PA3 P O LOAD2 + * + * PA4 PA4 P I PLL_LOCK + * PA5 PA5 P O nSLAVE_RESET + * PA6 PA6 P I BOOTLOADER_SW + * PA7 PA7 P I N/C + * + * PA8 PA8 P O SPI_SS2 (Comparator) + * PA9 DRXD A I Debug + * PA10 DTXD A O Debug + * PA11 NPCS0 A O SPI_SS1 (Gain) + * + * PA12 PA12 P O LED2 red + * PA13 MOSI A O SPI Master Out + * PA14 SPCK A O SPI Clock + * PA15 TF A I SSC Tx Frame + * + * PA16 PA16 P O UDP_PUP (old) + * PA17 TD A O SSC Tx Data (MOD) * + * PA18 RD A I SSC Rx Data (SSC_DATA) + * PA19 RK A I SSC Rx Clock (SSC_CLOCK) + * + * PA20 PA20 P I AB_DETECT + * PA21 PA21 P I N/C + * PA22 PA22 P I N/C + * PA23 PWM0 B O PWM Output (MOD) * + * + * PA24 PA24 P O PLL_INHIBIT + * PA25 PA25 P O LED1 green + * PA26 TIOA2 B O TC FDT output (-> SPI Tx Frame) + * PA27 TIOB2 B I DATA + * + * PA28 TCLK1 B I CARRIER + * PA29 TCLK2 B I CARRIER_DIV_HELP + * PA30 PA30 P I N/C + * PA31 PA31 P I N/C + * + */ + +#define OPENPICC_PIO_LOAD1 AT91C_PIO_PA2 +#define OPENPICC_PIO_LOAD2 AT91C_PIO_PA3 +#define OPENPICC_PIO_nSLAVE_RESET AT91C_PIO_PA5 +#define OPENPICC_PIO_BOOTLDR AT91C_PIO_PA6 +#define OPENPICC_PIO_SS2_DT_THRESH AT91C_PIO_PA8 +#define OPENPICC_PIO_SS1_GAIN AT91C_PIO_PA11 +#define OPENPICC_PIO_PLL_LOCK AT91C_PIO_PA4 + +#define OPENPICC_PIO_FRAME AT91C_PIO_PA20 +#define OPENPICC_PIO_SSC_DATA_CONTROL AT91C_PIO_PA21 +#define OPENPICC_PIO_AB_DETECT AT91C_PIO_PA22 +#define OPENPICC_PIO_PLL_INHIBIT AT91C_PIO_PA24 + +#define OPENPICC_ADC_FIELD_STRENGTH AT91C_ADC_CH4 +#define OPENPICC_ADC_PLL_DEM AT91C_ADC_CH5 +#define OPENPICC_ADC_AN1 AT91C_ADC_CH6 +#define OPENPICC_ADC_AN2 AT91C_ADC_CH7 + +#define OPENPCD_IRQ_PRIO_SPI AT91C_AIC_PRIOR_HIGHEST +#define OPENPCD_IRQ_PRIO_SSC (AT91C_AIC_PRIOR_HIGHEST-1) +#define OPENPCD_IRQ_PRIO_SYS (AT91C_AIC_PRIOR_HIGHEST-2) +#define OPENPCD_IRQ_PRIO_TC_FDT (AT91C_AIC_PRIOR_LOWEST+3) +#define OPENPCD_IRQ_PRIO_UDP (AT91C_AIC_PRIOR_LOWEST+2) +#define OPENPCD_IRQ_PRIO_PIT (AT91C_AIC_PRIOR_LOWEST+1) +#define OPENPCD_IRQ_PRIO_RC632 AT91C_AIC_PRIOR_LOWEST + +#endif /* _OPENPCD_H */ diff --git a/firmware/src/os/blinkcode.c b/firmware/src/os/blinkcode.c new file mode 100644 index 0000000..22d4b25 --- /dev/null +++ b/firmware/src/os/blinkcode.c @@ -0,0 +1,115 @@ +/* SAM7DFU blink code support + * (C) 2006 by Harald Welte + * + */ + +#include +#include +#include +#include + +#define NUM_LEDS 2 + +enum blinkcode_state { + BLINKCODE_STATE_NONE, + BLINKCODE_STATE_SILENT, /* period of silence at start */ + BLINKCODE_STATE_INIT, /* initial long light */ + BLINKCODE_STATE_BLINK_OFF, /* blinking out, currently off */ + BLINKCODE_STATE_BLINK_ON, /* blinking out, currently on */ + BLINKCODE_STATE_DONE, +}; + +#define TIME_SILENT (1*HZ) +#define TIME_INIT (1*HZ) +#define TIME_BLINK (HZ/4) + +struct blinker { + struct timer_list timer; + enum blinkcode_state state; + int num; + int cur; + u_int8_t led; +}; + +static struct blinker blink_state[NUM_LEDS]; + +static void blinkcode_cb(void *data) +{ + /* we got called back by the timer */ + struct blinker *bl = data; + + DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + jiffies, data, bl->state); + switch (bl->state) { + case BLINKCODE_STATE_NONE: + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_SILENT; + bl->timer.expires = jiffies + TIME_SILENT; + bl->cur = bl->num; + break; + case BLINKCODE_STATE_SILENT: + /* we've finished the period of silence, turn led on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_INIT; + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_INIT: + /* we've finished the period of init */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + bl->timer.expires = jiffies + TIME_INIT; + break; + case BLINKCODE_STATE_BLINK_OFF: + /* we've been off, turn on */ + led_switch(bl->led, 1); + bl->state = BLINKCODE_STATE_BLINK_ON; + bl->cur--; + bl->timer.expires = jiffies + TIME_BLINK; + if (bl->cur <= 0) + bl->state = BLINKCODE_STATE_DONE; + break; + case BLINKCODE_STATE_BLINK_ON: + /* we've been on, turn off */ + led_switch(bl->led, 0); + bl->state = BLINKCODE_STATE_BLINK_OFF; + bl->timer.expires = jiffies + TIME_BLINK; + break; + case BLINKCODE_STATE_DONE: + /* we've been on, turn off */ + led_switch(bl->led, 0); + return; + break; + } + /* default case: re-add the timer */ + timer_add(&bl->timer); +} + +void blinkcode_set(int led, enum blinkcode_num num) +{ + DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + + if (--led > NUM_LEDS) + return; + + timer_del(&blink_state[led].timer); + + blink_state[led].num = num; + blink_state[led].state = BLINKCODE_STATE_NONE; + blink_state[led].timer.expires = jiffies; + + if (num != BLINKCODE_NONE) + timer_add(&blink_state[led].timer); +} + +void blinkcode_init(void) +{ + int i; + + for (i = 0; i < NUM_LEDS; i++) { + blink_state[i].num = 0; + blink_state[i].state = BLINKCODE_STATE_NONE; + blink_state[i].led = i+1; + blink_state[i].timer.data = &blink_state[i]; + blink_state[i].timer.function = &blinkcode_cb; + } +} diff --git a/firmware/src/os/blinkcode.h b/firmware/src/os/blinkcode.h new file mode 100644 index 0000000..142c148 --- /dev/null +++ b/firmware/src/os/blinkcode.h @@ -0,0 +1,14 @@ +#ifndef _BLINKCODE_H +#define _BLINKCODE_H + +enum blinkcode_num { + BLINKCODE_NONE, + BLINKCODE_IDLE, + BLINKCODE_DFU_MODE, + BLINKCODE_DFU_PROBLEM, + BLINKCODE_ +}; + +extern void blinkcode_set(int led, enum blinkcode_num); +extern void blinkcode_init(void); +#endif diff --git a/firmware/src/os/blinkcode.lst b/firmware/src/os/blinkcode.lst new file mode 100644 index 0000000..74d6ea2 --- /dev/null +++ b/firmware/src/os/blinkcode.lst @@ -0,0 +1,562 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "blinkcode.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 blinkcode_cb: + 24 .LFB0: + 25 .file 1 "src/os/blinkcode.c" + 1:src/os/blinkcode.c **** /* SAM7DFU blink code support + 2:src/os/blinkcode.c **** * (C) 2006 by Harald Welte + 3:src/os/blinkcode.c **** * + 4:src/os/blinkcode.c **** */ + 5:src/os/blinkcode.c **** + 6:src/os/blinkcode.c **** #include + 7:src/os/blinkcode.c **** #include + 8:src/os/blinkcode.c **** #include + 9:src/os/blinkcode.c **** #include + 10:src/os/blinkcode.c **** + 11:src/os/blinkcode.c **** #define NUM_LEDS 2 + 12:src/os/blinkcode.c **** + 13:src/os/blinkcode.c **** enum blinkcode_state { + 14:src/os/blinkcode.c **** BLINKCODE_STATE_NONE, + 15:src/os/blinkcode.c **** BLINKCODE_STATE_SILENT, /* period of silence at start */ + 16:src/os/blinkcode.c **** BLINKCODE_STATE_INIT, /* initial long light */ + 17:src/os/blinkcode.c **** BLINKCODE_STATE_BLINK_OFF, /* blinking out, currently off */ + 18:src/os/blinkcode.c **** BLINKCODE_STATE_BLINK_ON, /* blinking out, currently on */ + 19:src/os/blinkcode.c **** BLINKCODE_STATE_DONE, + 20:src/os/blinkcode.c **** }; + 21:src/os/blinkcode.c **** + 22:src/os/blinkcode.c **** #define TIME_SILENT (1*HZ) + 23:src/os/blinkcode.c **** #define TIME_INIT (1*HZ) + 24:src/os/blinkcode.c **** #define TIME_BLINK (HZ/4) + 25:src/os/blinkcode.c **** + 26:src/os/blinkcode.c **** struct blinker { + 27:src/os/blinkcode.c **** struct timer_list timer; + 28:src/os/blinkcode.c **** enum blinkcode_state state; + 29:src/os/blinkcode.c **** int num; + 30:src/os/blinkcode.c **** int cur; + 31:src/os/blinkcode.c **** u_int8_t led; + 32:src/os/blinkcode.c **** }; + 33:src/os/blinkcode.c **** + 34:src/os/blinkcode.c **** static struct blinker blink_state[NUM_LEDS]; + 35:src/os/blinkcode.c **** + 36:src/os/blinkcode.c **** static void blinkcode_cb(void *data) + 37:src/os/blinkcode.c **** { + 26 .loc 1 37 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 .LVL0: + 32 0000 30402DE9 stmfd sp!, {r4, r5, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 12 + 38:src/os/blinkcode.c **** /* we got called back by the timer */ + 39:src/os/blinkcode.c **** struct blinker *bl = data; + 40:src/os/blinkcode.c **** + 41:src/os/blinkcode.c **** DEBUGPCRF("(jiffies=%lu, data=%p, state=%u)", + 35 .loc 1 41 0 + 36 0004 3C519FE5 ldr r5, .L12 + 37 .cfi_offset 14, -4 + 38 .cfi_offset 5, -8 + 39 .cfi_offset 4, -12 + 40 0008 10C0D0E5 ldrb ip, [r0, #16] @ zero_extendqisi2 + 37:src/os/blinkcode.c **** { + 41 .loc 1 37 0 + 42 000c 0CD04DE2 sub sp, sp, #12 + 43 .LCFI1: + 44 .cfi_def_cfa_offset 24 + 37:src/os/blinkcode.c **** { + 45 .loc 1 37 0 + 46 0010 0040A0E1 mov r4, r0 + 47 .LVL1: + 48 .loc 1 41 0 + 49 0014 003095E5 ldr r3, [r5, #0] + 50 0018 2C019FE5 ldr r0, .L12+4 + 51 .LVL2: + 52 001c 2C119FE5 ldr r1, .L12+8 + 53 0020 2A20A0E3 mov r2, #42 + 54 0024 10108DE8 stmia sp, {r4, ip} @ phole stm + 55 0028 FEFFFFEB bl debugp + 42:src/os/blinkcode.c **** jiffies, data, bl->state); + 43:src/os/blinkcode.c **** switch (bl->state) { + 56 .loc 1 43 0 + 57 002c 1030D4E5 ldrb r3, [r4, #16] @ zero_extendqisi2 + 58 0030 050053E3 cmp r3, #5 + 59 0034 03F19F97 ldrls pc, [pc, r3, asl #2] + 60 0038 0D0000EA b .L2 + 61 .L9: + 62 003c 98000000 .word .L3 + 63 0040 C4000000 .word .L4 + 64 0044 E8000000 .word .L5 + 65 0048 0C010000 .word .L6 + 66 004c 54000000 .word .L7 + 67 0050 88000000 .word .L8 + 68 .L7: + 69 .LVL3: + 44:src/os/blinkcode.c **** case BLINKCODE_STATE_NONE: + 45:src/os/blinkcode.c **** led_switch(bl->led, 0); + 46:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_SILENT; + 47:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_SILENT; + 48:src/os/blinkcode.c **** bl->cur = bl->num; + 49:src/os/blinkcode.c **** break; + 50:src/os/blinkcode.c **** case BLINKCODE_STATE_SILENT: + 51:src/os/blinkcode.c **** /* we've finished the period of silence, turn led on */ + 52:src/os/blinkcode.c **** led_switch(bl->led, 1); + 53:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_INIT; + 54:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 55:src/os/blinkcode.c **** break; + 56:src/os/blinkcode.c **** case BLINKCODE_STATE_INIT: + 57:src/os/blinkcode.c **** /* we've finished the period of init */ + 58:src/os/blinkcode.c **** led_switch(bl->led, 0); + 59:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 60:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 61:src/os/blinkcode.c **** break; + 62:src/os/blinkcode.c **** case BLINKCODE_STATE_BLINK_OFF: + 63:src/os/blinkcode.c **** /* we've been off, turn on */ + 64:src/os/blinkcode.c **** led_switch(bl->led, 1); + 65:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_ON; + 66:src/os/blinkcode.c **** bl->cur--; + 67:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_BLINK; + 68:src/os/blinkcode.c **** if (bl->cur <= 0) + 69:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_DONE; + 70:src/os/blinkcode.c **** break; + 71:src/os/blinkcode.c **** case BLINKCODE_STATE_BLINK_ON: + 72:src/os/blinkcode.c **** /* we've been on, turn off */ + 73:src/os/blinkcode.c **** led_switch(bl->led, 0); + 70 .loc 1 73 0 + 71 0054 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 72 0058 0010A0E3 mov r1, #0 + 73 005c FEFFFFEB bl led_switch + 74:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 75:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_BLINK; + 74 .loc 1 75 0 + 75 0060 001095E5 ldr r1, [r5, #0] + 74:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 76 .loc 1 74 0 + 77 0064 0320A0E3 mov r2, #3 + 78 .loc 1 75 0 + 79 0068 190081E2 add r0, r1, #25 + 74:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 80 .loc 1 74 0 + 81 006c 1020C4E5 strb r2, [r4, #16] + 82 .loc 1 75 0 + 83 0070 040084E5 str r0, [r4, #4] + 84 .L2: + 76:src/os/blinkcode.c **** break; + 77:src/os/blinkcode.c **** case BLINKCODE_STATE_DONE: + 78:src/os/blinkcode.c **** /* we've been on, turn off */ + 79:src/os/blinkcode.c **** led_switch(bl->led, 0); + 80:src/os/blinkcode.c **** return; + 81:src/os/blinkcode.c **** break; + 82:src/os/blinkcode.c **** } + 83:src/os/blinkcode.c **** /* default case: re-add the timer */ + 84:src/os/blinkcode.c **** timer_add(&bl->timer); + 85 .loc 1 84 0 + 86 0074 0400A0E1 mov r0, r4 + 87 0078 FEFFFFEB bl timer_add + 88 .L1: + 85:src/os/blinkcode.c **** } + 89 .loc 1 85 0 + 90 007c 0CD08DE2 add sp, sp, #12 + 91 0080 3040BDE8 ldmfd sp!, {r4, r5, lr} + 92 0084 1EFF2FE1 bx lr + 93 .L8: + 79:src/os/blinkcode.c **** led_switch(bl->led, 0); + 94 .loc 1 79 0 + 95 0088 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 96 008c 0010A0E3 mov r1, #0 + 97 0090 FEFFFFEB bl led_switch + 80:src/os/blinkcode.c **** return; + 98 .loc 1 80 0 + 99 0094 F8FFFFEA b .L1 + 100 .L3: + 45:src/os/blinkcode.c **** led_switch(bl->led, 0); + 101 .loc 1 45 0 + 102 0098 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 103 009c 0010A0E3 mov r1, #0 + 104 00a0 FEFFFFEB bl led_switch + 47:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_SILENT; + 105 .loc 1 47 0 + 106 00a4 003095E5 ldr r3, [r5, #0] + 48:src/os/blinkcode.c **** bl->cur = bl->num; + 107 .loc 1 48 0 + 108 00a8 140094E5 ldr r0, [r4, #20] + 47:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_SILENT; + 109 .loc 1 47 0 + 110 00ac 642083E2 add r2, r3, #100 + 46:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_SILENT; + 111 .loc 1 46 0 + 112 00b0 0110A0E3 mov r1, #1 + 113 00b4 1010C4E5 strb r1, [r4, #16] + 47:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_SILENT; + 114 .loc 1 47 0 + 115 00b8 042084E5 str r2, [r4, #4] + 48:src/os/blinkcode.c **** bl->cur = bl->num; + 116 .loc 1 48 0 + 117 00bc 180084E5 str r0, [r4, #24] + 49:src/os/blinkcode.c **** break; + 118 .loc 1 49 0 + 119 00c0 EBFFFFEA b .L2 + 120 .L4: + 52:src/os/blinkcode.c **** led_switch(bl->led, 1); + 121 .loc 1 52 0 + 122 00c4 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 123 00c8 0110A0E3 mov r1, #1 + 124 00cc FEFFFFEB bl led_switch + 54:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 125 .loc 1 54 0 + 126 00d0 002095E5 ldr r2, [r5, #0] + 53:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_INIT; + 127 .loc 1 53 0 + 128 00d4 0200A0E3 mov r0, #2 + 54:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 129 .loc 1 54 0 + 130 00d8 64C082E2 add ip, r2, #100 + 53:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_INIT; + 131 .loc 1 53 0 + 132 00dc 1000C4E5 strb r0, [r4, #16] + 54:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 133 .loc 1 54 0 + 134 00e0 04C084E5 str ip, [r4, #4] + 55:src/os/blinkcode.c **** break; + 135 .loc 1 55 0 + 136 00e4 E2FFFFEA b .L2 + 137 .L5: + 58:src/os/blinkcode.c **** led_switch(bl->led, 0); + 138 .loc 1 58 0 + 139 00e8 0010A0E3 mov r1, #0 + 140 00ec 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 141 00f0 FEFFFFEB bl led_switch + 60:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 142 .loc 1 60 0 + 143 00f4 00C095E5 ldr ip, [r5, #0] + 59:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 144 .loc 1 59 0 + 145 00f8 0330A0E3 mov r3, #3 + 60:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 146 .loc 1 60 0 + 147 00fc 64108CE2 add r1, ip, #100 + 59:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_OFF; + 148 .loc 1 59 0 + 149 0100 1030C4E5 strb r3, [r4, #16] + 60:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_INIT; + 150 .loc 1 60 0 + 151 0104 041084E5 str r1, [r4, #4] + 61:src/os/blinkcode.c **** break; + 152 .loc 1 61 0 + 153 0108 D9FFFFEA b .L2 + 154 .L6: + 64:src/os/blinkcode.c **** led_switch(bl->led, 1); + 155 .loc 1 64 0 + 156 010c 1C00D4E5 ldrb r0, [r4, #28] @ zero_extendqisi2 + 157 0110 0110A0E3 mov r1, #1 + 158 0114 FEFFFFEB bl led_switch + 66:src/os/blinkcode.c **** bl->cur--; + 159 .loc 1 66 0 + 160 0118 183094E5 ldr r3, [r4, #24] + 67:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_BLINK; + 161 .loc 1 67 0 + 162 011c 00C095E5 ldr ip, [r5, #0] + 66:src/os/blinkcode.c **** bl->cur--; + 163 .loc 1 66 0 + 164 0120 010043E2 sub r0, r3, #1 + 68:src/os/blinkcode.c **** if (bl->cur <= 0) + 165 .loc 1 68 0 + 166 0124 000050E3 cmp r0, #0 + 67:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_BLINK; + 167 .loc 1 67 0 + 168 0128 19208CE2 add r2, ip, #25 + 65:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_ON; + 169 .loc 1 65 0 + 170 012c 0410A0E3 mov r1, #4 + 66:src/os/blinkcode.c **** bl->cur--; + 171 .loc 1 66 0 + 172 0130 180084E5 str r0, [r4, #24] + 69:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_DONE; + 173 .loc 1 69 0 + 174 0134 0500A0D3 movle r0, #5 + 65:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_BLINK_ON; + 175 .loc 1 65 0 + 176 0138 1010C4E5 strb r1, [r4, #16] + 67:src/os/blinkcode.c **** bl->timer.expires = jiffies + TIME_BLINK; + 177 .loc 1 67 0 + 178 013c 042084E5 str r2, [r4, #4] + 69:src/os/blinkcode.c **** bl->state = BLINKCODE_STATE_DONE; + 179 .loc 1 69 0 + 180 0140 1000C4D5 strleb r0, [r4, #16] + 181 0144 CAFFFFEA b .L2 + 182 .L13: + 183 .align 2 + 184 .L12: + 185 0148 00000000 .word jiffies + 186 014c 00000000 .word .LC0 + 187 0150 00000000 .word .LANCHOR0 + 188 .cfi_endproc + 189 .LFE0: + 191 .align 2 + 192 .global blinkcode_set + 194 blinkcode_set: + 195 .LFB1: + 86:src/os/blinkcode.c **** + 87:src/os/blinkcode.c **** void blinkcode_set(int led, enum blinkcode_num num) + 88:src/os/blinkcode.c **** { + 196 .loc 1 88 0 + 197 .cfi_startproc + 198 @ Function supports interworking. + 199 @ args = 0, pretend = 0, frame = 0 + 200 @ frame_needed = 0, uses_anonymous_args = 0 + 201 .LVL4: + 202 0154 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 203 .LCFI2: + 204 .cfi_def_cfa_offset 16 + 89:src/os/blinkcode.c **** DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + 205 .loc 1 89 0 + 206 0158 74609FE5 ldr r6, .L17 + 207 .cfi_offset 14, -4 + 208 .cfi_offset 6, -8 + 209 .cfi_offset 5, -12 + 210 .cfi_offset 4, -16 + 88:src/os/blinkcode.c **** { + 211 .loc 1 88 0 + 212 015c 08D04DE2 sub sp, sp, #8 + 213 .LCFI3: + 214 .cfi_def_cfa_offset 24 + 88:src/os/blinkcode.c **** { + 215 .loc 1 88 0 + 216 0160 0040A0E1 mov r4, r0 + 217 0164 0150A0E1 mov r5, r1 + 218 .loc 1 89 0 + 219 0168 00408DE5 str r4, [sp, #0] + 220 016c 003096E5 ldr r3, [r6, #0] + 221 0170 60009FE5 ldr r0, .L17+4 + 222 .LVL5: + 223 0174 60109FE5 ldr r1, .L17+8 + 224 .LVL6: + 225 0178 5920A0E3 mov r2, #89 + 90:src/os/blinkcode.c **** + 91:src/os/blinkcode.c **** if (--led > NUM_LEDS) + 226 .loc 1 91 0 + 227 017c 014044E2 sub r4, r4, #1 + 228 .LVL7: + 89:src/os/blinkcode.c **** DEBUGPCRF("(jiffies=%lu, led=%u, num=%u)", jiffies, led, num); + 229 .loc 1 89 0 + 230 0180 04508DE5 str r5, [sp, #4] + 231 0184 FEFFFFEB bl debugp + 232 .LVL8: + 233 .loc 1 91 0 + 234 0188 020054E3 cmp r4, #2 + 235 018c 020000DA ble .L16 + 236 .LVL9: + 237 .L14: + 92:src/os/blinkcode.c **** return; + 93:src/os/blinkcode.c **** + 94:src/os/blinkcode.c **** timer_del(&blink_state[led].timer); + 95:src/os/blinkcode.c **** + 96:src/os/blinkcode.c **** blink_state[led].num = num; + 97:src/os/blinkcode.c **** blink_state[led].state = BLINKCODE_STATE_NONE; + 98:src/os/blinkcode.c **** blink_state[led].timer.expires = jiffies; + 99:src/os/blinkcode.c **** + 100:src/os/blinkcode.c **** if (num != BLINKCODE_NONE) + 101:src/os/blinkcode.c **** timer_add(&blink_state[led].timer); + 102:src/os/blinkcode.c **** } + 238 .loc 1 102 0 + 239 0190 08D08DE2 add sp, sp, #8 + 240 0194 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 241 0198 1EFF2FE1 bx lr + 242 .LVL10: + 243 .L16: + 94:src/os/blinkcode.c **** timer_del(&blink_state[led].timer); + 244 .loc 1 94 0 + 245 019c 3C009FE5 ldr r0, .L17+12 + 246 01a0 844280E0 add r4, r0, r4, asl #5 + 247 .LVL11: + 248 01a4 0400A0E1 mov r0, r4 + 249 01a8 FEFFFFEB bl timer_del + 98:src/os/blinkcode.c **** blink_state[led].timer.expires = jiffies; + 250 .loc 1 98 0 + 251 01ac 003096E5 ldr r3, [r6, #0] + 97:src/os/blinkcode.c **** blink_state[led].state = BLINKCODE_STATE_NONE; + 252 .loc 1 97 0 + 253 01b0 0020A0E3 mov r2, #0 + 100:src/os/blinkcode.c **** if (num != BLINKCODE_NONE) + 254 .loc 1 100 0 + 255 01b4 000055E3 cmp r5, #0 + 96:src/os/blinkcode.c **** blink_state[led].num = num; + 256 .loc 1 96 0 + 257 01b8 145084E5 str r5, [r4, #20] + 97:src/os/blinkcode.c **** blink_state[led].state = BLINKCODE_STATE_NONE; + 258 .loc 1 97 0 + 259 01bc 1020C4E5 strb r2, [r4, #16] + 98:src/os/blinkcode.c **** blink_state[led].timer.expires = jiffies; + 260 .loc 1 98 0 + 261 01c0 043084E5 str r3, [r4, #4] + 100:src/os/blinkcode.c **** if (num != BLINKCODE_NONE) + 262 .loc 1 100 0 + 263 01c4 F1FFFF0A beq .L14 + 101:src/os/blinkcode.c **** timer_add(&blink_state[led].timer); + 264 .loc 1 101 0 + 265 01c8 0400A0E1 mov r0, r4 + 266 01cc FEFFFFEB bl timer_add + 267 01d0 EEFFFFEA b .L14 + 268 .L18: + 269 .align 2 + 270 .L17: + 271 01d4 00000000 .word jiffies + 272 01d8 2C000000 .word .LC1 + 273 01dc 10000000 .word .LANCHOR0+16 + 274 01e0 00000000 .word .LANCHOR1 + 275 .cfi_endproc + 276 .LFE1: + 278 .align 2 + 279 .global blinkcode_init + 281 blinkcode_init: + 282 .LFB2: + 103:src/os/blinkcode.c **** + 104:src/os/blinkcode.c **** void blinkcode_init(void) + 105:src/os/blinkcode.c **** { + 283 .loc 1 105 0 + 284 .cfi_startproc + 285 @ Function supports interworking. + 286 @ args = 0, pretend = 0, frame = 0 + 287 @ frame_needed = 0, uses_anonymous_args = 0 + 288 @ link register save eliminated. + 289 .LVL12: + 106:src/os/blinkcode.c **** int i; + 107:src/os/blinkcode.c **** + 108:src/os/blinkcode.c **** for (i = 0; i < NUM_LEDS; i++) { + 109:src/os/blinkcode.c **** blink_state[i].num = 0; + 290 .loc 1 109 0 + 291 01e4 3C309FE5 ldr r3, .L20 + 292 01e8 0020A0E3 mov r2, #0 + 110:src/os/blinkcode.c **** blink_state[i].state = BLINKCODE_STATE_NONE; + 111:src/os/blinkcode.c **** blink_state[i].led = i+1; + 112:src/os/blinkcode.c **** blink_state[i].timer.data = &blink_state[i]; + 113:src/os/blinkcode.c **** blink_state[i].timer.function = &blinkcode_cb; + 293 .loc 1 113 0 + 294 01ec 38109FE5 ldr r1, .L20+4 + 112:src/os/blinkcode.c **** blink_state[i].timer.data = &blink_state[i]; + 295 .loc 1 112 0 + 296 01f0 200083E2 add r0, r3, #32 + 109:src/os/blinkcode.c **** blink_state[i].num = 0; + 297 .loc 1 109 0 + 298 01f4 142083E5 str r2, [r3, #20] + 110:src/os/blinkcode.c **** blink_state[i].state = BLINKCODE_STATE_NONE; + 299 .loc 1 110 0 + 300 01f8 1020C3E5 strb r2, [r3, #16] + 111:src/os/blinkcode.c **** blink_state[i].led = i+1; + 301 .loc 1 111 0 + 302 01fc 01C0A0E3 mov ip, #1 + 109:src/os/blinkcode.c **** blink_state[i].num = 0; + 303 .loc 1 109 0 + 304 0200 342083E5 str r2, [r3, #52] + 110:src/os/blinkcode.c **** blink_state[i].state = BLINKCODE_STATE_NONE; + 305 .loc 1 110 0 + 306 0204 3020C3E5 strb r2, [r3, #48] + 111:src/os/blinkcode.c **** blink_state[i].led = i+1; + 307 .loc 1 111 0 + 308 0208 0220A0E3 mov r2, #2 + 309 020c 1CC0C3E5 strb ip, [r3, #28] + 112:src/os/blinkcode.c **** blink_state[i].timer.data = &blink_state[i]; + 310 .loc 1 112 0 + 311 0210 0C3083E5 str r3, [r3, #12] + 312 .loc 1 113 0 + 313 0214 081083E5 str r1, [r3, #8] + 314 .LVL13: + 111:src/os/blinkcode.c **** blink_state[i].led = i+1; + 315 .loc 1 111 0 + 316 0218 3C20C3E5 strb r2, [r3, #60] + 112:src/os/blinkcode.c **** blink_state[i].timer.data = &blink_state[i]; + 317 .loc 1 112 0 + 318 021c 2C0083E5 str r0, [r3, #44] + 319 .loc 1 113 0 + 320 0220 281083E5 str r1, [r3, #40] + 321 .LVL14: + 114:src/os/blinkcode.c **** } + 115:src/os/blinkcode.c **** } + 322 .loc 1 115 0 + 323 0224 1EFF2FE1 bx lr + 324 .L21: + 325 .align 2 + 326 .L20: + 327 0228 00000000 .word .LANCHOR1 + 328 022c 00000000 .word blinkcode_cb + 329 .cfi_endproc + 330 .LFE2: + 332 .section .rodata + 333 .align 2 + 334 .set .LANCHOR0,. + 0 + 337 __FUNCTION__.4079: + 338 0000 626C696E .ascii "blinkcode_cb\000" + 338 6B636F64 + 338 655F6362 + 338 00 + 339 000d 000000 .space 3 + 342 __FUNCTION__.4091: + 343 0010 626C696E .ascii "blinkcode_set\000" + 343 6B636F64 + 343 655F7365 + 343 7400 + 344 001e 0000 .section .rodata.str1.4,"aMS",%progbits,1 + 345 .align 2 + 346 .LC0: + 347 0000 25732825 .ascii "%s(%d): (jiffies=%lu, data=%p, state=%u)\015\012\000" + 347 64293A20 + 347 286A6966 + 347 66696573 + 347 3D256C75 + 348 002b 00 .space 1 + 349 .LC1: + 350 002c 25732825 .ascii "%s(%d): (jiffies=%lu, led=%u, num=%u)\015\012\000" + 350 64293A20 + 350 286A6966 + 350 66696573 + 350 3D256C75 + 351 .bss + 352 .align 2 + 353 .set .LANCHOR1,. + 0 + 356 blink_state: + 357 0000 00000000 .space 64 + 357 00000000 + 357 00000000 + 357 00000000 + 357 00000000 + 358 .text + 359 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 blinkcode.c +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:23 .text:00000000 blinkcode_cb +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:62 .text:0000003c $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:71 .text:00000054 $a +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:185 .text:00000148 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:191 .text:00000154 $a +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:194 .text:00000154 blinkcode_set +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:271 .text:000001d4 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:278 .text:000001e4 $a +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:281 .text:000001e4 blinkcode_init +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:327 .text:00000228 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:333 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:337 .rodata:00000000 __FUNCTION__.4079 +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:342 .rodata:00000010 __FUNCTION__.4091 +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:345 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:352 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTdUyhN.s:356 .bss:00000000 blink_state + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +debugp +led_switch +timer_add +jiffies +timer_del diff --git a/firmware/src/os/dbgu.c b/firmware/src/os/dbgu.c new file mode 100644 index 0000000..026b56b --- /dev/null +++ b/firmware/src/os/dbgu.c @@ -0,0 +1,350 @@ +/* AT91SAM7 debug function implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * I based this on existing BSD-style licensed code, please see below. + * + * 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 + * + */ + +/*---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support - ROUSSET - + *---------------------------------------------------------------------------- + * The software is delivered "AS IS" without warranty or condition of any + * kind, either express, implied or statutory. This includes without + * limitation any warranty or condition with respect to merchantability or + * fitness for any particular purpose, or against the infringements of + * intellectual property rights of others. + *---------------------------------------------------------------------------- + * File Name : Debug.c + * Object : Debug menu + * Creation : JPP 14/Sep/2004 + * 1.1 29/Aug/05 JPP : Update AIC definion + *----------------------------------------------------------------------------*/ + +// Include Standard files +#include +#include +#include "../openpcd.h" +#include +#include +#include +#include +#include +#include + +//#define DEBUG_UNBUFFERED + +#define USART_SYS_LEVEL 4 +/*---------------------------- Global Variable ------------------------------*/ +//*--------------------------1-------------------------------------------------- +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Ready(void) +{ + while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; +} + +//*---------------------------------------------------------------------------- +//* Function Name : Send_reset +//* Object : Acknoledeg AIC and send reset +//*---------------------------------------------------------------------------- +static void Send_reset(void) +{ + void (*pfct) (void) = (void (*)(void))0x00000000; + + // Acknoledge the interrupt + // Mark the End of Interrupt on the AIC + AT91C_BASE_AIC->AIC_EOICR = 0; + AT91F_DBGU_Ready(); + // Jump in reset + pfct(); +} + +//*---------------------------------------------------------------------------- +//* Function Name : DBGU_irq_handler +//* Object : C handler interrupt function called by the sysirq +//* demultiplexer +//*---------------------------------------------------------------------------- +static void DBGU_irq_handler(u_int32_t sr) +{ + static char value; + + AT91F_DBGU_Get(&value); + switch (value) { + case '0': //* info + AT91F_DBGU_Frame("Clear Pull up\n\r"); + // Set + udp_pullup_on(); + break; + case '1': //* info + udp_pullup_off(); + AT91F_DBGU_Printk("Set Pull up\n\r"); + // Reset Application + Send_reset(); + break; + case '2': + AT91F_DBGU_Printk("Toggling LED 1\n\r"); + led_toggle(1); + break; + case '3': + AT91F_DBGU_Printk("Toggling LED 2\n\r"); + led_toggle(2); + break; + case '9': + AT91F_DBGU_Printk("Resetting SAM7\n\r"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + default: + if (_main_dbgu(value) < 0) + AT91F_DBGU_Printk("\n\r"); + break; + } // end switch +} + +void dbgu_rb_init(void); +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Init +//* \brief This function is used to send a string through the DBGU channel (Very low level debugging) +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Init(void) +{ + dbgu_rb_init(); + + //* Open PIO for DBGU + AT91F_DBGU_CfgPIO(); + //* Enable Transmitter & receivier + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + AT91C_US_RSTTX | AT91C_US_RSTRX; + + //* Configure DBGU + AT91F_US_Configure((AT91PS_USART) AT91C_BASE_DBGU, // DBGU base address + MCK, AT91C_US_ASYNC_MODE, // Mode Register to be programmed + AT91C_DBGU_BAUD, // Baudrate to be programmed + 0); // Timeguard to be programmed + + //* Enable Transmitter & receivier + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + + //* Enable USART IT error and AT91C_US_ENDRX + AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + + //* open interrupt + sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + + AT91F_DBGU_Printk("\n\r"); + AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + AT91F_DBGU_Printk("Version " COMPILE_SVNREV + " compiled " COMPILE_DATE + " by " COMPILE_BY "\n\r\n\r"); + AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + "0) Set Pull-up 1) Clear Pull-up 2) Toggle LED1 3) " + "Toggle LED2\r\n9) Reset\n\r"); +} + +/* + * Disable the PIO assignments for the DBGU + */ +void AT91F_DBGU_Fini(void) +{ + ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXDIS | AT91C_US_TXDIS; + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PA10_DTXD); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PA9_DRXD); + // Maybe FIXME, do more? -- Henryk Plötz +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Printk +//* \brief This function is used to send a string through the DBGU channel (Very low level debugging) +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Printk(char *buffer) +{ + while (*buffer != '\0') { + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, *buffer++); + } +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_DBGU_Frame +//* \brief This function is used to send a string through the DBGU channel +//*---------------------------------------------------------------------------- +void AT91F_DBGU_Frame(char *buffer) +{ + unsigned char len; + + for (len = 0; buffer[len] != '\0'; len++) { + } + + AT91F_US_SendFrame((AT91PS_USART) AT91C_BASE_DBGU, + (unsigned char *)buffer, len, 0, 0); + +} + +//*---------------------------------------------------------------------------- +//* \fn AT91F_US_Get +//* \brief Get a Char to USART +//*---------------------------------------------------------------------------- +int AT91F_DBGU_Get(char *val) +{ + if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + return (0); + else { + *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + return (-1); + } +} + +// mthomas: function not used in this application. avoid +// linking huge newlib code for sscanf. + +#ifdef DEBUG +#include +#include +#include +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[256]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +struct dbgu { + char buf[4096]; + char *next_inbyte; + char *next_outbyte; +}; +static struct dbgu dbgu; + +void dbgu_rb_init(void) +{ + memset(dbgu.buf, 0, sizeof(dbgu.buf)); + dbgu.next_inbyte = &dbgu.buf[0]; + dbgu.next_outbyte = &dbgu.buf[0]; +} + +/* pull one char out of debug ring buffer */ +static int dbgu_rb_pull(char *ret) +{ + unsigned long flags; + + local_irq_save(flags); + + if (dbgu.next_outbyte == dbgu.next_inbyte) { + local_irq_restore(flags); + return -1; + } + + *ret = *dbgu.next_outbyte; + + dbgu.next_outbyte++; + if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + //AT91F_DBGU_Printk("WRAP DURING PULL\r\n"); + dbgu.next_outbyte = &dbgu.buf[0]; + } else if (dbgu.next_outbyte > &dbgu.buf[0]+sizeof(dbgu.buf)) { + //AT91F_DBGU_Printk("OUTBYTE > END_OF_BUF!!\r\n"); + dbgu.next_outbyte -= sizeof(dbgu.buf); + } + + local_irq_restore(flags); + + return 0; +} + +static void __rb_flush(void) +{ + char ch; + while (dbgu_rb_pull(&ch) >= 0) { + while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, ch); + } +} + +/* flush pending data from debug ring buffer to serial port */ +void dbgu_rb_flush(void) +{ + __rb_flush(); +} + +static void __dbgu_rb_append(char *data, int len) +{ + char *pos = dbgu.next_inbyte; + + dbgu.next_inbyte += len; + if (dbgu.next_inbyte >= &dbgu.buf[0]+sizeof(dbgu.buf)) { + AT91F_DBGU_Printk("WRAP DURING APPEND\r\n"); + dbgu.next_inbyte -= sizeof(dbgu.buf); + } + + memcpy(pos, data, len); +} + +void dbgu_rb_append(char *data, int len) +{ + unsigned long flags; + int bytes_left; + char *data_cur; + + local_irq_save(flags); + + bytes_left = &dbgu.buf[0]+sizeof(dbgu.buf)-dbgu.next_inbyte; + data_cur = data; + + if (len > bytes_left) { + AT91F_DBGU_Printk("LEN > BYTES_LEFT\r\n"); + __rb_flush(); + __dbgu_rb_append(data_cur, bytes_left); + len -= bytes_left; + data_cur += bytes_left; + } + __dbgu_rb_append(data_cur, len); + + local_irq_restore(flags); +} + +static char dbg_buf[256]; +void debugp(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + va_end(ap); + + dbg_buf[sizeof(dbg_buf)-1] = '\0'; + //AT91F_DBGU_Frame(dbg_buf); +#ifdef DEBUG_UNBUFFERED + AT91F_DBGU_Printk(dbg_buf); +#else + dbgu_rb_append(dbg_buf, strlen(dbg_buf)); +#endif +} +#else +void dbgu_rb_flush(void) {} +void dbgu_rb_init(void) {} +#endif diff --git a/firmware/src/os/dbgu.h b/firmware/src/os/dbgu.h new file mode 100644 index 0000000..c36ac8c --- /dev/null +++ b/firmware/src/os/dbgu.h @@ -0,0 +1,45 @@ +//*---------------------------------------------------------------------------- +//* ATMEL Microcontroller Software Support - ROUSSET - +//*---------------------------------------------------------------------------- +//* The software is delivered "AS IS" without warranty or condition of any +//* kind, either express, implied or statutory. This includes without +//* limitation any warranty or condition with respect to merchantability or +//* fitness for any particular purpose, or against the infringements of +//* intellectual property rights of others. +//*---------------------------------------------------------------------------- +//* File Name : Debug.h +//* Object : Debug menu +//* Creation : JPP 02/Sep/2004 +//*---------------------------------------------------------------------------- + +#ifndef dbgu_h +#define dbgu_h + +#define AT91C_DBGU_BAUD 115200 + +//#define DEBUGP(x) AT91F_DBGU_Printk(x) + +//* ----------------------- External Function Prototype ----------------------- + +extern const char *hexdump(const void *data, unsigned int len); +void AT91F_DBGU_Init(void); +void AT91F_DBGU_Fini(void); +void AT91F_DBGU_Printk( char *buffer); +void AT91F_DBGU_Frame( char *buffer); +int AT91F_DBGU_Get( char *val); +void dbgu_rb_flush(void); +#ifndef __WinARM__ +void AT91F_DBGU_scanf(char * type,unsigned int * val); +#endif + +#ifdef DEBUG +extern void debugp(const char *format, ...); +#define DEBUGP(x, args ...) debugp(x, ## args) +#else +#define DEBUGP(x, args ...) do {} while(0) +#endif + +#define DEBUGPCR(x, args ...) DEBUGP(x "\r\n", ## args) +#define DEBUGPCRF(x, args ...) DEBUGPCR("%s(%d): " x, __FUNCTION__, __LINE__, ## args) + +#endif /* dbgu_h */ diff --git a/firmware/src/os/dbgu.lst b/firmware/src/os/dbgu.lst new file mode 100644 index 0000000..9dbe745 --- /dev/null +++ b/firmware/src/os/dbgu.lst @@ -0,0 +1,4138 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "dbgu.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 __rb_flush: + 24 .LFB289: + 25 .file 1 "src/os/dbgu.c" + 1:src/os/dbgu.c **** /* AT91SAM7 debug function implementation for OpenPCD + 2:src/os/dbgu.c **** * (C) 2006 by Harald Welte + 3:src/os/dbgu.c **** * + 4:src/os/dbgu.c **** * I based this on existing BSD-style licensed code, please see below. + 5:src/os/dbgu.c **** * + 6:src/os/dbgu.c **** * This program is free software; you can redistribute it and/or modify + 7:src/os/dbgu.c **** * it under the terms of the GNU General Public License as published by + 8:src/os/dbgu.c **** * the Free Software Foundation; either version 2 of the License, or + 9:src/os/dbgu.c **** * (at your option) any later version. + 10:src/os/dbgu.c **** * + 11:src/os/dbgu.c **** * This program is distributed in the hope that it will be useful, + 12:src/os/dbgu.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 13:src/os/dbgu.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 14:src/os/dbgu.c **** * GNU General Public License for more details. + 15:src/os/dbgu.c **** * + 16:src/os/dbgu.c **** * You should have received a copy of the GNU General Public License + 17:src/os/dbgu.c **** * along with this program; if not, write to the Free Software + 18:src/os/dbgu.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 19:src/os/dbgu.c **** * + 20:src/os/dbgu.c **** */ + 21:src/os/dbgu.c **** + 22:src/os/dbgu.c **** /*---------------------------------------------------------------------------- + 23:src/os/dbgu.c **** * ATMEL Microcontroller Software Support - ROUSSET - + 24:src/os/dbgu.c **** *---------------------------------------------------------------------------- + 25:src/os/dbgu.c **** * The software is delivered "AS IS" without warranty or condition of any + 26:src/os/dbgu.c **** * kind, either express, implied or statutory. This includes without + 27:src/os/dbgu.c **** * limitation any warranty or condition with respect to merchantability or + 28:src/os/dbgu.c **** * fitness for any particular purpose, or against the infringements of + 29:src/os/dbgu.c **** * intellectual property rights of others. + 30:src/os/dbgu.c **** *---------------------------------------------------------------------------- + 31:src/os/dbgu.c **** * File Name : Debug.c + 32:src/os/dbgu.c **** * Object : Debug menu + 33:src/os/dbgu.c **** * Creation : JPP 14/Sep/2004 + 34:src/os/dbgu.c **** * 1.1 29/Aug/05 JPP : Update AIC definion + 35:src/os/dbgu.c **** *----------------------------------------------------------------------------*/ + 36:src/os/dbgu.c **** + 37:src/os/dbgu.c **** // Include Standard files + 38:src/os/dbgu.c **** #include + 39:src/os/dbgu.c **** #include + 40:src/os/dbgu.c **** #include "../openpcd.h" + 41:src/os/dbgu.c **** #include + 42:src/os/dbgu.c **** #include + 43:src/os/dbgu.c **** #include + 44:src/os/dbgu.c **** #include + 45:src/os/dbgu.c **** #include + 46:src/os/dbgu.c **** #include + 47:src/os/dbgu.c **** + 48:src/os/dbgu.c **** //#define DEBUG_UNBUFFERED + 49:src/os/dbgu.c **** + 50:src/os/dbgu.c **** #define USART_SYS_LEVEL 4 + 51:src/os/dbgu.c **** /*---------------------------- Global Variable ------------------------------*/ + 52:src/os/dbgu.c **** //*--------------------------1-------------------------------------------------- + 53:src/os/dbgu.c **** //* \fn AT91F_DBGU_Printk + 54:src/os/dbgu.c **** //* \brief This function is used to send a string through the DBGU channel + 55:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 56:src/os/dbgu.c **** void AT91F_DBGU_Ready(void) + 57:src/os/dbgu.c **** { + 58:src/os/dbgu.c **** while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 59:src/os/dbgu.c **** } + 60:src/os/dbgu.c **** + 61:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 62:src/os/dbgu.c **** //* Function Name : Send_reset + 63:src/os/dbgu.c **** //* Object : Acknoledeg AIC and send reset + 64:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 65:src/os/dbgu.c **** static void Send_reset(void) + 66:src/os/dbgu.c **** { + 67:src/os/dbgu.c **** void (*pfct) (void) = (void (*)(void))0x00000000; + 68:src/os/dbgu.c **** + 69:src/os/dbgu.c **** // Acknoledge the interrupt + 70:src/os/dbgu.c **** // Mark the End of Interrupt on the AIC + 71:src/os/dbgu.c **** AT91C_BASE_AIC->AIC_EOICR = 0; + 72:src/os/dbgu.c **** AT91F_DBGU_Ready(); + 73:src/os/dbgu.c **** // Jump in reset + 74:src/os/dbgu.c **** pfct(); + 75:src/os/dbgu.c **** } + 76:src/os/dbgu.c **** + 77:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 78:src/os/dbgu.c **** //* Function Name : DBGU_irq_handler + 79:src/os/dbgu.c **** //* Object : C handler interrupt function called by the sysirq + 80:src/os/dbgu.c **** //* demultiplexer + 81:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 82:src/os/dbgu.c **** static void DBGU_irq_handler(u_int32_t sr) + 83:src/os/dbgu.c **** { + 84:src/os/dbgu.c **** static char value; + 85:src/os/dbgu.c **** + 86:src/os/dbgu.c **** AT91F_DBGU_Get(&value); + 87:src/os/dbgu.c **** switch (value) { + 88:src/os/dbgu.c **** case '0': //* info + 89:src/os/dbgu.c **** AT91F_DBGU_Frame("Clear Pull up\n\r"); + 90:src/os/dbgu.c **** // Set + 91:src/os/dbgu.c **** udp_pullup_on(); + 92:src/os/dbgu.c **** break; + 93:src/os/dbgu.c **** case '1': //* info + 94:src/os/dbgu.c **** udp_pullup_off(); + 95:src/os/dbgu.c **** AT91F_DBGU_Printk("Set Pull up\n\r"); + 96:src/os/dbgu.c **** // Reset Application + 97:src/os/dbgu.c **** Send_reset(); + 98:src/os/dbgu.c **** break; + 99:src/os/dbgu.c **** case '2': + 100:src/os/dbgu.c **** AT91F_DBGU_Printk("Toggling LED 1\n\r"); + 101:src/os/dbgu.c **** led_toggle(1); + 102:src/os/dbgu.c **** break; + 103:src/os/dbgu.c **** case '3': + 104:src/os/dbgu.c **** AT91F_DBGU_Printk("Toggling LED 2\n\r"); + 105:src/os/dbgu.c **** led_toggle(2); + 106:src/os/dbgu.c **** break; + 107:src/os/dbgu.c **** case '9': + 108:src/os/dbgu.c **** AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 109:src/os/dbgu.c **** AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 110:src/os/dbgu.c **** AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + 111:src/os/dbgu.c **** break; + 112:src/os/dbgu.c **** default: + 113:src/os/dbgu.c **** if (_main_dbgu(value) < 0) + 114:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 115:src/os/dbgu.c **** break; + 116:src/os/dbgu.c **** } // end switch + 117:src/os/dbgu.c **** } + 118:src/os/dbgu.c **** + 119:src/os/dbgu.c **** void dbgu_rb_init(void); + 120:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 121:src/os/dbgu.c **** //* \fn AT91F_DBGU_Init + 122:src/os/dbgu.c **** //* \brief This function is used to send a string through the DBGU channel (Very low level debuggin + 123:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 124:src/os/dbgu.c **** void AT91F_DBGU_Init(void) + 125:src/os/dbgu.c **** { + 126:src/os/dbgu.c **** dbgu_rb_init(); + 127:src/os/dbgu.c **** + 128:src/os/dbgu.c **** //* Open PIO for DBGU + 129:src/os/dbgu.c **** AT91F_DBGU_CfgPIO(); + 130:src/os/dbgu.c **** //* Enable Transmitter & receivier + 131:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 132:src/os/dbgu.c **** AT91C_US_RSTTX | AT91C_US_RSTRX; + 133:src/os/dbgu.c **** + 134:src/os/dbgu.c **** //* Configure DBGU + 135:src/os/dbgu.c **** AT91F_US_Configure((AT91PS_USART) AT91C_BASE_DBGU, // DBGU base address + 136:src/os/dbgu.c **** MCK, AT91C_US_ASYNC_MODE, // Mode Register to be programmed + 137:src/os/dbgu.c **** AT91C_DBGU_BAUD, // Baudrate to be programmed + 138:src/os/dbgu.c **** 0); // Timeguard to be programmed + 139:src/os/dbgu.c **** + 140:src/os/dbgu.c **** //* Enable Transmitter & receivier + 141:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + 142:src/os/dbgu.c **** + 143:src/os/dbgu.c **** //* Enable USART IT error and AT91C_US_ENDRX + 144:src/os/dbgu.c **** AT91F_US_EnableIt((AT91PS_USART) AT91C_BASE_DBGU, AT91C_US_RXRDY); + 145:src/os/dbgu.c **** + 146:src/os/dbgu.c **** //* open interrupt + 147:src/os/dbgu.c **** sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 148:src/os/dbgu.c **** + 149:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 150:src/os/dbgu.c **** AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + 151:src/os/dbgu.c **** "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); + 152:src/os/dbgu.c **** AT91F_DBGU_Printk("Version " COMPILE_SVNREV + 153:src/os/dbgu.c **** " compiled " COMPILE_DATE + 154:src/os/dbgu.c **** " by " COMPILE_BY "\n\r\n\r"); + 155:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + 156:src/os/dbgu.c **** "0) Set Pull-up 1) Clear Pull-up 2) Toggle LED1 3) " + 157:src/os/dbgu.c **** "Toggle LED2\r\n9) Reset\n\r"); + 158:src/os/dbgu.c **** } + 159:src/os/dbgu.c **** + 160:src/os/dbgu.c **** /* + 161:src/os/dbgu.c **** * Disable the PIO assignments for the DBGU + 162:src/os/dbgu.c **** */ + 163:src/os/dbgu.c **** void AT91F_DBGU_Fini(void) + 164:src/os/dbgu.c **** { + 165:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXDIS | AT91C_US_TXDIS; + 166:src/os/dbgu.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PA10_DTXD); + 167:src/os/dbgu.c **** AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PA9_DRXD); + 168:src/os/dbgu.c **** // Maybe FIXME, do more? -- Henryk Plötz + 169:src/os/dbgu.c **** } + 170:src/os/dbgu.c **** + 171:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 172:src/os/dbgu.c **** //* \fn AT91F_DBGU_Printk + 173:src/os/dbgu.c **** //* \brief This function is used to send a string through the DBGU channel (Very low level debuggin + 174:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 175:src/os/dbgu.c **** void AT91F_DBGU_Printk(char *buffer) + 176:src/os/dbgu.c **** { + 177:src/os/dbgu.c **** while (*buffer != '\0') { + 178:src/os/dbgu.c **** while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 179:src/os/dbgu.c **** AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, *buffer++); + 180:src/os/dbgu.c **** } + 181:src/os/dbgu.c **** } + 182:src/os/dbgu.c **** + 183:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 184:src/os/dbgu.c **** //* \fn AT91F_DBGU_Frame + 185:src/os/dbgu.c **** //* \brief This function is used to send a string through the DBGU channel + 186:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 187:src/os/dbgu.c **** void AT91F_DBGU_Frame(char *buffer) + 188:src/os/dbgu.c **** { + 189:src/os/dbgu.c **** unsigned char len; + 190:src/os/dbgu.c **** + 191:src/os/dbgu.c **** for (len = 0; buffer[len] != '\0'; len++) { + 192:src/os/dbgu.c **** } + 193:src/os/dbgu.c **** + 194:src/os/dbgu.c **** AT91F_US_SendFrame((AT91PS_USART) AT91C_BASE_DBGU, + 195:src/os/dbgu.c **** (unsigned char *)buffer, len, 0, 0); + 196:src/os/dbgu.c **** + 197:src/os/dbgu.c **** } + 198:src/os/dbgu.c **** + 199:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 200:src/os/dbgu.c **** //* \fn AT91F_US_Get + 201:src/os/dbgu.c **** //* \brief Get a Char to USART + 202:src/os/dbgu.c **** //*---------------------------------------------------------------------------- + 203:src/os/dbgu.c **** int AT91F_DBGU_Get(char *val) + 204:src/os/dbgu.c **** { + 205:src/os/dbgu.c **** if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 206:src/os/dbgu.c **** return (0); + 207:src/os/dbgu.c **** else { + 208:src/os/dbgu.c **** *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 209:src/os/dbgu.c **** return (-1); + 210:src/os/dbgu.c **** } + 211:src/os/dbgu.c **** } + 212:src/os/dbgu.c **** + 213:src/os/dbgu.c **** // mthomas: function not used in this application. avoid + 214:src/os/dbgu.c **** // linking huge newlib code for sscanf. + 215:src/os/dbgu.c **** + 216:src/os/dbgu.c **** #ifdef DEBUG + 217:src/os/dbgu.c **** #include + 218:src/os/dbgu.c **** #include + 219:src/os/dbgu.c **** #include + 220:src/os/dbgu.c **** const char * + 221:src/os/dbgu.c **** hexdump(const void *data, unsigned int len) + 222:src/os/dbgu.c **** { + 223:src/os/dbgu.c **** static char string[256]; + 224:src/os/dbgu.c **** unsigned char *d = (unsigned char *) data; + 225:src/os/dbgu.c **** unsigned int i, left; + 226:src/os/dbgu.c **** + 227:src/os/dbgu.c **** string[0] = '\0'; + 228:src/os/dbgu.c **** left = sizeof(string); + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 230:src/os/dbgu.c **** if (i >= sizeof(string) -4) + 231:src/os/dbgu.c **** break; + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 233:src/os/dbgu.c **** } + 234:src/os/dbgu.c **** return string; + 235:src/os/dbgu.c **** } + 236:src/os/dbgu.c **** + 237:src/os/dbgu.c **** struct dbgu { + 238:src/os/dbgu.c **** char buf[4096]; + 239:src/os/dbgu.c **** char *next_inbyte; + 240:src/os/dbgu.c **** char *next_outbyte; + 241:src/os/dbgu.c **** }; + 242:src/os/dbgu.c **** static struct dbgu dbgu; + 243:src/os/dbgu.c **** + 244:src/os/dbgu.c **** void dbgu_rb_init(void) + 245:src/os/dbgu.c **** { + 246:src/os/dbgu.c **** memset(dbgu.buf, 0, sizeof(dbgu.buf)); + 247:src/os/dbgu.c **** dbgu.next_inbyte = &dbgu.buf[0]; + 248:src/os/dbgu.c **** dbgu.next_outbyte = &dbgu.buf[0]; + 249:src/os/dbgu.c **** } + 250:src/os/dbgu.c **** + 251:src/os/dbgu.c **** /* pull one char out of debug ring buffer */ + 252:src/os/dbgu.c **** static int dbgu_rb_pull(char *ret) + 253:src/os/dbgu.c **** { + 254:src/os/dbgu.c **** unsigned long flags; + 255:src/os/dbgu.c **** + 256:src/os/dbgu.c **** local_irq_save(flags); + 257:src/os/dbgu.c **** + 258:src/os/dbgu.c **** if (dbgu.next_outbyte == dbgu.next_inbyte) { + 259:src/os/dbgu.c **** local_irq_restore(flags); + 260:src/os/dbgu.c **** return -1; + 261:src/os/dbgu.c **** } + 262:src/os/dbgu.c **** + 263:src/os/dbgu.c **** *ret = *dbgu.next_outbyte; + 264:src/os/dbgu.c **** + 265:src/os/dbgu.c **** dbgu.next_outbyte++; + 266:src/os/dbgu.c **** if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + 267:src/os/dbgu.c **** //AT91F_DBGU_Printk("WRAP DURING PULL\r\n"); + 268:src/os/dbgu.c **** dbgu.next_outbyte = &dbgu.buf[0]; + 269:src/os/dbgu.c **** } else if (dbgu.next_outbyte > &dbgu.buf[0]+sizeof(dbgu.buf)) { + 270:src/os/dbgu.c **** //AT91F_DBGU_Printk("OUTBYTE > END_OF_BUF!!\r\n"); + 271:src/os/dbgu.c **** dbgu.next_outbyte -= sizeof(dbgu.buf); + 272:src/os/dbgu.c **** } + 273:src/os/dbgu.c **** + 274:src/os/dbgu.c **** local_irq_restore(flags); + 275:src/os/dbgu.c **** + 276:src/os/dbgu.c **** return 0; + 277:src/os/dbgu.c **** } + 278:src/os/dbgu.c **** + 279:src/os/dbgu.c **** static void __rb_flush(void) + 280:src/os/dbgu.c **** { + 26 .loc 1 280 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 32 0000 F0012DE9 stmfd sp!, {r4, r5, r6, r7, r8} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 20 + 35 .LBB45: + 36 .LBB47: + 37 .LBB48: + 256:src/os/dbgu.c **** local_irq_save(flags); + 38 .loc 1 256 0 + 39 @ 256 "src/os/dbgu.c" 1 + 40 0004 00C00FE1 mrs ip, cpsr @ local_irq_save + 41 0008 80308CE3 orr r3, ip, #128 + 42 000c 03F021E1 msr cpsr_c, r3 + 43 @ 0 "" 2 + 44 .LVL0: + 45 .LBE48: + 258:src/os/dbgu.c **** if (dbgu.next_outbyte == dbgu.next_inbyte) { + 46 .loc 1 258 0 + 47 0010 7C109FE5 ldr r1, .L11 + 48 0014 7C009FE5 ldr r0, .L11+4 + 49 0018 015AA0E3 mov r5, #4096 + 50 .cfi_offset 8, -4 + 51 .cfi_offset 7, -8 + 52 .cfi_offset 6, -12 + 53 .cfi_offset 5, -16 + 54 .cfi_offset 4, -20 + 55 001c 003091E7 ldr r3, [r1, r0] + 56 0020 052091E7 ldr r2, [r1, r5] + 57 0024 020053E1 cmp r3, r2 + 58 0028 1600000A beq .L2 + 59 .LBE47: + 60 .LBE45: + 61 .LBB52: + 62 .LBB54: + 63 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:include/lib_AT91SAM7.h **** } +1574:include/lib_AT91SAM7.h **** +1575:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:include/lib_AT91SAM7.h **** { +1583:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:include/lib_AT91SAM7.h **** } +1585:include/lib_AT91SAM7.h **** +1586:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:include/lib_AT91SAM7.h **** { +1594:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:include/lib_AT91SAM7.h **** } +1596:include/lib_AT91SAM7.h **** +1597:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:include/lib_AT91SAM7.h **** int val) // chip select register +1608:include/lib_AT91SAM7.h **** { +1609:include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:include/lib_AT91SAM7.h **** } +1612:include/lib_AT91SAM7.h **** +1613:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:include/lib_AT91SAM7.h **** { +1621:include/lib_AT91SAM7.h **** //* Write to the IER register +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:include/lib_AT91SAM7.h **** } +1624:include/lib_AT91SAM7.h **** +1625:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:include/lib_AT91SAM7.h **** { +1633:include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:include/lib_AT91SAM7.h **** } +1636:include/lib_AT91SAM7.h **** +1637:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:include/lib_AT91SAM7.h **** ) +1644:include/lib_AT91SAM7.h **** { +1645:include/lib_AT91SAM7.h **** //* Write to the CR register +1646:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:include/lib_AT91SAM7.h **** } +1648:include/lib_AT91SAM7.h **** +1649:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:include/lib_AT91SAM7.h **** ) +1656:include/lib_AT91SAM7.h **** { +1657:include/lib_AT91SAM7.h **** //* Write to the CR register +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:include/lib_AT91SAM7.h **** } +1660:include/lib_AT91SAM7.h **** +1661:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:include/lib_AT91SAM7.h **** ) +1668:include/lib_AT91SAM7.h **** { +1669:include/lib_AT91SAM7.h **** //* Write to the CR register +1670:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:include/lib_AT91SAM7.h **** } +1672:include/lib_AT91SAM7.h **** +1673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:include/lib_AT91SAM7.h **** int mode) // mode register +1680:include/lib_AT91SAM7.h **** { +1681:include/lib_AT91SAM7.h **** //* Write to the MR register +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:include/lib_AT91SAM7.h **** } +1684:include/lib_AT91SAM7.h **** +1685:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:include/lib_AT91SAM7.h **** { +1693:include/lib_AT91SAM7.h **** //* Write to the MR register +1694:include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:include/lib_AT91SAM7.h **** } +1697:include/lib_AT91SAM7.h **** +1698:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:include/lib_AT91SAM7.h **** { +1709:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +1710:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:include/lib_AT91SAM7.h **** pBuffer, +1712:include/lib_AT91SAM7.h **** szBuffer, +1713:include/lib_AT91SAM7.h **** pNextBuffer, +1714:include/lib_AT91SAM7.h **** szNextBuffer); +1715:include/lib_AT91SAM7.h **** } +1716:include/lib_AT91SAM7.h **** +1717:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:include/lib_AT91SAM7.h **** { +1728:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +1729:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1730:include/lib_AT91SAM7.h **** pBuffer, +1731:include/lib_AT91SAM7.h **** szBuffer, +1732:include/lib_AT91SAM7.h **** pNextBuffer, +1733:include/lib_AT91SAM7.h **** szNextBuffer); +1734:include/lib_AT91SAM7.h **** } +1735:include/lib_AT91SAM7.h **** +1736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1737:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Close +1738:include/lib_AT91SAM7.h **** //* \brief Close SPI: disable IT disable transfert, close PDC +1739:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1740:include/lib_AT91SAM7.h **** extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller +1741:include/lib_AT91SAM7.h **** +1742:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1743:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_PutChar +1744:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +1745:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1746:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_PutChar ( +1747:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1748:include/lib_AT91SAM7.h **** unsigned int character, +1749:include/lib_AT91SAM7.h **** unsigned int cs_number ) +1750:include/lib_AT91SAM7.h **** { +1751:include/lib_AT91SAM7.h **** unsigned int value_for_cs; +1752:include/lib_AT91SAM7.h **** value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +1753:include/lib_AT91SAM7.h **** pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +1754:include/lib_AT91SAM7.h **** } +1755:include/lib_AT91SAM7.h **** +1756:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1757:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetChar +1758:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +1759:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1760:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_GetChar ( +1761:include/lib_AT91SAM7.h **** const AT91PS_SPI pSPI) +1762:include/lib_AT91SAM7.h **** { +1763:include/lib_AT91SAM7.h **** return((pSPI->SPI_RDR) & 0xFFFF); +1764:include/lib_AT91SAM7.h **** } +1765:include/lib_AT91SAM7.h **** +1766:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1767:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetInterruptMaskStatus +1768:include/lib_AT91SAM7.h **** //* \brief Return SPI Interrupt Mask Status +1769:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1770:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +1771:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi) // \arg pointer to a SPI controller +1772:include/lib_AT91SAM7.h **** { +1773:include/lib_AT91SAM7.h **** return pSpi->SPI_IMR; +1774:include/lib_AT91SAM7.h **** } +1775:include/lib_AT91SAM7.h **** +1776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1777:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_IsInterruptMasked +1778:include/lib_AT91SAM7.h **** //* \brief Test if SPI Interrupt is Masked +1779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1780:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_IsInterruptMasked( +1781:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi, // \arg pointer to a SPI controller +1782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1783:include/lib_AT91SAM7.h **** { +1784:include/lib_AT91SAM7.h **** return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +1785:include/lib_AT91SAM7.h **** } +1786:include/lib_AT91SAM7.h **** +1787:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1788:include/lib_AT91SAM7.h **** SOFTWARE API FOR ADC +1789:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1791:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableIt +1792:include/lib_AT91SAM7.h **** //* \brief Enable ADC interrupt +1793:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1794:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableIt ( +1795:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1796:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1797:include/lib_AT91SAM7.h **** { +1798:include/lib_AT91SAM7.h **** //* Write to the IER register +1799:include/lib_AT91SAM7.h **** pADC->ADC_IER = flag; +1800:include/lib_AT91SAM7.h **** } +1801:include/lib_AT91SAM7.h **** +1802:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1803:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableIt +1804:include/lib_AT91SAM7.h **** //* \brief Disable ADC interrupt +1805:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1806:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableIt ( +1807:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1808:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1809:include/lib_AT91SAM7.h **** { +1810:include/lib_AT91SAM7.h **** //* Write to the IDR register +1811:include/lib_AT91SAM7.h **** pADC->ADC_IDR = flag; +1812:include/lib_AT91SAM7.h **** } +1813:include/lib_AT91SAM7.h **** +1814:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1815:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetStatus +1816:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Status +1817:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1818:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +1819:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1820:include/lib_AT91SAM7.h **** { +1821:include/lib_AT91SAM7.h **** return pADC->ADC_SR; +1822:include/lib_AT91SAM7.h **** } +1823:include/lib_AT91SAM7.h **** +1824:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1825:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetInterruptMaskStatus +1826:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Mask Status +1827:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1828:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +1829:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1830:include/lib_AT91SAM7.h **** { +1831:include/lib_AT91SAM7.h **** return pADC->ADC_IMR; +1832:include/lib_AT91SAM7.h **** } +1833:include/lib_AT91SAM7.h **** +1834:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1835:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsInterruptMasked +1836:include/lib_AT91SAM7.h **** //* \brief Test if ADC Interrupt is Masked +1837:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1838:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsInterruptMasked( +1839:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1840:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1841:include/lib_AT91SAM7.h **** { +1842:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +1843:include/lib_AT91SAM7.h **** } +1844:include/lib_AT91SAM7.h **** +1845:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1846:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsStatusSet +1847:include/lib_AT91SAM7.h **** //* \brief Test if ADC Status is Set +1848:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1849:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsStatusSet( +1850:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1851:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1852:include/lib_AT91SAM7.h **** { +1853:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetStatus(pADC) & flag); +1854:include/lib_AT91SAM7.h **** } +1855:include/lib_AT91SAM7.h **** +1856:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1857:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgModeReg +1858:include/lib_AT91SAM7.h **** //* \brief Configure the Mode Register of the ADC controller +1859:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1860:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_CfgModeReg ( +1861:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1862:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1863:include/lib_AT91SAM7.h **** { +1864:include/lib_AT91SAM7.h **** //* Write to the MR register +1865:include/lib_AT91SAM7.h **** pADC->ADC_MR = mode; +1866:include/lib_AT91SAM7.h **** } +1867:include/lib_AT91SAM7.h **** +1868:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1869:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetModeReg +1870:include/lib_AT91SAM7.h **** //* \brief Return the Mode Register of the ADC controller value +1871:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1872:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetModeReg ( +1873:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1874:include/lib_AT91SAM7.h **** ) +1875:include/lib_AT91SAM7.h **** { +1876:include/lib_AT91SAM7.h **** return pADC->ADC_MR; +1877:include/lib_AT91SAM7.h **** } +1878:include/lib_AT91SAM7.h **** +1879:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1880:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgTimings +1881:include/lib_AT91SAM7.h **** //* \brief Configure the different necessary timings of the ADC controller +1882:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1883:include/lib_AT91SAM7.h **** extern void AT91F_ADC_CfgTimings ( +1884:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1885:include/lib_AT91SAM7.h **** unsigned int mck_clock, // in MHz +1886:include/lib_AT91SAM7.h **** unsigned int adc_clock, // in MHz +1887:include/lib_AT91SAM7.h **** unsigned int startup_time, // in us +1888:include/lib_AT91SAM7.h **** unsigned int sample_and_hold_time); // in ns +1889:include/lib_AT91SAM7.h **** +1890:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1891:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableChannel +1892:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1893:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1894:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableChannel ( +1895:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1896:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1897:include/lib_AT91SAM7.h **** { +1898:include/lib_AT91SAM7.h **** //* Write to the CHER register +1899:include/lib_AT91SAM7.h **** pADC->ADC_CHER = channel; +1900:include/lib_AT91SAM7.h **** } +1901:include/lib_AT91SAM7.h **** +1902:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1903:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableChannel +1904:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1905:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1906:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableChannel ( +1907:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1908:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1909:include/lib_AT91SAM7.h **** { +1910:include/lib_AT91SAM7.h **** //* Write to the CHDR register +1911:include/lib_AT91SAM7.h **** pADC->ADC_CHDR = channel; +1912:include/lib_AT91SAM7.h **** } +1913:include/lib_AT91SAM7.h **** +1914:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1915:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetChannelStatus +1916:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1917:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1918:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetChannelStatus ( +1919:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1920:include/lib_AT91SAM7.h **** ) +1921:include/lib_AT91SAM7.h **** { +1922:include/lib_AT91SAM7.h **** return pADC->ADC_CHSR; +1923:include/lib_AT91SAM7.h **** } +1924:include/lib_AT91SAM7.h **** +1925:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1926:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_StartConversion +1927:include/lib_AT91SAM7.h **** //* \brief Software request for a analog to digital conversion +1928:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1929:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_StartConversion ( +1930:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1931:include/lib_AT91SAM7.h **** ) +1932:include/lib_AT91SAM7.h **** { +1933:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_START; +1934:include/lib_AT91SAM7.h **** } +1935:include/lib_AT91SAM7.h **** +1936:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1937:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_SoftReset +1938:include/lib_AT91SAM7.h **** //* \brief Software reset +1939:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1940:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_SoftReset ( +1941:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1942:include/lib_AT91SAM7.h **** ) +1943:include/lib_AT91SAM7.h **** { +1944:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_SWRST; +1945:include/lib_AT91SAM7.h **** } +1946:include/lib_AT91SAM7.h **** +1947:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1948:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetLastConvertedData +1949:include/lib_AT91SAM7.h **** //* \brief Return the Last Converted Data +1950:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1951:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetLastConvertedData ( +1952:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1953:include/lib_AT91SAM7.h **** ) +1954:include/lib_AT91SAM7.h **** { +1955:include/lib_AT91SAM7.h **** return pADC->ADC_LCDR; +1956:include/lib_AT91SAM7.h **** } +1957:include/lib_AT91SAM7.h **** +1958:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1959:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH0 +1960:include/lib_AT91SAM7.h **** //* \brief Return the Channel 0 Converted Data +1961:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1962:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +1963:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1964:include/lib_AT91SAM7.h **** ) +1965:include/lib_AT91SAM7.h **** { +1966:include/lib_AT91SAM7.h **** return pADC->ADC_CDR0; +1967:include/lib_AT91SAM7.h **** } +1968:include/lib_AT91SAM7.h **** +1969:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1970:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH1 +1971:include/lib_AT91SAM7.h **** //* \brief Return the Channel 1 Converted Data +1972:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1973:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +1974:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1975:include/lib_AT91SAM7.h **** ) +1976:include/lib_AT91SAM7.h **** { +1977:include/lib_AT91SAM7.h **** return pADC->ADC_CDR1; +1978:include/lib_AT91SAM7.h **** } +1979:include/lib_AT91SAM7.h **** +1980:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1981:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH2 +1982:include/lib_AT91SAM7.h **** //* \brief Return the Channel 2 Converted Data +1983:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1984:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +1985:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1986:include/lib_AT91SAM7.h **** ) +1987:include/lib_AT91SAM7.h **** { +1988:include/lib_AT91SAM7.h **** return pADC->ADC_CDR2; +1989:include/lib_AT91SAM7.h **** } +1990:include/lib_AT91SAM7.h **** +1991:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1992:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH3 +1993:include/lib_AT91SAM7.h **** //* \brief Return the Channel 3 Converted Data +1994:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1995:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +1996:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1997:include/lib_AT91SAM7.h **** ) +1998:include/lib_AT91SAM7.h **** { +1999:include/lib_AT91SAM7.h **** return pADC->ADC_CDR3; +2000:include/lib_AT91SAM7.h **** } +2001:include/lib_AT91SAM7.h **** +2002:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2003:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH4 +2004:include/lib_AT91SAM7.h **** //* \brief Return the Channel 4 Converted Data +2005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2006:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +2007:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2008:include/lib_AT91SAM7.h **** ) +2009:include/lib_AT91SAM7.h **** { +2010:include/lib_AT91SAM7.h **** return pADC->ADC_CDR4; +2011:include/lib_AT91SAM7.h **** } +2012:include/lib_AT91SAM7.h **** +2013:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2014:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH5 +2015:include/lib_AT91SAM7.h **** //* \brief Return the Channel 5 Converted Data +2016:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2017:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +2018:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2019:include/lib_AT91SAM7.h **** ) +2020:include/lib_AT91SAM7.h **** { +2021:include/lib_AT91SAM7.h **** return pADC->ADC_CDR5; +2022:include/lib_AT91SAM7.h **** } +2023:include/lib_AT91SAM7.h **** +2024:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2025:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH6 +2026:include/lib_AT91SAM7.h **** //* \brief Return the Channel 6 Converted Data +2027:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2028:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +2029:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2030:include/lib_AT91SAM7.h **** ) +2031:include/lib_AT91SAM7.h **** { +2032:include/lib_AT91SAM7.h **** return pADC->ADC_CDR6; +2033:include/lib_AT91SAM7.h **** } +2034:include/lib_AT91SAM7.h **** +2035:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2036:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH7 +2037:include/lib_AT91SAM7.h **** //* \brief Return the Channel 7 Converted Data +2038:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2039:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +2040:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2041:include/lib_AT91SAM7.h **** ) +2042:include/lib_AT91SAM7.h **** { +2043:include/lib_AT91SAM7.h **** return pADC->ADC_CDR7; +2044:include/lib_AT91SAM7.h **** } +2045:include/lib_AT91SAM7.h **** +2046:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2047:include/lib_AT91SAM7.h **** SOFTWARE API FOR SSC +2048:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2049:include/lib_AT91SAM7.h **** //* Define the standard I2S mode configuration +2050:include/lib_AT91SAM7.h **** +2051:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Clock Mode Register +2052:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2053:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2054:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2055:include/lib_AT91SAM7.h **** AT91C_SSC_CKS_DIV +\ +2056:include/lib_AT91SAM7.h **** AT91C_SSC_CKO_CONTINOUS +\ +2057:include/lib_AT91SAM7.h **** AT91C_SSC_CKG_NONE +\ +2058:include/lib_AT91SAM7.h **** AT91C_SSC_START_FALL_RF +\ +2059:include/lib_AT91SAM7.h **** AT91C_SSC_STTOUT +\ +2060:include/lib_AT91SAM7.h **** ((1<<16) & AT91C_SSC_STTDLY) +\ +2061:include/lib_AT91SAM7.h **** ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +2062:include/lib_AT91SAM7.h **** +2063:include/lib_AT91SAM7.h **** +2064:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Frame Mode Register +2065:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2066:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2067:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2068:include/lib_AT91SAM7.h **** (nb_bit_by_slot-1) +\ +2069:include/lib_AT91SAM7.h **** AT91C_SSC_MSBF +\ +2070:include/lib_AT91SAM7.h **** (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +2071:include/lib_AT91SAM7.h **** (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +2072:include/lib_AT91SAM7.h **** AT91C_SSC_FSOS_NEGATIVE) +2073:include/lib_AT91SAM7.h **** +2074:include/lib_AT91SAM7.h **** +2075:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2076:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SetBaudrate +2077:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2078:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2079:include/lib_AT91SAM7.h **** extern void AT91F_SSC_SetBaudrate ( +2080:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2081:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2082:include/lib_AT91SAM7.h **** unsigned int speed); // \arg SSC baudrate +2083:include/lib_AT91SAM7.h **** +2084:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2085:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_Configure +2086:include/lib_AT91SAM7.h **** //* \brief Configure SSC +2087:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2088:include/lib_AT91SAM7.h **** extern void AT91F_SSC_Configure ( +2089:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2090:include/lib_AT91SAM7.h **** unsigned int syst_clock, // \arg System Clock Frequency +2091:include/lib_AT91SAM7.h **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency +2092:include/lib_AT91SAM7.h **** unsigned int clock_rx, // \arg Receiver Clock Parameters +2093:include/lib_AT91SAM7.h **** unsigned int mode_rx, // \arg mode Register to be programmed +2094:include/lib_AT91SAM7.h **** unsigned int clock_tx, // \arg Transmitter Clock Parameters +2095:include/lib_AT91SAM7.h **** unsigned int mode_tx); // \arg mode Register to be programmed +2096:include/lib_AT91SAM7.h **** +2097:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2098:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableRx +2099:include/lib_AT91SAM7.h **** //* \brief Enable receiving datas +2100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2101:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableRx ( +2102:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2103:include/lib_AT91SAM7.h **** { +2104:include/lib_AT91SAM7.h **** //* Enable receiver +2105:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXEN; +2106:include/lib_AT91SAM7.h **** } +2107:include/lib_AT91SAM7.h **** +2108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2109:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableRx +2110:include/lib_AT91SAM7.h **** //* \brief Disable receiving datas +2111:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2112:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableRx ( +2113:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2114:include/lib_AT91SAM7.h **** { +2115:include/lib_AT91SAM7.h **** //* Disable receiver +2116:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXDIS; +2117:include/lib_AT91SAM7.h **** } +2118:include/lib_AT91SAM7.h **** +2119:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2120:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableTx +2121:include/lib_AT91SAM7.h **** //* \brief Enable sending datas +2122:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2123:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableTx ( +2124:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2125:include/lib_AT91SAM7.h **** { +2126:include/lib_AT91SAM7.h **** //* Enable transmitter +2127:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXEN; +2128:include/lib_AT91SAM7.h **** } +2129:include/lib_AT91SAM7.h **** +2130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2131:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableTx +2132:include/lib_AT91SAM7.h **** //* \brief Disable sending datas +2133:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2134:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableTx ( +2135:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2136:include/lib_AT91SAM7.h **** { +2137:include/lib_AT91SAM7.h **** //* Disable transmitter +2138:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXDIS; +2139:include/lib_AT91SAM7.h **** } +2140:include/lib_AT91SAM7.h **** +2141:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2142:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableIt +2143:include/lib_AT91SAM7.h **** //* \brief Enable SSC IT +2144:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2145:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableIt ( +2146:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2147:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2148:include/lib_AT91SAM7.h **** { +2149:include/lib_AT91SAM7.h **** //* Write to the IER register +2150:include/lib_AT91SAM7.h **** pSSC->SSC_IER = flag; +2151:include/lib_AT91SAM7.h **** } +2152:include/lib_AT91SAM7.h **** +2153:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2154:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableIt +2155:include/lib_AT91SAM7.h **** //* \brief Disable SSC IT +2156:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2157:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableIt ( +2158:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2159:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2160:include/lib_AT91SAM7.h **** { +2161:include/lib_AT91SAM7.h **** //* Write to the IDR register +2162:include/lib_AT91SAM7.h **** pSSC->SSC_IDR = flag; +2163:include/lib_AT91SAM7.h **** } +2164:include/lib_AT91SAM7.h **** +2165:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2166:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_ReceiveFrame +2167:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2168:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2169:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_ReceiveFrame ( +2170:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2171:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2172:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2173:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2174:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2175:include/lib_AT91SAM7.h **** { +2176:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2177:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2178:include/lib_AT91SAM7.h **** pBuffer, +2179:include/lib_AT91SAM7.h **** szBuffer, +2180:include/lib_AT91SAM7.h **** pNextBuffer, +2181:include/lib_AT91SAM7.h **** szNextBuffer); +2182:include/lib_AT91SAM7.h **** } +2183:include/lib_AT91SAM7.h **** +2184:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2185:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SendFrame +2186:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2187:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2188:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_SendFrame( +2189:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2190:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2191:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2192:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2193:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2194:include/lib_AT91SAM7.h **** { +2195:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2196:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2197:include/lib_AT91SAM7.h **** pBuffer, +2198:include/lib_AT91SAM7.h **** szBuffer, +2199:include/lib_AT91SAM7.h **** pNextBuffer, +2200:include/lib_AT91SAM7.h **** szNextBuffer); +2201:include/lib_AT91SAM7.h **** } +2202:include/lib_AT91SAM7.h **** +2203:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2204:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_GetInterruptMaskStatus +2205:include/lib_AT91SAM7.h **** //* \brief Return SSC Interrupt Mask Status +2206:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2207:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +2208:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc) // \arg pointer to a SSC controller +2209:include/lib_AT91SAM7.h **** { +2210:include/lib_AT91SAM7.h **** return pSsc->SSC_IMR; +2211:include/lib_AT91SAM7.h **** } +2212:include/lib_AT91SAM7.h **** +2213:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2214:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_IsInterruptMasked +2215:include/lib_AT91SAM7.h **** //* \brief Test if SSC Interrupt is Masked +2216:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2217:include/lib_AT91SAM7.h **** static inline int AT91F_SSC_IsInterruptMasked( +2218:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc, // \arg pointer to a SSC controller +2219:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2220:include/lib_AT91SAM7.h **** { +2221:include/lib_AT91SAM7.h **** return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +2222:include/lib_AT91SAM7.h **** } +2223:include/lib_AT91SAM7.h **** +2224:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2225:include/lib_AT91SAM7.h **** SOFTWARE API FOR USART +2226:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2228:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2229:include/lib_AT91SAM7.h **** //* \brief Calculate the baudrate +2230:include/lib_AT91SAM7.h **** //* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +2231:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +2232:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2233:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2234:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2235:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2236:include/lib_AT91SAM7.h **** +2237:include/lib_AT91SAM7.h **** //* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +2238:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +2239:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2240:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2241:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2242:include/lib_AT91SAM7.h **** AT91C_US_CLKS_EXT ) +2243:include/lib_AT91SAM7.h **** +2244:include/lib_AT91SAM7.h **** //* Standard Synchronous Mode : 8 bits , 1 stop , no parity +2245:include/lib_AT91SAM7.h **** #define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +2246:include/lib_AT91SAM7.h **** AT91C_US_USMODE_NORMAL + \ +2247:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2248:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2249:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2250:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2251:include/lib_AT91SAM7.h **** +2252:include/lib_AT91SAM7.h **** //* SCK used Label +2253:include/lib_AT91SAM7.h **** #define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +2254:include/lib_AT91SAM7.h **** +2255:include/lib_AT91SAM7.h **** //* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +2256:include/lib_AT91SAM7.h **** #define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +2257:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK +\ +2258:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2259:include/lib_AT91SAM7.h **** AT91C_US_PAR_EVEN + \ +2260:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2261:include/lib_AT91SAM7.h **** AT91C_US_CKLO +\ +2262:include/lib_AT91SAM7.h **** AT91C_US_OVER) +2263:include/lib_AT91SAM7.h **** +2264:include/lib_AT91SAM7.h **** //* Standard IRDA mode +2265:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +2266:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2267:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2268:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2269:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2270:include/lib_AT91SAM7.h **** +2271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2272:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2273:include/lib_AT91SAM7.h **** //* \brief Caluculate baud_value according to the main clock and the baud rate +2274:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2275:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Baudrate ( +2276:include/lib_AT91SAM7.h **** const unsigned int main_clock, // \arg peripheral clock +2277:include/lib_AT91SAM7.h **** const unsigned int baud_rate) // \arg UART baudrate +2278:include/lib_AT91SAM7.h **** { +2279:include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +2280:include/lib_AT91SAM7.h **** if ((baud_value % 10) >= 5) +2281:include/lib_AT91SAM7.h **** baud_value = (baud_value / 10) + 1; +2282:include/lib_AT91SAM7.h **** else +2283:include/lib_AT91SAM7.h **** baud_value /= 10; +2284:include/lib_AT91SAM7.h **** return baud_value; +2285:include/lib_AT91SAM7.h **** } +2286:include/lib_AT91SAM7.h **** +2287:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2288:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetBaudrate +2289:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2290:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2291:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetBaudrate ( +2292:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2293:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2294:include/lib_AT91SAM7.h **** unsigned int speed) // \arg UART baudrate +2295:include/lib_AT91SAM7.h **** { +2296:include/lib_AT91SAM7.h **** //* Define the baud rate divisor register +2297:include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +2298:include/lib_AT91SAM7.h **** } +2299:include/lib_AT91SAM7.h **** +2300:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2301:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetTimeguard +2302:include/lib_AT91SAM7.h **** //* \brief Set USART timeguard +2303:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2304:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetTimeguard ( +2305:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2306:include/lib_AT91SAM7.h **** unsigned int timeguard) // \arg timeguard value +2307:include/lib_AT91SAM7.h **** { +2308:include/lib_AT91SAM7.h **** //* Write the Timeguard Register +2309:include/lib_AT91SAM7.h **** pUSART->US_TTGR = timeguard ; +2310:include/lib_AT91SAM7.h **** } +2311:include/lib_AT91SAM7.h **** +2312:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2313:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableIt +2314:include/lib_AT91SAM7.h **** //* \brief Enable USART IT +2315:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2316:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableIt ( +2317:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2318:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2319:include/lib_AT91SAM7.h **** { +2320:include/lib_AT91SAM7.h **** //* Write to the IER register +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; +2322:include/lib_AT91SAM7.h **** } +2323:include/lib_AT91SAM7.h **** +2324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2325:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableIt +2326:include/lib_AT91SAM7.h **** //* \brief Disable USART IT +2327:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2328:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableIt ( +2329:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2330:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2331:include/lib_AT91SAM7.h **** { +2332:include/lib_AT91SAM7.h **** //* Write to the IER register +2333:include/lib_AT91SAM7.h **** pUSART->US_IDR = flag; +2334:include/lib_AT91SAM7.h **** } +2335:include/lib_AT91SAM7.h **** +2336:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2337:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Configure +2338:include/lib_AT91SAM7.h **** //* \brief Configure USART +2339:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2340:include/lib_AT91SAM7.h **** extern void AT91F_US_Configure ( +2341:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2342:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2343:include/lib_AT91SAM7.h **** unsigned int mode , // \arg mode Register to be programmed +2344:include/lib_AT91SAM7.h **** unsigned int baudRate , // \arg baudrate to be programmed +2345:include/lib_AT91SAM7.h **** unsigned int timeguard ); // \arg timeguard to be programmed +2346:include/lib_AT91SAM7.h **** +2347:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2348:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableRx +2349:include/lib_AT91SAM7.h **** //* \brief Enable receiving characters +2350:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2351:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableRx ( +2352:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2353:include/lib_AT91SAM7.h **** { +2354:include/lib_AT91SAM7.h **** //* Enable receiver +2355:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2356:include/lib_AT91SAM7.h **** } +2357:include/lib_AT91SAM7.h **** +2358:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2359:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableTx +2360:include/lib_AT91SAM7.h **** //* \brief Enable sending characters +2361:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2362:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableTx ( +2363:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2364:include/lib_AT91SAM7.h **** { +2365:include/lib_AT91SAM7.h **** //* Enable transmitter +2366:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2367:include/lib_AT91SAM7.h **** } +2368:include/lib_AT91SAM7.h **** +2369:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2370:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetRx +2371:include/lib_AT91SAM7.h **** //* \brief Reset Receiver and re-enable it +2372:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2373:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetRx ( +2374:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2375:include/lib_AT91SAM7.h **** { +2376:include/lib_AT91SAM7.h **** //* Reset receiver +2377:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTRX; +2378:include/lib_AT91SAM7.h **** //* Re-Enable receiver +2379:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2380:include/lib_AT91SAM7.h **** } +2381:include/lib_AT91SAM7.h **** +2382:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2383:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetTx +2384:include/lib_AT91SAM7.h **** //* \brief Reset Transmitter and re-enable it +2385:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2386:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetTx ( +2387:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2388:include/lib_AT91SAM7.h **** { +2389:include/lib_AT91SAM7.h **** //* Reset transmitter +2390:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTTX; +2391:include/lib_AT91SAM7.h **** //* Enable transmitter +2392:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2393:include/lib_AT91SAM7.h **** } +2394:include/lib_AT91SAM7.h **** +2395:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2396:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableRx +2397:include/lib_AT91SAM7.h **** //* \brief Disable Receiver +2398:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2399:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableRx ( +2400:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2401:include/lib_AT91SAM7.h **** { +2402:include/lib_AT91SAM7.h **** //* Disable receiver +2403:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXDIS; +2404:include/lib_AT91SAM7.h **** } +2405:include/lib_AT91SAM7.h **** +2406:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2407:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableTx +2408:include/lib_AT91SAM7.h **** //* \brief Disable Transmitter +2409:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2410:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableTx ( +2411:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2412:include/lib_AT91SAM7.h **** { +2413:include/lib_AT91SAM7.h **** //* Disable transmitter +2414:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXDIS; +2415:include/lib_AT91SAM7.h **** } +2416:include/lib_AT91SAM7.h **** +2417:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2418:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Close +2419:include/lib_AT91SAM7.h **** //* \brief Close USART: disable IT disable receiver and transmitter, close PDC +2420:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2421:include/lib_AT91SAM7.h **** extern void AT91F_US_Close(AT91PS_USART pUSART); // \arg pointer to a USART controller +2422:include/lib_AT91SAM7.h **** +2423:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2424:include/lib_AT91SAM7.h **** //* \fn AT91F_US_TxReady +2425:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be written in US_THR +2426:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2427:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_TxReady ( +2428:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2429:include/lib_AT91SAM7.h **** { +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 64 .loc 2 2430 0 + 65 002c 0D2CE0E3 mvn r2, #3328 + 66 0030 057081E0 add r7, r1, r5 + 67 .LBE54: + 68 .LBE52: + 69 .LBB56: + 70 .LBB50: + 265:src/os/dbgu.c **** dbgu.next_outbyte++; + 71 .loc 1 265 0 + 72 0034 0180A0E1 mov r8, r1 + 73 .LBE50: + 74 .LBE56: + 75 .LBB57: + 76 .LBB53: + 77 .loc 2 2430 0 + 78 0038 0260A0E1 mov r6, r2 + 79 .L5: + 80 .LBE53: + 81 .LBE57: + 82 .LBB58: + 83 .LBB46: + 263:src/os/dbgu.c **** *ret = *dbgu.next_outbyte; + 84 .loc 1 263 0 + 85 003c 0140D3E4 ldrb r4, [r3], #1 @ zero_extendqisi2 + 86 .LVL1: + 266:src/os/dbgu.c **** if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + 87 .loc 1 266 0 + 88 0040 070053E1 cmp r3, r7 + 265:src/os/dbgu.c **** dbgu.next_outbyte++; + 89 .loc 1 265 0 + 90 0044 003081E7 str r3, [r1, r0] + 268:src/os/dbgu.c **** dbgu.next_outbyte = &dbgu.buf[0]; + 91 .loc 1 268 0 + 92 0048 00808807 streq r8, [r8, r0] + 266:src/os/dbgu.c **** if (dbgu.next_outbyte == &dbgu.buf[0]+sizeof(dbgu.buf)) { + 93 .loc 1 266 0 + 94 004c 0100000A beq .L7 + 271:src/os/dbgu.c **** dbgu.next_outbyte -= sizeof(dbgu.buf); + 95 .loc 1 271 0 + 96 0050 013A4382 subhi r3, r3, #4096 + 97 0054 00308887 strhi r3, [r8, r0] + 98 .L7: + 274:src/os/dbgu.c **** local_irq_restore(flags); + 99 .loc 1 274 0 + 100 @ 274 "src/os/dbgu.c" 1 + 101 0058 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 102 + 103 @ 0 "" 2 + 104 .L4: + 105 .LVL2: + 106 .LBE46: + 107 .LBE58: + 108 .LBB59: + 109 .LBB55: + 110 .loc 2 2430 0 discriminator 1 + 111 005c EB3012E5 ldr r3, [r2, #-235] + 112 .LBE55: + 113 .LBE59: + 281:src/os/dbgu.c **** char ch; + 282:src/os/dbgu.c **** while (dbgu_rb_pull(&ch) >= 0) { + 283:src/os/dbgu.c **** while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 114 .loc 1 283 0 discriminator 1 + 115 0060 020013E3 tst r3, #2 + 116 0064 FCFFFF0A beq .L4 + 117 .LVL3: + 118 .LBB60: + 119 .LBB61: +2431:include/lib_AT91SAM7.h **** } +2432:include/lib_AT91SAM7.h **** +2433:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2434:include/lib_AT91SAM7.h **** //* \fn AT91F_US_RxReady +2435:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be read in US_RHR +2436:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2437:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_RxReady ( +2438:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2439:include/lib_AT91SAM7.h **** { +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); +2441:include/lib_AT91SAM7.h **** } +2442:include/lib_AT91SAM7.h **** +2443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2444:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Error +2445:include/lib_AT91SAM7.h **** //* \brief Return the error flag +2446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2447:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Error ( +2448:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2449:include/lib_AT91SAM7.h **** { +2450:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & +2451:include/lib_AT91SAM7.h **** (AT91C_US_OVRE | // Overrun error +2452:include/lib_AT91SAM7.h **** AT91C_US_FRAME | // Framing error +2453:include/lib_AT91SAM7.h **** AT91C_US_PARE)); // Parity error +2454:include/lib_AT91SAM7.h **** } +2455:include/lib_AT91SAM7.h **** +2456:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2457:include/lib_AT91SAM7.h **** //* \fn AT91F_US_PutChar +2458:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +2459:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2460:include/lib_AT91SAM7.h **** static inline void AT91F_US_PutChar ( +2461:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2462:include/lib_AT91SAM7.h **** int character ) +2463:include/lib_AT91SAM7.h **** { +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); + 120 .loc 2 2464 0 + 121 0068 E34006E5 str r4, [r6, #-227] + 122 .LVL4: + 123 .LBE61: + 124 .LBE60: + 125 .LBB62: + 126 .LBB51: + 127 .LBB49: + 256:src/os/dbgu.c **** local_irq_save(flags); + 128 .loc 1 256 0 + 129 @ 256 "src/os/dbgu.c" 1 + 130 006c 00C00FE1 mrs ip, cpsr @ local_irq_save + 131 0070 80308CE3 orr r3, ip, #128 + 132 0074 03F021E1 msr cpsr_c, r3 + 133 @ 0 "" 2 + 134 .LVL5: + 135 .LBE49: + 258:src/os/dbgu.c **** if (dbgu.next_outbyte == dbgu.next_inbyte) { + 136 .loc 1 258 0 + 137 0078 003091E7 ldr r3, [r1, r0] + 138 007c 054091E7 ldr r4, [r1, r5] + 139 .LVL6: + 140 0080 040053E1 cmp r3, r4 + 141 0084 ECFFFF1A bne .L5 + 142 .LVL7: + 143 .L2: + 259:src/os/dbgu.c **** local_irq_restore(flags); + 144 .loc 1 259 0 + 145 @ 259 "src/os/dbgu.c" 1 + 146 0088 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 147 + 148 @ 0 "" 2 + 149 .LBE51: + 150 .LBE62: + 284:src/os/dbgu.c **** AT91F_US_PutChar((AT91PS_USART) AT91C_BASE_DBGU, ch); + 285:src/os/dbgu.c **** } + 286:src/os/dbgu.c **** } + 151 .loc 1 286 0 + 152 008c F001BDE8 ldmfd sp!, {r4, r5, r6, r7, r8} + 153 0090 1EFF2FE1 bx lr + 154 .L12: + 155 .align 2 + 156 .L11: + 157 0094 00000000 .word .LANCHOR0 + 158 0098 04100000 .word 4100 + 159 .cfi_endproc + 160 .LFE289: + 162 .align 2 + 163 .global AT91F_DBGU_Ready + 165 AT91F_DBGU_Ready: + 166 .LFB278: + 57:src/os/dbgu.c **** { + 167 .loc 1 57 0 + 168 .cfi_startproc + 169 @ Function supports interworking. + 170 @ args = 0, pretend = 0, frame = 0 + 171 @ frame_needed = 0, uses_anonymous_args = 0 + 172 @ link register save eliminated. + 58:src/os/dbgu.c **** while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 173 .loc 1 58 0 + 174 009c 0D2CE0E3 mvn r2, #3328 + 175 .L14: + 58:src/os/dbgu.c **** while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 176 .loc 1 58 0 is_stmt 0 discriminator 1 + 177 00a0 EB3012E5 ldr r3, [r2, #-235] + 178 00a4 020C13E3 tst r3, #512 + 179 00a8 FCFFFF0A beq .L14 + 59:src/os/dbgu.c **** } + 180 .loc 1 59 0 is_stmt 1 + 181 00ac 1EFF2FE1 bx lr + 182 .cfi_endproc + 183 .LFE278: + 185 .align 2 + 186 .global AT91F_DBGU_Fini + 188 AT91F_DBGU_Fini: + 189 .LFB282: + 164:src/os/dbgu.c **** { + 190 .loc 1 164 0 + 191 .cfi_startproc + 192 @ Function supports interworking. + 193 @ args = 0, pretend = 0, frame = 0 + 194 @ frame_needed = 0, uses_anonymous_args = 0 + 195 @ link register save eliminated. + 196 .LBB63: + 197 .LBB64: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 198 .loc 2 404 0 + 199 00b0 0B3CE0E3 mvn r3, #2816 + 200 00b4 011BA0E3 mov r1, #1024 + 201 .LBE64: + 202 .LBE63: + 203 .LBB66: + 204 .LBB67: + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 205 .loc 2 417 0 + 206 00b8 022CA0E3 mov r2, #512 + 207 .LBE67: + 208 .LBE66: + 165:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXDIS | AT91C_US_TXDIS; + 209 .loc 1 165 0 + 210 00bc A0C0A0E3 mov ip, #160 + 211 00c0 0D0CE0E3 mvn r0, #3328 + 212 00c4 FFC000E5 str ip, [r0, #-255] + 213 .LVL8: + 214 .LBB69: + 215 .LBB65: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 216 .loc 2 404 0 + 217 00c8 FF1003E5 str r1, [r3, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 218 .loc 2 405 0 + 219 00cc EF1003E5 str r1, [r3, #-239] + 220 .LVL9: + 221 .LBE65: + 222 .LBE69: + 223 .LBB70: + 224 .LBB68: + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 225 .loc 2 417 0 + 226 00d0 EB2003E5 str r2, [r3, #-235] + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 227 .loc 2 418 0 + 228 00d4 FF2003E5 str r2, [r3, #-255] + 229 .LBE68: + 230 .LBE70: + 169:src/os/dbgu.c **** } + 231 .loc 1 169 0 + 232 00d8 1EFF2FE1 bx lr + 233 .cfi_endproc + 234 .LFE282: + 236 .align 2 + 237 .global AT91F_DBGU_Printk + 239 AT91F_DBGU_Printk: + 240 .LFB283: + 176:src/os/dbgu.c **** { + 241 .loc 1 176 0 + 242 .cfi_startproc + 243 @ Function supports interworking. + 244 @ args = 0, pretend = 0, frame = 0 + 245 @ frame_needed = 0, uses_anonymous_args = 0 + 246 @ link register save eliminated. + 247 .LVL10: + 177:src/os/dbgu.c **** while (*buffer != '\0') { + 248 .loc 1 177 0 + 249 00dc 0010D0E5 ldrb r1, [r0, #0] @ zero_extendqisi2 + 250 00e0 000051E3 cmp r1, #0 + 251 00e4 1EFF2F01 bxeq lr + 252 .LBB71: + 253 .LBB72: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 254 .loc 2 2430 0 + 255 00e8 0D2CE0E3 mvn r2, #3328 + 256 .LVL11: + 257 .L23: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 258 .loc 2 2430 0 is_stmt 0 discriminator 1 + 259 00ec EB3012E5 ldr r3, [r2, #-235] + 260 .LBE72: + 261 .LBE71: + 178:src/os/dbgu.c **** while (!AT91F_US_TxReady((AT91PS_USART) AT91C_BASE_DBGU)) ; + 262 .loc 1 178 0 is_stmt 1 discriminator 1 + 263 00f0 020013E3 tst r3, #2 + 264 00f4 FCFFFF0A beq .L23 + 265 .LVL12: + 266 .LBB73: + 267 .LBB74: + 268 .loc 2 2464 0 + 269 00f8 E31002E5 str r1, [r2, #-227] + 270 .LBE74: + 271 .LBE73: + 177:src/os/dbgu.c **** while (*buffer != '\0') { + 272 .loc 1 177 0 + 273 00fc 0110F0E5 ldrb r1, [r0, #1]! @ zero_extendqisi2 + 274 .LVL13: + 275 0100 000051E3 cmp r1, #0 + 276 0104 F8FFFF1A bne .L23 + 277 0108 1EFF2FE1 bx lr + 278 .cfi_endproc + 279 .LFE283: + 281 .align 2 + 283 __dbgu_rb_append: + 284 .LFB291: + 287:src/os/dbgu.c **** + 288:src/os/dbgu.c **** /* flush pending data from debug ring buffer to serial port */ + 289:src/os/dbgu.c **** void dbgu_rb_flush(void) + 290:src/os/dbgu.c **** { + 291:src/os/dbgu.c **** __rb_flush(); + 292:src/os/dbgu.c **** } + 293:src/os/dbgu.c **** + 294:src/os/dbgu.c **** static void __dbgu_rb_append(char *data, int len) + 295:src/os/dbgu.c **** { + 285 .loc 1 295 0 + 286 .cfi_startproc + 287 @ Function supports interworking. + 288 @ args = 0, pretend = 0, frame = 0 + 289 @ frame_needed = 0, uses_anonymous_args = 0 + 290 .LVL14: + 291 010c F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 292 .LCFI1: + 293 .cfi_def_cfa_offset 24 + 296:src/os/dbgu.c **** char *pos = dbgu.next_inbyte; + 294 .loc 1 296 0 + 295 0110 4C409FE5 ldr r4, .L26 + 296 .cfi_offset 14, -4 + 297 .cfi_offset 8, -8 + 298 .cfi_offset 7, -12 + 299 .cfi_offset 6, -16 + 300 .cfi_offset 5, -20 + 301 .cfi_offset 4, -24 + 302 0114 015AA0E3 mov r5, #4096 + 303 0118 057094E7 ldr r7, [r4, r5] + 304 .LVL15: + 297:src/os/dbgu.c **** + 298:src/os/dbgu.c **** dbgu.next_inbyte += len; + 299:src/os/dbgu.c **** if (dbgu.next_inbyte >= &dbgu.buf[0]+sizeof(dbgu.buf)) { + 305 .loc 1 299 0 + 306 011c 052084E0 add r2, r4, r5 + 298:src/os/dbgu.c **** dbgu.next_inbyte += len; + 307 .loc 1 298 0 + 308 0120 013087E0 add r3, r7, r1 + 309 .loc 1 299 0 + 310 0124 020053E1 cmp r3, r2 + 295:src/os/dbgu.c **** { + 311 .loc 1 295 0 + 312 0128 0160A0E1 mov r6, r1 + 313 012c 0080A0E1 mov r8, r0 + 298:src/os/dbgu.c **** dbgu.next_inbyte += len; + 314 .loc 1 298 0 + 315 0130 053084E7 str r3, [r4, r5] + 316 .loc 1 299 0 + 317 0134 0400003A bcc .L25 + 300:src/os/dbgu.c **** AT91F_DBGU_Printk("WRAP DURING APPEND\r\n"); + 318 .loc 1 300 0 + 319 0138 28009FE5 ldr r0, .L26+4 + 320 .LVL16: + 321 013c FEFFFFEB bl AT91F_DBGU_Printk + 322 .LVL17: + 301:src/os/dbgu.c **** dbgu.next_inbyte -= sizeof(dbgu.buf); + 323 .loc 1 301 0 + 324 0140 051094E7 ldr r1, [r4, r5] + 325 0144 010A41E2 sub r0, r1, #4096 + 326 0148 050084E7 str r0, [r4, r5] + 327 .L25: + 302:src/os/dbgu.c **** } + 303:src/os/dbgu.c **** + 304:src/os/dbgu.c **** memcpy(pos, data, len); + 328 .loc 1 304 0 + 329 014c 0700A0E1 mov r0, r7 + 330 0150 0810A0E1 mov r1, r8 + 331 0154 0620A0E1 mov r2, r6 + 332 0158 FEFFFFEB bl memcpy + 305:src/os/dbgu.c **** } + 333 .loc 1 305 0 + 334 015c F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 335 0160 1EFF2FE1 bx lr + 336 .L27: + 337 .align 2 + 338 .L26: + 339 0164 00000000 .word .LANCHOR0 + 340 0168 00000000 .word .LC0 + 341 .cfi_endproc + 342 .LFE291: + 344 .align 2 + 345 .global AT91F_DBGU_Frame + 347 AT91F_DBGU_Frame: + 348 .LFB284: + 188:src/os/dbgu.c **** { + 349 .loc 1 188 0 + 350 .cfi_startproc + 351 @ Function supports interworking. + 352 @ args = 0, pretend = 0, frame = 0 + 353 @ frame_needed = 0, uses_anonymous_args = 0 + 354 .LVL18: + 355 016c 04E02DE5 str lr, [sp, #-4]! + 356 .LCFI2: + 357 .cfi_def_cfa_offset 4 + 191:src/os/dbgu.c **** for (len = 0; buffer[len] != '\0'; len++) { + 358 .loc 1 191 0 + 359 0170 0020D0E5 ldrb r2, [r0, #0] @ zero_extendqisi2 + 360 0174 000052E3 cmp r2, #0 + 188:src/os/dbgu.c **** { + 361 .loc 1 188 0 + 362 0178 0CD04DE2 sub sp, sp, #12 + 363 .LCFI3: + 364 .cfi_def_cfa_offset 16 + 188:src/os/dbgu.c **** { + 365 .loc 1 188 0 + 366 017c 0010A0E1 mov r1, r0 + 191:src/os/dbgu.c **** for (len = 0; buffer[len] != '\0'; len++) { + 367 .loc 1 191 0 + 368 0180 0600000A beq .L29 + 369 .cfi_offset 14, -4 + 191:src/os/dbgu.c **** for (len = 0; buffer[len] != '\0'; len++) { + 370 .loc 1 191 0 is_stmt 0 discriminator 2 + 371 0184 0030A0E3 mov r3, #0 + 372 .LVL19: + 373 .L30: + 374 0188 013083E2 add r3, r3, #1 + 375 018c FF3003E2 and r3, r3, #255 + 376 .LVL20: + 377 0190 0320D1E7 ldrb r2, [r1, r3] @ zero_extendqisi2 + 378 0194 000052E3 cmp r2, #0 + 379 0198 0320A0E1 mov r2, r3 + 380 019c F9FFFF1A bne .L30 + 381 .LVL21: + 382 .L29: + 383 .LBB75: + 384 .LBB76: +2465:include/lib_AT91SAM7.h **** } +2466:include/lib_AT91SAM7.h **** +2467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2468:include/lib_AT91SAM7.h **** //* \fn AT91F_US_GetChar +2469:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +2470:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2471:include/lib_AT91SAM7.h **** static inline int AT91F_US_GetChar ( +2472:include/lib_AT91SAM7.h **** const AT91PS_USART pUSART) +2473:include/lib_AT91SAM7.h **** { +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); +2475:include/lib_AT91SAM7.h **** } +2476:include/lib_AT91SAM7.h **** +2477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2478:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SendFrame +2479:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2480:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2481:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_SendFrame( +2482:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2483:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2484:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2485:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2486:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2487:include/lib_AT91SAM7.h **** { +2488:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( + 385 .loc 2 2488 0 is_stmt 1 + 386 01a0 00C0A0E3 mov ip, #0 + 387 01a4 0C30A0E1 mov r3, ip + 388 01a8 10009FE5 ldr r0, .L33 + 389 .LVL22: + 390 01ac 00C08DE5 str ip, [sp, #0] + 391 01b0 FEFFFFEB bl AT91F_PDC_SendFrame + 392 .LVL23: + 393 .LBE76: + 394 .LBE75: + 197:src/os/dbgu.c **** } + 395 .loc 1 197 0 + 396 01b4 0CD08DE2 add sp, sp, #12 + 397 01b8 04E09DE4 ldr lr, [sp], #4 + 398 01bc 1EFF2FE1 bx lr + 399 .L34: + 400 .align 2 + 401 .L33: + 402 01c0 00F3FFFF .word -3328 + 403 .cfi_endproc + 404 .LFE284: + 406 .align 2 + 408 DBGU_irq_handler: + 409 .LFB280: + 83:src/os/dbgu.c **** { + 410 .loc 1 83 0 + 411 .cfi_startproc + 412 @ Function supports interworking. + 413 @ args = 0, pretend = 0, frame = 0 + 414 @ frame_needed = 0, uses_anonymous_args = 0 + 415 .LVL24: + 416 .LBB77: + 417 .LBB79: + 418 .LBB82: + 419 .LBB83: +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); + 420 .loc 2 2440 0 + 421 01c4 0D1CE0E3 mvn r1, #3328 + 422 01c8 EB2011E5 ldr r2, [r1, #-235] + 423 .LBE83: + 424 .LBE82: + 425 .LBE79: + 426 .LBE77: + 83:src/os/dbgu.c **** { + 427 .loc 1 83 0 + 428 01cc 10402DE9 stmfd sp!, {r4, lr} + 429 .LCFI4: + 430 .cfi_def_cfa_offset 8 + 431 .LBB85: + 432 .LBB78: + 205:src/os/dbgu.c **** if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 433 .loc 1 205 0 + 434 01d0 010012E3 tst r2, #1 + 435 01d4 EC109F05 ldreq r1, .L48 + 436 .LBB80: + 437 .LBB81: +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); + 438 .loc 2 2474 0 + 439 01d8 E7001115 ldrne r0, [r1, #-231] + 440 .LVL25: + 441 .LBE81: + 442 .LBE80: + 205:src/os/dbgu.c **** if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 443 .loc 1 205 0 + 444 01dc F00F5105 ldreqb r0, [r1, #-4080] @ zero_extendqisi2 + 445 .LVL26: + 208:src/os/dbgu.c **** *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 446 .loc 1 208 0 + 447 01e0 FF000012 andne r0, r0, #255 + 448 01e4 DC109F15 ldrne r1, .L48 + 449 .LBE78: + 450 .LBE85: + 87:src/os/dbgu.c **** switch (value) { + 451 .loc 1 87 0 + 452 01e8 303040E2 sub r3, r0, #48 + 453 .LBB86: + 454 .LBB84: + 208:src/os/dbgu.c **** *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 455 .loc 1 208 0 + 456 01ec F00F4115 strneb r0, [r1, #-4080] + 457 .LBE84: + 458 .LBE86: + 87:src/os/dbgu.c **** switch (value) { + 459 .loc 1 87 0 + 460 01f0 090053E3 cmp r3, #9 + 461 01f4 03F19F97 ldrls pc, [pc, r3, asl #2] + 462 01f8 100000EA b .L38 + 463 .cfi_offset 14, -4 + 464 .cfi_offset 4, -8 + 465 .L44: + 466 01fc 58020000 .word .L39 + 467 0200 68020000 .word .L40 + 468 0204 A0020000 .word .L41 + 469 0208 B4020000 .word .L42 + 470 020c 40020000 .word .L38 + 471 0210 40020000 .word .L38 + 472 0214 40020000 .word .L38 + 473 0218 40020000 .word .L38 + 474 021c 40020000 .word .L38 + 475 0220 24020000 .word .L43 + 476 .L43: + 108:src/os/dbgu.c **** AT91F_DBGU_Printk("Resetting SAM7\n\r"); + 477 .loc 1 108 0 + 478 0224 A0009FE5 ldr r0, .L48+4 + 479 0228 FEFFFFEB bl AT91F_DBGU_Printk + 480 .LVL27: + 481 .LBB87: + 482 .LBB88: +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); + 483 .loc 2 1193 0 + 484 022c 9C109FE5 ldr r1, .L48+8 + 485 0230 022CE0E3 mvn r2, #512 + 486 0234 FF1002E5 str r1, [r2, #-255] + 487 .LVL28: + 488 .L35: + 489 .LBE88: + 490 .LBE87: + 117:src/os/dbgu.c **** } + 491 .loc 1 117 0 + 492 0238 1040BDE8 ldmfd sp!, {r4, lr} + 493 023c 1EFF2FE1 bx lr + 494 .L38: + 113:src/os/dbgu.c **** if (_main_dbgu(value) < 0) + 495 .loc 1 113 0 + 496 0240 FEFFFFEB bl _main_dbgu + 497 0244 000050E3 cmp r0, #0 + 498 0248 FAFFFFAA bge .L35 + 114:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 499 .loc 1 114 0 + 500 024c 80009FE5 ldr r0, .L48+12 + 117:src/os/dbgu.c **** } + 501 .loc 1 117 0 + 502 0250 1040BDE8 ldmfd sp!, {r4, lr} + 114:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 503 .loc 1 114 0 + 504 0254 FEFFFFEA b AT91F_DBGU_Printk + 505 .L39: + 89:src/os/dbgu.c **** AT91F_DBGU_Frame("Clear Pull up\n\r"); + 506 .loc 1 89 0 + 507 0258 78009FE5 ldr r0, .L48+16 + 508 025c FEFFFFEB bl AT91F_DBGU_Frame + 91:src/os/dbgu.c **** udp_pullup_on(); + 509 .loc 1 91 0 + 510 0260 FEFFFFEB bl udp_pullup_on + 92:src/os/dbgu.c **** break; + 511 .loc 1 92 0 + 512 0264 F3FFFFEA b .L35 + 513 .L40: + 94:src/os/dbgu.c **** udp_pullup_off(); + 514 .loc 1 94 0 + 515 0268 FEFFFFEB bl udp_pullup_off + 95:src/os/dbgu.c **** AT91F_DBGU_Printk("Set Pull up\n\r"); + 516 .loc 1 95 0 + 517 026c 68009FE5 ldr r0, .L48+20 + 518 0270 FEFFFFEB bl AT91F_DBGU_Printk + 519 .LVL29: + 520 .LBB89: + 521 .LBB90: + 71:src/os/dbgu.c **** AT91C_BASE_AIC->AIC_EOICR = 0; + 522 .loc 1 71 0 + 523 0274 0000A0E3 mov r0, #0 + 524 0278 0FCCE0E3 mvn ip, #3840 + 525 027c 31008CE5 str r0, [ip, #49] + 526 .LBB91: + 527 .LBB92: + 58:src/os/dbgu.c **** while (!(AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXEMPTY)) ; + 528 .loc 1 58 0 + 529 0280 0D2CE0E3 mvn r2, #3328 + 530 .L46: + 531 0284 EBE012E5 ldr lr, [r2, #-235] + 532 0288 020C1EE3 tst lr, #512 + 533 028c FCFFFF0A beq .L46 + 534 .LBE92: + 535 .LBE91: + 74:src/os/dbgu.c **** pfct(); + 536 .loc 1 74 0 + 537 0290 0030A0E3 mov r3, #0 + 538 0294 0FE0A0E1 mov lr, pc + 539 0298 13FF2FE1 bx r3 + 540 .LBE90: + 541 .LBE89: + 98:src/os/dbgu.c **** break; + 542 .loc 1 98 0 + 543 029c E5FFFFEA b .L35 + 544 .LVL30: + 545 .L41: + 100:src/os/dbgu.c **** AT91F_DBGU_Printk("Toggling LED 1\n\r"); + 546 .loc 1 100 0 + 547 02a0 38009FE5 ldr r0, .L48+24 + 548 02a4 FEFFFFEB bl AT91F_DBGU_Printk + 101:src/os/dbgu.c **** led_toggle(1); + 549 .loc 1 101 0 + 550 02a8 0100A0E3 mov r0, #1 + 551 02ac FEFFFFEB bl led_toggle + 102:src/os/dbgu.c **** break; + 552 .loc 1 102 0 + 553 02b0 E0FFFFEA b .L35 + 554 .L42: + 104:src/os/dbgu.c **** AT91F_DBGU_Printk("Toggling LED 2\n\r"); + 555 .loc 1 104 0 + 556 02b4 28009FE5 ldr r0, .L48+28 + 557 02b8 FEFFFFEB bl AT91F_DBGU_Printk + 105:src/os/dbgu.c **** led_toggle(2); + 558 .loc 1 105 0 + 559 02bc 0200A0E3 mov r0, #2 + 560 02c0 FEFFFFEB bl led_toggle + 106:src/os/dbgu.c **** break; + 561 .loc 1 106 0 + 562 02c4 DBFFFFEA b .L35 + 563 .L49: + 564 .align 2 + 565 .L48: + 566 02c8 F81F0000 .word .LANCHOR1 + 567 02cc 60000000 .word .LC5 + 568 02d0 0D0000A5 .word -1526726643 + 569 02d4 74000000 .word .LC6 + 570 02d8 18000000 .word .LC1 + 571 02dc 28000000 .word .LC2 + 572 02e0 38000000 .word .LC3 + 573 02e4 4C000000 .word .LC4 + 574 .cfi_endproc + 575 .LFE280: + 577 .align 2 + 578 .global AT91F_DBGU_Get + 580 AT91F_DBGU_Get: + 581 .LFB285: + 204:src/os/dbgu.c **** { + 582 .loc 1 204 0 + 583 .cfi_startproc + 584 @ Function supports interworking. + 585 @ args = 0, pretend = 0, frame = 0 + 586 @ frame_needed = 0, uses_anonymous_args = 0 + 587 @ link register save eliminated. + 588 .LVL31: + 589 .LBB93: + 590 .LBB94: +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); + 591 .loc 2 2440 0 + 592 02e8 0D2CE0E3 mvn r2, #3328 + 593 02ec EB1012E5 ldr r1, [r2, #-235] + 594 .LBE94: + 595 .LBE93: + 205:src/os/dbgu.c **** if ((AT91F_US_RxReady((AT91PS_USART) AT91C_BASE_DBGU)) == 0) + 596 .loc 1 205 0 + 597 02f0 013011E2 ands r3, r1, #1 + 598 .LVL32: + 599 .LBB95: + 600 .LBB96: +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); + 601 .loc 2 2474 0 + 602 02f4 E7201215 ldrne r2, [r2, #-231] + 603 .LBE96: + 604 .LBE95: + 209:src/os/dbgu.c **** return (-1); + 605 .loc 1 209 0 + 606 02f8 0030E013 mvnne r3, #0 + 208:src/os/dbgu.c **** *val = AT91F_US_GetChar((AT91PS_USART) AT91C_BASE_DBGU); + 607 .loc 1 208 0 + 608 02fc 0020C015 strneb r2, [r0, #0] + 211:src/os/dbgu.c **** } + 609 .loc 1 211 0 + 610 0300 0300A0E1 mov r0, r3 + 611 .LVL33: + 612 0304 1EFF2FE1 bx lr + 613 .cfi_endproc + 614 .LFE285: + 616 .align 2 + 617 .global hexdump + 619 hexdump: + 620 .LFB286: + 222:src/os/dbgu.c **** { + 621 .loc 1 222 0 + 622 .cfi_startproc + 623 @ Function supports interworking. + 624 @ args = 0, pretend = 0, frame = 0 + 625 @ frame_needed = 0, uses_anonymous_args = 0 + 626 .LVL34: + 227:src/os/dbgu.c **** string[0] = '\0'; + 627 .loc 1 227 0 + 628 0308 80309FE5 ldr r3, .L59 + 629 030c 0020A0E3 mov r2, #0 + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 630 .loc 1 229 0 + 631 0310 000051E3 cmp r1, #0 + 632 .LVL35: + 222:src/os/dbgu.c **** { + 633 .loc 1 222 0 + 634 0314 F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 635 .LCFI5: + 636 .cfi_def_cfa_offset 24 + 227:src/os/dbgu.c **** string[0] = '\0'; + 637 .loc 1 227 0 + 638 0318 EC2F43E5 strb r2, [r3, #-4076] + 639 .LVL36: + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 640 .loc 1 229 0 + 641 031c 1800000A beq .L54 + 642 .cfi_offset 14, -4 + 643 .cfi_offset 8, -8 + 644 .cfi_offset 7, -12 + 645 .cfi_offset 6, -16 + 646 .cfi_offset 5, -20 + 647 .cfi_offset 4, -24 + 648 .LVL37: + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 649 .loc 1 232 0 + 650 0320 FE6E43E2 sub r6, r3, #4064 + 224:src/os/dbgu.c **** unsigned char *d = (unsigned char *) data; + 651 .loc 1 224 0 + 652 0324 0040A0E1 mov r4, r0 + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 653 .loc 1 232 0 + 654 0328 0C6046E2 sub r6, r6, #12 + 221:src/os/dbgu.c **** hexdump(const void *data, unsigned int len) + 655 .loc 1 221 0 + 656 032c 017080E0 add r7, r0, r1 + 657 0330 548080E2 add r8, r0, #84 + 658 .LVL38: + 659 0334 070000EA b .L55 + 660 .LVL39: + 661 .L56: + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 662 .loc 1 232 0 + 663 0338 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 664 033c 014085E2 add r4, r5, #1 + 665 .LVL40: + 666 0340 FEFFFFEB bl snprintf + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 667 .loc 1 229 0 + 668 0344 070054E1 cmp r4, r7 + 669 0348 0D00000A beq .L54 + 230:src/os/dbgu.c **** if (i >= sizeof(string) -4) + 670 .loc 1 230 0 + 671 034c 080054E1 cmp r4, r8 + 221:src/os/dbgu.c **** hexdump(const void *data, unsigned int len) + 672 .loc 1 221 0 + 673 0350 066086E2 add r6, r6, #6 + 230:src/os/dbgu.c **** if (i >= sizeof(string) -4) + 674 .loc 1 230 0 + 675 0354 0A00000A beq .L54 + 676 .LVL41: + 677 .L55: + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 678 .loc 1 232 0 + 679 0358 0450A0E1 mov r5, r4 + 680 035c 0130D5E4 ldrb r3, [r5], #1 @ zero_extendqisi2 + 681 0360 0410A0E3 mov r1, #4 + 682 0364 28209FE5 ldr r2, .L59+4 + 683 0368 0600A0E1 mov r0, r6 + 684 036c FEFFFFEB bl snprintf + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 685 .loc 1 229 0 + 686 0370 070055E1 cmp r5, r7 + 232:src/os/dbgu.c **** snprintf(string+i, 4, " %02x", *d++); + 687 .loc 1 232 0 + 688 0374 030086E2 add r0, r6, #3 + 689 0378 0410A0E3 mov r1, #4 + 690 037c 10209FE5 ldr r2, .L59+4 + 229:src/os/dbgu.c **** for (i = 0; len--; i += 3) { + 691 .loc 1 229 0 + 692 0380 ECFFFF1A bne .L56 + 693 .LVL42: + 694 .L54: + 235:src/os/dbgu.c **** } + 695 .loc 1 235 0 + 696 0384 0C009FE5 ldr r0, .L59+8 + 697 0388 F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 698 038c 1EFF2FE1 bx lr + 699 .L60: + 700 .align 2 + 701 .L59: + 702 0390 F81F0000 .word .LANCHOR1 + 703 0394 78000000 .word .LC7 + 704 0398 0C100000 .word .LANCHOR1-4076 + 705 .cfi_endproc + 706 .LFE286: + 708 .align 2 + 709 .global dbgu_rb_init + 711 dbgu_rb_init: + 712 .LFB287: + 245:src/os/dbgu.c **** { + 713 .loc 1 245 0 + 714 .cfi_startproc + 715 @ Function supports interworking. + 716 @ args = 0, pretend = 0, frame = 0 + 717 @ frame_needed = 0, uses_anonymous_args = 0 + 718 039c 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 719 .LCFI6: + 720 .cfi_def_cfa_offset 16 + 246:src/os/dbgu.c **** memset(dbgu.buf, 0, sizeof(dbgu.buf)); + 721 .loc 1 246 0 + 722 03a0 24409FE5 ldr r4, .L62 + 723 .cfi_offset 14, -4 + 724 .cfi_offset 5, -8 + 725 .cfi_offset 4, -12 + 726 .cfi_offset 3, -16 + 727 03a4 015AA0E3 mov r5, #4096 + 728 03a8 0400A0E1 mov r0, r4 + 729 03ac 0010A0E3 mov r1, #0 + 730 03b0 0520A0E1 mov r2, r5 + 731 03b4 FEFFFFEB bl memset + 248:src/os/dbgu.c **** dbgu.next_outbyte = &dbgu.buf[0]; + 732 .loc 1 248 0 + 733 03b8 10309FE5 ldr r3, .L62+4 + 247:src/os/dbgu.c **** dbgu.next_inbyte = &dbgu.buf[0]; + 734 .loc 1 247 0 + 735 03bc 054084E7 str r4, [r4, r5] + 248:src/os/dbgu.c **** dbgu.next_outbyte = &dbgu.buf[0]; + 736 .loc 1 248 0 + 737 03c0 034084E7 str r4, [r4, r3] + 249:src/os/dbgu.c **** } + 738 .loc 1 249 0 + 739 03c4 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 740 03c8 1EFF2FE1 bx lr + 741 .L63: + 742 .align 2 + 743 .L62: + 744 03cc 00000000 .word .LANCHOR0 + 745 03d0 04100000 .word 4100 + 746 .cfi_endproc + 747 .LFE287: + 749 .align 2 + 750 .global AT91F_DBGU_Init + 752 AT91F_DBGU_Init: + 753 .LFB281: + 125:src/os/dbgu.c **** { + 754 .loc 1 125 0 + 755 .cfi_startproc + 756 @ Function supports interworking. + 757 @ args = 0, pretend = 0, frame = 0 + 758 @ frame_needed = 0, uses_anonymous_args = 0 + 759 03d4 30402DE9 stmfd sp!, {r4, r5, lr} + 760 .LCFI7: + 761 .cfi_def_cfa_offset 12 + 762 03d8 0CD04DE2 sub sp, sp, #12 + 763 .LCFI8: + 764 .cfi_def_cfa_offset 24 + 126:src/os/dbgu.c **** dbgu_rb_init(); + 765 .loc 1 126 0 + 766 .cfi_offset 14, -4 + 767 .cfi_offset 5, -8 + 768 .cfi_offset 4, -12 + 769 03dc FEFFFFEB bl dbgu_rb_init + 770 .LVL43: + 771 .LBB97: + 772 .LBB98: + 773 .LBB99: + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 774 .loc 2 391 0 + 775 03e0 065CA0E3 mov r5, #1536 + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 776 .loc 2 392 0 + 777 03e4 00E0A0E3 mov lr, #0 + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 778 .loc 2 391 0 + 779 03e8 0BCCE0E3 mvn ip, #2816 + 780 03ec 8F500CE5 str r5, [ip, #-143] + 781 .LBE99: + 782 .LBE98: + 783 .LBE97: + 131:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 784 .loc 1 131 0 + 785 03f0 0D4CE0E3 mvn r4, #3328 + 786 .LBB102: + 787 .LBB101: + 788 .LBB100: + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 789 .loc 2 392 0 + 790 03f4 8BE00CE5 str lr, [ip, #-139] + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 791 .loc 2 393 0 + 792 03f8 FB500CE5 str r5, [ip, #-251] + 793 .LBE100: + 794 .LBE101: + 795 .LBE102: + 131:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = + 796 .loc 1 131 0 + 797 03fc 0CC0A0E3 mov ip, #12 + 798 0400 FFC004E5 str ip, [r4, #-255] + 135:src/os/dbgu.c **** AT91F_US_Configure((AT91PS_USART) AT91C_BASE_DBGU, // DBGU base address + 799 .loc 1 135 0 + 800 0404 232DA0E3 mov r2, #2240 + 801 0408 50309FE5 ldr r3, .L65 + 802 040c 50009FE5 ldr r0, .L65+4 + 803 0410 50109FE5 ldr r1, .L65+8 + 804 0414 00E08DE5 str lr, [sp, #0] + 805 0418 FEFFFFEB bl AT91F_US_Configure + 806 .LBB103: + 807 .LBB104: +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; + 808 .loc 2 2321 0 + 809 041c 0130A0E3 mov r3, #1 + 810 .LBE104: + 811 .LBE103: + 141:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + 812 .loc 1 141 0 + 813 0420 5020A0E3 mov r2, #80 + 147:src/os/dbgu.c **** sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 814 .loc 1 147 0 + 815 0424 0300A0E1 mov r0, r3 + 141:src/os/dbgu.c **** ((AT91PS_USART) AT91C_BASE_DBGU)->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; + 816 .loc 1 141 0 + 817 0428 FF2004E5 str r2, [r4, #-255] + 818 .LVL44: + 147:src/os/dbgu.c **** sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 819 .loc 1 147 0 + 820 042c 38109FE5 ldr r1, .L65+12 + 821 .LBB106: + 822 .LBB105: +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; + 823 .loc 2 2321 0 + 824 0430 F73004E5 str r3, [r4, #-247] + 825 .LBE105: + 826 .LBE106: + 147:src/os/dbgu.c **** sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); + 827 .loc 1 147 0 + 828 0434 FEFFFFEB bl sysirq_register + 149:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\r"); + 829 .loc 1 149 0 + 830 0438 30009FE5 ldr r0, .L65+16 + 831 043c FEFFFFEB bl AT91F_DBGU_Printk + 150:src/os/dbgu.c **** AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + 832 .loc 1 150 0 + 833 0440 2C009FE5 ldr r0, .L65+20 + 834 0444 FEFFFFEB bl AT91F_DBGU_Printk + 152:src/os/dbgu.c **** AT91F_DBGU_Printk("Version " COMPILE_SVNREV + 835 .loc 1 152 0 + 836 0448 28009FE5 ldr r0, .L65+24 + 837 044c FEFFFFEB bl AT91F_DBGU_Printk + 155:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + 838 .loc 1 155 0 + 839 0450 24009FE5 ldr r0, .L65+28 + 158:src/os/dbgu.c **** } + 840 .loc 1 158 0 + 841 0454 0CD08DE2 add sp, sp, #12 + 842 0458 3040BDE8 ldmfd sp!, {r4, r5, lr} + 155:src/os/dbgu.c **** AT91F_DBGU_Printk("\n\rDEBUG Interface:\n\r" + 843 .loc 1 155 0 + 844 045c FEFFFFEA b AT91F_DBGU_Printk + 845 .L66: + 846 .align 2 + 847 .L65: + 848 0460 00C20100 .word 115200 + 849 0464 00F2FFFF .word -3584 + 850 0468 0040DB02 .word 47923200 + 851 046c 00000000 .word DBGU_irq_handler + 852 0470 74000000 .word .LC6 + 853 0474 80000000 .word .LC8 + 854 0478 F0000000 .word .LC9 + 855 047c 34010000 .word .LC10 + 856 .cfi_endproc + 857 .LFE281: + 859 .align 2 + 860 .global dbgu_rb_flush + 862 dbgu_rb_flush: + 863 .LFB290: + 290:src/os/dbgu.c **** { + 864 .loc 1 290 0 + 865 .cfi_startproc + 866 @ Function supports interworking. + 867 @ args = 0, pretend = 0, frame = 0 + 868 @ frame_needed = 0, uses_anonymous_args = 0 + 869 @ link register save eliminated. + 292:src/os/dbgu.c **** } + 870 .loc 1 292 0 + 291:src/os/dbgu.c **** __rb_flush(); + 871 .loc 1 291 0 + 872 0480 DEFEFFEA b __rb_flush + 873 .cfi_endproc + 874 .LFE290: + 876 .align 2 + 877 .global dbgu_rb_append + 879 dbgu_rb_append: + 880 .LFB292: + 306:src/os/dbgu.c **** + 307:src/os/dbgu.c **** void dbgu_rb_append(char *data, int len) + 308:src/os/dbgu.c **** { + 881 .loc 1 308 0 + 882 .cfi_startproc + 883 @ Function supports interworking. + 884 @ args = 0, pretend = 0, frame = 0 + 885 @ frame_needed = 0, uses_anonymous_args = 0 + 886 .LVL45: + 887 0484 F8402DE9 stmfd sp!, {r3, r4, r5, r6, r7, lr} + 888 .LCFI9: + 889 .cfi_def_cfa_offset 24 + 890 .loc 1 308 0 + 891 0488 0060A0E1 mov r6, r0 + 892 .cfi_offset 14, -4 + 893 .cfi_offset 7, -8 + 894 .cfi_offset 6, -12 + 895 .cfi_offset 5, -16 + 896 .cfi_offset 4, -20 + 897 .cfi_offset 3, -24 + 898 048c 0140A0E1 mov r4, r1 + 899 .LBB107: + 309:src/os/dbgu.c **** unsigned long flags; + 310:src/os/dbgu.c **** int bytes_left; + 311:src/os/dbgu.c **** char *data_cur; + 312:src/os/dbgu.c **** + 313:src/os/dbgu.c **** local_irq_save(flags); + 900 .loc 1 313 0 + 901 @ 313 "src/os/dbgu.c" 1 + 902 0490 00700FE1 mrs r7, cpsr @ local_irq_save + 903 0494 803087E3 orr r3, r7, #128 + 904 0498 03F021E1 msr cpsr_c, r3 + 905 @ 0 "" 2 + 906 .LVL46: + 907 .LBE107: + 314:src/os/dbgu.c **** + 315:src/os/dbgu.c **** bytes_left = &dbgu.buf[0]+sizeof(dbgu.buf)-dbgu.next_inbyte; + 908 .loc 1 315 0 + 909 049c 48309FE5 ldr r3, .L71 + 910 04a0 01CAA0E3 mov ip, #4096 + 911 04a4 0C2093E7 ldr r2, [r3, ip] + 912 04a8 015A83E2 add r5, r3, #4096 + 913 04ac 055062E0 rsb r5, r2, r5 + 914 .LVL47: + 316:src/os/dbgu.c **** data_cur = data; + 317:src/os/dbgu.c **** + 318:src/os/dbgu.c **** if (len > bytes_left) { + 915 .loc 1 318 0 + 916 04b0 010055E1 cmp r5, r1 + 917 04b4 070000AA bge .L69 + 319:src/os/dbgu.c **** AT91F_DBGU_Printk("LEN > BYTES_LEFT\r\n"); + 918 .loc 1 319 0 + 919 04b8 30009FE5 ldr r0, .L71+4 + 920 .LVL48: + 921 04bc FEFFFFEB bl AT91F_DBGU_Printk + 922 .LVL49: + 320:src/os/dbgu.c **** __rb_flush(); + 923 .loc 1 320 0 + 924 04c0 CEFEFFEB bl __rb_flush + 321:src/os/dbgu.c **** __dbgu_rb_append(data_cur, bytes_left); + 925 .loc 1 321 0 + 926 04c4 0600A0E1 mov r0, r6 + 927 04c8 0510A0E1 mov r1, r5 + 928 04cc 0EFFFFEB bl __dbgu_rb_append + 322:src/os/dbgu.c **** len -= bytes_left; + 929 .loc 1 322 0 + 930 04d0 044065E0 rsb r4, r5, r4 + 931 .LVL50: + 323:src/os/dbgu.c **** data_cur += bytes_left; + 932 .loc 1 323 0 + 933 04d4 050086E0 add r0, r6, r5 + 934 .LVL51: + 935 .L69: + 324:src/os/dbgu.c **** } + 325:src/os/dbgu.c **** __dbgu_rb_append(data_cur, len); + 936 .loc 1 325 0 + 937 04d8 0410A0E1 mov r1, r4 + 938 04dc 0AFFFFEB bl __dbgu_rb_append + 939 .LVL52: + 326:src/os/dbgu.c **** + 327:src/os/dbgu.c **** local_irq_restore(flags); + 940 .loc 1 327 0 + 941 @ 327 "src/os/dbgu.c" 1 + 942 04e0 07F021E1 msr cpsr_c, r7 @ local_irq_restore + 943 + 944 @ 0 "" 2 + 328:src/os/dbgu.c **** } + 945 .loc 1 328 0 + 946 04e4 F840BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, lr} + 947 04e8 1EFF2FE1 bx lr + 948 .L72: + 949 .align 2 + 950 .L71: + 951 04ec 00000000 .word .LANCHOR0 + 952 04f0 94010000 .word .LC11 + 953 .cfi_endproc + 954 .LFE292: + 956 .align 2 + 957 .global debugp + 959 debugp: + 960 .LFB293: + 329:src/os/dbgu.c **** + 330:src/os/dbgu.c **** static char dbg_buf[256]; + 331:src/os/dbgu.c **** void debugp(const char *format, ...) + 332:src/os/dbgu.c **** { + 961 .loc 1 332 0 + 962 .cfi_startproc + 963 @ Function supports interworking. + 964 @ args = 4, pretend = 16, frame = 8 + 965 @ frame_needed = 0, uses_anonymous_args = 1 + 966 .LVL53: + 967 04f4 0F002DE9 stmfd sp!, {r0, r1, r2, r3} + 968 .LCFI10: + 969 .cfi_def_cfa_offset 16 + 970 04f8 30402DE9 stmfd sp!, {r4, r5, lr} + 971 .LCFI11: + 972 .cfi_def_cfa_offset 28 + 333:src/os/dbgu.c **** va_list ap; + 334:src/os/dbgu.c **** + 335:src/os/dbgu.c **** va_start(ap, format); + 336:src/os/dbgu.c **** vsnprintf(dbg_buf, sizeof(dbg_buf)-1, format, ap); + 973 .loc 1 336 0 + 974 04fc 50509FE5 ldr r5, .L74 + 975 .cfi_offset 14, -20 + 976 .cfi_offset 5, -24 + 977 .cfi_offset 4, -28 + 978 .cfi_offset 3, -4 + 979 .cfi_offset 2, -8 + 980 .cfi_offset 1, -12 + 981 .cfi_offset 0, -16 + 332:src/os/dbgu.c **** { + 982 .loc 1 332 0 + 983 0500 0CD04DE2 sub sp, sp, #12 + 984 .LCFI12: + 985 .cfi_def_cfa_offset 40 + 986 .loc 1 336 0 + 987 0504 EE4E45E2 sub r4, r5, #3808 + 335:src/os/dbgu.c **** va_start(ap, format); + 988 .loc 1 335 0 + 989 0508 1CC08DE2 add ip, sp, #28 + 990 .loc 1 336 0 + 991 050c 0C4044E2 sub r4, r4, #12 + 992 0510 0C30A0E1 mov r3, ip + 993 0514 FF10A0E3 mov r1, #255 + 994 0518 18209DE5 ldr r2, [sp, #24] + 995 051c 0400A0E1 mov r0, r4 + 335:src/os/dbgu.c **** va_start(ap, format); + 996 .loc 1 335 0 + 997 0520 04C08DE5 str ip, [sp, #4] + 998 .loc 1 336 0 + 999 0524 FEFFFFEB bl vsnprintf + 337:src/os/dbgu.c **** va_end(ap); + 338:src/os/dbgu.c **** + 339:src/os/dbgu.c **** dbg_buf[sizeof(dbg_buf)-1] = '\0'; + 1000 .loc 1 339 0 + 1001 0528 0030A0E3 mov r3, #0 + 340:src/os/dbgu.c **** //AT91F_DBGU_Frame(dbg_buf); + 341:src/os/dbgu.c **** #ifdef DEBUG_UNBUFFERED + 342:src/os/dbgu.c **** AT91F_DBGU_Printk(dbg_buf); + 343:src/os/dbgu.c **** #else + 344:src/os/dbgu.c **** dbgu_rb_append(dbg_buf, strlen(dbg_buf)); + 1002 .loc 1 344 0 + 1003 052c 0400A0E1 mov r0, r4 + 339:src/os/dbgu.c **** dbg_buf[sizeof(dbg_buf)-1] = '\0'; + 1004 .loc 1 339 0 + 1005 0530 ED3D45E5 strb r3, [r5, #-3565] + 1006 .loc 1 344 0 + 1007 0534 FEFFFFEB bl strlen + 1008 0538 0010A0E1 mov r1, r0 + 1009 053c 0400A0E1 mov r0, r4 + 1010 0540 FEFFFFEB bl dbgu_rb_append + 345:src/os/dbgu.c **** #endif + 346:src/os/dbgu.c **** } + 1011 .loc 1 346 0 + 1012 0544 0CD08DE2 add sp, sp, #12 + 1013 0548 3040BDE8 ldmfd sp!, {r4, r5, lr} + 1014 054c 10D08DE2 add sp, sp, #16 + 1015 0550 1EFF2FE1 bx lr + 1016 .L75: + 1017 .align 2 + 1018 .L74: + 1019 0554 F81F0000 .word .LANCHOR1 + 1020 .cfi_endproc + 1021 .LFE293: + 1023 .section .rodata.str1.4,"aMS",%progbits,1 + 1024 .align 2 + 1025 .LC0: + 1026 0000 57524150 .ascii "WRAP DURING APPEND\015\012\000" + 1026 20445552 + 1026 494E4720 + 1026 41505045 + 1026 4E440D0A + 1027 0015 000000 .space 3 + 1028 .LC1: + 1029 0018 436C6561 .ascii "Clear Pull up\012\015\000" + 1029 72205075 + 1029 6C6C2075 + 1029 700A0D00 + 1030 .LC2: + 1031 0028 53657420 .ascii "Set Pull up\012\015\000" + 1031 50756C6C + 1031 2075700A + 1031 0D00 + 1032 0036 0000 .space 2 + 1033 .LC3: + 1034 0038 546F6767 .ascii "Toggling LED 1\012\015\000" + 1034 6C696E67 + 1034 204C4544 + 1034 20310A0D + 1034 00 + 1035 0049 000000 .space 3 + 1036 .LC4: + 1037 004c 546F6767 .ascii "Toggling LED 2\012\015\000" + 1037 6C696E67 + 1037 204C4544 + 1037 20320A0D + 1037 00 + 1038 005d 000000 .space 3 + 1039 .LC5: + 1040 0060 52657365 .ascii "Resetting SAM7\012\015\000" + 1040 7474696E + 1040 67205341 + 1040 4D370A0D + 1040 00 + 1041 0071 000000 .space 3 + 1042 .LC6: + 1043 0074 0A0D00 .ascii "\012\015\000" + 1044 0077 00 .space 1 + 1045 .LC7: + 1046 0078 20253032 .ascii " %02x\000" + 1046 7800 + 1047 007e 0000 .space 2 + 1048 .LC8: + 1049 0080 28432920 .ascii "(C) 2006 by Harald Welte " + 1049 32303036 + 1049 20627920 + 1049 48617261 + 1049 6C642057 + 1050 00b3 0A0D5468 .ascii "\012\015This software is FREE SOFTWARE licensed und" + 1050 69732073 + 1050 6F667477 + 1050 61726520 + 1050 69732046 + 1051 00e0 65722047 .ascii "er GNU GPL\012\015\000" + 1051 4E552047 + 1051 504C0A0D + 1051 00 + 1052 00ed 000000 .space 3 + 1053 .LC9: + 1054 00f0 56657273 .ascii "Version 495-unclean compiled 20110510-160603 by net" + 1054 696F6E20 + 1054 3439352D + 1054 756E636C + 1054 65616E20 + 1055 0123 7A40426C .ascii "z@BlubbFish\012\015\012\015\000" + 1055 75626246 + 1055 6973680A + 1055 0D0A0D00 + 1056 0133 00 .space 1 + 1057 .LC10: + 1058 0134 0A0D4445 .ascii "\012\015DEBUG Interface:\012\0150) Set Pull-up 1) C" + 1058 42554720 + 1058 496E7465 + 1058 72666163 + 1058 653A0A0D + 1059 015b 6C656172 .ascii "lear Pull-up 2) Toggle LED1 3) Toggle LED2\015\0129" + 1059 2050756C + 1059 6C2D7570 + 1059 20322920 + 1059 546F6767 + 1060 0188 29205265 .ascii ") Reset\012\015\000" + 1060 7365740A + 1060 0D00 + 1061 0192 0000 .space 2 + 1062 .LC11: + 1063 0194 4C454E20 .ascii "LEN > BYTES_LEFT\015\012\000" + 1063 3E204259 + 1063 5445535F + 1063 4C454654 + 1063 0D0A00 + 1064 01a7 00 .bss + 1065 .align 2 + 1066 .set .LANCHOR0,. + 0 + 1067 .set .LANCHOR1,. + 8184 + 1070 dbgu: + 1071 0000 00000000 .space 4104 + 1071 00000000 + 1071 00000000 + 1071 00000000 + 1071 00000000 + 1074 value.5922: + 1075 1008 00 .space 1 + 1076 1009 000000 .space 3 + 1079 string.6944: + 1080 100c 00000000 .space 256 + 1080 00000000 + 1080 00000000 + 1080 00000000 + 1080 00000000 + 1083 dbg_buf: + 1084 110c 00000000 .space 256 + 1084 00000000 + 1084 00000000 + 1084 00000000 + 1084 00000000 + 1085 .text + 1086 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 dbgu.c +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:23 .text:00000000 __rb_flush +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:157 .text:00000094 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:162 .text:0000009c $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:165 .text:0000009c AT91F_DBGU_Ready +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:188 .text:000000b0 AT91F_DBGU_Fini +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:239 .text:000000dc AT91F_DBGU_Printk +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:283 .text:0000010c __dbgu_rb_append +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:339 .text:00000164 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:344 .text:0000016c $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:347 .text:0000016c AT91F_DBGU_Frame +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:402 .text:000001c0 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:406 .text:000001c4 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:408 .text:000001c4 DBGU_irq_handler +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:466 .text:000001fc $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:478 .text:00000224 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:566 .text:000002c8 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:577 .text:000002e8 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:580 .text:000002e8 AT91F_DBGU_Get +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:619 .text:00000308 hexdump +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:702 .text:00000390 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:708 .text:0000039c $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:711 .text:0000039c dbgu_rb_init +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:744 .text:000003cc $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:749 .text:000003d4 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:752 .text:000003d4 AT91F_DBGU_Init +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:848 .text:00000460 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:859 .text:00000480 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:862 .text:00000480 dbgu_rb_flush +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:879 .text:00000484 dbgu_rb_append +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:951 .text:000004ec $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:956 .text:000004f4 $a +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:959 .text:000004f4 debugp +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1019 .text:00000554 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1024 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1065 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1070 .bss:00000000 dbgu +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1074 .bss:00001008 value.5922 +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1079 .bss:0000100c string.6944 +C:\Users\netz\AppData\Local\Temp\ccBLfQhe.s:1083 .bss:0000110c dbg_buf + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +memcpy +AT91F_PDC_SendFrame +_main_dbgu +udp_pullup_on +udp_pullup_off +led_toggle +snprintf +memset +AT91F_US_Configure +sysirq_register +vsnprintf +strlen diff --git a/firmware/src/os/fifo.c b/firmware/src/os/fifo.c new file mode 100644 index 0000000..c30ba10 --- /dev/null +++ b/firmware/src/os/fifo.c @@ -0,0 +1,126 @@ +/* Implementation of a virtual FIFO for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +#include "fifo.h" + +#include +#include + +#define FIFO_IRQ_LO 0x01 +#define FIFO_IRQ_HI 0x02 +#define FIFO_IRQ_OFLOW 0x04 + +/* returns number of data bytes present in the fifo */ +int fifo_available(struct fifo *fifo) +{ + if (fifo->producer > fifo->consumer) + return fifo->producer - fifo->consumer; + else + return (fifo->size - fifo->consumer) + fifo->producer; +} + +void fifo_check_water(struct fifo *fifo) +{ + int avail = fifo_available(fifo); + + if (avail <= fifo->watermark) + fifo->irq |= FIFO_IRQ_LO; + else + fifo->irq &= FIFO_IRQ_LO; + + if (fifo->size - avail >= fifo->watermark) + fifo->irq |= FIFO_IRQ_HI; + else + fifo->irq &= FIFO_IRQ_HI; +} + +void fifo_check_raise_int(struct fifo *fifo) +{ + if (fifo->irq & fifo->irq_en) + fifo->callback(fifo, fifo->irq, fifo->cb_data); +} + + +u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + if (len > fifo_available(fifo)) { + len = fifo_available(fifo); + fifo->irq |= FIFO_IRQ_OFLOW; + } + + if (len + fifo->producer <= fifo->size) { + /* easy case */ + memcpy(&fifo->data[fifo->producer], data, len); + fifo->producer += len; + } else { + /* difficult: wrap around */ + u_int16_t chunk_len; + + chunk_len = fifo->size - fifo->producer; + memcpy(&fifo->data[fifo->producer], data, chunk_len); + + memcpy(&fifo->data[0], data + chunk_len, len - chunk_len); + fifo->producer = len - chunk_len; + } + + fifo_check_water(fifo); + + return len; +} + + +u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) +{ + u_int16_t avail = fifo_available(fifo); + + if (avail < len) + len = avail; + + if (fifo->producer > fifo->consumer) { + /* easy case */ + memcpy(data, &fifo->data[fifo->consumer], len); + } else { + /* difficult case: wrap */ + u_int16_t chunk_len = fifo->size - fifo->consumer; + memcpy(data, &fifo->data[fifo->consumer], chunk_len); + memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); + } + + fifo_check_water(fifo); + + return len; +} + +int fifo_init(struct fifo *fifo, u_int16_t size, + void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) +{ + if (size > sizeof(fifo->data)) + return -EINVAL; + + memset(fifo->data, 0, sizeof(fifo->data)); + fifo->size = size; + fifo->producer = fifo->consumer = 0; + fifo->watermark = 0; + fifo->callback = cb; + fifo->cb_data = cb_data; + + return 0; +} + diff --git a/firmware/src/os/fifo.h b/firmware/src/os/fifo.h new file mode 100644 index 0000000..d91c6c2 --- /dev/null +++ b/firmware/src/os/fifo.h @@ -0,0 +1,28 @@ +#ifndef _FIFO_H +#define _FIFO_H + +#include + +#define FIFO_SIZE 1024 + +struct fifo { + u_int16_t size; /* actual FIFO size, can be smaller than 'data' */ + u_int16_t producer; /* index of producer */ + u_int16_t consumer; /* index of consumer */ + u_int16_t watermark; + u_int8_t irq; + u_int8_t irq_en; + u_int8_t status; + void (*callback)(struct fifo *fifo, u_int8_t event, void *data); + void *cb_data; + u_int8_t data[FIFO_SIZE]; +}; + + +extern int fifo_init(struct fifo *fifo, u_int16_t size, + void (*callback)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data); +extern u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data); +extern u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data); +extern int fifo_available(struct fifo *fifo); + +#endif diff --git a/firmware/src/os/fifo.lst b/firmware/src/os/fifo.lst new file mode 100644 index 0000000..7fb4916 --- /dev/null +++ b/firmware/src/os/fifo.lst @@ -0,0 +1,627 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "fifo.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global fifo_available + 24 fifo_available: + 25 .LFB0: + 26 .file 1 "src/os/fifo.c" + 1:src/os/fifo.c **** /* Implementation of a virtual FIFO for OpenPCD + 2:src/os/fifo.c **** * (C) 2006 by Harald Welte + 3:src/os/fifo.c **** * + 4:src/os/fifo.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/fifo.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/fifo.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/fifo.c **** * (at your option) any later version. + 8:src/os/fifo.c **** * + 9:src/os/fifo.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/fifo.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/fifo.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/fifo.c **** * GNU General Public License for more details. + 13:src/os/fifo.c **** * + 14:src/os/fifo.c **** * You should have received a copy of the GNU General Public License + 15:src/os/fifo.c **** * along with this program; if not, write to the Free Software + 16:src/os/fifo.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/fifo.c **** * + 18:src/os/fifo.c **** */ + 19:src/os/fifo.c **** + 20:src/os/fifo.c **** + 21:src/os/fifo.c **** #include "fifo.h" + 22:src/os/fifo.c **** + 23:src/os/fifo.c **** #include + 24:src/os/fifo.c **** #include + 25:src/os/fifo.c **** + 26:src/os/fifo.c **** #define FIFO_IRQ_LO 0x01 + 27:src/os/fifo.c **** #define FIFO_IRQ_HI 0x02 + 28:src/os/fifo.c **** #define FIFO_IRQ_OFLOW 0x04 + 29:src/os/fifo.c **** + 30:src/os/fifo.c **** /* returns number of data bytes present in the fifo */ + 31:src/os/fifo.c **** int fifo_available(struct fifo *fifo) + 32:src/os/fifo.c **** { + 27 .loc 1 32 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 34 .loc 1 33 0 + 35 0000 B220D0E1 ldrh r2, [r0, #2] + 36 0004 B430D0E1 ldrh r3, [r0, #4] + 37 0008 030052E1 cmp r2, r3 + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 35:src/os/fifo.c **** else + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 38 .loc 1 36 0 + 39 000c B000D091 ldrlsh r0, [r0, #0] + 40 .LVL1: + 41 0010 00208290 addls r2, r2, r0 + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 42 .loc 1 34 0 + 43 0014 02006380 rsbhi r0, r3, r2 + 44 .loc 1 36 0 + 45 0018 02006390 rsbls r0, r3, r2 + 37:src/os/fifo.c **** } + 46 .loc 1 37 0 + 47 001c 1EFF2FE1 bx lr + 48 .cfi_endproc + 49 .LFE0: + 51 .align 2 + 52 .global fifo_check_water + 54 fifo_check_water: + 55 .LFB1: + 38:src/os/fifo.c **** + 39:src/os/fifo.c **** void fifo_check_water(struct fifo *fifo) + 40:src/os/fifo.c **** { + 56 .loc 1 40 0 + 57 .cfi_startproc + 58 @ Function supports interworking. + 59 @ args = 0, pretend = 0, frame = 0 + 60 @ frame_needed = 0, uses_anonymous_args = 0 + 61 @ link register save eliminated. + 62 .LVL2: + 63 .LBB12: + 64 .LBB13: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 65 .loc 1 33 0 + 66 0020 B210D0E1 ldrh r1, [r0, #2] + 67 0024 B430D0E1 ldrh r3, [r0, #4] + 68 0028 030051E1 cmp r1, r3 + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 69 .loc 1 36 0 + 70 002c B0C0D091 ldrlsh ip, [r0, #0] + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 71 .loc 1 34 0 + 72 0030 B0C0D081 ldrhih ip, [r0, #0] + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 73 .loc 1 36 0 + 74 0034 0C108190 addls r1, r1, ip + 75 .LBE13: + 76 .LBE12: + 41:src/os/fifo.c **** int avail = fifo_available(fifo); + 42:src/os/fifo.c **** + 43:src/os/fifo.c **** if (avail <= fifo->watermark) + 77 .loc 1 43 0 + 78 0038 B620D0E1 ldrh r2, [r0, #6] + 79 .LBB15: + 80 .LBB14: + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 81 .loc 1 34 0 + 82 003c 01106380 rsbhi r1, r3, r1 + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 83 .loc 1 36 0 + 84 0040 01106390 rsbls r1, r3, r1 + 85 .LBE14: + 86 .LBE15: + 44:src/os/fifo.c **** fifo->irq |= FIFO_IRQ_LO; + 87 .loc 1 44 0 + 88 0044 0830D0E5 ldrb r3, [r0, #8] @ zero_extendqisi2 + 43:src/os/fifo.c **** if (avail <= fifo->watermark) + 89 .loc 1 43 0 + 90 0048 010052E1 cmp r2, r1 + 45:src/os/fifo.c **** else + 46:src/os/fifo.c **** fifo->irq &= FIFO_IRQ_LO; + 47:src/os/fifo.c **** + 48:src/os/fifo.c **** if (fifo->size - avail >= fifo->watermark) + 91 .loc 1 48 0 + 92 004c 0C1061E0 rsb r1, r1, ip + 44:src/os/fifo.c **** fifo->irq |= FIFO_IRQ_LO; + 93 .loc 1 44 0 + 94 0050 013083A3 orrge r3, r3, #1 + 46:src/os/fifo.c **** fifo->irq &= FIFO_IRQ_LO; + 95 .loc 1 46 0 + 96 0054 013003B2 andlt r3, r3, #1 + 97 .loc 1 48 0 + 98 0058 010052E1 cmp r2, r1 + 46:src/os/fifo.c **** fifo->irq &= FIFO_IRQ_LO; + 99 .loc 1 46 0 + 100 005c 0830C0E5 strb r3, [r0, #8] + 49:src/os/fifo.c **** fifo->irq |= FIFO_IRQ_HI; + 101 .loc 1 49 0 + 102 0060 023083D3 orrle r3, r3, #2 + 50:src/os/fifo.c **** else + 51:src/os/fifo.c **** fifo->irq &= FIFO_IRQ_HI; + 103 .loc 1 51 0 + 104 0064 023003C2 andgt r3, r3, #2 + 105 0068 0830C0E5 strb r3, [r0, #8] + 106 006c 1EFF2FE1 bx lr + 107 .cfi_endproc + 108 .LFE1: + 110 .align 2 + 111 .global fifo_check_raise_int + 113 fifo_check_raise_int: + 114 .LFB2: + 52:src/os/fifo.c **** } + 53:src/os/fifo.c **** + 54:src/os/fifo.c **** void fifo_check_raise_int(struct fifo *fifo) + 55:src/os/fifo.c **** { + 115 .loc 1 55 0 + 116 .cfi_startproc + 117 @ Function supports interworking. + 118 @ args = 0, pretend = 0, frame = 0 + 119 @ frame_needed = 0, uses_anonymous_args = 0 + 120 .LVL3: + 56:src/os/fifo.c **** if (fifo->irq & fifo->irq_en) + 121 .loc 1 56 0 + 122 0070 0810D0E5 ldrb r1, [r0, #8] @ zero_extendqisi2 + 123 0074 0920D0E5 ldrb r2, [r0, #9] @ zero_extendqisi2 + 124 0078 020011E1 tst r1, r2 + 55:src/os/fifo.c **** { + 125 .loc 1 55 0 + 126 007c 08402DE9 stmfd sp!, {r3, lr} + 127 .LCFI0: + 128 .cfi_def_cfa_offset 8 + 129 .loc 1 56 0 + 130 .cfi_offset 14, -4 + 131 .cfi_offset 3, -8 + 57:src/os/fifo.c **** fifo->callback(fifo, fifo->irq, fifo->cb_data); + 132 .loc 1 57 0 + 133 0080 10209015 ldrne r2, [r0, #16] + 134 0084 0CC09015 ldrne ip, [r0, #12] + 135 0088 0FE0A011 movne lr, pc + 136 008c 1CFF2F11 bxne ip + 137 .LVL4: + 138 .L11: + 58:src/os/fifo.c **** } + 139 .loc 1 58 0 + 140 0090 0840BDE8 ldmfd sp!, {r3, lr} + 141 0094 1EFF2FE1 bx lr + 142 .cfi_endproc + 143 .LFE2: + 145 .align 2 + 146 .global fifo_data_put + 148 fifo_data_put: + 149 .LFB3: + 59:src/os/fifo.c **** + 60:src/os/fifo.c **** + 61:src/os/fifo.c **** u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) + 62:src/os/fifo.c **** { + 150 .loc 1 62 0 + 151 .cfi_startproc + 152 @ Function supports interworking. + 153 @ args = 0, pretend = 0, frame = 0 + 154 @ frame_needed = 0, uses_anonymous_args = 0 + 155 .LVL5: + 156 0098 F8452DE9 stmfd sp!, {r3, r4, r5, r6, r7, r8, sl, lr} + 157 .LCFI1: + 158 .cfi_def_cfa_offset 32 + 159 .loc 1 62 0 + 160 009c 0040A0E1 mov r4, r0 + 161 .cfi_offset 14, -4 + 162 .cfi_offset 10, -8 + 163 .cfi_offset 8, -12 + 164 .cfi_offset 7, -16 + 165 .cfi_offset 6, -20 + 166 .cfi_offset 5, -24 + 167 .cfi_offset 4, -28 + 168 .cfi_offset 3, -32 + 169 .LVL6: + 170 .LBB16: + 171 .LBB17: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 172 .loc 1 33 0 + 173 00a0 B430D4E1 ldrh r3, [r4, #4] + 174 00a4 B200D0E1 ldrh r0, [r0, #2] + 175 .LVL7: + 176 00a8 030050E1 cmp r0, r3 + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 177 .loc 1 36 0 + 178 00ac B070D491 ldrlsh r7, [r4, #0] + 179 .LBE17: + 180 .LBE16: + 181 .loc 1 62 0 + 182 00b0 0260A0E1 mov r6, r2 + 183 .LBB19: + 184 .LBB18: + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 185 .loc 1 36 0 + 186 00b4 07208090 addls r2, r0, r7 + 187 .LVL8: + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 188 .loc 1 34 0 + 189 00b8 00206380 rsbhi r2, r3, r0 + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 190 .loc 1 36 0 + 191 00bc 02206390 rsbls r2, r3, r2 + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 192 .loc 1 34 0 + 193 00c0 B070D481 ldrhih r7, [r4, #0] + 194 .LBE18: + 195 .LBE19: + 63:src/os/fifo.c **** if (len > fifo_available(fifo)) { + 196 .loc 1 63 0 + 197 00c4 020051E1 cmp r1, r2 + 62:src/os/fifo.c **** { + 198 .loc 1 62 0 + 199 00c8 0150A0E1 mov r5, r1 + 200 .loc 1 63 0 + 201 00cc 080000DA ble .L17 + 202 .LVL9: + 203 .LBB20: + 204 .LBB21: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 205 .loc 1 33 0 + 206 00d0 030050E1 cmp r0, r3 + 207 .LBE21: + 208 .LBE20: + 64:src/os/fifo.c **** len = fifo_available(fifo); + 65:src/os/fifo.c **** fifo->irq |= FIFO_IRQ_OFLOW; + 209 .loc 1 65 0 + 210 00d4 0810D4E5 ldrb r1, [r4, #8] @ zero_extendqisi2 + 211 .LVL10: + 212 .LBB23: + 213 .LBB22: + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 214 .loc 1 36 0 + 215 00d8 00508790 addls r5, r7, r0 + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 216 .loc 1 34 0 + 217 00dc 00506380 rsbhi r5, r3, r0 + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 218 .loc 1 36 0 + 219 00e0 05506390 rsbls r5, r3, r5 + 220 .LBE22: + 221 .LBE23: + 222 .loc 1 65 0 + 223 00e4 042081E3 orr r2, r1, #4 + 64:src/os/fifo.c **** len = fifo_available(fifo); + 224 .loc 1 64 0 + 225 00e8 0558A0E1 mov r5, r5, asl #16 + 226 .loc 1 65 0 + 227 00ec 0820C4E5 strb r2, [r4, #8] + 64:src/os/fifo.c **** len = fifo_available(fifo); + 228 .loc 1 64 0 + 229 00f0 2558A0E1 mov r5, r5, lsr #16 + 230 .LVL11: + 231 .L17: + 66:src/os/fifo.c **** } + 67:src/os/fifo.c **** + 68:src/os/fifo.c **** if (len + fifo->producer <= fifo->size) { + 232 .loc 1 68 0 + 233 00f4 003085E0 add r3, r5, r0 + 234 00f8 070053E1 cmp r3, r7 + 235 00fc 120000DA ble .L22 + 236 .LBB24: + 69:src/os/fifo.c **** /* easy case */ + 70:src/os/fifo.c **** memcpy(&fifo->data[fifo->producer], data, len); + 71:src/os/fifo.c **** fifo->producer += len; + 72:src/os/fifo.c **** } else { + 73:src/os/fifo.c **** /* difficult: wrap around */ + 74:src/os/fifo.c **** u_int16_t chunk_len; + 75:src/os/fifo.c **** + 76:src/os/fifo.c **** chunk_len = fifo->size - fifo->producer; + 237 .loc 1 76 0 + 238 0100 078060E0 rsb r8, r0, r7 + 239 0104 0878A0E1 mov r7, r8, asl #16 + 240 0108 2778A0E1 mov r7, r7, lsr #16 + 241 .LVL12: + 77:src/os/fifo.c **** memcpy(&fifo->data[fifo->producer], data, chunk_len); + 242 .loc 1 77 0 + 243 010c 14A084E2 add sl, r4, #20 + 244 0110 0610A0E1 mov r1, r6 + 245 0114 0720A0E1 mov r2, r7 + 78:src/os/fifo.c **** + 79:src/os/fifo.c **** memcpy(&fifo->data[0], data + chunk_len, len - chunk_len); + 246 .loc 1 79 0 + 247 0118 058067E0 rsb r8, r7, r5 + 77:src/os/fifo.c **** memcpy(&fifo->data[fifo->producer], data, chunk_len); + 248 .loc 1 77 0 + 249 011c 00008AE0 add r0, sl, r0 + 250 0120 FEFFFFEB bl memcpy + 251 .loc 1 79 0 + 252 0124 0A00A0E1 mov r0, sl + 253 0128 071086E0 add r1, r6, r7 + 254 012c 0820A0E1 mov r2, r8 + 255 0130 FEFFFFEB bl memcpy + 80:src/os/fifo.c **** fifo->producer = len - chunk_len; + 256 .loc 1 80 0 + 257 0134 B280C4E1 strh r8, [r4, #2] @ movhi + 258 .LVL13: + 259 .L21: + 260 .LBE24: + 81:src/os/fifo.c **** } + 82:src/os/fifo.c **** + 83:src/os/fifo.c **** fifo_check_water(fifo); + 261 .loc 1 83 0 + 262 0138 0400A0E1 mov r0, r4 + 263 013c FEFFFFEB bl fifo_check_water + 84:src/os/fifo.c **** + 85:src/os/fifo.c **** return len; + 86:src/os/fifo.c **** } + 264 .loc 1 86 0 + 265 0140 0500A0E1 mov r0, r5 + 266 0144 F845BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, r8, sl, lr} + 267 0148 1EFF2FE1 bx lr + 268 .L22: + 70:src/os/fifo.c **** memcpy(&fifo->data[fifo->producer], data, len); + 269 .loc 1 70 0 + 270 014c 14E084E2 add lr, r4, #20 + 271 0150 00008EE0 add r0, lr, r0 + 272 0154 0610A0E1 mov r1, r6 + 273 0158 0520A0E1 mov r2, r5 + 274 015c FEFFFFEB bl memcpy + 71:src/os/fifo.c **** fifo->producer += len; + 275 .loc 1 71 0 + 276 0160 B2C0D4E1 ldrh ip, [r4, #2] + 277 0164 0C0085E0 add r0, r5, ip + 278 0168 B200C4E1 strh r0, [r4, #2] @ movhi + 279 016c F1FFFFEA b .L21 + 280 .cfi_endproc + 281 .LFE3: + 283 .align 2 + 284 .global fifo_data_get + 286 fifo_data_get: + 287 .LFB4: + 87:src/os/fifo.c **** + 88:src/os/fifo.c **** + 89:src/os/fifo.c **** u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) + 90:src/os/fifo.c **** { + 288 .loc 1 90 0 + 289 .cfi_startproc + 290 @ Function supports interworking. + 291 @ args = 0, pretend = 0, frame = 0 + 292 @ frame_needed = 0, uses_anonymous_args = 0 + 293 .LVL14: + 294 0170 F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 295 .LCFI2: + 296 .cfi_def_cfa_offset 24 + 297 .loc 1 90 0 + 298 0174 0040A0E1 mov r4, r0 + 299 .cfi_offset 14, -4 + 300 .cfi_offset 8, -8 + 301 .cfi_offset 7, -12 + 302 .cfi_offset 6, -16 + 303 .cfi_offset 5, -20 + 304 .cfi_offset 4, -24 + 305 .LVL15: + 306 .LBB25: + 307 .LBB28: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 308 .loc 1 33 0 + 309 0178 B430D4E1 ldrh r3, [r4, #4] + 310 017c B200D0E1 ldrh r0, [r0, #2] + 311 .LVL16: + 312 0180 030050E1 cmp r0, r3 + 313 .LBE28: + 314 .LBE25: + 315 .loc 1 90 0 + 316 0184 0270A0E1 mov r7, r2 + 317 .LBB31: + 318 .LBB27: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 319 .loc 1 33 0 + 320 0188 0E00009A bls .L24 + 321 .LVL17: + 34:src/os/fifo.c **** return fifo->producer - fifo->consumer; + 322 .loc 1 34 0 + 323 018c 000063E0 rsb r0, r3, r0 + 324 .LVL18: + 33:src/os/fifo.c **** if (fifo->producer > fifo->consumer) + 325 .loc 1 33 0 + 326 0190 0058A0E1 mov r5, r0, asl #16 + 327 0194 2558A0E1 mov r5, r5, lsr #16 + 328 0198 050051E1 cmp r1, r5 + 329 019c 0150A031 movcc r5, r1 + 330 .LVL19: + 331 .LBE27: + 332 .LBE31: + 91:src/os/fifo.c **** u_int16_t avail = fifo_available(fifo); + 92:src/os/fifo.c **** + 93:src/os/fifo.c **** if (avail < len) + 94:src/os/fifo.c **** len = avail; + 95:src/os/fifo.c **** + 96:src/os/fifo.c **** if (fifo->producer > fifo->consumer) { + 97:src/os/fifo.c **** /* easy case */ + 98:src/os/fifo.c **** memcpy(data, &fifo->data[fifo->consumer], len); + 333 .loc 1 98 0 + 334 01a0 141084E2 add r1, r4, #20 + 335 .LVL20: + 336 01a4 0200A0E1 mov r0, r2 + 337 01a8 031081E0 add r1, r1, r3 + 338 01ac 0520A0E1 mov r2, r5 + 339 .LVL21: + 340 01b0 FEFFFFEB bl memcpy + 341 .LVL22: + 342 .L25: + 99:src/os/fifo.c **** } else { + 100:src/os/fifo.c **** /* difficult case: wrap */ + 101:src/os/fifo.c **** u_int16_t chunk_len = fifo->size - fifo->consumer; + 102:src/os/fifo.c **** memcpy(data, &fifo->data[fifo->consumer], chunk_len); + 103:src/os/fifo.c **** memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); + 104:src/os/fifo.c **** } + 105:src/os/fifo.c **** + 106:src/os/fifo.c **** fifo_check_water(fifo); + 343 .loc 1 106 0 + 344 01b4 0400A0E1 mov r0, r4 + 345 01b8 FEFFFFEB bl fifo_check_water + 107:src/os/fifo.c **** + 108:src/os/fifo.c **** return len; + 109:src/os/fifo.c **** } + 346 .loc 1 109 0 + 347 01bc 0500A0E1 mov r0, r5 + 348 01c0 F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 349 01c4 1EFF2FE1 bx lr + 350 .LVL23: + 351 .L24: + 352 .LBB32: + 353 .LBB29: + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 354 .loc 1 36 0 + 355 01c8 0460A0E1 mov r6, r4 + 356 01cc B421D6E0 ldrh r2, [r6], #20 + 357 01d0 025080E0 add r5, r0, r2 + 358 01d4 05E063E0 rsb lr, r3, r5 + 359 .LBE29: + 360 .LBE32: + 361 .LBB33: + 101:src/os/fifo.c **** u_int16_t chunk_len = fifo->size - fifo->consumer; + 362 .loc 1 101 0 + 363 01d8 02C063E0 rsb ip, r3, r2 + 364 01dc 0C88A0E1 mov r8, ip, asl #16 + 365 .LBE33: + 366 .LBB34: + 367 .LBB26: + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 368 .loc 1 36 0 + 369 01e0 0E28A0E1 mov r2, lr, asl #16 + 370 .LBE26: + 371 .LBE34: + 372 .LBB35: + 101:src/os/fifo.c **** u_int16_t chunk_len = fifo->size - fifo->consumer; + 373 .loc 1 101 0 + 374 01e4 2888A0E1 mov r8, r8, lsr #16 + 375 .LBE35: + 376 .LBB36: + 377 .LBB30: + 36:src/os/fifo.c **** return (fifo->size - fifo->consumer) + fifo->producer; + 378 .loc 1 36 0 + 379 01e8 2258A0E1 mov r5, r2, lsr #16 + 380 01ec 010055E1 cmp r5, r1 + 381 01f0 0150A021 movcs r5, r1 + 382 .LVL24: + 383 .LBE30: + 384 .LBE36: + 385 .LBB37: + 102:src/os/fifo.c **** memcpy(data, &fifo->data[fifo->consumer], chunk_len); + 386 .loc 1 102 0 + 387 01f4 0820A0E1 mov r2, r8 + 388 01f8 031086E0 add r1, r6, r3 + 389 01fc 0700A0E1 mov r0, r7 + 390 0200 FEFFFFEB bl memcpy + 103:src/os/fifo.c **** memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); + 391 .loc 1 103 0 + 392 0204 080087E0 add r0, r7, r8 + 393 0208 0610A0E1 mov r1, r6 + 394 020c 052068E0 rsb r2, r8, r5 + 395 0210 FEFFFFEB bl memcpy + 396 0214 E6FFFFEA b .L25 + 397 .LBE37: + 398 .cfi_endproc + 399 .LFE4: + 401 .align 2 + 402 .global fifo_init + 404 fifo_init: + 405 .LFB5: + 110:src/os/fifo.c **** + 111:src/os/fifo.c **** int fifo_init(struct fifo *fifo, u_int16_t size, + 112:src/os/fifo.c **** void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) + 113:src/os/fifo.c **** { + 406 .loc 1 113 0 + 407 .cfi_startproc + 408 @ Function supports interworking. + 409 @ args = 0, pretend = 0, frame = 0 + 410 @ frame_needed = 0, uses_anonymous_args = 0 + 411 .LVL25: + 114:src/os/fifo.c **** if (size > sizeof(fifo->data)) + 412 .loc 1 114 0 + 413 0218 010B51E3 cmp r1, #1024 + 113:src/os/fifo.c **** { + 414 .loc 1 113 0 + 415 021c F8402DE9 stmfd sp!, {r3, r4, r5, r6, r7, lr} + 416 .LCFI3: + 417 .cfi_def_cfa_offset 24 + 113:src/os/fifo.c **** { + 418 .loc 1 113 0 + 419 0220 0040A0E1 mov r4, r0 + 420 .cfi_offset 14, -4 + 421 .cfi_offset 7, -8 + 422 .cfi_offset 6, -12 + 423 .cfi_offset 5, -16 + 424 .cfi_offset 4, -20 + 425 .cfi_offset 3, -24 + 426 0224 0150A0E1 mov r5, r1 + 427 0228 0260A0E1 mov r6, r2 + 428 022c 0370A0E1 mov r7, r3 + 115:src/os/fifo.c **** return -EINVAL; + 429 .loc 1 115 0 + 430 0230 1500E083 mvnhi r0, #21 + 431 .LVL26: + 114:src/os/fifo.c **** if (size > sizeof(fifo->data)) + 432 .loc 1 114 0 + 433 0234 0B00008A bhi .L27 + 116:src/os/fifo.c **** + 117:src/os/fifo.c **** memset(fifo->data, 0, sizeof(fifo->data)); + 434 .loc 1 117 0 + 435 0238 140080E2 add r0, r0, #20 + 436 023c 0010A0E3 mov r1, #0 + 437 .LVL27: + 438 0240 012BA0E3 mov r2, #1024 + 439 .LVL28: + 440 0244 FEFFFFEB bl memset + 441 .LVL29: + 118:src/os/fifo.c **** fifo->size = size; + 119:src/os/fifo.c **** fifo->producer = fifo->consumer = 0; + 442 .loc 1 119 0 + 443 0248 0030A0E3 mov r3, #0 @ movhi + 118:src/os/fifo.c **** fifo->size = size; + 444 .loc 1 118 0 + 445 024c B050C4E1 strh r5, [r4, #0] @ movhi + 446 .loc 1 119 0 + 447 0250 B430C4E1 strh r3, [r4, #4] @ movhi + 448 0254 B230C4E1 strh r3, [r4, #2] @ movhi + 120:src/os/fifo.c **** fifo->watermark = 0; + 449 .loc 1 120 0 + 450 0258 B630C4E1 strh r3, [r4, #6] @ movhi + 121:src/os/fifo.c **** fifo->callback = cb; + 451 .loc 1 121 0 + 452 025c 0C6084E5 str r6, [r4, #12] + 122:src/os/fifo.c **** fifo->cb_data = cb_data; + 453 .loc 1 122 0 + 454 0260 107084E5 str r7, [r4, #16] + 123:src/os/fifo.c **** + 124:src/os/fifo.c **** return 0; + 455 .loc 1 124 0 + 456 0264 0000A0E3 mov r0, #0 + 457 .L27: + 125:src/os/fifo.c **** } + 458 .loc 1 125 0 + 459 0268 F840BDE8 ldmfd sp!, {r3, r4, r5, r6, r7, lr} + 460 026c 1EFF2FE1 bx lr + 461 .cfi_endproc + 462 .LFE5: + 464 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 fifo.c +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:24 .text:00000000 fifo_available +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:54 .text:00000020 fifo_check_water +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:113 .text:00000070 fifo_check_raise_int +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:148 .text:00000098 fifo_data_put +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:286 .text:00000170 fifo_data_get +C:\Users\netz\AppData\Local\Temp\ccgbdQHX.s:404 .text:00000218 fifo_init + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +memcpy +memset diff --git a/firmware/src/os/flash.c b/firmware/src/os/flash.c new file mode 100644 index 0000000..c729ff8 --- /dev/null +++ b/firmware/src/os/flash.c @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include + +#define EFCS_CMD_WRITE_PAGE 0x1 +#define EFCS_CMD_SET_LOCK_BIT 0x2 +#define EFCS_CMD_WRITE_PAGE_LOCK 0x3 +#define EFCS_CMD_CLEAR_LOCK 0x4 +#define EFCS_CMD_ERASE_ALL 0x8 +#define EFCS_CMD_SET_NVM_BIT 0xb +#define EFCS_CMD_CLEAR_NVM_BIT 0xd +#define EFCS_CMD_SET_SECURITY_BIT 0xf + +static u_int16_t page_from_ramaddr(const void *addr) +{ + u_int32_t ramaddr = (u_int32_t) addr; + ramaddr -= (u_int32_t) AT91C_IFLASH; + return ((ramaddr >> AT91C_IFLASH_PAGE_SHIFT)); +} +#define PAGES_PER_LOCKREGION (AT91C_IFLASH_LOCK_REGION_SIZE>>AT91C_IFLASH_PAGE_SHIFT) +#define IS_FIRST_PAGE_OF_LOCKREGION(x) ((x % PAGES_PER_LOCKREGION) == 0) +#define LOCKREGION_FROM_PAGE(x) (x / PAGES_PER_LOCKREGION) + +static int is_page_locked(u_int16_t page) +{ + u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + + return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); +} + +static void unlock_page(u_int16_t page) +{ + page &= 0x3ff; + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_page(u_int8_t *addr) +{ + u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + DEBUGP("flash_page(0x%x=%u) ", addr, page); + + if (is_page_locked(page)) { + DEBUGP("unlocking "); + unlock_page(page); + } + + if (!(fsr & AT91C_MC_FRDY)) { + DEBUGP("NOT_FLASHING "); + return; + } + + DEBUGP("performing start_prog "); + + AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + AT91C_MC_CORRECT_KEY | (page << 8)); +} + +void flash_init(void) +{ + unsigned int fmcn = AT91F_MC_EFC_ComputeFMCN(MCK); + + AT91F_MC_EFC_CfgModeReg(AT91C_BASE_MC, (fmcn&0xff) << 16 | + AT91C_MC_FWS_3FWS); +} diff --git a/firmware/src/os/flash.h b/firmware/src/os/flash.h new file mode 100644 index 0000000..b812714 --- /dev/null +++ b/firmware/src/os/flash.h @@ -0,0 +1,5 @@ +#ifndef _FLASH_H +#define _FLASH_H +extern void flash_page(u_int8_t *addr); +extern void flash_init(void); +#endif diff --git a/firmware/src/os/flash.lst b/firmware/src/os/flash.lst new file mode 100644 index 0000000..9d56392 --- /dev/null +++ b/firmware/src/os/flash.lst @@ -0,0 +1,1810 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "flash.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 AT91F_MC_EFC_PerformCmd.clone.3: + 24 .LFB278: + 25 .file 1 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( + 26 .loc 1 1558 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 32 .LVL0: +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; + 33 .loc 1 1562 0 + 34 0000 0030E0E3 mvn r3, #0 + 35 0004 9B0003E5 str r0, [r3, #-155] +1563:include/lib_AT91SAM7.h **** } + 36 .loc 1 1563 0 + 37 0008 1EFF2FE1 bx lr + 38 .cfi_endproc + 39 .LFE278: + 41 .align 2 + 42 .global flash_page + 44 flash_page: + 45 .LFB276: + 46 .file 2 "src/os/flash.c" + 1:src/os/flash.c **** #include + 2:src/os/flash.c **** #include + 3:src/os/flash.c **** #include + 4:src/os/flash.c **** #include + 5:src/os/flash.c **** #include + 6:src/os/flash.c **** + 7:src/os/flash.c **** #define EFCS_CMD_WRITE_PAGE 0x1 + 8:src/os/flash.c **** #define EFCS_CMD_SET_LOCK_BIT 0x2 + 9:src/os/flash.c **** #define EFCS_CMD_WRITE_PAGE_LOCK 0x3 + 10:src/os/flash.c **** #define EFCS_CMD_CLEAR_LOCK 0x4 + 11:src/os/flash.c **** #define EFCS_CMD_ERASE_ALL 0x8 + 12:src/os/flash.c **** #define EFCS_CMD_SET_NVM_BIT 0xb + 13:src/os/flash.c **** #define EFCS_CMD_CLEAR_NVM_BIT 0xd + 14:src/os/flash.c **** #define EFCS_CMD_SET_SECURITY_BIT 0xf + 15:src/os/flash.c **** + 16:src/os/flash.c **** static u_int16_t page_from_ramaddr(const void *addr) + 17:src/os/flash.c **** { + 18:src/os/flash.c **** u_int32_t ramaddr = (u_int32_t) addr; + 19:src/os/flash.c **** ramaddr -= (u_int32_t) AT91C_IFLASH; + 20:src/os/flash.c **** return ((ramaddr >> AT91C_IFLASH_PAGE_SHIFT)); + 21:src/os/flash.c **** } + 22:src/os/flash.c **** #define PAGES_PER_LOCKREGION (AT91C_IFLASH_LOCK_REGION_SIZE>>AT91C_IFLASH_PAGE_SHIFT) + 23:src/os/flash.c **** #define IS_FIRST_PAGE_OF_LOCKREGION(x) ((x % PAGES_PER_LOCKREGION) == 0) + 24:src/os/flash.c **** #define LOCKREGION_FROM_PAGE(x) (x / PAGES_PER_LOCKREGION) + 25:src/os/flash.c **** + 26:src/os/flash.c **** static int is_page_locked(u_int16_t page) + 27:src/os/flash.c **** { + 28:src/os/flash.c **** u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + 29:src/os/flash.c **** + 30:src/os/flash.c **** return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 31:src/os/flash.c **** } + 32:src/os/flash.c **** + 33:src/os/flash.c **** static void unlock_page(u_int16_t page) + 34:src/os/flash.c **** { + 35:src/os/flash.c **** page &= 0x3ff; + 36:src/os/flash.c **** AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + 37:src/os/flash.c **** AT91C_MC_CORRECT_KEY | (page << 8)); + 38:src/os/flash.c **** } + 39:src/os/flash.c **** + 40:src/os/flash.c **** void flash_page(u_int8_t *addr) + 41:src/os/flash.c **** { + 47 .loc 2 41 0 + 48 .cfi_startproc + 49 @ Function supports interworking. + 50 @ args = 0, pretend = 0, frame = 0 + 51 @ frame_needed = 0, uses_anonymous_args = 0 + 52 .LVL1: + 53 .LBB10: + 54 .LBB11: + 20:src/os/flash.c **** return ((ramaddr >> AT91C_IFLASH_PAGE_SHIFT)); + 55 .loc 2 20 0 + 56 000c 0037A0E1 mov r3, r0, asl #14 + 57 .LBE11: + 58 .LBE10: + 59 .LBB12: + 60 .LBB13: +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; + 61 .loc 1 1572 0 + 62 0010 0020E0E3 mvn r2, #0 + 63 .LBE13: + 64 .LBE12: + 42:src/os/flash.c **** u_int16_t page = page_from_ramaddr(addr) & 0x3ff; + 65 .loc 2 42 0 + 66 0014 233BA0E1 mov r3, r3, lsr #22 + 41:src/os/flash.c **** { + 67 .loc 2 41 0 + 68 0018 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 69 .LCFI0: + 70 .cfi_def_cfa_offset 16 + 71 .loc 2 42 0 + 72 001c 0338A0E1 mov r3, r3, asl #16 + 73 .LBB15: + 74 .LBB14: + 75 .loc 1 1572 0 + 76 0020 975012E5 ldr r5, [r2, #-151] + 77 .cfi_offset 14, -4 + 78 .cfi_offset 6, -8 + 79 .cfi_offset 5, -12 + 80 .cfi_offset 4, -16 + 81 .LBE14: + 82 .LBE15: + 83 .LBB16: + 84 .LBB17: + 30:src/os/flash.c **** return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 85 .loc 2 30 0 + 86 0024 972012E5 ldr r2, [r2, #-151] + 87 .LBE17: + 88 .LBE16: + 89 .loc 2 42 0 + 90 0028 2348A0E1 mov r4, r3, lsr #16 + 91 .LVL2: + 92 .LBB19: + 93 .LBB18: + 30:src/os/flash.c **** return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); + 94 .loc 2 30 0 + 95 002c 233AA0E1 mov r3, r3, lsr #20 + 96 .LBE18: + 97 .LBE19: + 43:src/os/flash.c **** u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + 44:src/os/flash.c **** DEBUGP("flash_page(0x%x=%u) ", addr, page); + 45:src/os/flash.c **** + 46:src/os/flash.c **** if (is_page_locked(page)) { + 98 .loc 2 46 0 + 99 0030 033812E0 ands r3, r2, r3, asl #16 + 100 .LVL3: + 101 .LBB20: + 102 .LBB21: + 37:src/os/flash.c **** AT91C_MC_CORRECT_KEY | (page << 8)); + 103 .loc 2 37 0 + 104 0034 0404A011 movne r0, r4, asl #8 + 105 .LVL4: + 36:src/os/flash.c **** AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | + 106 .loc 2 36 0 + 107 0038 5A048013 orrne r0, r0, #1509949440 + 108 003c 04008013 orrne r0, r0, #4 + 109 0040 EEFFFF1B blne AT91F_MC_EFC_PerformCmd.clone.3 + 110 .LVL5: + 111 .L3: + 112 .LBE21: + 113 .LBE20: + 47:src/os/flash.c **** DEBUGP("unlocking "); + 48:src/os/flash.c **** unlock_page(page); + 49:src/os/flash.c **** } + 50:src/os/flash.c **** + 51:src/os/flash.c **** if (!(fsr & AT91C_MC_FRDY)) { + 114 .loc 2 51 0 + 115 0044 010015E3 tst r5, #1 + 116 0048 0400000A beq .L2 + 52:src/os/flash.c **** DEBUGP("NOT_FLASHING "); + 53:src/os/flash.c **** return; + 54:src/os/flash.c **** } + 55:src/os/flash.c **** + 56:src/os/flash.c **** DEBUGP("performing start_prog "); + 57:src/os/flash.c **** + 58:src/os/flash.c **** AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 59:src/os/flash.c **** AT91C_MC_CORRECT_KEY | (page << 8)); + 117 .loc 2 59 0 + 118 004c 0444A0E1 mov r4, r4, asl #8 + 119 .LVL6: + 58:src/os/flash.c **** AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 120 .loc 2 58 0 + 121 0050 5A0484E3 orr r0, r4, #1509949440 + 122 0054 010080E3 orr r0, r0, #1 + 60:src/os/flash.c **** } + 123 .loc 2 60 0 + 124 0058 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 58:src/os/flash.c **** AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_START_PROG | + 125 .loc 2 58 0 + 126 005c E7FFFFEA b AT91F_MC_EFC_PerformCmd.clone.3 + 127 .LVL7: + 128 .L2: + 129 .loc 2 60 0 + 130 0060 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 131 0064 1EFF2FE1 bx lr + 132 .cfi_endproc + 133 .LFE276: + 135 .align 2 + 136 .global flash_init + 138 flash_init: + 139 .LFB277: + 61:src/os/flash.c **** + 62:src/os/flash.c **** void flash_init(void) + 63:src/os/flash.c **** { + 140 .loc 2 63 0 + 141 .cfi_startproc + 142 @ Function supports interworking. + 143 @ args = 0, pretend = 0, frame = 0 + 144 @ frame_needed = 0, uses_anonymous_args = 0 + 145 @ link register save eliminated. + 146 .LVL8: + 147 .LBB26: + 148 .LBB27: +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; + 149 .loc 1 1531 0 + 150 0068 08209FE5 ldr r2, .L6 + 151 006c 0030E0E3 mvn r3, #0 + 152 0070 9F2003E5 str r2, [r3, #-159] + 153 .LBE27: + 154 .LBE26: + 64:src/os/flash.c **** unsigned int fmcn = AT91F_MC_EFC_ComputeFMCN(MCK); + 65:src/os/flash.c **** + 66:src/os/flash.c **** AT91F_MC_EFC_CfgModeReg(AT91C_BASE_MC, (fmcn&0xff) << 16 | + 67:src/os/flash.c **** AT91C_MC_FWS_3FWS); + 68:src/os/flash.c **** } + 155 .loc 2 68 0 + 156 0074 1EFF2FE1 bx lr + 157 .L7: + 158 .align 2 + 159 .L6: + 160 0078 00033100 .word 3212032 + 161 .cfi_endproc + 162 .LFE277: + 164 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 flash.c +C:\Users\netz\AppData\Local\Temp\ccZQ9oCI.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccZQ9oCI.s:23 .text:00000000 AT91F_MC_EFC_PerformCmd.clone.3 +C:\Users\netz\AppData\Local\Temp\ccZQ9oCI.s:44 .text:0000000c flash_page +C:\Users\netz\AppData\Local\Temp\ccZQ9oCI.s:138 .text:00000068 flash_init +C:\Users\netz\AppData\Local\Temp\ccZQ9oCI.s:160 .text:00000078 $d + .debug_frame:00000010 $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/src/os/led.c b/firmware/src/os/led.c new file mode 100644 index 0000000..fbe3f58 --- /dev/null +++ b/firmware/src/os/led.c @@ -0,0 +1,80 @@ +/* LED support code for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include "../openpcd.h" +#include +#include +#include + +static const int ledport[] = { + [1] = OPENPCD_PIO_LED1, + [2] = OPENPCD_PIO_LED2, +}; + +void led_switch(int led, int on) +{ + int port; + + if (led < 1 || led > 2) + return; + + port = ledport[led]; + if (on) + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, port); + else + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, port); +} + +int led_get(int led) +{ + int port; + + if (led < 1 || led > 2) + return -1; + + port = ledport[led]; + + return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); +} + +int led_toggle(int led) +{ + int on = led_get(led); + if (on < 0) + return on; + + if (on) + led_switch(led, 0); + else + led_switch(led, 1); + + return !on; +} + +void led_init(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + led_switch(1, 0); + led_switch(2, 0); +} diff --git a/firmware/src/os/led.h b/firmware/src/os/led.h new file mode 100644 index 0000000..394107b --- /dev/null +++ b/firmware/src/os/led.h @@ -0,0 +1,9 @@ +#ifndef _LED_H +#define _LED_H + +extern void led_init(void); +extern void led_switch(int led, int on); +extern int led_get(int led); +extern int led_toggle(int led); + +#endif diff --git a/firmware/src/os/led.lst b/firmware/src/os/led.lst new file mode 100644 index 0000000..555b79b --- /dev/null +++ b/firmware/src/os/led.lst @@ -0,0 +1,1045 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "led.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global led_switch + 24 led_switch: + 25 .LFB273: + 26 .file 1 "src/os/led.c" + 1:src/os/led.c **** /* LED support code for OpenPCD + 2:src/os/led.c **** * (C) 2006 by Harald Welte + 3:src/os/led.c **** * + 4:src/os/led.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/led.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/led.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/led.c **** * (at your option) any later version. + 8:src/os/led.c **** * + 9:src/os/led.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/led.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/led.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/led.c **** * GNU General Public License for more details. + 13:src/os/led.c **** * + 14:src/os/led.c **** * You should have received a copy of the GNU General Public License + 15:src/os/led.c **** * along with this program; if not, write to the Free Software + 16:src/os/led.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/led.c **** * + 18:src/os/led.c **** */ + 19:src/os/led.c **** + 20:src/os/led.c **** #include + 21:src/os/led.c **** #include + 22:src/os/led.c **** #include + 23:src/os/led.c **** #include + 24:src/os/led.c **** #include "../openpcd.h" + 25:src/os/led.c **** #include + 26:src/os/led.c **** #include + 27:src/os/led.c **** #include + 28:src/os/led.c **** + 29:src/os/led.c **** static const int ledport[] = { + 30:src/os/led.c **** [1] = OPENPCD_PIO_LED1, + 31:src/os/led.c **** [2] = OPENPCD_PIO_LED2, + 32:src/os/led.c **** }; + 33:src/os/led.c **** + 34:src/os/led.c **** void led_switch(int led, int on) + 35:src/os/led.c **** { + 27 .loc 1 35 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 36:src/os/led.c **** int port; + 37:src/os/led.c **** + 38:src/os/led.c **** if (led < 1 || led > 2) + 34 .loc 1 38 0 + 35 0000 013040E2 sub r3, r0, #1 + 36 0004 010053E3 cmp r3, #1 + 37 0008 1EFF2F81 bxhi lr + 39:src/os/led.c **** return; + 40:src/os/led.c **** + 41:src/os/led.c **** port = ledport[led]; + 42:src/os/led.c **** if (on) + 38 .loc 1 42 0 + 39 000c 000051E3 cmp r1, #0 + 41:src/os/led.c **** port = ledport[led]; + 40 .loc 1 41 0 + 41 0010 10109FE5 ldr r1, .L5 + 42 .LVL1: + 43 0014 000191E7 ldr r0, [r1, r0, asl #2] + 44 .LVL2: + 45 .LBB40: + 46 .LBB41: + 47 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 48 .loc 2 516 0 + 49 0018 0B2CE0E3 mvn r2, #2816 + 50 001c CB000215 strne r0, [r2, #-203] + 51 .LVL3: + 52 .LBE41: + 53 .LBE40: + 54 .LBB42: + 55 .LBB43: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 56 .loc 2 505 0 + 57 0020 CF000205 streq r0, [r2, #-207] + 58 0024 1EFF2FE1 bx lr + 59 .L6: + 60 .align 2 + 61 .L5: + 62 0028 00000000 .word .LANCHOR0 + 63 .LBE43: + 64 .LBE42: + 65 .cfi_endproc + 66 .LFE273: + 68 .align 2 + 69 .global led_get + 71 led_get: + 72 .LFB274: + 43:src/os/led.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, port); + 44:src/os/led.c **** else + 45:src/os/led.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, port); + 46:src/os/led.c **** } + 47:src/os/led.c **** + 48:src/os/led.c **** int led_get(int led) + 49:src/os/led.c **** { + 73 .loc 1 49 0 + 74 .cfi_startproc + 75 @ Function supports interworking. + 76 @ args = 0, pretend = 0, frame = 0 + 77 @ frame_needed = 0, uses_anonymous_args = 0 + 78 @ link register save eliminated. + 79 .LVL4: + 50:src/os/led.c **** int port; + 51:src/os/led.c **** + 52:src/os/led.c **** if (led < 1 || led > 2) + 80 .loc 1 52 0 + 81 002c 013040E2 sub r3, r0, #1 + 82 0030 010053E3 cmp r3, #1 + 83 0034 0100009A bls .L10 + 53:src/os/led.c **** return -1; + 84 .loc 1 53 0 + 85 0038 0000E0E3 mvn r0, #0 + 86 .LVL5: + 54:src/os/led.c **** + 55:src/os/led.c **** port = ledport[led]; + 56:src/os/led.c **** + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 58:src/os/led.c **** } + 87 .loc 1 58 0 + 88 003c 1EFF2FE1 bx lr + 89 .L10: + 90 .LVL6: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 91 .loc 1 57 0 + 92 0040 18109FE5 ldr r1, .L11 + 93 .LBB44: + 94 .LBB45: + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 95 .loc 2 666 0 + 96 0044 0BCCE0E3 mvn ip, #2816 + 97 .LBE45: + 98 .LBE44: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 99 .loc 1 57 0 + 100 0048 000191E7 ldr r0, [r1, r0, asl #2] + 101 .LBB47: + 102 .LBB46: + 103 .loc 2 666 0 + 104 004c C7201CE5 ldr r2, [ip, #-199] + 105 .LBE46: + 106 .LBE47: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 107 .loc 1 57 0 + 108 0050 000012E1 tst r2, r0 + 109 0054 0000A013 movne r0, #0 + 110 0058 0100A003 moveq r0, #1 + 111 005c 1EFF2FE1 bx lr + 112 .L12: + 113 .align 2 + 114 .L11: + 115 0060 00000000 .word .LANCHOR0 + 116 .cfi_endproc + 117 .LFE274: + 119 .align 2 + 120 .global led_toggle + 122 led_toggle: + 123 .LFB275: + 59:src/os/led.c **** + 60:src/os/led.c **** int led_toggle(int led) + 61:src/os/led.c **** { + 124 .loc 1 61 0 + 125 .cfi_startproc + 126 @ Function supports interworking. + 127 @ args = 0, pretend = 0, frame = 0 + 128 @ frame_needed = 0, uses_anonymous_args = 0 + 129 @ link register save eliminated. + 130 .LVL7: + 131 .LBB48: + 132 .LBB49: + 52:src/os/led.c **** if (led < 1 || led > 2) + 133 .loc 1 52 0 + 134 0064 013040E2 sub r3, r0, #1 + 135 0068 010053E3 cmp r3, #1 + 136 006c 0100009A bls .L18 + 137 .LVL8: + 138 0070 0000E0E3 mvn r0, #0 + 139 .LVL9: + 140 .LBE49: + 141 .LBE48: + 62:src/os/led.c **** int on = led_get(led); + 63:src/os/led.c **** if (on < 0) + 64:src/os/led.c **** return on; + 65:src/os/led.c **** + 66:src/os/led.c **** if (on) + 67:src/os/led.c **** led_switch(led, 0); + 68:src/os/led.c **** else + 69:src/os/led.c **** led_switch(led, 1); + 70:src/os/led.c **** + 71:src/os/led.c **** return !on; + 72:src/os/led.c **** } + 142 .loc 1 72 0 + 143 0074 1EFF2FE1 bx lr + 144 .LVL10: + 145 .L18: + 146 .LBB55: + 147 .LBB54: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 148 .loc 1 57 0 + 149 0078 24309FE5 ldr r3, .L19 + 150 .LVL11: + 151 .LBB50: + 152 .LBB51: + 153 .loc 2 666 0 + 154 007c 0BCCE0E3 mvn ip, #2816 + 155 .LBE51: + 156 .LBE50: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 157 .loc 1 57 0 + 158 0080 002193E7 ldr r2, [r3, r0, asl #2] + 159 .LBB53: + 160 .LBB52: + 161 .loc 2 666 0 + 162 0084 C7101CE5 ldr r1, [ip, #-199] + 163 .LBE52: + 164 .LBE53: + 57:src/os/led.c **** return !(AT91F_PIO_GetOutputDataStatus(AT91C_BASE_PIOA) & port); + 165 .loc 1 57 0 + 166 0088 010012E1 tst r2, r1 + 167 .LBE54: + 168 .LBE55: + 66:src/os/led.c **** if (on) + 169 .loc 1 66 0 + 170 008c 0000A013 movne r0, #0 + 171 0090 0100A003 moveq r0, #1 + 172 .LVL12: + 173 .LBB56: + 174 .LBB57: + 175 .LBB58: + 176 .LBB59: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 177 .loc 2 505 0 + 178 0094 CF200C05 streq r2, [ip, #-207] + 179 .LVL13: + 180 .LBE59: + 181 .LBE58: + 182 .LBE57: + 183 .LBE56: + 184 .LBB60: + 185 .LBB61: + 186 .LBB62: + 187 .LBB63: + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 188 .loc 2 516 0 + 189 0098 CB200C15 strne r2, [ip, #-203] + 190 .LBE63: + 191 .LBE62: + 192 .LBE61: + 193 .LBE60: + 71:src/os/led.c **** return !on; + 194 .loc 1 71 0 + 195 009c 010020E2 eor r0, r0, #1 + 196 00a0 1EFF2FE1 bx lr + 197 .L20: + 198 .align 2 + 199 .L19: + 200 00a4 00000000 .word .LANCHOR0 + 201 .cfi_endproc + 202 .LFE275: + 204 .align 2 + 205 .global led_init + 207 led_init: + 208 .LFB276: + 73:src/os/led.c **** + 74:src/os/led.c **** void led_init(void) + 75:src/os/led.c **** { + 209 .loc 1 75 0 + 210 .cfi_startproc + 211 @ Function supports interworking. + 212 @ args = 0, pretend = 0, frame = 0 + 213 @ frame_needed = 0, uses_anonymous_args = 0 + 214 @ link register save eliminated. + 215 .LVL14: + 216 .LBB64: + 217 .LBB65: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 218 .loc 2 404 0 + 219 00a8 0B3CE0E3 mvn r3, #2816 + 220 00ac 0214A0E3 mov r1, #33554432 + 221 .LBE65: + 222 .LBE64: + 223 .LBB67: + 224 .LBB68: + 225 00b0 0123A0E3 mov r2, #67108864 + 226 .LBE68: + 227 .LBE67: + 228 .LBB70: + 229 .LBB66: + 230 00b4 FF1003E5 str r1, [r3, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 231 .loc 2 405 0 + 232 00b8 EF1003E5 str r1, [r3, #-239] + 233 .LVL15: + 234 .LBE66: + 235 .LBE70: + 236 .LBB71: + 237 .LBB69: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 238 .loc 2 404 0 + 239 00bc FF2003E5 str r2, [r3, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 240 .loc 2 405 0 + 241 00c0 EF2003E5 str r2, [r3, #-239] + 242 .LVL16: + 243 .LBE69: + 244 .LBE71: + 245 .LBB72: + 246 .LBB73: + 247 .LBB74: + 248 .LBB75: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 249 .loc 2 505 0 + 250 00c4 CF1003E5 str r1, [r3, #-207] + 251 .LVL17: + 252 .LBE75: + 253 .LBE74: + 254 .LBE73: + 255 .LBE72: + 256 .LBB76: + 257 .LBB77: + 258 .LBB78: + 259 .LBB79: + 260 00c8 CF2003E5 str r2, [r3, #-207] + 261 .LBE79: + 262 .LBE78: + 263 .LBE77: + 264 .LBE76: + 76:src/os/led.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + 77:src/os/led.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); + 78:src/os/led.c **** led_switch(1, 0); + 79:src/os/led.c **** led_switch(2, 0); + 80:src/os/led.c **** } + 265 .loc 1 80 0 + 266 00cc 1EFF2FE1 bx lr + 267 .cfi_endproc + 268 .LFE276: + 270 .section .rodata + 271 .align 2 + 272 .set .LANCHOR0,. + 0 + 275 ledport: + 276 0000 00000000 .space 4 + 277 0004 00000002 .word 33554432 + 278 0008 00000004 .word 67108864 + 279 .text + 280 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 led.c +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:24 .text:00000000 led_switch +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:62 .text:00000028 $d +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:68 .text:0000002c $a +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:71 .text:0000002c led_get +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:115 .text:00000060 $d +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:119 .text:00000064 $a +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:122 .text:00000064 led_toggle +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:200 .text:000000a4 $d +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:204 .text:000000a8 $a +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:207 .text:000000a8 led_init +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:271 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccyiwpqM.s:275 .rodata:00000000 ledport + .debug_frame:00000010 $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/src/os/main.c b/firmware/src/os/main.c new file mode 100644 index 0000000..968f6ad --- /dev/null +++ b/firmware/src/os/main.c @@ -0,0 +1,88 @@ +/* USB Device Firmware for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../openpcd.h" + +#include + +const struct openpcd_compile_version opcd_version = { + .svnrev = COMPILE_SVNREV, + .date = COMPILE_DATE, + .by = COMPILE_BY, +}; + +int main(void) +{ + /* initialize LED and debug unit */ + led_init(); + sysirq_init(); + AT91F_DBGU_Init(); + + AT91F_PIOA_CfgPMC(); + wdt_init(); + pit_init(); + blinkcode_init(); + + /* initialize USB */ + req_ctx_init(); + usbcmd_gen_init(); + udp_open(); + + /* call application specific init function */ + _init_func(); + + // Enable User Reset and set its minimal assertion to 960 us + AT91C_BASE_RSTC->RSTC_RMR = + AT91C_RSTC_URSTEN | (0x4 << 8) | (unsigned int)(0xA5 << 24); + +#ifdef DEBUG_CLOCK_PA6 + AT91F_PMC_EnablePCK(AT91C_BASE_PMC, 0, AT91C_PMC_CSS_PLL_CLK); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA6_PCK0); +#endif + + /* switch on first led */ + led_switch(2, 1); + + DEBUGPCRF("entering main (idle) loop"); + while (1) { + /* Call application specific main idle function */ + _main_func(); + dbgu_rb_flush(); + + /* restart watchdog timer */ + wdt_restart(); +#ifdef CONFIG_IDLE + //cpu_idle(); +#endif + } +} diff --git a/firmware/src/os/main.h b/firmware/src/os/main.h new file mode 100644 index 0000000..bd42341 --- /dev/null +++ b/firmware/src/os/main.h @@ -0,0 +1,9 @@ +#ifndef _MAIN_H +#define _MAIN_H + +extern void _init_func(void); +extern int _main_dbgu(char key); +extern void _main_func(void); + +extern const struct openpcd_compile_version opcd_version; +#endif diff --git a/firmware/src/os/main.lst b/firmware/src/os/main.lst new file mode 100644 index 0000000..0dd3e74 --- /dev/null +++ b/firmware/src/os/main.lst @@ -0,0 +1,1174 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "main.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global main + 24 main: + 25 .LFB279: + 26 .file 1 "src/os/main.c" + 1:src/os/main.c **** /* USB Device Firmware for OpenPCD + 2:src/os/main.c **** * (C) 2006 by Harald Welte + 3:src/os/main.c **** * + 4:src/os/main.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/main.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/main.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/main.c **** * (at your option) any later version. + 8:src/os/main.c **** * + 9:src/os/main.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/main.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/main.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/main.c **** * GNU General Public License for more details. + 13:src/os/main.c **** * + 14:src/os/main.c **** * You should have received a copy of the GNU General Public License + 15:src/os/main.c **** * along with this program; if not, write to the Free Software + 16:src/os/main.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/main.c **** * + 18:src/os/main.c **** */ + 19:src/os/main.c **** + 20:src/os/main.c **** #include + 21:src/os/main.c **** #include + 22:src/os/main.c **** #include + 23:src/os/main.c **** #include + 24:src/os/main.c **** #include + 25:src/os/main.c **** #include + 26:src/os/main.c **** #include + 27:src/os/main.c **** #include + 28:src/os/main.c **** #include + 29:src/os/main.c **** #include + 30:src/os/main.c **** #include + 31:src/os/main.c **** #include + 32:src/os/main.c **** #include + 33:src/os/main.c **** #include + 34:src/os/main.c **** #include "../openpcd.h" + 35:src/os/main.c **** + 36:src/os/main.c **** #include + 37:src/os/main.c **** + 38:src/os/main.c **** const struct openpcd_compile_version opcd_version = { + 39:src/os/main.c **** .svnrev = COMPILE_SVNREV, + 40:src/os/main.c **** .date = COMPILE_DATE, + 41:src/os/main.c **** .by = COMPILE_BY, + 42:src/os/main.c **** }; + 43:src/os/main.c **** + 44:src/os/main.c **** int main(void) + 45:src/os/main.c **** { + 27 .loc 1 45 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 0000 08402DE9 stmfd sp!, {r3, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 8 + 46:src/os/main.c **** /* initialize LED and debug unit */ + 47:src/os/main.c **** led_init(); + 35 .loc 1 47 0 + 36 .cfi_offset 14, -4 + 37 .cfi_offset 3, -8 + 38 0004 FEFFFFEB bl led_init + 48:src/os/main.c **** sysirq_init(); + 39 .loc 1 48 0 + 40 0008 FEFFFFEB bl sysirq_init + 49:src/os/main.c **** AT91F_DBGU_Init(); + 41 .loc 1 49 0 + 42 000c FEFFFFEB bl AT91F_DBGU_Init + 43 .LVL0: + 44 .LBB8: + 45 .LBB9: + 46 .LBB10: + 47 .file 2 "./include/lib_AT91SAM7.h" + 1:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:./include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:./include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:./include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:./include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:./include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:./include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:./include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:./include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:./include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:./include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:./include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:./include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:./include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:./include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:./include/lib_AT91SAM7.h **** //* + 19:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:./include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:./include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:./include/lib_AT91SAM7.h **** + 40:./include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:./include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:./include/lib_AT91SAM7.h **** + 43:./include/lib_AT91SAM7.h **** #include + 44:./include/lib_AT91SAM7.h **** + 45:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:./include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:./include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:./include/lib_AT91SAM7.h **** + 50:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:./include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:./include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:./include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:./include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:./include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:./include/lib_AT91SAM7.h **** + 61:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:./include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:./include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:./include/lib_AT91SAM7.h **** { + 69:./include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:./include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:./include/lib_AT91SAM7.h **** } + 72:./include/lib_AT91SAM7.h **** + 73:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:./include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:./include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:./include/lib_AT91SAM7.h **** { + 81:./include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:./include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:./include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:./include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:./include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:./include/lib_AT91SAM7.h **** } + 87:./include/lib_AT91SAM7.h **** + 88:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:./include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:./include/lib_AT91SAM7.h **** { + 96:./include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:./include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:./include/lib_AT91SAM7.h **** } + 99:./include/lib_AT91SAM7.h **** + 100:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:./include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:./include/lib_AT91SAM7.h **** { + 107:./include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:./include/lib_AT91SAM7.h **** } + 109:./include/lib_AT91SAM7.h **** + 110:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:./include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:./include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:./include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:./include/lib_AT91SAM7.h **** + 118:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:./include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:./include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:./include/lib_AT91SAM7.h **** { + 126:./include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:./include/lib_AT91SAM7.h **** } + 128:./include/lib_AT91SAM7.h **** + 129:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:./include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:./include/lib_AT91SAM7.h **** { + 137:./include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:./include/lib_AT91SAM7.h **** } + 139:./include/lib_AT91SAM7.h **** + 140:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:./include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:./include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:./include/lib_AT91SAM7.h **** { + 148:./include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:./include/lib_AT91SAM7.h **** } + 150:./include/lib_AT91SAM7.h **** + 151:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:./include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:./include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:./include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:./include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:./include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:./include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:./include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:./include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:./include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:./include/lib_AT91SAM7.h **** + 163:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:./include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:./include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:./include/lib_AT91SAM7.h **** { + 175:./include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:./include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:./include/lib_AT91SAM7.h **** } + 178:./include/lib_AT91SAM7.h **** + 179:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:./include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:./include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:./include/lib_AT91SAM7.h **** { + 188:./include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:./include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:./include/lib_AT91SAM7.h **** } + 191:./include/lib_AT91SAM7.h **** + 192:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:./include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:./include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:./include/lib_AT91SAM7.h **** { + 201:./include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:./include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:./include/lib_AT91SAM7.h **** } + 204:./include/lib_AT91SAM7.h **** + 205:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:./include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:./include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:./include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:./include/lib_AT91SAM7.h **** { + 214:./include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:./include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:./include/lib_AT91SAM7.h **** } + 217:./include/lib_AT91SAM7.h **** + 218:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:./include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:./include/lib_AT91SAM7.h **** { + 225:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:./include/lib_AT91SAM7.h **** } + 227:./include/lib_AT91SAM7.h **** + 228:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:./include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:./include/lib_AT91SAM7.h **** { + 235:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:./include/lib_AT91SAM7.h **** } + 237:./include/lib_AT91SAM7.h **** + 238:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:./include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:./include/lib_AT91SAM7.h **** { + 245:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:./include/lib_AT91SAM7.h **** } + 247:./include/lib_AT91SAM7.h **** + 248:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:./include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:./include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:./include/lib_AT91SAM7.h **** { + 255:./include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:./include/lib_AT91SAM7.h **** } + 257:./include/lib_AT91SAM7.h **** + 258:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:./include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:./include/lib_AT91SAM7.h **** { + 265:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:./include/lib_AT91SAM7.h **** } + 267:./include/lib_AT91SAM7.h **** + 268:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:./include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:./include/lib_AT91SAM7.h **** { + 275:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:./include/lib_AT91SAM7.h **** } + 277:./include/lib_AT91SAM7.h **** + 278:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:./include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:./include/lib_AT91SAM7.h **** { + 285:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:./include/lib_AT91SAM7.h **** } + 287:./include/lib_AT91SAM7.h **** + 288:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:./include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:./include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:./include/lib_AT91SAM7.h **** { + 295:./include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:./include/lib_AT91SAM7.h **** } + 297:./include/lib_AT91SAM7.h **** + 298:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:./include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:./include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:./include/lib_AT91SAM7.h **** + 304:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:./include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:./include/lib_AT91SAM7.h **** + 310:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:./include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:./include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:./include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:./include/lib_AT91SAM7.h **** + 321:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:./include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:./include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:./include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:./include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:./include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:./include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:./include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:./include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:./include/lib_AT91SAM7.h **** + 332:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:./include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:./include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:./include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:./include/lib_AT91SAM7.h **** { + 343:./include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:./include/lib_AT91SAM7.h **** } + 345:./include/lib_AT91SAM7.h **** + 346:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:./include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:./include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:./include/lib_AT91SAM7.h **** { + 354:./include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:./include/lib_AT91SAM7.h **** } + 356:./include/lib_AT91SAM7.h **** + 357:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:./include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:./include/lib_AT91SAM7.h **** { + 364:./include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:./include/lib_AT91SAM7.h **** } + 366:./include/lib_AT91SAM7.h **** + 367:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:./include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:./include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:./include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:./include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:./include/lib_AT91SAM7.h **** { + 375:./include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:./include/lib_AT91SAM7.h **** } + 377:./include/lib_AT91SAM7.h **** + 378:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:./include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:./include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:./include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:./include/lib_AT91SAM7.h **** + 390:./include/lib_AT91SAM7.h **** { + 391:./include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:./include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:./include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:./include/lib_AT91SAM7.h **** } + 395:./include/lib_AT91SAM7.h **** + 396:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:./include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:./include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:./include/lib_AT91SAM7.h **** { + 404:./include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:./include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:./include/lib_AT91SAM7.h **** } + 407:./include/lib_AT91SAM7.h **** + 408:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:./include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:./include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:./include/lib_AT91SAM7.h **** { + 416:./include/lib_AT91SAM7.h **** // Disable output + 417:./include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:./include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:./include/lib_AT91SAM7.h **** } + 420:./include/lib_AT91SAM7.h **** + 421:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:./include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:./include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:./include/lib_AT91SAM7.h **** { + 429:./include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:./include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:./include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:./include/lib_AT91SAM7.h **** } + 433:./include/lib_AT91SAM7.h **** + 434:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:./include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:./include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:./include/lib_AT91SAM7.h **** { + 442:./include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:./include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:./include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:./include/lib_AT91SAM7.h **** } + 446:./include/lib_AT91SAM7.h **** + 447:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:./include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:./include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:./include/lib_AT91SAM7.h **** + 455:./include/lib_AT91SAM7.h **** { + 456:./include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:./include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:./include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:./include/lib_AT91SAM7.h **** } + 460:./include/lib_AT91SAM7.h **** + 461:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:./include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:./include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:./include/lib_AT91SAM7.h **** + 469:./include/lib_AT91SAM7.h **** { + 470:./include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:./include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:./include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:./include/lib_AT91SAM7.h **** } + 474:./include/lib_AT91SAM7.h **** + 475:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:./include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:./include/lib_AT91SAM7.h **** { + 482:./include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:./include/lib_AT91SAM7.h **** } + 484:./include/lib_AT91SAM7.h **** + 485:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:./include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:./include/lib_AT91SAM7.h **** { + 493:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:./include/lib_AT91SAM7.h **** } + 495:./include/lib_AT91SAM7.h **** + 496:./include/lib_AT91SAM7.h **** + 497:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:./include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:./include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:./include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:./include/lib_AT91SAM7.h **** { + 505:./include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:./include/lib_AT91SAM7.h **** } + 507:./include/lib_AT91SAM7.h **** + 508:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:./include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:./include/lib_AT91SAM7.h **** { + 516:./include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:./include/lib_AT91SAM7.h **** } + 518:./include/lib_AT91SAM7.h **** + 519:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:./include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:./include/lib_AT91SAM7.h **** { + 527:./include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:./include/lib_AT91SAM7.h **** } + 529:./include/lib_AT91SAM7.h **** + 530:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:./include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:./include/lib_AT91SAM7.h **** { + 538:./include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:./include/lib_AT91SAM7.h **** } + 540:./include/lib_AT91SAM7.h **** + 541:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:./include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:./include/lib_AT91SAM7.h **** { + 549:./include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:./include/lib_AT91SAM7.h **** } + 551:./include/lib_AT91SAM7.h **** + 552:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:./include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:./include/lib_AT91SAM7.h **** { + 559:./include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:./include/lib_AT91SAM7.h **** } + 561:./include/lib_AT91SAM7.h **** + 562:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:./include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:./include/lib_AT91SAM7.h **** { + 570:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:./include/lib_AT91SAM7.h **** } + 572:./include/lib_AT91SAM7.h **** + 573:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:./include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:./include/lib_AT91SAM7.h **** { + 581:./include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:./include/lib_AT91SAM7.h **** } + 583:./include/lib_AT91SAM7.h **** + 584:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:./include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:./include/lib_AT91SAM7.h **** { + 592:./include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:./include/lib_AT91SAM7.h **** } + 594:./include/lib_AT91SAM7.h **** + 595:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:./include/lib_AT91SAM7.h **** { + 602:./include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:./include/lib_AT91SAM7.h **** } + 604:./include/lib_AT91SAM7.h **** + 605:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:./include/lib_AT91SAM7.h **** { + 613:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:./include/lib_AT91SAM7.h **** } + 615:./include/lib_AT91SAM7.h **** + 616:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:./include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:./include/lib_AT91SAM7.h **** { + 624:./include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:./include/lib_AT91SAM7.h **** } + 626:./include/lib_AT91SAM7.h **** + 627:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:./include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:./include/lib_AT91SAM7.h **** { + 635:./include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:./include/lib_AT91SAM7.h **** } + 637:./include/lib_AT91SAM7.h **** + 638:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:./include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:./include/lib_AT91SAM7.h **** { + 645:./include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:./include/lib_AT91SAM7.h **** } + 647:./include/lib_AT91SAM7.h **** + 648:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:./include/lib_AT91SAM7.h **** { + 656:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:./include/lib_AT91SAM7.h **** } + 658:./include/lib_AT91SAM7.h **** + 659:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:./include/lib_AT91SAM7.h **** { + 666:./include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:./include/lib_AT91SAM7.h **** } + 668:./include/lib_AT91SAM7.h **** + 669:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:./include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:./include/lib_AT91SAM7.h **** { + 677:./include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:./include/lib_AT91SAM7.h **** } + 679:./include/lib_AT91SAM7.h **** + 680:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:./include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:./include/lib_AT91SAM7.h **** { + 688:./include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:./include/lib_AT91SAM7.h **** } + 690:./include/lib_AT91SAM7.h **** + 691:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:./include/lib_AT91SAM7.h **** { + 698:./include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:./include/lib_AT91SAM7.h **** } + 700:./include/lib_AT91SAM7.h **** + 701:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:./include/lib_AT91SAM7.h **** { + 708:./include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:./include/lib_AT91SAM7.h **** } + 710:./include/lib_AT91SAM7.h **** + 711:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:./include/lib_AT91SAM7.h **** { + 719:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:./include/lib_AT91SAM7.h **** } + 721:./include/lib_AT91SAM7.h **** + 722:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:./include/lib_AT91SAM7.h **** { + 730:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:./include/lib_AT91SAM7.h **** } + 732:./include/lib_AT91SAM7.h **** + 733:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:./include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:./include/lib_AT91SAM7.h **** { + 741:./include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:./include/lib_AT91SAM7.h **** } + 743:./include/lib_AT91SAM7.h **** + 744:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:./include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:./include/lib_AT91SAM7.h **** { + 752:./include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:./include/lib_AT91SAM7.h **** } + 754:./include/lib_AT91SAM7.h **** + 755:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:./include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:./include/lib_AT91SAM7.h **** { + 762:./include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:./include/lib_AT91SAM7.h **** } + 764:./include/lib_AT91SAM7.h **** + 765:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:./include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:./include/lib_AT91SAM7.h **** { + 773:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:./include/lib_AT91SAM7.h **** } + 775:./include/lib_AT91SAM7.h **** + 776:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:./include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:./include/lib_AT91SAM7.h **** { + 784:./include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:./include/lib_AT91SAM7.h **** } + 786:./include/lib_AT91SAM7.h **** + 787:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:./include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:./include/lib_AT91SAM7.h **** { + 795:./include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:./include/lib_AT91SAM7.h **** } + 797:./include/lib_AT91SAM7.h **** + 798:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:./include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:./include/lib_AT91SAM7.h **** { + 805:./include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:./include/lib_AT91SAM7.h **** } + 807:./include/lib_AT91SAM7.h **** + 808:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:./include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:./include/lib_AT91SAM7.h **** { + 816:./include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:./include/lib_AT91SAM7.h **** } + 818:./include/lib_AT91SAM7.h **** + 819:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:./include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:./include/lib_AT91SAM7.h **** { + 827:./include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:./include/lib_AT91SAM7.h **** } + 829:./include/lib_AT91SAM7.h **** + 830:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:./include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:./include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:./include/lib_AT91SAM7.h **** { + 838:./include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:./include/lib_AT91SAM7.h **** } + 840:./include/lib_AT91SAM7.h **** + 841:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:./include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:./include/lib_AT91SAM7.h **** { + 848:./include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:./include/lib_AT91SAM7.h **** } + 850:./include/lib_AT91SAM7.h **** + 851:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:./include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:./include/lib_AT91SAM7.h **** { + 859:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:./include/lib_AT91SAM7.h **** } + 861:./include/lib_AT91SAM7.h **** + 862:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:./include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:./include/lib_AT91SAM7.h **** { + 869:./include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:./include/lib_AT91SAM7.h **** } + 871:./include/lib_AT91SAM7.h **** + 872:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:./include/lib_AT91SAM7.h **** { + 880:./include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:./include/lib_AT91SAM7.h **** } + 882:./include/lib_AT91SAM7.h **** + 883:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:./include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:./include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:./include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:./include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:./include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:./include/lib_AT91SAM7.h **** { + 891:./include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:./include/lib_AT91SAM7.h **** } + 893:./include/lib_AT91SAM7.h **** + 894:./include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:./include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:./include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:./include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:./include/lib_AT91SAM7.h **** unsigned int mode) + 904:./include/lib_AT91SAM7.h **** { + 905:./include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:./include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:./include/lib_AT91SAM7.h **** } + 908:./include/lib_AT91SAM7.h **** + 909:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:./include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:./include/lib_AT91SAM7.h **** unsigned int mode) + 916:./include/lib_AT91SAM7.h **** { + 917:./include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:./include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:./include/lib_AT91SAM7.h **** } + 920:./include/lib_AT91SAM7.h **** + 921:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:./include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:./include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:./include/lib_AT91SAM7.h **** ) + 928:./include/lib_AT91SAM7.h **** { + 929:./include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:./include/lib_AT91SAM7.h **** } + 931:./include/lib_AT91SAM7.h **** + 932:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:./include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:./include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:./include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:./include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:./include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:./include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:./include/lib_AT91SAM7.h **** { + 940:./include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 48 .loc 2 940 0 + 49 0010 031CE0E3 mvn r1, #768 + 50 0014 0400A0E3 mov r0, #4 + 51 0018 EF0001E5 str r0, [r1, #-239] + 52 .LBE10: + 53 .LBE9: + 54 .LBE8: + 50:src/os/main.c **** + 51:src/os/main.c **** AT91F_PIOA_CfgPMC(); + 52:src/os/main.c **** wdt_init(); + 55 .loc 1 52 0 + 56 001c FEFFFFEB bl wdt_init + 53:src/os/main.c **** pit_init(); + 57 .loc 1 53 0 + 58 0020 FEFFFFEB bl pit_init + 54:src/os/main.c **** blinkcode_init(); + 59 .loc 1 54 0 + 60 0024 FEFFFFEB bl blinkcode_init + 55:src/os/main.c **** + 56:src/os/main.c **** /* initialize USB */ + 57:src/os/main.c **** req_ctx_init(); + 61 .loc 1 57 0 + 62 0028 FEFFFFEB bl req_ctx_init + 58:src/os/main.c **** usbcmd_gen_init(); + 63 .loc 1 58 0 + 64 002c FEFFFFEB bl usbcmd_gen_init + 59:src/os/main.c **** udp_open(); + 65 .loc 1 59 0 + 66 0030 FEFFFFEB bl udp_open + 60:src/os/main.c **** + 61:src/os/main.c **** /* call application specific init function */ + 62:src/os/main.c **** _init_func(); + 67 .loc 1 62 0 + 68 0034 FEFFFFEB bl _init_func + 63:src/os/main.c **** + 64:src/os/main.c **** // Enable User Reset and set its minimal assertion to 960 us + 65:src/os/main.c **** AT91C_BASE_RSTC->RSTC_RMR = + 69 .loc 1 65 0 + 70 0038 30209FE5 ldr r2, .L4 + 71 003c 023CE0E3 mvn r3, #512 + 66:src/os/main.c **** AT91C_RSTC_URSTEN | (0x4 << 8) | (unsigned int)(0xA5 << 24); + 67:src/os/main.c **** + 68:src/os/main.c **** #ifdef DEBUG_CLOCK_PA6 + 69:src/os/main.c **** AT91F_PMC_EnablePCK(AT91C_BASE_PMC, 0, AT91C_PMC_CSS_PLL_CLK); + 70:src/os/main.c **** AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA6_PCK0); + 71:src/os/main.c **** #endif + 72:src/os/main.c **** + 73:src/os/main.c **** /* switch on first led */ + 74:src/os/main.c **** led_switch(2, 1); + 72 .loc 1 74 0 + 73 0040 0200A0E3 mov r0, #2 + 74 0044 0110A0E3 mov r1, #1 + 65:src/os/main.c **** AT91C_BASE_RSTC->RSTC_RMR = + 75 .loc 1 65 0 + 76 0048 F72003E5 str r2, [r3, #-247] + 77 .loc 1 74 0 + 78 004c FEFFFFEB bl led_switch + 75:src/os/main.c **** + 76:src/os/main.c **** DEBUGPCRF("entering main (idle) loop"); + 79 .loc 1 76 0 + 80 0050 1C009FE5 ldr r0, .L4+4 + 81 0054 1C109FE5 ldr r1, .L4+8 + 82 0058 4C20A0E3 mov r2, #76 + 83 005c FEFFFFEB bl debugp + 84 .L2: + 77:src/os/main.c **** while (1) { + 78:src/os/main.c **** /* Call application specific main idle function */ + 79:src/os/main.c **** _main_func(); + 85 .loc 1 79 0 discriminator 1 + 86 0060 FEFFFFEB bl _main_func + 80:src/os/main.c **** dbgu_rb_flush(); + 87 .loc 1 80 0 discriminator 1 + 88 0064 FEFFFFEB bl dbgu_rb_flush + 81:src/os/main.c **** + 82:src/os/main.c **** /* restart watchdog timer */ + 83:src/os/main.c **** wdt_restart(); + 89 .loc 1 83 0 discriminator 1 + 90 0068 FEFFFFEB bl wdt_restart + 91 006c FBFFFFEA b .L2 + 92 .L5: + 93 .align 2 + 94 .L4: + 95 0070 010400A5 .word -1526725631 + 96 0074 00000000 .word .LC0 + 97 0078 00000000 .word .LANCHOR0 + 98 .cfi_endproc + 99 .LFE279: + 101 .global opcd_version + 102 .section .rodata + 103 .align 2 + 104 .set .LANCHOR0,. + 0 + 107 __FUNCTION__.6256: + 108 0000 6D61696E .ascii "main\000" + 108 00 + 109 0005 000000 .space 3 + 112 opcd_version: + 113 0008 3439352D .ascii "495-unclean\000" + 113 756E636C + 113 65616E00 + 114 0014 00000000 .space 4 + 115 0018 6E65747A .ascii "netz@BlubbFish\000" + 115 40426C75 + 115 62624669 + 115 736800 + 116 0027 00 .space 1 + 117 0028 32303131 .ascii "20110510-160603\000" + 117 30353130 + 117 2D313630 + 117 36303300 + 118 .section .rodata.str1.4,"aMS",%progbits,1 + 119 .align 2 + 120 .LC0: + 121 0000 25732825 .ascii "%s(%d): entering main (idle) loop\015\012\000" + 121 64293A20 + 121 656E7465 + 121 72696E67 + 121 206D6169 + 122 .text + 123 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 main.c +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:24 .text:00000000 main +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:95 .text:00000070 $d +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:112 .rodata:00000008 opcd_version +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:103 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:107 .rodata:00000000 __FUNCTION__.6256 +C:\Users\netz\AppData\Local\Temp\ccT13ko3.s:119 .rodata.str1.4:00000000 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +led_init +sysirq_init +AT91F_DBGU_Init +wdt_init +pit_init +blinkcode_init +req_ctx_init +usbcmd_gen_init +udp_open +_init_func +led_switch +debugp +_main_func +dbgu_rb_flush +wdt_restart diff --git a/firmware/src/os/pcd_enumerate.c b/firmware/src/os/pcd_enumerate.c new file mode 100644 index 0000000..ab000c7 --- /dev/null +++ b/firmware/src/os/pcd_enumerate.c @@ -0,0 +1,851 @@ +/* AT91SAM7 USB interface code for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + * based on existing AT91SAM7 UDP CDC ACM example code, licensed as followed: + *---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support - ROUSSET - + *---------------------------------------------------------------------------- + * The software is delivered "AS IS" without warranty or condition of any + * kind, either express, implied or statutory. This includes without + * limitation any warranty or condition with respect to merchantability or + * fitness for any particular purpose, or against the infringements of + * intellectual property rights of others. + *---------------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include "../openpcd.h" +#include + +#include "../config.h" + +//#define DEBUG_UDP_IRQ +//#define DEBUG_UDP_IRQ_IN +//#define DEBUG_UDP_IRQ_OUT +#define DEBUG_UDP_EP0 + +#ifdef DEBUG_UDP_IRQ +#define DEBUGI(x, args ...) DEBUGP(x, ## args) +#else +#define DEBUGI(x, args ...) do { } while (0) +#endif + +#ifdef DEBUG_UDP_IRQ_IN +#define DEBUGII(x, args ...) DEBUGP(x, ## args) +#else +#define DEBUGII(x, args ...) do { } while (0) +#endif + +#ifdef DEBUG_UDP_IRQ_OUT +#define DEBUGIO(x, args ...) DEBUGP(x, ## args) +#else +#define DEBUGIO(x, args ...) do { } while (0) +#endif + +#ifdef DEBUG_UDP_EP0 +#define DEBUGE(x, args ...) DEBUGP(x, ## args) +#else +#define DEBUGE(x, args ...) do { } while (0) +#endif + +#define CONFIG_DFU + +#ifdef CONFIG_DFU +static const struct dfuapi *dfu = DFU_API_LOCATION; +#define udp_init dfu->udp_init +//#define udp_ep0_send_data dfu->ep0_send_data +#define udp_ep0_send_zlp dfu->ep0_send_zlp +#define udp_ep0_send_stall dfu->ep0_send_stall +#else +#error non-DFU builds currently not supported (yet) again +#endif + +#ifdef CONFIG_USB_HID +#include "usb_descriptors_hid.h" +#else +#include "usb_descriptors_openpcd.h" +#endif + +static struct udp_pcd upcd; + +struct epstate { + u_int32_t state_busy; + u_int32_t state_pending; +}; + +static const struct epstate epstate[] = { + [0] = { .state_busy = RCTX_STATE_INVALID }, + [1] = { .state_busy = RCTX_STATE_INVALID }, + [2] = { .state_busy = RCTX_STATE_UDP_EP2_BUSY, + .state_pending = RCTX_STATE_UDP_EP2_PENDING }, + [3] = { .state_busy = RCTX_STATE_UDP_EP3_BUSY, + .state_pending = RCTX_STATE_UDP_EP3_PENDING }, +}; + +/* Send Data through the control endpoint */ +static void udp_ep0_send_data(const char *pData, u_int32_t length) +{ + AT91PS_UDP pUdp = AT91C_BASE_UDP; + u_int32_t cpt = 0; + AT91_REG csr; + + DEBUGE("send_data: %u bytes ", length); + + do { + cpt = MIN(length, 8); + length -= cpt; + + DEBUGE("fifo_fill "); + while (cpt--) + pUdp->UDP_FDR[0] = *pData++; + + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + DEBUGE("wait_txcomp_clear "); + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + + DEBUGE("set_txpktrdy "); + pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + DEBUGE("wait_txcomp "); + do { + csr = pUdp->UDP_CSR[0]; + + /* Data IN stage has been stopped by a status OUT */ + if (csr & AT91C_UDP_RX_DATA_BK0) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + DEBUGE("stopped by status out "); + return; + } + } while (!(csr & AT91C_UDP_TXCOMP)); + + } while (length); + + DEBUGE("clear_txcomp "); + if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + } + DEBUGE("done "); +} + +static void reset_ep(unsigned int ep) +{ + AT91PS_UDP pUDP = upcd.pUdp; + struct req_ctx *rctx; + + //pUDP->UDP_CSR[ep] = AT91C_UDP_EPEDS; + + atomic_set(&upcd.ep[ep].pkts_in_transit, 0); + + /* free all currently transmitting contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_busy, + RCTX_STATE_FREE))) {} + /* free all currently pending contexts */ + while ((rctx = req_ctx_find_get(0, epstate[ep].state_pending, + RCTX_STATE_FREE))) {} + + pUDP->UDP_RSTEP |= (1 << ep); + pUDP->UDP_RSTEP &= ~(1 << ep); + + upcd.ep[ep].incomplete.rctx = NULL; +} + +static void udp_ep0_handler(void); + +void udp_unthrottle(void) +{ + AT91PS_UDP pUDP = upcd.pUdp; + pUDP->UDP_IER = AT91C_UDP_EPINT1; +} + +static int __udp_refill_ep(int ep) +{ + u_int16_t i; + AT91PS_UDP pUDP = upcd.pUdp; + struct req_ctx *rctx; + unsigned int start, end; + + /* If we're not configured by the host yet, there is no point + * in trying to send data to it... */ + if (!upcd.cur_config) { + return -ENXIO; + } + + /* If there are already two packets in transit, the DPR of + * the SAM7 UDC doesn't have space for more data */ + if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + return -EBUSY; + } + + /* If we have an incompletely-transmitted req_ctx (>EP size), + * we need to transmit the rest and finish the transaction */ + if (upcd.ep[ep].incomplete.rctx) { + rctx = upcd.ep[ep].incomplete.rctx; + start = upcd.ep[ep].incomplete.bytes_sent; + } else { + /* get pending rctx and start transmitting from zero */ + rctx = req_ctx_find_get(0, epstate[ep].state_pending, + epstate[ep].state_busy); + if (!rctx) + return 0; + start = 0; + + upcd.ep[ep].incomplete.bytes_sent = 0; + } + + if (rctx->tot_len - start <= AT91C_EP_IN_SIZE) + end = rctx->tot_len; + else + end = start + AT91C_EP_IN_SIZE; + + /* fill FIFO/DPR */ + DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + end - start); + for (i = start; i < end; i++) + pUDP->UDP_FDR[ep] = rctx->data[i]; + + if (atomic_inc_return(&upcd.ep[ep].pkts_in_transit) == 1) { + /* not been transmitting before, start transmit */ + pUDP->UDP_CSR[ep] |= AT91C_UDP_TXPKTRDY; + } + + if ((end - start < AT91C_EP_OUT_SIZE) || + (((end - start) == 0) && end && (rctx->tot_len % AT91C_EP_OUT_SIZE) == 0)) { + /* CASE 1: return context to pool, if + * - packet transfer < AT91C_EP_OUT_SIZE + * - after ZLP of transfer == AT91C_EP_OUT_SIZE + * - after ZLP of transfer % AT91C_EP_OUT_SIZE == 0 + * - after last packet of transfer % AT91C_EP_OUT_SIZE != 0 + */ + DEBUGII("RCTX(ep=%u,ctx=%u)_tx_done ", ep, req_ctx_num(rctx)); + upcd.ep[ep].incomplete.rctx = NULL; + req_ctx_put(rctx); + } else { + /* CASE 2: mark transfer as incomplete, if + * - after data of transfer == AT91C_EP_OUT_SIZE + * - after data of transfer > AT91C_EP_OUT_SIZE + * - after last packet of transfer % AT91C_EP_OUT_SIZE == 0 + */ + upcd.ep[ep].incomplete.rctx = rctx; + upcd.ep[ep].incomplete.bytes_sent += end - start; + DEBUGII("RCTX(ep=%u)_tx_cont ", ep); + } + + return 1; +} + +int udp_refill_ep(int ep) +{ + unsigned long flags; + int ret; + + local_irq_save(flags); + ret = __udp_refill_ep(ep); + local_irq_restore(flags); + + return ret; +} + +static void udp_irq(void) +{ + u_int32_t csr; + AT91PS_UDP pUDP = upcd.pUdp; + AT91_REG isr = pUDP->UDP_ISR; + + DEBUGI("udp_irq(imr=0x%04x, isr=0x%04x, state=%d): ", + pUDP->UDP_IMR, isr, upcd.state); + + if (isr & AT91C_UDP_ENDBUSRES) { + DEBUGI("ENDBUSRES "); + pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + pUDP->UDP_IER = AT91C_UDP_EPINT0; + /* reset all endpoints */ + pUDP->UDP_RSTEP = (unsigned int)-1; + pUDP->UDP_RSTEP = 0; + /* Enable the function */ + pUDP->UDP_FADDR = AT91C_UDP_FEN; + /* Configure endpoint 0 */ + pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + upcd.cur_config = 0; + upcd.state = USB_STATE_DEFAULT; + + reset_ep(1); + reset_ep(2); + reset_ep(3); + +#ifdef CONFIG_DFU + if (*dfu->dfu_state == DFU_STATE_appDETACH) { + DEBUGI("DFU_SWITCH "); + /* now we need to switch to DFU mode */ + dfu->dfu_switch(); + goto out; + } +#endif + } + + if (isr & AT91C_UDP_EPINT0) { + DEBUGI("EP0INT(Control) "); + udp_ep0_handler(); + } + if (isr & AT91C_UDP_EPINT1) { + u_int32_t cur_rcv_bank = upcd.cur_rcv_bank; + u_int16_t i, pkt_size; + struct req_ctx *rctx; + + csr = pUDP->UDP_CSR[1]; + pkt_size = csr >> 16; + + DEBUGI("EP1INT(Out, CSR=0x%08x) ", csr); + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK1) + DEBUGIO("cur_bank=1 "); + else if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + DEBUGIO("cur_bank=0 "); + else + DEBUGIO("cur_bank INVALID "); + + if (csr & AT91C_UDP_RX_DATA_BK1) + DEBUGIO("BANK1 "); + if (csr & AT91C_UDP_RX_DATA_BK0) + DEBUGIO("BANK0 "); + + if (!(csr & cur_rcv_bank)) + goto cont_ep2; + + if (upcd.ep[1].incomplete.rctx) { + DEBUGIO("continue_incompl_RCTX "); + rctx = upcd.ep[1].incomplete.rctx; + } else { + /* allocate new req_ctx */ + DEBUGIO("alloc_new_RCTX "); + + /* whether to get a big or a small req_ctx */ + if (pkt_size >= AT91C_EP_IN_SIZE) + rctx = req_ctx_find_get(1, RCTX_STATE_FREE, + RCTX_STATE_UDP_RCV_BUSY); + else + rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_UDP_RCV_BUSY); + + if (!rctx) { + /* disable interrupts for now */ + pUDP->UDP_IDR = AT91C_UDP_EPINT1; + DEBUGP("NO_RCTX_AVAIL! "); + goto cont_ep2; + } + rctx->tot_len = 0; + } + DEBUGIO("RCTX=%u ", req_ctx_num(rctx)); + + if (rctx->size - rctx->tot_len < pkt_size) { + DEBUGIO("RCTX too small, truncating !!!\n"); + pkt_size = rctx->size - rctx->tot_len; + } + + for (i = 0; i < pkt_size; i++) + rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + + pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + + /* toggle current receive bank */ + if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + else + cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + upcd.cur_rcv_bank = cur_rcv_bank; + + DEBUGIO("rctxdump(%s) ", hexdump(rctx->data, rctx->tot_len)); + + /* if this is the last packet in transfer, hand rctx up the + * stack */ + if (pkt_size < AT91C_EP_IN_SIZE) { + DEBUGIO("RCTX_rx_done "); + req_ctx_set_state(rctx, RCTX_STATE_UDP_RCV_DONE); + upcd.ep[1].incomplete.rctx = NULL; + } else { + DEBUGIO("RCTX_rx_cont "); + upcd.ep[1].incomplete.rctx = rctx; + } + } +cont_ep2: + if (isr & AT91C_UDP_EPINT2) { + csr = pUDP->UDP_CSR[2]; + DEBUGI("EP2INT(In, CSR=0x%08x) ", csr); + if (csr & AT91C_UDP_TXCOMP) { + DEBUGII("ACK_TX_COMP "); + /* acknowledge TX completion */ + pUDP->UDP_CSR[2] &= ~AT91C_UDP_TXCOMP; + while (pUDP->UDP_CSR[2] & AT91C_UDP_TXCOMP) ; + + /* if we already have another packet in DPR, send it */ + if (atomic_dec_return(&upcd.ep[2].pkts_in_transit) == 1) + pUDP->UDP_CSR[2] |= AT91C_UDP_TXPKTRDY; + + __udp_refill_ep(2); + } + } + if (isr & AT91C_UDP_EPINT3) { + csr = pUDP->UDP_CSR[3]; + DEBUGII("EP3INT(Interrupt, CSR=0x%08x) ", csr); + /* Transmit has completed, re-fill from pending rcts for EP3 */ + if (csr & AT91C_UDP_TXCOMP) { + pUDP->UDP_CSR[3] &= ~AT91C_UDP_TXCOMP; + while (pUDP->UDP_CSR[3] & AT91C_UDP_TXCOMP) ; + + /* if we already have another packet in DPR, send it */ + if (atomic_dec_return(&upcd.ep[3].pkts_in_transit) == 1) + pUDP->UDP_CSR[3] |= AT91C_UDP_TXPKTRDY; + + __udp_refill_ep(3); + } + } + if (isr & AT91C_UDP_RXSUSP) { + pUDP->UDP_ICR = AT91C_UDP_RXSUSP; + DEBUGI("RXSUSP "); +#ifdef CONFIG_USB_SUSPEND + upcd.state = USB_STATE_SUSPENDED; + /* FIXME: implement suspend/resume correctly. This + * involves saving the pre-suspend state, and calling back + * into the main application program to ask it to power down + * all peripherals, switching to slow clock, ... */ +#endif + } + if (isr & AT91C_UDP_RXRSM) { + pUDP->UDP_ICR = AT91C_UDP_RXRSM; + DEBUGI("RXRSM "); +#ifdef CONFIG_USB_SUSPEND + if (upcd.state == USB_STATE_SUSPENDED) + upcd.state = USB_STATE_CONFIGURED; + /* FIXME: implement suspend/resume */ +#endif + } + if (isr & AT91C_UDP_EXTRSM) { + pUDP->UDP_ICR = AT91C_UDP_EXTRSM; + DEBUGI("EXTRSM "); + /* FIXME: implement suspend/resume */ + } + if (isr & AT91C_UDP_SOFINT) { + pUDP->UDP_ICR = AT91C_UDP_SOFINT; + DEBUGI("SOFINT "); + } + if (isr & AT91C_UDP_WAKEUP) { + pUDP->UDP_ICR = AT91C_UDP_WAKEUP; + DEBUGI("WAKEUP "); + } +out: + DEBUGI("END\r\n"); + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); +} + +void udp_pullup_on(void) +{ +#ifdef PCD + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +void udp_pullup_off(void) +{ +#ifdef PCD + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); +#endif + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); +} + +/* Open USB Device Port */ +void udp_open(void) +{ + DEBUGPCRF("entering"); + udp_init(); + upcd.pUdp = AT91C_BASE_UDP; + upcd.cur_config = 0; + upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + /* This should start with USB_STATE_NOTATTACHED, but we're a pure + * bus powered device and thus start with powered */ + upcd.state = USB_STATE_POWERED; + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + OPENPCD_IRQ_PRIO_UDP, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &udp_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_UDP); + + /* End-of-Bus-Reset is always enabled */ + + /* Set the Pull up resistor */ + udp_pullup_on(); +} + +void udp_reset(void) +{ + volatile int i; + + udp_pullup_off(); + for (i = 0; i < 0xffff; i++) + ; + udp_pullup_on(); +} + +/* Handle requests on the USB Control Endpoint */ +static void udp_ep0_handler(void) +{ + AT91PS_UDP pUDP = upcd.pUdp; + u_int8_t bmRequestType, bRequest; + u_int16_t wValue, wIndex, wLength, wStatus; + u_int32_t csr = pUDP->UDP_CSR[0]; + + DEBUGE("CSR=0x%04x ", csr); + + if (csr & AT91C_UDP_STALLSENT) { + DEBUGE("ACK_STALLSENT "); + pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + } + + if (csr & AT91C_UDP_RX_DATA_BK0) { + DEBUGE("ACK_BANK0 "); + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + } + + if (!(csr & AT91C_UDP_RXSETUP)) { + DEBUGE("no setup packet "); + return; + } + + DEBUGE("len=%d ", csr >> 16); + if (csr >> 16 == 0) { + DEBUGE("empty packet "); + return; + } + + bmRequestType = pUDP->UDP_FDR[0]; + bRequest = pUDP->UDP_FDR[0]; + wValue = (pUDP->UDP_FDR[0] & 0xFF); + wValue |= (pUDP->UDP_FDR[0] << 8); + wIndex = (pUDP->UDP_FDR[0] & 0xFF); + wIndex |= (pUDP->UDP_FDR[0] << 8); + wLength = (pUDP->UDP_FDR[0] & 0xFF); + wLength |= (pUDP->UDP_FDR[0] << 8); + + DEBUGE("bmRequestType=0x%2x ", bmRequestType); + + if (bmRequestType & 0x80) { + DEBUGE("DATA_IN=1 "); + pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + } + pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + + DEBUGE("dfu_state = %u ", *dfu->dfu_state); + /* Handle supported standard device request Cf Table 9-3 in USB + * speciication Rev 1.1 */ + switch ((bRequest << 8) | bmRequestType) { + u_int8_t desc_type, desc_index; + case STD_GET_DESCRIPTOR: + DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", + wValue, wIndex); + desc_type = wValue >> 8; + desc_index = wValue & 0xff; + switch (desc_type) { + case USB_DT_DEVICE: + /* Return Device Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + dfu->dfu_dev_descriptor, + MIN(dfu->dfu_dev_descriptor->bLength, + wLength)); + else +#endif + udp_ep0_send_data((const char *) &dev_descriptor, + MIN(sizeof(dev_descriptor), wLength)); + break; + case USB_DT_CONFIG: + /* Return Configuration Descriptor */ +#ifdef CONFIG_DFU + if (*dfu->dfu_state != DFU_STATE_appIDLE) + udp_ep0_send_data((const char *) + dfu->dfu_cfg_descriptor, + MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + wLength)); + else +#endif + udp_ep0_send_data((const char *) &cfg_descriptor, + MIN(sizeof(cfg_descriptor), wLength)); + break; + case USB_DT_STRING: +#ifdef CONFIG_USB_STRING + /* Return String descriptor */ + if (desc_index > ARRAY_SIZE(usb_strings)) + goto out_stall; + DEBUGE("bLength=%u, wLength=%u\n", + usb_strings[desc_index]->bLength, wLength); + udp_ep0_send_data((const char *) usb_strings[desc_index], + MIN(usb_strings[desc_index]->bLength, + wLength)); +#else + goto out_stall; +#endif + break; + case USB_DT_CS_DEVICE: + /* Return Function descriptor */ + udp_ep0_send_data((const char *) &dfu->dfu_cfg_descriptor->func_dfu, + MIN(sizeof(dfu->dfu_cfg_descriptor->func_dfu), wLength)); + break; + case USB_DT_INTERFACE: + /* Return Interface descriptor */ + if (desc_index > cfg_descriptor.ucfg.bNumInterfaces) + goto out_stall; + switch (desc_index) { + case 0: + udp_ep0_send_data((const char *) + &cfg_descriptor.uif, + MIN(sizeof(cfg_descriptor.uif), + wLength)); + break; + #ifdef CONFIG_DFU + case 1: + udp_ep0_send_data((const char *) + &cfg_descriptor.uif_dfu[0], + MIN(sizeof(cfg_descriptor.uif_dfu[0]), + wLength)); + break; + case 2: + udp_ep0_send_data((const char *) + &cfg_descriptor.uif_dfu[1], + MIN(sizeof(cfg_descriptor.uif_dfu[1]), + wLength)); + break; + #endif + default: + goto out_stall; + break; + } + break; + default: + goto out_stall; + break; + } + break; + case STD_SET_ADDRESS: + DEBUGE("SET_ADDRESS "); + if (wValue > 127) + goto out_stall; + + switch (upcd.state) { + case USB_STATE_DEFAULT: + udp_ep0_send_zlp(); + if (wValue == 0) { + /* do nothing */ + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + upcd.state = USB_STATE_ADDRESS; + } + break; + case USB_STATE_ADDRESS: + udp_ep0_send_zlp(); + if (wValue == 0) { + upcd.state = USB_STATE_DEFAULT; + } else { + pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + } + break; + default: + goto out_stall; + break; + } + break; + case STD_SET_CONFIGURATION: + DEBUGE("SET_CONFIG "); + if (upcd.state != USB_STATE_ADDRESS && + upcd.state != USB_STATE_CONFIGURED) { + goto out_stall; + } + if ((wValue & 0xff) == 0) { + DEBUGE("VALUE==0 "); + upcd.state = USB_STATE_ADDRESS; + pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + pUDP->UDP_CSR[1] = 0; + pUDP->UDP_CSR[2] = 0; + pUDP->UDP_CSR[3] = 0; + } else if ((wValue & 0xff) <= + dev_descriptor.bNumConfigurations) { + DEBUGE("VALUE!=0 "); + upcd.state = USB_STATE_CONFIGURED; + pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + AT91C_UDP_EPTYPE_BULK_OUT; + pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + AT91C_UDP_EPTYPE_BULK_IN; + pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + AT91C_UDP_EPTYPE_INT_IN; + } else { + /* invalid configuration */ + goto out_stall; + break; + } + upcd.cur_config = wValue; + udp_ep0_send_zlp(); + pUDP->UDP_IER = (AT91C_UDP_EPINT0 | AT91C_UDP_EPINT1 | + AT91C_UDP_EPINT2 | AT91C_UDP_EPINT3); + break; + case STD_GET_CONFIGURATION: + DEBUGE("GET_CONFIG "); + switch (upcd.state) { + case USB_STATE_ADDRESS: + case USB_STATE_CONFIGURED: + udp_ep0_send_data((char *)&(upcd.cur_config), + sizeof(upcd.cur_config)); + break; + default: + goto out_stall; + break; + } + break; + case STD_GET_INTERFACE: + DEBUGE("GET_INTERFACE "); + if (upcd.state != USB_STATE_CONFIGURED) + goto out_stall; + udp_ep0_send_data((char *)&(upcd.cur_altsett), + sizeof(upcd.cur_altsett)); + break; + case STD_GET_STATUS_ZERO: + DEBUGE("GET_STATUS_ZERO "); + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_INTERFACE: + DEBUGE("GET_STATUS_INTERFACE "); + if (upcd.state == USB_STATE_DEFAULT || + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + break; + case STD_GET_STATUS_ENDPOINT: + DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + if (upcd.state == USB_STATE_DEFAULT || + (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + goto out_stall; + wStatus = 0; + wIndex &= 0x0F; + if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + && (wIndex == 0)) { + wStatus = + (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + udp_ep0_send_data((char *)&wStatus, + sizeof(wStatus)); + } else + goto out_stall; + break; + case STD_SET_FEATURE_ZERO: + DEBUGE("SET_FEATURE_ZERO "); + if (upcd.state == USB_STATE_ADDRESS && + (wIndex & 0xff) != 0) + goto out_stall; + /* FIXME: implement this */ + goto out_stall; + break; + case STD_SET_FEATURE_INTERFACE: + DEBUGE("SET_FEATURE_INTERFACE "); + if (upcd.state == USB_STATE_ADDRESS && + (wIndex & 0xff) != 0) + goto out_stall; + udp_ep0_send_zlp(); + break; + case STD_SET_FEATURE_ENDPOINT: + DEBUGE("SET_FEATURE_ENDPOINT "); + if (upcd.state == USB_STATE_ADDRESS && + (wIndex & 0xff) != 0) + goto out_stall; + if (wValue != USB_ENDPOINT_HALT) + goto out_stall; + udp_ep0_send_zlp(); + wIndex &= 0x0F; + if ((wValue == 0) && wIndex && (wIndex <= 3)) { + pUDP->UDP_CSR[wIndex] = 0; + udp_ep0_send_zlp(); + } else + goto out_stall; + break; + case STD_CLEAR_FEATURE_ZERO: + DEBUGE("CLEAR_FEATURE_ZERO "); + goto out_stall; + break; + case STD_CLEAR_FEATURE_INTERFACE: + DEBUGP("CLEAR_FEATURE_INTERFACE "); + udp_ep0_send_zlp(); + break; + case STD_CLEAR_FEATURE_ENDPOINT: + DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + if (wValue != USB_ENDPOINT_HALT) + goto out_stall; + wIndex &= 0x0F; + if ((wValue == 0) && wIndex && (wIndex <= 3)) { + reset_ep(wIndex); + udp_ep0_send_zlp(); + } else + goto out_stall; + break; + case STD_SET_INTERFACE: + DEBUGE("SET INTERFACE "); + if (upcd.state != USB_STATE_CONFIGURED) + goto out_stall; + if (wIndex > cfg_descriptor.ucfg.bNumInterfaces) + goto out_stall; + upcd.cur_interface = wIndex; + upcd.cur_altsett = wValue; + /* USB spec mandates that if we only support one altsetting in + * the given interface, we shall respond with STALL in the + * status stage */ + udp_ep0_send_stall(); + break; + default: + DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + bRequest, bmRequestType); +#ifdef CONFIG_DFU + if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + dfu->dfu_ep0_handler(bmRequestType, bRequest, wValue, + wLength); + } else +#endif + goto out_stall; + break; + } + return; +out_stall: + DEBUGE("STALL!! "); + udp_ep0_send_stall(); +} + diff --git a/firmware/src/os/pcd_enumerate.h b/firmware/src/os/pcd_enumerate.h new file mode 100644 index 0000000..ae15dc0 --- /dev/null +++ b/firmware/src/os/pcd_enumerate.h @@ -0,0 +1,72 @@ +#ifndef _OPCD_USB_H +#define _OPCD_USB_H + +#include +#include +#include +#include "openpcd.h" +#include + +#define AT91C_EP_OUT 1 +#define AT91C_EP_OUT_SIZE 0x40 +#define AT91C_EP_IN 2 +#define AT91C_EP_IN_SIZE 0x40 +#define AT91C_EP_INT 3 + + +struct req_ctx; + +extern void udp_open(void); +extern int udp_refill_ep(int ep); +extern void udp_unthrottle(void); +extern void udp_reset(void); + +extern void udp_pullup_off(void); +extern void udp_pullup_on(void); + +struct ep_ctx { + atomic_t pkts_in_transit; + struct { + struct req_ctx *rctx; + unsigned int bytes_sent; + } incomplete; +}; + +struct udp_pcd { + AT91PS_UDP pUdp; + enum usb_device_state state; + unsigned char cur_config; + unsigned char cur_interface; + unsigned char cur_altsett; + unsigned int cur_rcv_bank; + struct ep_ctx ep[4]; +}; + +/* USB standard request code */ + +#define STD_GET_STATUS_ZERO 0x0080 +#define STD_GET_STATUS_INTERFACE 0x0081 +#define STD_GET_STATUS_ENDPOINT 0x0082 + +#define STD_CLEAR_FEATURE_ZERO 0x0100 +#define STD_CLEAR_FEATURE_INTERFACE 0x0101 +#define STD_CLEAR_FEATURE_ENDPOINT 0x0102 + +#define STD_SET_FEATURE_ZERO 0x0300 +#define STD_SET_FEATURE_INTERFACE 0x0301 +#define STD_SET_FEATURE_ENDPOINT 0x0302 + +#define STD_SET_ADDRESS 0x0500 +#define STD_GET_DESCRIPTOR 0x0680 +#define STD_SET_DESCRIPTOR 0x0700 +#define STD_GET_CONFIGURATION 0x0880 +#define STD_SET_CONFIGURATION 0x0900 +#define STD_GET_INTERFACE 0x0A81 +#define STD_SET_INTERFACE 0x0B01 +#define STD_SYNCH_FRAME 0x0C82 + +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) + + +#endif + diff --git a/firmware/src/os/pcd_enumerate.lst b/firmware/src/os/pcd_enumerate.lst new file mode 100644 index 0000000..6daefc8 --- /dev/null +++ b/firmware/src/os/pcd_enumerate.lst @@ -0,0 +1,4266 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "pcd_enumerate.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 udp_ep0_send_data: + 24 .LFB278: + 25 .file 1 "src/os/pcd_enumerate.c" + 1:src/os/pcd_enumerate.c **** /* AT91SAM7 USB interface code for OpenPCD + 2:src/os/pcd_enumerate.c **** * (C) 2006 by Harald Welte + 3:src/os/pcd_enumerate.c **** * + 4:src/os/pcd_enumerate.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/pcd_enumerate.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/pcd_enumerate.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/pcd_enumerate.c **** * (at your option) any later version. + 8:src/os/pcd_enumerate.c **** * + 9:src/os/pcd_enumerate.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/pcd_enumerate.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/pcd_enumerate.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/pcd_enumerate.c **** * GNU General Public License for more details. + 13:src/os/pcd_enumerate.c **** * + 14:src/os/pcd_enumerate.c **** * You should have received a copy of the GNU General Public License + 15:src/os/pcd_enumerate.c **** * along with this program; if not, write to the Free Software + 16:src/os/pcd_enumerate.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/pcd_enumerate.c **** * + 18:src/os/pcd_enumerate.c **** * based on existing AT91SAM7 UDP CDC ACM example code, licensed as followed: + 19:src/os/pcd_enumerate.c **** *---------------------------------------------------------------------------- + 20:src/os/pcd_enumerate.c **** * ATMEL Microcontroller Software Support - ROUSSET - + 21:src/os/pcd_enumerate.c **** *---------------------------------------------------------------------------- + 22:src/os/pcd_enumerate.c **** * The software is delivered "AS IS" without warranty or condition of any + 23:src/os/pcd_enumerate.c **** * kind, either express, implied or statutory. This includes without + 24:src/os/pcd_enumerate.c **** * limitation any warranty or condition with respect to merchantability or + 25:src/os/pcd_enumerate.c **** * fitness for any particular purpose, or against the infringements of + 26:src/os/pcd_enumerate.c **** * intellectual property rights of others. + 27:src/os/pcd_enumerate.c **** *---------------------------------------------------------------------------- + 28:src/os/pcd_enumerate.c **** */ + 29:src/os/pcd_enumerate.c **** + 30:src/os/pcd_enumerate.c **** #include + 31:src/os/pcd_enumerate.c **** #include + 32:src/os/pcd_enumerate.c **** #include + 33:src/os/pcd_enumerate.c **** #include + 34:src/os/pcd_enumerate.c **** #include + 35:src/os/pcd_enumerate.c **** #include + 36:src/os/pcd_enumerate.c **** + 37:src/os/pcd_enumerate.c **** #include + 38:src/os/pcd_enumerate.c **** + 39:src/os/pcd_enumerate.c **** #include + 40:src/os/pcd_enumerate.c **** #include + 41:src/os/pcd_enumerate.c **** #include + 42:src/os/pcd_enumerate.c **** #include "../openpcd.h" + 43:src/os/pcd_enumerate.c **** #include + 44:src/os/pcd_enumerate.c **** + 45:src/os/pcd_enumerate.c **** #include "../config.h" + 46:src/os/pcd_enumerate.c **** + 47:src/os/pcd_enumerate.c **** //#define DEBUG_UDP_IRQ + 48:src/os/pcd_enumerate.c **** //#define DEBUG_UDP_IRQ_IN + 49:src/os/pcd_enumerate.c **** //#define DEBUG_UDP_IRQ_OUT + 50:src/os/pcd_enumerate.c **** #define DEBUG_UDP_EP0 + 51:src/os/pcd_enumerate.c **** + 52:src/os/pcd_enumerate.c **** #ifdef DEBUG_UDP_IRQ + 53:src/os/pcd_enumerate.c **** #define DEBUGI(x, args ...) DEBUGP(x, ## args) + 54:src/os/pcd_enumerate.c **** #else + 55:src/os/pcd_enumerate.c **** #define DEBUGI(x, args ...) do { } while (0) + 56:src/os/pcd_enumerate.c **** #endif + 57:src/os/pcd_enumerate.c **** + 58:src/os/pcd_enumerate.c **** #ifdef DEBUG_UDP_IRQ_IN + 59:src/os/pcd_enumerate.c **** #define DEBUGII(x, args ...) DEBUGP(x, ## args) + 60:src/os/pcd_enumerate.c **** #else + 61:src/os/pcd_enumerate.c **** #define DEBUGII(x, args ...) do { } while (0) + 62:src/os/pcd_enumerate.c **** #endif + 63:src/os/pcd_enumerate.c **** + 64:src/os/pcd_enumerate.c **** #ifdef DEBUG_UDP_IRQ_OUT + 65:src/os/pcd_enumerate.c **** #define DEBUGIO(x, args ...) DEBUGP(x, ## args) + 66:src/os/pcd_enumerate.c **** #else + 67:src/os/pcd_enumerate.c **** #define DEBUGIO(x, args ...) do { } while (0) + 68:src/os/pcd_enumerate.c **** #endif + 69:src/os/pcd_enumerate.c **** + 70:src/os/pcd_enumerate.c **** #ifdef DEBUG_UDP_EP0 + 71:src/os/pcd_enumerate.c **** #define DEBUGE(x, args ...) DEBUGP(x, ## args) + 72:src/os/pcd_enumerate.c **** #else + 73:src/os/pcd_enumerate.c **** #define DEBUGE(x, args ...) do { } while (0) + 74:src/os/pcd_enumerate.c **** #endif + 75:src/os/pcd_enumerate.c **** + 76:src/os/pcd_enumerate.c **** #define CONFIG_DFU + 77:src/os/pcd_enumerate.c **** + 78:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 79:src/os/pcd_enumerate.c **** static const struct dfuapi *dfu = DFU_API_LOCATION; + 80:src/os/pcd_enumerate.c **** #define udp_init dfu->udp_init + 81:src/os/pcd_enumerate.c **** //#define udp_ep0_send_data dfu->ep0_send_data + 82:src/os/pcd_enumerate.c **** #define udp_ep0_send_zlp dfu->ep0_send_zlp + 83:src/os/pcd_enumerate.c **** #define udp_ep0_send_stall dfu->ep0_send_stall + 84:src/os/pcd_enumerate.c **** #else + 85:src/os/pcd_enumerate.c **** #error non-DFU builds currently not supported (yet) again + 86:src/os/pcd_enumerate.c **** #endif + 87:src/os/pcd_enumerate.c **** + 88:src/os/pcd_enumerate.c **** #ifdef CONFIG_USB_HID + 89:src/os/pcd_enumerate.c **** #include "usb_descriptors_hid.h" + 90:src/os/pcd_enumerate.c **** #else + 91:src/os/pcd_enumerate.c **** #include "usb_descriptors_openpcd.h" + 92:src/os/pcd_enumerate.c **** #endif + 93:src/os/pcd_enumerate.c **** + 94:src/os/pcd_enumerate.c **** static struct udp_pcd upcd; + 95:src/os/pcd_enumerate.c **** + 96:src/os/pcd_enumerate.c **** struct epstate { + 97:src/os/pcd_enumerate.c **** u_int32_t state_busy; + 98:src/os/pcd_enumerate.c **** u_int32_t state_pending; + 99:src/os/pcd_enumerate.c **** }; + 100:src/os/pcd_enumerate.c **** + 101:src/os/pcd_enumerate.c **** static const struct epstate epstate[] = { + 102:src/os/pcd_enumerate.c **** [0] = { .state_busy = RCTX_STATE_INVALID }, + 103:src/os/pcd_enumerate.c **** [1] = { .state_busy = RCTX_STATE_INVALID }, + 104:src/os/pcd_enumerate.c **** [2] = { .state_busy = RCTX_STATE_UDP_EP2_BUSY, + 105:src/os/pcd_enumerate.c **** .state_pending = RCTX_STATE_UDP_EP2_PENDING }, + 106:src/os/pcd_enumerate.c **** [3] = { .state_busy = RCTX_STATE_UDP_EP3_BUSY, + 107:src/os/pcd_enumerate.c **** .state_pending = RCTX_STATE_UDP_EP3_PENDING }, + 108:src/os/pcd_enumerate.c **** }; + 109:src/os/pcd_enumerate.c **** + 110:src/os/pcd_enumerate.c **** /* Send Data through the control endpoint */ + 111:src/os/pcd_enumerate.c **** static void udp_ep0_send_data(const char *pData, u_int32_t length) + 112:src/os/pcd_enumerate.c **** { + 26 .loc 1 112 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 8 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 .LVL0: + 32 0000 F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 24 + 35 0004 0040A0E1 mov r4, r0 + 36 .cfi_offset 14, -4 + 37 .cfi_offset 8, -8 + 38 .cfi_offset 7, -12 + 39 .cfi_offset 6, -16 + 40 .cfi_offset 5, -20 + 41 .cfi_offset 4, -24 + 42 0008 08D04DE2 sub sp, sp, #8 + 43 .LCFI1: + 44 .cfi_def_cfa_offset 32 + 113:src/os/pcd_enumerate.c **** AT91PS_UDP pUdp = AT91C_BASE_UDP; + 114:src/os/pcd_enumerate.c **** u_int32_t cpt = 0; + 115:src/os/pcd_enumerate.c **** AT91_REG csr; + 116:src/os/pcd_enumerate.c **** + 117:src/os/pcd_enumerate.c **** DEBUGE("send_data: %u bytes ", length); + 45 .loc 1 117 0 + 46 000c 58019FE5 ldr r0, .L26 + 47 .LVL1: + 112:src/os/pcd_enumerate.c **** { + 48 .loc 1 112 0 + 49 0010 0150A0E1 mov r5, r1 + 50 .loc 1 117 0 + 51 0014 FEFFFFEB bl debugp + 52 .LVL2: + 118:src/os/pcd_enumerate.c **** + 119:src/os/pcd_enumerate.c **** do { + 120:src/os/pcd_enumerate.c **** cpt = MIN(length, 8); + 121:src/os/pcd_enumerate.c **** length -= cpt; + 122:src/os/pcd_enumerate.c **** + 123:src/os/pcd_enumerate.c **** DEBUGE("fifo_fill "); + 124:src/os/pcd_enumerate.c **** while (cpt--) + 125:src/os/pcd_enumerate.c **** pUdp->UDP_FDR[0] = *pData++; + 53 .loc 1 125 0 + 54 0018 50619FE5 ldr r6, .L26+4 + 55 .LVL3: + 56 .L9: + 120:src/os/pcd_enumerate.c **** cpt = MIN(length, 8); + 57 .loc 1 120 0 + 58 001c 080055E3 cmp r5, #8 + 59 0020 0580A031 movcc r8, r5 + 60 0024 0880A023 movcs r8, #8 + 61 .LVL4: + 123:src/os/pcd_enumerate.c **** DEBUGE("fifo_fill "); + 62 .loc 1 123 0 + 63 0028 44019FE5 ldr r0, .L26+8 + 64 002c FEFFFFEB bl debugp + 65 .LVL5: + 124:src/os/pcd_enumerate.c **** while (cpt--) + 66 .loc 1 124 0 + 67 0030 000058E3 cmp r8, #0 + 68 0034 1700000A beq .L2 + 69 .loc 1 125 0 + 70 0038 0430A0E1 mov r3, r4 + 71 003c 0120D3E4 ldrb r2, [r3], #1 @ zero_extendqisi2 + 111:src/os/pcd_enumerate.c **** static void udp_ep0_send_data(const char *pData, u_int32_t length) + 72 .loc 1 111 0 + 73 0040 081084E0 add r1, r4, r8 + 74 0044 0400E0E1 mvn r0, r4 + 75 0048 004081E0 add r4, r1, r0 + 76 .LVL6: + 124:src/os/pcd_enumerate.c **** while (cpt--) + 77 .loc 1 124 0 + 78 004c 010053E1 cmp r3, r1 + 79 0050 014004E2 and r4, r4, #1 + 80 .loc 1 125 0 + 81 0054 AF2006E5 str r2, [r6, #-175] + 82 .LVL7: + 124:src/os/pcd_enumerate.c **** while (cpt--) + 83 .loc 1 124 0 + 84 0058 0D00000A beq .L22 + 85 005c 000054E3 cmp r4, #0 + 86 0060 0300000A beq .L3 + 87 .loc 1 125 0 + 88 0064 0140D3E4 ldrb r4, [r3], #1 @ zero_extendqisi2 + 124:src/os/pcd_enumerate.c **** while (cpt--) + 89 .loc 1 124 0 + 90 0068 010053E1 cmp r3, r1 + 91 .loc 1 125 0 + 92 006c AF4006E5 str r4, [r6, #-175] + 124:src/os/pcd_enumerate.c **** while (cpt--) + 93 .loc 1 124 0 + 94 0070 0700000A beq .L22 + 95 .L3: + 96 .loc 1 125 0 + 97 0074 03C0A0E1 mov ip, r3 + 98 0078 01E0DCE4 ldrb lr, [ip], #1 @ zero_extendqisi2 + 99 007c AFE006E5 str lr, [r6, #-175] + 100 0080 0170D3E5 ldrb r7, [r3, #1] @ zero_extendqisi2 + 101 0084 01308CE2 add r3, ip, #1 + 124:src/os/pcd_enumerate.c **** while (cpt--) + 102 .loc 1 124 0 + 103 0088 010053E1 cmp r3, r1 + 104 .loc 1 125 0 + 105 008c AF7006E5 str r7, [r6, #-175] + 124:src/os/pcd_enumerate.c **** while (cpt--) + 106 .loc 1 124 0 + 107 0090 F7FFFF1A bne .L3 + 108 .L22: + 109 0094 0140A0E1 mov r4, r1 + 110 .L2: + 126:src/os/pcd_enumerate.c **** + 127:src/os/pcd_enumerate.c **** if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 111 .loc 1 127 0 + 112 0098 CF3016E5 ldr r3, [r6, #-207] + 113 009c 010013E3 tst r3, #1 + 114 00a0 2800001A bne .L24 + 115 .L4: + 128:src/os/pcd_enumerate.c **** DEBUGE("wait_txcomp_clear "); + 129:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 130:src/os/pcd_enumerate.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 131:src/os/pcd_enumerate.c **** } + 132:src/os/pcd_enumerate.c **** + 133:src/os/pcd_enumerate.c **** DEBUGE("set_txpktrdy "); + 116 .loc 1 133 0 + 117 00a4 CC009FE5 ldr r0, .L26+12 + 118 00a8 FEFFFFEB bl debugp + 134:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 119 .loc 1 134 0 + 120 00ac CFC016E5 ldr ip, [r6, #-207] + 121 00b0 10708CE3 orr r7, ip, #16 + 135:src/os/pcd_enumerate.c **** DEBUGE("wait_txcomp "); + 122 .loc 1 135 0 + 123 00b4 C0009FE5 ldr r0, .L26+16 + 134:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; + 124 .loc 1 134 0 + 125 00b8 CF7006E5 str r7, [r6, #-207] + 126 .loc 1 135 0 + 127 00bc FEFFFFEB bl debugp + 128 00c0 020000EA b .L8 + 129 .L6: + 136:src/os/pcd_enumerate.c **** do { + 137:src/os/pcd_enumerate.c **** csr = pUdp->UDP_CSR[0]; + 138:src/os/pcd_enumerate.c **** + 139:src/os/pcd_enumerate.c **** /* Data IN stage has been stopped by a status OUT */ + 140:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 141:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 142:src/os/pcd_enumerate.c **** DEBUGE("stopped by status out "); + 143:src/os/pcd_enumerate.c **** return; + 144:src/os/pcd_enumerate.c **** } + 145:src/os/pcd_enumerate.c **** } while (!(csr & AT91C_UDP_TXCOMP)); + 130 .loc 1 145 0 + 131 00c4 04009DE5 ldr r0, [sp, #4] + 132 00c8 010010E3 tst r0, #1 + 133 00cc 0D00001A bne .L25 + 134 .L8: + 137:src/os/pcd_enumerate.c **** csr = pUdp->UDP_CSR[0]; + 135 .loc 1 137 0 + 136 00d0 CF3016E5 ldr r3, [r6, #-207] + 137 .LVL8: + 138 00d4 04308DE5 str r3, [sp, #4] + 140:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 139 .loc 1 140 0 + 140 00d8 04E09DE5 ldr lr, [sp, #4] + 141 00dc 02001EE3 tst lr, #2 + 137:src/os/pcd_enumerate.c **** csr = pUdp->UDP_CSR[0]; + 142 .loc 1 137 0 + 143 00e0 88709FE5 ldr r7, .L26+4 + 140:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 144 .loc 1 140 0 + 145 00e4 F6FFFF0A beq .L6 + 141:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 146 .loc 1 141 0 + 147 00e8 CF2017E5 ldr r2, [r7, #-207] + 148 00ec 0210C2E3 bic r1, r2, #2 + 142:src/os/pcd_enumerate.c **** DEBUGE("stopped by status out "); + 149 .loc 1 142 0 + 150 00f0 88009FE5 ldr r0, .L26+20 + 141:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); + 151 .loc 1 141 0 + 152 00f4 CF1007E5 str r1, [r7, #-207] + 142:src/os/pcd_enumerate.c **** DEBUGE("stopped by status out "); + 153 .loc 1 142 0 + 154 00f8 FEFFFFEB bl debugp + 155 .LVL9: + 156 .L1: + 146:src/os/pcd_enumerate.c **** + 147:src/os/pcd_enumerate.c **** } while (length); + 148:src/os/pcd_enumerate.c **** + 149:src/os/pcd_enumerate.c **** DEBUGE("clear_txcomp "); + 150:src/os/pcd_enumerate.c **** if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 151:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 152:src/os/pcd_enumerate.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 153:src/os/pcd_enumerate.c **** } + 154:src/os/pcd_enumerate.c **** DEBUGE("done "); + 155:src/os/pcd_enumerate.c **** } + 157 .loc 1 155 0 + 158 00fc 08D08DE2 add sp, sp, #8 + 159 0100 F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 160 0104 1EFF2FE1 bx lr + 161 .LVL10: + 162 .L25: + 147:src/os/pcd_enumerate.c **** } while (length); + 163 .loc 1 147 0 + 164 0108 085055E0 subs r5, r5, r8 + 165 .LVL11: + 166 010c C2FFFF1A bne .L9 + 149:src/os/pcd_enumerate.c **** DEBUGE("clear_txcomp "); + 167 .loc 1 149 0 + 168 0110 6C009FE5 ldr r0, .L26+24 + 169 0114 FEFFFFEB bl debugp + 150:src/os/pcd_enumerate.c **** if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { + 170 .loc 1 150 0 + 171 0118 CFC017E5 ldr ip, [r7, #-207] + 172 011c 01001CE3 tst ip, #1 + 173 0120 0500000A beq .L10 + 151:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 174 .loc 1 151 0 + 175 0124 CF3017E5 ldr r3, [r7, #-207] + 176 0128 01E0C3E3 bic lr, r3, #1 + 177 012c CFE007E5 str lr, [r7, #-207] + 178 .L11: + 152:src/os/pcd_enumerate.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 179 .loc 1 152 0 discriminator 1 + 180 0130 CF1017E5 ldr r1, [r7, #-207] + 181 0134 010011E3 tst r1, #1 + 182 0138 FCFFFF1A bne .L11 + 183 .L10: + 154:src/os/pcd_enumerate.c **** DEBUGE("done "); + 184 .loc 1 154 0 + 185 013c 44009FE5 ldr r0, .L26+28 + 186 0140 FEFFFFEB bl debugp + 187 0144 ECFFFFEA b .L1 + 188 .LVL12: + 189 .L24: + 128:src/os/pcd_enumerate.c **** DEBUGE("wait_txcomp_clear "); + 190 .loc 1 128 0 + 191 0148 3C009FE5 ldr r0, .L26+32 + 192 014c FEFFFFEB bl debugp + 129:src/os/pcd_enumerate.c **** pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); + 193 .loc 1 129 0 + 194 0150 CF2016E5 ldr r2, [r6, #-207] + 195 0154 0110C2E3 bic r1, r2, #1 + 196 0158 CF1006E5 str r1, [r6, #-207] + 197 .L5: + 130:src/os/pcd_enumerate.c **** while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; + 198 .loc 1 130 0 discriminator 1 + 199 015c CF0016E5 ldr r0, [r6, #-207] + 200 0160 010010E3 tst r0, #1 + 201 0164 FCFFFF1A bne .L5 + 202 0168 CDFFFFEA b .L4 + 203 .L27: + 204 .align 2 + 205 .L26: + 206 016c 00000000 .word .LC0 + 207 0170 FF00FBFF .word -327425 + 208 0174 18000000 .word .LC1 + 209 0178 38000000 .word .LC3 + 210 017c 48000000 .word .LC4 + 211 0180 58000000 .word .LC5 + 212 0184 70000000 .word .LC6 + 213 0188 80000000 .word .LC7 + 214 018c 24000000 .word .LC2 + 215 .cfi_endproc + 216 .LFE278: + 218 .align 2 + 220 reset_ep: + 221 .LFB279: + 156:src/os/pcd_enumerate.c **** + 157:src/os/pcd_enumerate.c **** static void reset_ep(unsigned int ep) + 158:src/os/pcd_enumerate.c **** { + 222 .loc 1 158 0 + 223 .cfi_startproc + 224 @ Function supports interworking. + 225 @ args = 0, pretend = 0, frame = 0 + 226 @ frame_needed = 0, uses_anonymous_args = 0 + 227 .LVL13: + 228 0190 F0472DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 229 .LCFI2: + 230 .cfi_def_cfa_offset 32 + 159:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 231 .loc 1 159 0 + 232 0194 98809FE5 ldr r8, .L33 + 233 .cfi_offset 14, -4 + 234 .cfi_offset 10, -8 + 235 .cfi_offset 9, -12 + 236 .cfi_offset 8, -16 + 237 .cfi_offset 7, -20 + 238 .cfi_offset 6, -24 + 239 .cfi_offset 5, -28 + 240 .cfi_offset 4, -32 + 160:src/os/pcd_enumerate.c **** struct req_ctx *rctx; + 161:src/os/pcd_enumerate.c **** + 162:src/os/pcd_enumerate.c **** //pUDP->UDP_CSR[ep] = AT91C_UDP_EPEDS; + 163:src/os/pcd_enumerate.c **** + 164:src/os/pcd_enumerate.c **** atomic_set(&upcd.ep[ep].pkts_in_transit, 0); + 241 .loc 1 164 0 + 242 0198 8090A0E1 mov r9, r0, asl #1 + 243 019c 001089E0 add r1, r9, r0 + 244 01a0 90A09FE5 ldr sl, .L33+4 + 245 01a4 013188E0 add r3, r8, r1, asl #2 + 246 01a8 0020A0E3 mov r2, #0 + 159:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 247 .loc 1 159 0 + 248 01ac 007098E5 ldr r7, [r8, #0] + 249 .LVL14: + 250 .loc 1 164 0 + 251 01b0 0C2083E5 str r2, [r3, #12] + 252 01b4 80519AE7 ldr r5, [sl, r0, asl #3] + 253 01b8 7C409FE5 ldr r4, .L33+8 + 158:src/os/pcd_enumerate.c **** { + 254 .loc 1 158 0 + 255 01bc 0060A0E1 mov r6, r0 + 256 .LVL15: + 257 .L29: + 165:src/os/pcd_enumerate.c **** + 166:src/os/pcd_enumerate.c **** /* free all currently transmitting contexts */ + 167:src/os/pcd_enumerate.c **** while ((rctx = req_ctx_find_get(0, epstate[ep].state_busy, + 258 .loc 1 167 0 discriminator 1 + 259 01c0 0000A0E3 mov r0, #0 + 260 01c4 0510A0E1 mov r1, r5 + 261 01c8 FE20A0E3 mov r2, #254 + 262 01cc 0FE0A0E1 mov lr, pc + 263 01d0 14FF2FE1 bx r4 + 264 .LVL16: + 265 01d4 000050E3 cmp r0, #0 + 266 01d8 F8FFFF1A bne .L29 + 267 .loc 1 167 0 is_stmt 0 + 268 01dc 86A18AE0 add sl, sl, r6, asl #3 + 269 01e0 04509AE5 ldr r5, [sl, #4] + 270 .L30: + 168:src/os/pcd_enumerate.c **** RCTX_STATE_FREE))) {} + 169:src/os/pcd_enumerate.c **** /* free all currently pending contexts */ + 170:src/os/pcd_enumerate.c **** while ((rctx = req_ctx_find_get(0, epstate[ep].state_pending, + 271 .loc 1 170 0 is_stmt 1 discriminator 1 + 272 01e4 0000A0E3 mov r0, #0 + 273 .LVL17: + 274 01e8 0510A0E1 mov r1, r5 + 275 01ec FE20A0E3 mov r2, #254 + 276 01f0 0FE0A0E1 mov lr, pc + 277 01f4 14FF2FE1 bx r4 + 278 .LVL18: + 279 01f8 000050E3 cmp r0, #0 + 280 01fc F8FFFF1A bne .L30 + 171:src/os/pcd_enumerate.c **** RCTX_STATE_FREE))) {} + 172:src/os/pcd_enumerate.c **** + 173:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP |= (1 << ep); + 281 .loc 1 173 0 + 282 0200 01C0A0E3 mov ip, #1 + 283 0204 1CE6A0E1 mov lr, ip, asl r6 + 284 0208 281097E5 ldr r1, [r7, #40] + 285 020c 01308EE1 orr r3, lr, r1 + 286 0210 283087E5 str r3, [r7, #40] + 174:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP &= ~(1 << ep); + 287 .loc 1 174 0 + 288 0214 282097E5 ldr r2, [r7, #40] + 175:src/os/pcd_enumerate.c **** + 176:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = NULL; + 289 .loc 1 176 0 + 290 0218 066089E0 add r6, r9, r6 + 291 .LVL19: + 174:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP &= ~(1 << ep); + 292 .loc 1 174 0 + 293 021c 0EC0C2E1 bic ip, r2, lr + 294 .loc 1 176 0 + 295 0220 068188E0 add r8, r8, r6, asl #2 + 174:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP &= ~(1 << ep); + 296 .loc 1 174 0 + 297 0224 28C087E5 str ip, [r7, #40] + 298 .loc 1 176 0 + 299 0228 100088E5 str r0, [r8, #16] + 177:src/os/pcd_enumerate.c **** } + 300 .loc 1 177 0 + 301 022c F047BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 302 0230 1EFF2FE1 bx lr + 303 .L34: + 304 .align 2 + 305 .L33: + 306 0234 00000000 .word .LANCHOR0 + 307 0238 00000000 .word .LANCHOR1 + 308 023c 00000000 .word req_ctx_find_get + 309 .cfi_endproc + 310 .LFE279: + 312 .align 2 + 314 __udp_refill_ep: + 315 .LFB281: + 178:src/os/pcd_enumerate.c **** + 179:src/os/pcd_enumerate.c **** static void udp_ep0_handler(void); + 180:src/os/pcd_enumerate.c **** + 181:src/os/pcd_enumerate.c **** void udp_unthrottle(void) + 182:src/os/pcd_enumerate.c **** { + 183:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 184:src/os/pcd_enumerate.c **** pUDP->UDP_IER = AT91C_UDP_EPINT1; + 185:src/os/pcd_enumerate.c **** } + 186:src/os/pcd_enumerate.c **** + 187:src/os/pcd_enumerate.c **** static int __udp_refill_ep(int ep) + 188:src/os/pcd_enumerate.c **** { + 316 .loc 1 188 0 + 317 .cfi_startproc + 318 @ Function supports interworking. + 319 @ args = 0, pretend = 0, frame = 0 + 320 @ frame_needed = 0, uses_anonymous_args = 0 + 321 .LVL20: + 322 0240 F84F2DE9 stmfd sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 323 .LCFI3: + 324 .cfi_def_cfa_offset 40 + 189:src/os/pcd_enumerate.c **** u_int16_t i; + 190:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 325 .loc 1 190 0 + 326 0244 C8419FE5 ldr r4, .L55 + 327 .cfi_offset 14, -4 + 328 .cfi_offset 11, -8 + 329 .cfi_offset 10, -12 + 330 .cfi_offset 9, -16 + 331 .cfi_offset 8, -20 + 332 .cfi_offset 7, -24 + 333 .cfi_offset 6, -28 + 334 .cfi_offset 5, -32 + 335 .cfi_offset 4, -36 + 336 .cfi_offset 3, -40 + 191:src/os/pcd_enumerate.c **** struct req_ctx *rctx; + 192:src/os/pcd_enumerate.c **** unsigned int start, end; + 193:src/os/pcd_enumerate.c **** + 194:src/os/pcd_enumerate.c **** /* If we're not configured by the host yet, there is no point + 195:src/os/pcd_enumerate.c **** * in trying to send data to it... */ + 196:src/os/pcd_enumerate.c **** if (!upcd.cur_config) { + 337 .loc 1 196 0 + 338 0248 0530D4E5 ldrb r3, [r4, #5] @ zero_extendqisi2 + 339 024c 000053E3 cmp r3, #0 + 188:src/os/pcd_enumerate.c **** { + 340 .loc 1 188 0 + 341 0250 0060A0E1 mov r6, r0 + 190:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 342 .loc 1 190 0 + 343 0254 005094E5 ldr r5, [r4, #0] + 344 .LVL21: + 197:src/os/pcd_enumerate.c **** return -ENXIO; + 345 .loc 1 197 0 + 346 0258 0500E003 mvneq r0, #5 + 347 .LVL22: + 196:src/os/pcd_enumerate.c **** if (!upcd.cur_config) { + 348 .loc 1 196 0 + 349 025c 0100001A bne .L54 + 350 .LVL23: + 351 .L36: + 198:src/os/pcd_enumerate.c **** } + 199:src/os/pcd_enumerate.c **** + 200:src/os/pcd_enumerate.c **** /* If there are already two packets in transit, the DPR of + 201:src/os/pcd_enumerate.c **** * the SAM7 UDC doesn't have space for more data */ + 202:src/os/pcd_enumerate.c **** if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + 203:src/os/pcd_enumerate.c **** return -EBUSY; + 204:src/os/pcd_enumerate.c **** } + 205:src/os/pcd_enumerate.c **** + 206:src/os/pcd_enumerate.c **** /* If we have an incompletely-transmitted req_ctx (>EP size), + 207:src/os/pcd_enumerate.c **** * we need to transmit the rest and finish the transaction */ + 208:src/os/pcd_enumerate.c **** if (upcd.ep[ep].incomplete.rctx) { + 209:src/os/pcd_enumerate.c **** rctx = upcd.ep[ep].incomplete.rctx; + 210:src/os/pcd_enumerate.c **** start = upcd.ep[ep].incomplete.bytes_sent; + 211:src/os/pcd_enumerate.c **** } else { + 212:src/os/pcd_enumerate.c **** /* get pending rctx and start transmitting from zero */ + 213:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(0, epstate[ep].state_pending, + 214:src/os/pcd_enumerate.c **** epstate[ep].state_busy); + 215:src/os/pcd_enumerate.c **** if (!rctx) + 216:src/os/pcd_enumerate.c **** return 0; + 217:src/os/pcd_enumerate.c **** start = 0; + 218:src/os/pcd_enumerate.c **** + 219:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.bytes_sent = 0; + 220:src/os/pcd_enumerate.c **** } + 221:src/os/pcd_enumerate.c **** + 222:src/os/pcd_enumerate.c **** if (rctx->tot_len - start <= AT91C_EP_IN_SIZE) + 223:src/os/pcd_enumerate.c **** end = rctx->tot_len; + 224:src/os/pcd_enumerate.c **** else + 225:src/os/pcd_enumerate.c **** end = start + AT91C_EP_IN_SIZE; + 226:src/os/pcd_enumerate.c **** + 227:src/os/pcd_enumerate.c **** /* fill FIFO/DPR */ + 228:src/os/pcd_enumerate.c **** DEBUGII("RCTX_tx(ep=%u,ctx=%u):%u ", ep, req_ctx_num(rctx), + 229:src/os/pcd_enumerate.c **** end - start); + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 232:src/os/pcd_enumerate.c **** + 233:src/os/pcd_enumerate.c **** if (atomic_inc_return(&upcd.ep[ep].pkts_in_transit) == 1) { + 234:src/os/pcd_enumerate.c **** /* not been transmitting before, start transmit */ + 235:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[ep] |= AT91C_UDP_TXPKTRDY; + 236:src/os/pcd_enumerate.c **** } + 237:src/os/pcd_enumerate.c **** + 238:src/os/pcd_enumerate.c **** if ((end - start < AT91C_EP_OUT_SIZE) || + 239:src/os/pcd_enumerate.c **** (((end - start) == 0) && end && (rctx->tot_len % AT91C_EP_OUT_SIZE) == 0)) { + 240:src/os/pcd_enumerate.c **** /* CASE 1: return context to pool, if + 241:src/os/pcd_enumerate.c **** * - packet transfer < AT91C_EP_OUT_SIZE + 242:src/os/pcd_enumerate.c **** * - after ZLP of transfer == AT91C_EP_OUT_SIZE + 243:src/os/pcd_enumerate.c **** * - after ZLP of transfer % AT91C_EP_OUT_SIZE == 0 + 244:src/os/pcd_enumerate.c **** * - after last packet of transfer % AT91C_EP_OUT_SIZE != 0 + 245:src/os/pcd_enumerate.c **** */ + 246:src/os/pcd_enumerate.c **** DEBUGII("RCTX(ep=%u,ctx=%u)_tx_done ", ep, req_ctx_num(rctx)); + 247:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = NULL; + 248:src/os/pcd_enumerate.c **** req_ctx_put(rctx); + 249:src/os/pcd_enumerate.c **** } else { + 250:src/os/pcd_enumerate.c **** /* CASE 2: mark transfer as incomplete, if + 251:src/os/pcd_enumerate.c **** * - after data of transfer == AT91C_EP_OUT_SIZE + 252:src/os/pcd_enumerate.c **** * - after data of transfer > AT91C_EP_OUT_SIZE + 253:src/os/pcd_enumerate.c **** * - after last packet of transfer % AT91C_EP_OUT_SIZE == 0 + 254:src/os/pcd_enumerate.c **** */ + 255:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = rctx; + 256:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.bytes_sent += end - start; + 257:src/os/pcd_enumerate.c **** DEBUGII("RCTX(ep=%u)_tx_cont ", ep); + 258:src/os/pcd_enumerate.c **** } + 259:src/os/pcd_enumerate.c **** + 260:src/os/pcd_enumerate.c **** return 1; + 261:src/os/pcd_enumerate.c **** } + 352 .loc 1 261 0 + 353 0260 F84FBDE8 ldmfd sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} + 354 0264 1EFF2FE1 bx lr + 355 .LVL24: + 356 .L54: + 202:src/os/pcd_enumerate.c **** if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + 357 .loc 1 202 0 + 358 0268 8070A0E1 mov r7, r0, asl #1 + 359 026c 008087E0 add r8, r7, r0 + 360 0270 088184E0 add r8, r4, r8, asl #2 + 361 0274 0C1098E5 ldr r1, [r8, #12] + 362 0278 020051E3 cmp r1, #2 + 203:src/os/pcd_enumerate.c **** return -EBUSY; + 363 .loc 1 203 0 + 364 027c 0F00E003 mvneq r0, #15 + 202:src/os/pcd_enumerate.c **** if (atomic_read(&upcd.ep[ep].pkts_in_transit) == 2) { + 365 .loc 1 202 0 + 366 0280 F6FFFF0A beq .L36 + 208:src/os/pcd_enumerate.c **** if (upcd.ep[ep].incomplete.rctx) { + 367 .loc 1 208 0 + 368 0284 100098E5 ldr r0, [r8, #16] + 369 0288 000050E3 cmp r0, #0 + 370 028c 5100000A beq .L37 + 371 .LVL25: + 210:src/os/pcd_enumerate.c **** start = upcd.ep[ep].incomplete.bytes_sent; + 372 .loc 1 210 0 + 373 0290 148098E5 ldr r8, [r8, #20] + 374 .LVL26: + 375 0294 0898A0E1 mov r9, r8, asl #16 + 376 0298 2998A0E1 mov r9, r9, lsr #16 + 377 029c 0910A0E1 mov r1, r9 + 378 .LVL27: + 379 .L38: + 222:src/os/pcd_enumerate.c **** if (rctx->tot_len - start <= AT91C_EP_IN_SIZE) + 380 .loc 1 222 0 + 381 02a0 B620D0E1 ldrh r2, [r0, #6] + 382 02a4 02A068E0 rsb sl, r8, r2 + 383 02a8 40005AE3 cmp sl, #64 + 225:src/os/pcd_enumerate.c **** end = start + AT91C_EP_IN_SIZE; + 384 .loc 1 225 0 + 385 02ac 40208882 addhi r2, r8, #64 + 386 .LVL28: + 387 02b0 40A0A083 movhi sl, #64 + 388 .LVL29: + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 389 .loc 1 230 0 + 390 02b4 010052E1 cmp r2, r1 + 391 02b8 1E00009A bls .L40 + 392 02bc 01B089E2 add fp, r9, #1 + 393 02c0 08C090E5 ldr ip, [r0, #8] + 394 02c4 0B38A0E1 mov r3, fp, asl #16 + 395 02c8 0990E0E1 mvn r9, r9 + 396 .LVL30: + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 397 .loc 1 231 0 + 398 02cc 01B0DCE7 ldrb fp, [ip, r1] @ zero_extendqisi2 + 399 .LVL31: + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 400 .loc 1 230 0 + 401 02d0 2338A0E1 mov r3, r3, lsr #16 + 402 .LVL32: + 403 02d4 141086E2 add r1, r6, #20 + 404 02d8 029089E0 add r9, r9, r2 + 405 02dc 030052E1 cmp r2, r3 + 406 02e0 019009E2 and r9, r9, #1 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 407 .loc 1 231 0 + 408 02e4 01B185E7 str fp, [r5, r1, asl #2] + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 409 .loc 1 230 0 + 410 02e8 1200009A bls .L40 + 411 02ec 000059E3 cmp r9, #0 + 412 02f0 0600000A beq .L41 + 413 02f4 01B083E2 add fp, r3, #1 + 414 02f8 0B98A0E1 mov r9, fp, asl #16 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 415 .loc 1 231 0 + 416 02fc 03B0DCE7 ldrb fp, [ip, r3] @ zero_extendqisi2 + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 417 .loc 1 230 0 + 418 0300 2938A0E1 mov r3, r9, lsr #16 + 419 0304 030052E1 cmp r2, r3 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 420 .loc 1 231 0 + 421 0308 01B185E7 str fp, [r5, r1, asl #2] + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 422 .loc 1 230 0 + 423 030c 0900009A bls .L40 + 424 .L41: + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 425 .loc 1 231 0 discriminator 2 + 426 0310 03B0DCE7 ldrb fp, [ip, r3] @ zero_extendqisi2 + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 427 .loc 1 230 0 discriminator 2 + 428 0314 013083E2 add r3, r3, #1 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 429 .loc 1 231 0 discriminator 2 + 430 0318 01B185E7 str fp, [r5, r1, asl #2] + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 431 .loc 1 230 0 discriminator 2 + 432 031c 0398A0E1 mov r9, r3, asl #16 + 433 0320 013889E2 add r3, r9, #65536 + 434 0324 2338A0E1 mov r3, r3, lsr #16 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 435 .loc 1 231 0 discriminator 2 + 436 0328 2998DCE7 ldrb r9, [ip, r9, lsr #16] @ zero_extendqisi2 + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 437 .loc 1 230 0 discriminator 2 + 438 032c 030052E1 cmp r2, r3 + 231:src/os/pcd_enumerate.c **** pUDP->UDP_FDR[ep] = rctx->data[i]; + 439 .loc 1 231 0 discriminator 2 + 440 0330 019185E7 str r9, [r5, r1, asl #2] + 230:src/os/pcd_enumerate.c **** for (i = start; i < end; i++) + 441 .loc 1 230 0 discriminator 2 + 442 0334 F5FFFF8A bhi .L41 + 443 .L40: + 444 .LVL33: + 445 .LBB42: + 446 .LBB43: + 447 .LBB44: + 448 .file 2 "include/asm/atomic.h" + 1:include/asm/atomic.h **** /* + 2:include/asm/atomic.h **** * linux/include/asm-arm/atomic.h + 3:include/asm/atomic.h **** * + 4:include/asm/atomic.h **** * Copyright (C) 1996 Russell King. + 5:include/asm/atomic.h **** * Copyright (C) 2002 Deep Blue Solutions Ltd. + 6:include/asm/atomic.h **** * + 7:include/asm/atomic.h **** * This program is free software; you can redistribute it and/or modify + 8:include/asm/atomic.h **** * it under the terms of the GNU General Public License version 2 as + 9:include/asm/atomic.h **** * published by the Free Software Foundation. + 10:include/asm/atomic.h **** */ + 11:include/asm/atomic.h **** #ifndef __ASM_ARM_ATOMIC_H + 12:include/asm/atomic.h **** #define __ASM_ARM_ATOMIC_H + 13:include/asm/atomic.h **** + 14:include/asm/atomic.h **** typedef struct { volatile int counter; } atomic_t; + 15:include/asm/atomic.h **** + 16:include/asm/atomic.h **** #define ATOMIC_INIT(i) { (i) } + 17:include/asm/atomic.h **** + 18:include/asm/atomic.h **** #define atomic_read(v) ((v)->counter) + 19:include/asm/atomic.h **** + 20:include/asm/atomic.h **** #include + 21:include/asm/atomic.h **** #include + 22:include/asm/atomic.h **** + 23:include/asm/atomic.h **** #define atomic_set(v,i) (((v)->counter) = (i)) + 24:include/asm/atomic.h **** + 25:include/asm/atomic.h **** static inline int atomic_add_return(int i, atomic_t *v) + 26:include/asm/atomic.h **** { + 27:include/asm/atomic.h **** unsigned long flags; + 28:include/asm/atomic.h **** int val; + 29:include/asm/atomic.h **** + 30:include/asm/atomic.h **** local_irq_save(flags); + 449 .loc 2 30 0 + 450 @ 30 "include/asm/atomic.h" 1 + 451 0338 00C00FE1 mrs ip, cpsr @ local_irq_save + 452 033c 80308CE3 orr r3, ip, #128 + 453 0340 03F021E1 msr cpsr_c, r3 + 454 @ 0 "" 2 + 455 .LBE44: + 31:include/asm/atomic.h **** val = v->counter; + 456 .loc 2 31 0 + 457 0344 061087E0 add r1, r7, r6 + 458 0348 011184E0 add r1, r4, r1, asl #2 + 459 034c 0C3091E5 ldr r3, [r1, #12] + 460 .LVL34: + 32:include/asm/atomic.h **** v->counter = val += i; + 461 .loc 2 32 0 + 462 0350 013083E2 add r3, r3, #1 + 463 .LVL35: + 464 0354 0C3081E5 str r3, [r1, #12] + 33:include/asm/atomic.h **** local_irq_restore(flags); + 465 .loc 2 33 0 + 466 @ 33 "include/asm/atomic.h" 1 + 467 0358 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 468 + 469 @ 0 "" 2 + 470 .LBE43: + 471 .LBE42: + 233:src/os/pcd_enumerate.c **** if (atomic_inc_return(&upcd.ep[ep].pkts_in_transit) == 1) { + 472 .loc 1 233 0 + 473 035c 010053E3 cmp r3, #1 + 235:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[ep] |= AT91C_UDP_TXPKTRDY; + 474 .loc 1 235 0 + 475 0360 0C308602 addeq r3, r6, #12 + 476 .LVL36: + 477 0364 03119507 ldreq r1, [r5, r3, asl #2] + 478 .LVL37: + 479 0368 10108103 orreq r1, r1, #16 + 480 036c 03118507 streq r1, [r5, r3, asl #2] + 238:src/os/pcd_enumerate.c **** if ((end - start < AT91C_EP_OUT_SIZE) || + 481 .loc 1 238 0 + 482 0370 3F005AE3 cmp sl, #63 + 483 0374 1000009A bls .L43 + 238:src/os/pcd_enumerate.c **** if ((end - start < AT91C_EP_OUT_SIZE) || + 484 .loc 1 238 0 is_stmt 0 discriminator 1 + 485 0378 00C052E2 subs ip, r2, #0 + 486 037c 01C0A013 movne ip, #1 + 487 0380 080052E1 cmp r2, r8 + 488 0384 00C0A013 movne ip, #0 + 489 0388 00005CE3 cmp ip, #0 + 490 038c 0200000A beq .L44 + 239:src/os/pcd_enumerate.c **** (((end - start) == 0) && end && (rctx->tot_len % AT91C_EP_OUT_SIZE) == 0)) { + 491 .loc 1 239 0 is_stmt 1 + 492 0390 B620D0E1 ldrh r2, [r0, #6] + 493 .LVL38: + 494 0394 3F0012E3 tst r2, #63 + 495 0398 0700000A beq .L43 + 496 .L44: + 255:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = rctx; + 497 .loc 1 255 0 + 498 039c 066087E0 add r6, r7, r6 + 499 .LVL39: + 500 03a0 064184E0 add r4, r4, r6, asl #2 + 256:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.bytes_sent += end - start; + 501 .loc 1 256 0 + 502 03a4 143094E5 ldr r3, [r4, #20] + 503 03a8 03A08AE0 add sl, sl, r3 + 255:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = rctx; + 504 .loc 1 255 0 + 505 03ac 100084E5 str r0, [r4, #16] + 256:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.bytes_sent += end - start; + 506 .loc 1 256 0 + 507 03b0 14A084E5 str sl, [r4, #20] + 260:src/os/pcd_enumerate.c **** return 1; + 508 .loc 1 260 0 + 509 03b4 0100A0E3 mov r0, #1 + 510 .LVL40: + 511 03b8 A8FFFFEA b .L36 + 512 .LVL41: + 513 .L43: + 247:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.rctx = NULL; + 514 .loc 1 247 0 + 515 03bc 066087E0 add r6, r7, r6 + 516 .LVL42: + 517 03c0 00E0A0E3 mov lr, #0 + 518 03c4 064184E0 add r4, r4, r6, asl #2 + 519 03c8 10E084E5 str lr, [r4, #16] + 248:src/os/pcd_enumerate.c **** req_ctx_put(rctx); + 520 .loc 1 248 0 + 521 03cc FEFFFFEB bl req_ctx_put + 522 .LVL43: + 260:src/os/pcd_enumerate.c **** return 1; + 523 .loc 1 260 0 + 524 03d0 0100A0E3 mov r0, #1 + 248:src/os/pcd_enumerate.c **** req_ctx_put(rctx); + 525 .loc 1 248 0 + 526 03d4 A1FFFFEA b .L36 + 527 .LVL44: + 528 .L37: + 213:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(0, epstate[ep].state_pending, + 529 .loc 1 213 0 + 530 03d8 38E09FE5 ldr lr, .L55+4 + 531 03dc 86218EE0 add r2, lr, r6, asl #3 + 532 03e0 041092E5 ldr r1, [r2, #4] + 533 03e4 30C09FE5 ldr ip, .L55+8 + 534 03e8 86219EE7 ldr r2, [lr, r6, asl #3] + 535 03ec 0FE0A0E1 mov lr, pc + 536 03f0 1CFF2FE1 bx ip + 537 .LVL45: + 215:src/os/pcd_enumerate.c **** if (!rctx) + 538 .loc 1 215 0 + 539 03f4 000050E3 cmp r0, #0 + 540 03f8 98FFFF0A beq .L36 + 541 .LVL46: + 219:src/os/pcd_enumerate.c **** upcd.ep[ep].incomplete.bytes_sent = 0; + 542 .loc 1 219 0 + 543 03fc 00A0A0E3 mov sl, #0 + 544 0400 14A088E5 str sl, [r8, #20] + 545 0404 0A10A0E1 mov r1, sl + 546 0408 0A90A0E1 mov r9, sl + 217:src/os/pcd_enumerate.c **** start = 0; + 547 .loc 1 217 0 + 548 040c 0A80A0E1 mov r8, sl + 549 0410 A2FFFFEA b .L38 + 550 .L56: + 551 .align 2 + 552 .L55: + 553 0414 00000000 .word .LANCHOR0 + 554 0418 00000000 .word .LANCHOR1 + 555 041c 00000000 .word req_ctx_find_get + 556 .cfi_endproc + 557 .LFE281: + 559 .align 2 + 561 udp_irq: + 562 .LFB283: + 262:src/os/pcd_enumerate.c **** + 263:src/os/pcd_enumerate.c **** int udp_refill_ep(int ep) + 264:src/os/pcd_enumerate.c **** { + 265:src/os/pcd_enumerate.c **** unsigned long flags; + 266:src/os/pcd_enumerate.c **** int ret; + 267:src/os/pcd_enumerate.c **** + 268:src/os/pcd_enumerate.c **** local_irq_save(flags); + 269:src/os/pcd_enumerate.c **** ret = __udp_refill_ep(ep); + 270:src/os/pcd_enumerate.c **** local_irq_restore(flags); + 271:src/os/pcd_enumerate.c **** + 272:src/os/pcd_enumerate.c **** return ret; + 273:src/os/pcd_enumerate.c **** } + 274:src/os/pcd_enumerate.c **** + 275:src/os/pcd_enumerate.c **** static void udp_irq(void) + 276:src/os/pcd_enumerate.c **** { + 563 .loc 1 276 0 + 564 .cfi_startproc + 565 @ Function supports interworking. + 566 @ args = 0, pretend = 0, frame = 16 + 567 @ frame_needed = 0, uses_anonymous_args = 0 + 568 0420 F04F2DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 569 .LCFI4: + 570 .cfi_def_cfa_offset 36 + 277:src/os/pcd_enumerate.c **** u_int32_t csr; + 278:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 571 .loc 1 278 0 + 572 0424 105B9FE5 ldr r5, .L168 + 573 .cfi_offset 14, -4 + 574 .cfi_offset 11, -8 + 575 .cfi_offset 10, -12 + 576 .cfi_offset 9, -16 + 577 .cfi_offset 8, -20 + 578 .cfi_offset 7, -24 + 579 .cfi_offset 6, -28 + 580 .cfi_offset 5, -32 + 581 .cfi_offset 4, -36 + 582 0428 004095E5 ldr r4, [r5, #0] + 583 .LVL47: + 279:src/os/pcd_enumerate.c **** AT91_REG isr = pUDP->UDP_ISR; + 584 .loc 1 279 0 + 585 042c 1C0094E5 ldr r0, [r4, #28] + 586 .LVL48: + 276:src/os/pcd_enumerate.c **** { + 587 .loc 1 276 0 + 588 0430 14D04DE2 sub sp, sp, #20 + 589 .LCFI5: + 590 .cfi_def_cfa_offset 56 + 591 .loc 1 279 0 + 592 0434 08008DE5 str r0, [sp, #8] + 280:src/os/pcd_enumerate.c **** + 281:src/os/pcd_enumerate.c **** DEBUGI("udp_irq(imr=0x%04x, isr=0x%04x, state=%d): ", + 282:src/os/pcd_enumerate.c **** pUDP->UDP_IMR, isr, upcd.state); + 283:src/os/pcd_enumerate.c **** + 284:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_ENDBUSRES) { + 593 .loc 1 284 0 + 594 0438 08309DE5 ldr r3, [sp, #8] + 595 043c 010A13E3 tst r3, #4096 + 596 0440 9800001A bne .L152 + 597 .LVL49: + 598 .L58: + 285:src/os/pcd_enumerate.c **** DEBUGI("ENDBUSRES "); + 286:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + 287:src/os/pcd_enumerate.c **** pUDP->UDP_IER = AT91C_UDP_EPINT0; + 288:src/os/pcd_enumerate.c **** /* reset all endpoints */ + 289:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = (unsigned int)-1; + 290:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = 0; + 291:src/os/pcd_enumerate.c **** /* Enable the function */ + 292:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = AT91C_UDP_FEN; + 293:src/os/pcd_enumerate.c **** /* Configure endpoint 0 */ + 294:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 295:src/os/pcd_enumerate.c **** upcd.cur_config = 0; + 296:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 297:src/os/pcd_enumerate.c **** + 298:src/os/pcd_enumerate.c **** reset_ep(1); + 299:src/os/pcd_enumerate.c **** reset_ep(2); + 300:src/os/pcd_enumerate.c **** reset_ep(3); + 301:src/os/pcd_enumerate.c **** + 302:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 303:src/os/pcd_enumerate.c **** if (*dfu->dfu_state == DFU_STATE_appDETACH) { + 304:src/os/pcd_enumerate.c **** DEBUGI("DFU_SWITCH "); + 305:src/os/pcd_enumerate.c **** /* now we need to switch to DFU mode */ + 306:src/os/pcd_enumerate.c **** dfu->dfu_switch(); + 307:src/os/pcd_enumerate.c **** goto out; + 308:src/os/pcd_enumerate.c **** } + 309:src/os/pcd_enumerate.c **** #endif + 310:src/os/pcd_enumerate.c **** } + 311:src/os/pcd_enumerate.c **** + 312:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_EPINT0) { + 599 .loc 1 312 0 + 600 0444 08C09DE5 ldr ip, [sp, #8] + 601 0448 01001CE3 tst ip, #1 + 602 044c B300001A bne .L153 + 603 .LVL50: + 604 .L60: + 313:src/os/pcd_enumerate.c **** DEBUGI("EP0INT(Control) "); + 314:src/os/pcd_enumerate.c **** udp_ep0_handler(); + 315:src/os/pcd_enumerate.c **** } + 316:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_EPINT1) { + 605 .loc 1 316 0 + 606 0450 08009DE5 ldr r0, [sp, #8] + 607 .LVL51: + 608 0454 020010E3 tst r0, #2 + 609 0458 4600000A beq .L113 + 610 .LBB57: + 317:src/os/pcd_enumerate.c **** u_int32_t cur_rcv_bank = upcd.cur_rcv_bank; + 611 .loc 1 317 0 + 612 045c 086095E5 ldr r6, [r5, #8] + 613 .LVL52: + 318:src/os/pcd_enumerate.c **** u_int16_t i, pkt_size; + 319:src/os/pcd_enumerate.c **** struct req_ctx *rctx; + 320:src/os/pcd_enumerate.c **** + 321:src/os/pcd_enumerate.c **** csr = pUDP->UDP_CSR[1]; + 614 .loc 1 321 0 + 615 0460 347094E5 ldr r7, [r4, #52] + 616 .LVL53: + 322:src/os/pcd_enumerate.c **** pkt_size = csr >> 16; + 323:src/os/pcd_enumerate.c **** + 324:src/os/pcd_enumerate.c **** DEBUGI("EP1INT(Out, CSR=0x%08x) ", csr); + 325:src/os/pcd_enumerate.c **** if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK1) + 326:src/os/pcd_enumerate.c **** DEBUGIO("cur_bank=1 "); + 327:src/os/pcd_enumerate.c **** else if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + 328:src/os/pcd_enumerate.c **** DEBUGIO("cur_bank=0 "); + 329:src/os/pcd_enumerate.c **** else + 330:src/os/pcd_enumerate.c **** DEBUGIO("cur_bank INVALID "); + 331:src/os/pcd_enumerate.c **** + 332:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK1) + 333:src/os/pcd_enumerate.c **** DEBUGIO("BANK1 "); + 334:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK0) + 335:src/os/pcd_enumerate.c **** DEBUGIO("BANK0 "); + 336:src/os/pcd_enumerate.c **** + 337:src/os/pcd_enumerate.c **** if (!(csr & cur_rcv_bank)) + 617 .loc 1 337 0 + 618 0464 060017E1 tst r7, r6 + 619 0468 4200000A beq .L113 + 338:src/os/pcd_enumerate.c **** goto cont_ep2; + 339:src/os/pcd_enumerate.c **** + 340:src/os/pcd_enumerate.c **** if (upcd.ep[1].incomplete.rctx) { + 620 .loc 1 340 0 + 621 046c C8CA9FE5 ldr ip, .L168 + 622 0470 1C009CE5 ldr r0, [ip, #28] + 623 0474 000050E3 cmp r0, #0 + 322:src/os/pcd_enumerate.c **** pkt_size = csr >> 16; + 624 .loc 1 322 0 + 625 0478 2778A0E1 mov r7, r7, lsr #16 + 626 .LVL54: + 627 .loc 1 340 0 + 628 047c 3301000A beq .L114 + 629 0480 B620D0E1 ldrh r2, [r0, #6] + 630 0484 0210A0E1 mov r1, r2 + 631 .LVL55: + 632 .L115: + 341:src/os/pcd_enumerate.c **** DEBUGIO("continue_incompl_RCTX "); + 342:src/os/pcd_enumerate.c **** rctx = upcd.ep[1].incomplete.rctx; + 343:src/os/pcd_enumerate.c **** } else { + 344:src/os/pcd_enumerate.c **** /* allocate new req_ctx */ + 345:src/os/pcd_enumerate.c **** DEBUGIO("alloc_new_RCTX "); + 346:src/os/pcd_enumerate.c **** + 347:src/os/pcd_enumerate.c **** /* whether to get a big or a small req_ctx */ + 348:src/os/pcd_enumerate.c **** if (pkt_size >= AT91C_EP_IN_SIZE) + 349:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(1, RCTX_STATE_FREE, + 350:src/os/pcd_enumerate.c **** RCTX_STATE_UDP_RCV_BUSY); + 351:src/os/pcd_enumerate.c **** else + 352:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 353:src/os/pcd_enumerate.c **** RCTX_STATE_UDP_RCV_BUSY); + 354:src/os/pcd_enumerate.c **** + 355:src/os/pcd_enumerate.c **** if (!rctx) { + 356:src/os/pcd_enumerate.c **** /* disable interrupts for now */ + 357:src/os/pcd_enumerate.c **** pUDP->UDP_IDR = AT91C_UDP_EPINT1; + 358:src/os/pcd_enumerate.c **** DEBUGP("NO_RCTX_AVAIL! "); + 359:src/os/pcd_enumerate.c **** goto cont_ep2; + 360:src/os/pcd_enumerate.c **** } + 361:src/os/pcd_enumerate.c **** rctx->tot_len = 0; + 362:src/os/pcd_enumerate.c **** } + 363:src/os/pcd_enumerate.c **** DEBUGIO("RCTX=%u ", req_ctx_num(rctx)); + 364:src/os/pcd_enumerate.c **** + 365:src/os/pcd_enumerate.c **** if (rctx->size - rctx->tot_len < pkt_size) { + 633 .loc 1 365 0 + 634 0488 B430D0E1 ldrh r3, [r0, #4] + 635 048c 031061E0 rsb r1, r1, r3 + 636 0490 070051E1 cmp r1, r7 + 366:src/os/pcd_enumerate.c **** DEBUGIO("RCTX too small, truncating !!!\n"); + 367:src/os/pcd_enumerate.c **** pkt_size = rctx->size - rctx->tot_len; + 637 .loc 1 367 0 + 638 0494 037062B0 rsblt r7, r2, r3 + 639 .LVL56: + 640 0498 0778A0B1 movlt r7, r7, asl #16 + 641 049c 2778A0B1 movlt r7, r7, lsr #16 + 642 .LVL57: + 368:src/os/pcd_enumerate.c **** } + 369:src/os/pcd_enumerate.c **** + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 643 .loc 1 370 0 + 644 04a0 000057E3 cmp r7, #0 + 645 04a4 2800000A beq .L120 + 275:src/os/pcd_enumerate.c **** static void udp_irq(void) + 646 .loc 1 275 0 + 647 04a8 02C087E0 add ip, r7, r2 + 371:src/os/pcd_enumerate.c **** rctx->data[rctx->tot_len++] = pUDP->UDP_FDR[1]; + 648 .loc 1 371 0 + 649 04ac 018082E2 add r8, r2, #1 + 275:src/os/pcd_enumerate.c **** static void udp_irq(void) + 650 .loc 1 275 0 + 651 04b0 0CA8A0E1 mov sl, ip, asl #16 + 652 .loc 1 371 0 + 653 04b4 0838A0E1 mov r3, r8, asl #16 + 275:src/os/pcd_enumerate.c **** static void udp_irq(void) + 654 .loc 1 275 0 + 655 04b8 2AA8A0E1 mov sl, sl, lsr #16 + 656 .loc 1 371 0 + 657 04bc 548094E5 ldr r8, [r4, #84] + 658 04c0 2338A0E1 mov r3, r3, lsr #16 + 659 04c4 0210E0E1 mvn r1, r2 + 660 04c8 08C090E5 ldr ip, [r0, #8] + 661 04cc 0A1081E0 add r1, r1, sl + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 662 .loc 1 370 0 + 663 04d0 0A0053E1 cmp r3, sl + 664 .loc 1 371 0 + 665 04d4 0280CCE7 strb r8, [ip, r2] + 666 04d8 011001E2 and r1, r1, #1 + 667 04dc B630C0E1 strh r3, [r0, #6] @ movhi + 668 .LVL58: + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 669 .loc 1 370 0 + 670 04e0 1900000A beq .L120 + 671 04e4 000051E3 cmp r1, #0 + 672 04e8 0800000A beq .L121 + 673 .loc 1 371 0 + 674 04ec 54C094E5 ldr ip, [r4, #84] + 675 04f0 012083E2 add r2, r3, #1 + 676 04f4 081090E5 ldr r1, [r0, #8] + 677 04f8 0228A0E1 mov r2, r2, asl #16 + 678 04fc 03C0C1E7 strb ip, [r1, r3] + 679 0500 2238A0E1 mov r3, r2, lsr #16 + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 680 .loc 1 370 0 + 681 0504 0A0053E1 cmp r3, sl + 682 .loc 1 371 0 + 683 0508 B630C0E1 strh r3, [r0, #6] @ movhi + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 684 .loc 1 370 0 + 685 050c 0E00000A beq .L120 + 686 .L121: + 687 .loc 1 371 0 discriminator 2 + 688 0510 012083E2 add r2, r3, #1 + 689 0514 548094E5 ldr r8, [r4, #84] + 690 0518 08C090E5 ldr ip, [r0, #8] + 691 051c 0228A0E1 mov r2, r2, asl #16 + 692 0520 2218A0E1 mov r1, r2, lsr #16 + 693 0524 0380CCE7 strb r8, [ip, r3] + 694 0528 018081E2 add r8, r1, #1 + 695 052c 0838A0E1 mov r3, r8, asl #16 + 696 0530 2338A0E1 mov r3, r3, lsr #16 + 697 0534 548094E5 ldr r8, [r4, #84] + 698 0538 081090E5 ldr r1, [r0, #8] + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 699 .loc 1 370 0 discriminator 2 + 700 053c 0A0053E1 cmp r3, sl + 701 .loc 1 371 0 discriminator 2 + 702 0540 2288C1E7 strb r8, [r1, r2, lsr #16] + 703 0544 B630C0E1 strh r3, [r0, #6] @ movhi + 370:src/os/pcd_enumerate.c **** for (i = 0; i < pkt_size; i++) + 704 .loc 1 370 0 discriminator 2 + 705 0548 F0FFFF1A bne .L121 + 706 .L120: + 372:src/os/pcd_enumerate.c **** + 373:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + 707 .loc 1 373 0 + 708 054c 341094E5 ldr r1, [r4, #52] + 374:src/os/pcd_enumerate.c **** + 375:src/os/pcd_enumerate.c **** /* toggle current receive bank */ + 376:src/os/pcd_enumerate.c **** if (cur_rcv_bank == AT91C_UDP_RX_DATA_BK0) + 377:src/os/pcd_enumerate.c **** cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + 709 .loc 1 377 0 + 710 0550 020056E3 cmp r6, #2 + 373:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] &= ~cur_rcv_bank; + 711 .loc 1 373 0 + 712 0554 0660C1E1 bic r6, r1, r6 + 713 .LVL59: + 714 0558 346084E5 str r6, [r4, #52] + 378:src/os/pcd_enumerate.c **** else + 379:src/os/pcd_enumerate.c **** cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 380:src/os/pcd_enumerate.c **** upcd.cur_rcv_bank = cur_rcv_bank; + 715 .loc 1 380 0 + 716 055c D8699FE5 ldr r6, .L168 + 377:src/os/pcd_enumerate.c **** cur_rcv_bank = AT91C_UDP_RX_DATA_BK1; + 717 .loc 1 377 0 + 718 0560 0230A013 movne r3, #2 + 719 0564 4030A003 moveq r3, #64 + 720 .LVL60: + 381:src/os/pcd_enumerate.c **** + 382:src/os/pcd_enumerate.c **** DEBUGIO("rctxdump(%s) ", hexdump(rctx->data, rctx->tot_len)); + 383:src/os/pcd_enumerate.c **** + 384:src/os/pcd_enumerate.c **** /* if this is the last packet in transfer, hand rctx up the + 385:src/os/pcd_enumerate.c **** * stack */ + 386:src/os/pcd_enumerate.c **** if (pkt_size < AT91C_EP_IN_SIZE) { + 721 .loc 1 386 0 + 722 0568 3F0057E3 cmp r7, #63 + 380:src/os/pcd_enumerate.c **** upcd.cur_rcv_bank = cur_rcv_bank; + 723 .loc 1 380 0 + 724 056c 083085E5 str r3, [r5, #8] + 387:src/os/pcd_enumerate.c **** DEBUGIO("RCTX_rx_done "); + 388:src/os/pcd_enumerate.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_RCV_DONE); + 389:src/os/pcd_enumerate.c **** upcd.ep[1].incomplete.rctx = NULL; + 390:src/os/pcd_enumerate.c **** } else { + 391:src/os/pcd_enumerate.c **** DEBUGIO("RCTX_rx_cont "); + 392:src/os/pcd_enumerate.c **** upcd.ep[1].incomplete.rctx = rctx; + 725 .loc 1 392 0 + 726 0570 1C008685 strhi r0, [r6, #28] + 386:src/os/pcd_enumerate.c **** if (pkt_size < AT91C_EP_IN_SIZE) { + 727 .loc 1 386 0 + 728 0574 CB00009A bls .L154 + 729 .LVL61: + 730 .L113: + 731 .LBE57: + 393:src/os/pcd_enumerate.c **** } + 394:src/os/pcd_enumerate.c **** } + 395:src/os/pcd_enumerate.c **** cont_ep2: + 396:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_EPINT2) { + 732 .loc 1 396 0 + 733 0578 08309DE5 ldr r3, [sp, #8] + 734 057c 040013E3 tst r3, #4 + 735 0580 1500000A beq .L124 + 397:src/os/pcd_enumerate.c **** csr = pUDP->UDP_CSR[2]; + 736 .loc 1 397 0 + 737 0584 38C094E5 ldr ip, [r4, #56] + 738 .LVL62: + 398:src/os/pcd_enumerate.c **** DEBUGI("EP2INT(In, CSR=0x%08x) ", csr); + 399:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_TXCOMP) { + 739 .loc 1 399 0 + 740 0588 01001CE3 tst ip, #1 + 741 058c 1200000A beq .L124 + 400:src/os/pcd_enumerate.c **** DEBUGII("ACK_TX_COMP "); + 401:src/os/pcd_enumerate.c **** /* acknowledge TX completion */ + 402:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] &= ~AT91C_UDP_TXCOMP; + 742 .loc 1 402 0 + 743 0590 382094E5 ldr r2, [r4, #56] + 744 0594 01E0C2E3 bic lr, r2, #1 + 745 0598 38E084E5 str lr, [r4, #56] + 746 .L125: + 403:src/os/pcd_enumerate.c **** while (pUDP->UDP_CSR[2] & AT91C_UDP_TXCOMP) ; + 747 .loc 1 403 0 discriminator 1 + 748 059c 381094E5 ldr r1, [r4, #56] + 749 05a0 010011E3 tst r1, #1 + 750 05a4 FCFFFF1A bne .L125 + 751 .LVL63: + 752 .LBB58: + 753 .LBB59: + 754 .LBB60: + 34:include/asm/atomic.h **** + 35:include/asm/atomic.h **** return val; + 36:include/asm/atomic.h **** } + 37:include/asm/atomic.h **** + 38:include/asm/atomic.h **** static inline int atomic_sub_return(int i, atomic_t *v) + 39:include/asm/atomic.h **** { + 40:include/asm/atomic.h **** unsigned long flags; + 41:include/asm/atomic.h **** int val; + 42:include/asm/atomic.h **** + 43:include/asm/atomic.h **** local_irq_save(flags); + 755 .loc 2 43 0 + 756 @ 43 "include/asm/atomic.h" 1 + 757 05a8 00C00FE1 mrs ip, cpsr @ local_irq_save + 758 05ac 80308CE3 orr r3, ip, #128 + 759 05b0 03F021E1 msr cpsr_c, r3 + 760 @ 0 "" 2 + 761 .LVL64: + 762 .LBE60: + 44:include/asm/atomic.h **** val = v->counter; + 763 .loc 2 44 0 + 764 05b4 243095E5 ldr r3, [r5, #36] + 765 .LVL65: + 45:include/asm/atomic.h **** v->counter = val -= i; + 766 .loc 2 45 0 + 767 05b8 010043E2 sub r0, r3, #1 + 768 .LVL66: + 769 05bc 240085E5 str r0, [r5, #36] + 46:include/asm/atomic.h **** local_irq_restore(flags); + 770 .loc 2 46 0 + 771 @ 46 "include/asm/atomic.h" 1 + 772 05c0 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 773 + 774 @ 0 "" 2 + 775 .LBE59: + 776 .LBE58: + 404:src/os/pcd_enumerate.c **** + 405:src/os/pcd_enumerate.c **** /* if we already have another packet in DPR, send it */ + 406:src/os/pcd_enumerate.c **** if (atomic_dec_return(&upcd.ep[2].pkts_in_transit) == 1) + 777 .loc 1 406 0 + 778 05c4 010050E3 cmp r0, #1 + 407:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] |= AT91C_UDP_TXPKTRDY; + 779 .loc 1 407 0 + 780 05c8 38009405 ldreq r0, [r4, #56] + 781 .LVL67: + 782 05cc 10008003 orreq r0, r0, #16 + 783 05d0 38008405 streq r0, [r4, #56] + 408:src/os/pcd_enumerate.c **** + 409:src/os/pcd_enumerate.c **** __udp_refill_ep(2); + 784 .loc 1 409 0 + 785 05d4 0200A0E3 mov r0, #2 + 786 05d8 18FFFFEB bl __udp_refill_ep + 787 .LVL68: + 788 .L124: + 410:src/os/pcd_enumerate.c **** } + 411:src/os/pcd_enumerate.c **** } + 412:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_EPINT3) { + 789 .loc 1 412 0 + 790 05dc 08209DE5 ldr r2, [sp, #8] + 791 05e0 080012E3 tst r2, #8 + 792 05e4 1500000A beq .L127 + 413:src/os/pcd_enumerate.c **** csr = pUDP->UDP_CSR[3]; + 793 .loc 1 413 0 + 794 05e8 3C1094E5 ldr r1, [r4, #60] + 795 .LVL69: + 414:src/os/pcd_enumerate.c **** DEBUGII("EP3INT(Interrupt, CSR=0x%08x) ", csr); + 415:src/os/pcd_enumerate.c **** /* Transmit has completed, re-fill from pending rcts for EP3 */ + 416:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_TXCOMP) { + 796 .loc 1 416 0 + 797 05ec 010011E3 tst r1, #1 + 798 05f0 1200000A beq .L127 + 417:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] &= ~AT91C_UDP_TXCOMP; + 799 .loc 1 417 0 + 800 05f4 3C0094E5 ldr r0, [r4, #60] + 801 05f8 01E0C0E3 bic lr, r0, #1 + 802 05fc 3CE084E5 str lr, [r4, #60] + 803 .L128: + 418:src/os/pcd_enumerate.c **** while (pUDP->UDP_CSR[3] & AT91C_UDP_TXCOMP) ; + 804 .loc 1 418 0 discriminator 1 + 805 0600 3CC094E5 ldr ip, [r4, #60] + 806 0604 01001CE3 tst ip, #1 + 807 0608 FCFFFF1A bne .L128 + 808 .LVL70: + 809 .LBB61: + 810 .LBB62: + 811 .LBB63: + 43:include/asm/atomic.h **** local_irq_save(flags); + 812 .loc 2 43 0 + 813 @ 43 "include/asm/atomic.h" 1 + 814 060c 00200FE1 mrs r2, cpsr @ local_irq_save + 815 0610 803082E3 orr r3, r2, #128 + 816 0614 03F021E1 msr cpsr_c, r3 + 817 @ 0 "" 2 + 818 .LBE63: + 44:include/asm/atomic.h **** val = v->counter; + 819 .loc 2 44 0 + 820 0618 301095E5 ldr r1, [r5, #48] + 821 .LVL71: + 45:include/asm/atomic.h **** v->counter = val -= i; + 822 .loc 2 45 0 + 823 061c 013041E2 sub r3, r1, #1 + 824 .LVL72: + 825 0620 303085E5 str r3, [r5, #48] + 826 .loc 2 46 0 + 827 @ 46 "include/asm/atomic.h" 1 + 828 0624 02F021E1 msr cpsr_c, r2 @ local_irq_restore + 829 + 830 @ 0 "" 2 + 831 .LBE62: + 832 .LBE61: + 419:src/os/pcd_enumerate.c **** + 420:src/os/pcd_enumerate.c **** /* if we already have another packet in DPR, send it */ + 421:src/os/pcd_enumerate.c **** if (atomic_dec_return(&upcd.ep[3].pkts_in_transit) == 1) + 833 .loc 1 421 0 + 834 0628 010053E3 cmp r3, #1 + 422:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] |= AT91C_UDP_TXPKTRDY; + 835 .loc 1 422 0 + 836 062c 3C309405 ldreq r3, [r4, #60] + 837 .LVL73: + 838 0630 10308303 orreq r3, r3, #16 + 839 0634 3C308405 streq r3, [r4, #60] + 423:src/os/pcd_enumerate.c **** + 424:src/os/pcd_enumerate.c **** __udp_refill_ep(3); + 840 .loc 1 424 0 + 841 0638 0300A0E3 mov r0, #3 + 842 063c FFFEFFEB bl __udp_refill_ep + 843 .LVL74: + 844 .L127: + 425:src/os/pcd_enumerate.c **** } + 426:src/os/pcd_enumerate.c **** } + 427:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_RXSUSP) { + 845 .loc 1 427 0 + 846 0640 08109DE5 ldr r1, [sp, #8] + 847 0644 010C11E3 tst r1, #256 + 428:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_RXSUSP; + 848 .loc 1 428 0 + 849 0648 011CA013 movne r1, #256 + 850 064c 20108415 strne r1, [r4, #32] + 429:src/os/pcd_enumerate.c **** DEBUGI("RXSUSP "); + 430:src/os/pcd_enumerate.c **** #ifdef CONFIG_USB_SUSPEND + 431:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_SUSPENDED; + 432:src/os/pcd_enumerate.c **** /* FIXME: implement suspend/resume correctly. This + 433:src/os/pcd_enumerate.c **** * involves saving the pre-suspend state, and calling back + 434:src/os/pcd_enumerate.c **** * into the main application program to ask it to power down + 435:src/os/pcd_enumerate.c **** * all peripherals, switching to slow clock, ... */ + 436:src/os/pcd_enumerate.c **** #endif + 437:src/os/pcd_enumerate.c **** } + 438:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_RXRSM) { + 851 .loc 1 438 0 + 852 0650 08209DE5 ldr r2, [sp, #8] + 853 0654 020C12E3 tst r2, #512 + 439:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_RXRSM; + 854 .loc 1 439 0 + 855 0658 022CA013 movne r2, #512 + 856 065c 20208415 strne r2, [r4, #32] + 440:src/os/pcd_enumerate.c **** DEBUGI("RXRSM "); + 441:src/os/pcd_enumerate.c **** #ifdef CONFIG_USB_SUSPEND + 442:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_SUSPENDED) + 443:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_CONFIGURED; + 444:src/os/pcd_enumerate.c **** /* FIXME: implement suspend/resume */ + 445:src/os/pcd_enumerate.c **** #endif + 446:src/os/pcd_enumerate.c **** } + 447:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_EXTRSM) { + 857 .loc 1 447 0 + 858 0660 08309DE5 ldr r3, [sp, #8] + 859 0664 010B13E3 tst r3, #1024 + 448:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_EXTRSM; + 860 .loc 1 448 0 + 861 0668 013BA013 movne r3, #1024 + 862 066c 20308415 strne r3, [r4, #32] + 449:src/os/pcd_enumerate.c **** DEBUGI("EXTRSM "); + 450:src/os/pcd_enumerate.c **** /* FIXME: implement suspend/resume */ + 451:src/os/pcd_enumerate.c **** } + 452:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_SOFINT) { + 863 .loc 1 452 0 + 864 0670 08C09DE5 ldr ip, [sp, #8] + 865 0674 020B1CE3 tst ip, #2048 + 453:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_SOFINT; + 866 .loc 1 453 0 + 867 0678 02CBA013 movne ip, #2048 + 868 067c 20C08415 strne ip, [r4, #32] + 454:src/os/pcd_enumerate.c **** DEBUGI("SOFINT "); + 455:src/os/pcd_enumerate.c **** } + 456:src/os/pcd_enumerate.c **** if (isr & AT91C_UDP_WAKEUP) { + 869 .loc 1 456 0 + 870 0680 08009DE5 ldr r0, [sp, #8] + 871 0684 020A10E3 tst r0, #8192 + 457:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_WAKEUP; + 872 .loc 1 457 0 + 873 0688 020AA013 movne r0, #8192 + 874 068c 20008415 strne r0, [r4, #32] + 875 .L59: + 876 .LVL75: + 877 .LBB64: + 878 .LBB65: + 879 .file 3 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 880 .loc 3 97 0 + 881 0690 020BA0E3 mov r0, #2048 + 882 0694 0FCCE0E3 mvn ip, #3840 + 883 0698 29008CE5 str r0, [ip, #41] + 884 .LBE65: + 885 .LBE64: + 458:src/os/pcd_enumerate.c **** DEBUGI("WAKEUP "); + 459:src/os/pcd_enumerate.c **** } + 460:src/os/pcd_enumerate.c **** out: + 461:src/os/pcd_enumerate.c **** DEBUGI("END\r\n"); + 462:src/os/pcd_enumerate.c **** AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_UDP); + 463:src/os/pcd_enumerate.c **** } + 886 .loc 1 463 0 + 887 069c 14D08DE2 add sp, sp, #20 + 888 06a0 F04FBDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} + 889 06a4 1EFF2FE1 bx lr + 890 .LVL76: + 891 .L152: + 287:src/os/pcd_enumerate.c **** pUDP->UDP_IER = AT91C_UDP_EPINT0; + 892 .loc 1 287 0 + 893 06a8 01E0A0E3 mov lr, #1 + 286:src/os/pcd_enumerate.c **** pUDP->UDP_ICR = AT91C_UDP_ENDBUSRES; + 894 .loc 1 286 0 + 895 06ac 010AA0E3 mov r0, #4096 + 896 06b0 200084E5 str r0, [r4, #32] + 290:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = 0; + 897 .loc 1 290 0 + 898 06b4 00C0A0E3 mov ip, #0 + 287:src/os/pcd_enumerate.c **** pUDP->UDP_IER = AT91C_UDP_EPINT0; + 899 .loc 1 287 0 + 900 06b8 10E084E5 str lr, [r4, #16] + 289:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = (unsigned int)-1; + 901 .loc 1 289 0 + 902 06bc 0020E0E3 mvn r2, #0 + 292:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = AT91C_UDP_FEN; + 903 .loc 1 292 0 + 904 06c0 013CA0E3 mov r3, #256 + 298:src/os/pcd_enumerate.c **** reset_ep(1); + 905 .loc 1 298 0 + 906 06c4 0E00A0E1 mov r0, lr + 294:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 907 .loc 1 294 0 + 908 06c8 02E9A0E3 mov lr, #32768 + 289:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = (unsigned int)-1; + 909 .loc 1 289 0 + 910 06cc 282084E5 str r2, [r4, #40] + 296:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 911 .loc 1 296 0 + 912 06d0 0510A0E3 mov r1, #5 + 290:src/os/pcd_enumerate.c **** pUDP->UDP_RSTEP = 0; + 913 .loc 1 290 0 + 914 06d4 28C084E5 str ip, [r4, #40] + 292:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = AT91C_UDP_FEN; + 915 .loc 1 292 0 + 916 06d8 083084E5 str r3, [r4, #8] + 294:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] = (AT91C_UDP_EPEDS | AT91C_UDP_EPTYPE_CTRL); + 917 .loc 1 294 0 + 918 06dc 30E084E5 str lr, [r4, #48] + 295:src/os/pcd_enumerate.c **** upcd.cur_config = 0; + 919 .loc 1 295 0 + 920 06e0 05C0C5E5 strb ip, [r5, #5] + 296:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 921 .loc 1 296 0 + 922 06e4 0410C5E5 strb r1, [r5, #4] + 298:src/os/pcd_enumerate.c **** reset_ep(1); + 923 .loc 1 298 0 + 924 06e8 A8FEFFEB bl reset_ep + 299:src/os/pcd_enumerate.c **** reset_ep(2); + 925 .loc 1 299 0 + 926 06ec 0200A0E3 mov r0, #2 + 927 06f0 A6FEFFEB bl reset_ep + 300:src/os/pcd_enumerate.c **** reset_ep(3); + 928 .loc 1 300 0 + 929 06f4 0300A0E3 mov r0, #3 + 930 06f8 A4FEFFEB bl reset_ep + 303:src/os/pcd_enumerate.c **** if (*dfu->dfu_state == DFU_STATE_appDETACH) { + 931 .loc 1 303 0 + 932 06fc 3C389FE5 ldr r3, .L168+4 + 933 0700 E82093E5 ldr r2, [r3, #232] + 934 0704 002092E5 ldr r2, [r2, #0] + 935 0708 010052E3 cmp r2, #1 + 936 070c 4CFFFF1A bne .L58 + 306:src/os/pcd_enumerate.c **** dfu->dfu_switch(); + 937 .loc 1 306 0 + 938 0710 E4C093E5 ldr ip, [r3, #228] + 939 0714 0FE0A0E1 mov lr, pc + 940 0718 1CFF2FE1 bx ip + 307:src/os/pcd_enumerate.c **** goto out; + 941 .loc 1 307 0 + 942 071c DBFFFFEA b .L59 + 943 .L153: + 944 .LBB66: + 945 .LBB68: + 464:src/os/pcd_enumerate.c **** + 465:src/os/pcd_enumerate.c **** void udp_pullup_on(void) + 466:src/os/pcd_enumerate.c **** { + 467:src/os/pcd_enumerate.c **** #ifdef PCD + 468:src/os/pcd_enumerate.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 469:src/os/pcd_enumerate.c **** #endif + 470:src/os/pcd_enumerate.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 471:src/os/pcd_enumerate.c **** } + 472:src/os/pcd_enumerate.c **** + 473:src/os/pcd_enumerate.c **** void udp_pullup_off(void) + 474:src/os/pcd_enumerate.c **** { + 475:src/os/pcd_enumerate.c **** #ifdef PCD + 476:src/os/pcd_enumerate.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUP); + 477:src/os/pcd_enumerate.c **** #endif + 478:src/os/pcd_enumerate.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_UDP_PUPv4); + 479:src/os/pcd_enumerate.c **** } + 480:src/os/pcd_enumerate.c **** + 481:src/os/pcd_enumerate.c **** /* Open USB Device Port */ + 482:src/os/pcd_enumerate.c **** void udp_open(void) + 483:src/os/pcd_enumerate.c **** { + 484:src/os/pcd_enumerate.c **** DEBUGPCRF("entering"); + 485:src/os/pcd_enumerate.c **** udp_init(); + 486:src/os/pcd_enumerate.c **** upcd.pUdp = AT91C_BASE_UDP; + 487:src/os/pcd_enumerate.c **** upcd.cur_config = 0; + 488:src/os/pcd_enumerate.c **** upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 489:src/os/pcd_enumerate.c **** /* This should start with USB_STATE_NOTATTACHED, but we're a pure + 490:src/os/pcd_enumerate.c **** * bus powered device and thus start with powered */ + 491:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_POWERED; + 492:src/os/pcd_enumerate.c **** + 493:src/os/pcd_enumerate.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 494:src/os/pcd_enumerate.c **** OPENPCD_IRQ_PRIO_UDP, + 495:src/os/pcd_enumerate.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &udp_irq); + 496:src/os/pcd_enumerate.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_UDP); + 497:src/os/pcd_enumerate.c **** + 498:src/os/pcd_enumerate.c **** /* End-of-Bus-Reset is always enabled */ + 499:src/os/pcd_enumerate.c **** + 500:src/os/pcd_enumerate.c **** /* Set the Pull up resistor */ + 501:src/os/pcd_enumerate.c **** udp_pullup_on(); + 502:src/os/pcd_enumerate.c **** } + 503:src/os/pcd_enumerate.c **** + 504:src/os/pcd_enumerate.c **** void udp_reset(void) + 505:src/os/pcd_enumerate.c **** { + 506:src/os/pcd_enumerate.c **** volatile int i; + 507:src/os/pcd_enumerate.c **** + 508:src/os/pcd_enumerate.c **** udp_pullup_off(); + 509:src/os/pcd_enumerate.c **** for (i = 0; i < 0xffff; i++) + 510:src/os/pcd_enumerate.c **** ; + 511:src/os/pcd_enumerate.c **** udp_pullup_on(); + 512:src/os/pcd_enumerate.c **** } + 513:src/os/pcd_enumerate.c **** + 514:src/os/pcd_enumerate.c **** /* Handle requests on the USB Control Endpoint */ + 515:src/os/pcd_enumerate.c **** static void udp_ep0_handler(void) + 516:src/os/pcd_enumerate.c **** { + 517:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 946 .loc 1 517 0 + 947 0720 00A095E5 ldr sl, [r5, #0] + 948 .LVL77: + 518:src/os/pcd_enumerate.c **** u_int8_t bmRequestType, bRequest; + 519:src/os/pcd_enumerate.c **** u_int16_t wValue, wIndex, wLength, wStatus; + 520:src/os/pcd_enumerate.c **** u_int32_t csr = pUDP->UDP_CSR[0]; + 949 .loc 1 520 0 + 950 0724 30609AE5 ldr r6, [sl, #48] + 951 .LVL78: + 521:src/os/pcd_enumerate.c **** + 522:src/os/pcd_enumerate.c **** DEBUGE("CSR=0x%04x ", csr); + 952 .loc 1 522 0 + 953 0728 14089FE5 ldr r0, .L168+8 + 954 072c 0610A0E1 mov r1, r6 + 955 0730 FEFFFFEB bl debugp + 956 .LVL79: + 523:src/os/pcd_enumerate.c **** + 524:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_STALLSENT) { + 957 .loc 1 524 0 + 958 0734 080016E3 tst r6, #8 + 959 0738 6500001A bne .L155 + 960 .L61: + 525:src/os/pcd_enumerate.c **** DEBUGE("ACK_STALLSENT "); + 526:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + 527:src/os/pcd_enumerate.c **** } + 528:src/os/pcd_enumerate.c **** + 529:src/os/pcd_enumerate.c **** if (csr & AT91C_UDP_RX_DATA_BK0) { + 961 .loc 1 529 0 + 962 073c 020016E3 tst r6, #2 + 963 0740 5D00001A bne .L156 + 964 .L62: + 530:src/os/pcd_enumerate.c **** DEBUGE("ACK_BANK0 "); + 531:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + 532:src/os/pcd_enumerate.c **** } + 533:src/os/pcd_enumerate.c **** + 534:src/os/pcd_enumerate.c **** if (!(csr & AT91C_UDP_RXSETUP)) { + 965 .loc 1 534 0 + 966 0744 040016E3 tst r6, #4 + 967 0748 5300000A beq .L157 + 535:src/os/pcd_enumerate.c **** DEBUGE("no setup packet "); + 536:src/os/pcd_enumerate.c **** return; + 537:src/os/pcd_enumerate.c **** } + 538:src/os/pcd_enumerate.c **** + 539:src/os/pcd_enumerate.c **** DEBUGE("len=%d ", csr >> 16); + 968 .loc 1 539 0 + 969 074c 2668A0E1 mov r6, r6, lsr #16 + 970 .LVL80: + 971 0750 F0079FE5 ldr r0, .L168+12 + 972 0754 0610A0E1 mov r1, r6 + 973 0758 FEFFFFEB bl debugp + 540:src/os/pcd_enumerate.c **** if (csr >> 16 == 0) { + 974 .loc 1 540 0 + 975 075c 000056E3 cmp r6, #0 + 976 0760 6000000A beq .L158 + 541:src/os/pcd_enumerate.c **** DEBUGE("empty packet "); + 542:src/os/pcd_enumerate.c **** return; + 543:src/os/pcd_enumerate.c **** } + 544:src/os/pcd_enumerate.c **** + 545:src/os/pcd_enumerate.c **** bmRequestType = pUDP->UDP_FDR[0]; + 977 .loc 1 545 0 + 978 0764 50609AE5 ldr r6, [sl, #80] + 546:src/os/pcd_enumerate.c **** bRequest = pUDP->UDP_FDR[0]; + 979 .loc 1 546 0 + 980 0768 50709AE5 ldr r7, [sl, #80] + 547:src/os/pcd_enumerate.c **** wValue = (pUDP->UDP_FDR[0] & 0xFF); + 981 .loc 1 547 0 + 982 076c 50909AE5 ldr r9, [sl, #80] + 548:src/os/pcd_enumerate.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 983 .loc 1 548 0 + 984 0770 50809AE5 ldr r8, [sl, #80] + 549:src/os/pcd_enumerate.c **** wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 985 .loc 1 549 0 + 986 0774 50209AE5 ldr r2, [sl, #80] + 550:src/os/pcd_enumerate.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 987 .loc 1 550 0 + 988 0778 50E09AE5 ldr lr, [sl, #80] + 551:src/os/pcd_enumerate.c **** wLength = (pUDP->UDP_FDR[0] & 0xFF); + 989 .loc 1 551 0 + 990 077c 50009AE5 ldr r0, [sl, #80] + 552:src/os/pcd_enumerate.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 991 .loc 1 552 0 + 992 0780 50109AE5 ldr r1, [sl, #80] + 549:src/os/pcd_enumerate.c **** wIndex = (pUDP->UDP_FDR[0] & 0xFF); + 993 .loc 1 549 0 + 994 0784 FFB002E2 and fp, r2, #255 + 551:src/os/pcd_enumerate.c **** wLength = (pUDP->UDP_FDR[0] & 0xFF); + 995 .loc 1 551 0 + 996 0788 FF3000E2 and r3, r0, #255 + 550:src/os/pcd_enumerate.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 997 .loc 1 550 0 + 998 078c 0E248BE1 orr r2, fp, lr, asl #8 + 999 .loc 1 552 0 + 1000 0790 010483E1 orr r0, r3, r1, asl #8 + 547:src/os/pcd_enumerate.c **** wValue = (pUDP->UDP_FDR[0] & 0xFF); + 1001 .loc 1 547 0 + 1002 0794 FFC009E2 and ip, r9, #255 + 548:src/os/pcd_enumerate.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1003 .loc 1 548 0 + 1004 0798 08948CE1 orr r9, ip, r8, asl #8 + 545:src/os/pcd_enumerate.c **** bmRequestType = pUDP->UDP_FDR[0]; + 1005 .loc 1 545 0 + 1006 079c FF6006E2 and r6, r6, #255 + 1007 .LVL81: + 550:src/os/pcd_enumerate.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 1008 .loc 1 550 0 + 1009 07a0 02C8A0E1 mov ip, r2, asl #16 + 1010 .loc 1 552 0 + 1011 07a4 00B8A0E1 mov fp, r0, asl #16 + 548:src/os/pcd_enumerate.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1012 .loc 1 548 0 + 1013 07a8 0988A0E1 mov r8, r9, asl #16 + 550:src/os/pcd_enumerate.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 1014 .loc 1 550 0 + 1015 07ac 2CE8A0E1 mov lr, ip, lsr #16 + 553:src/os/pcd_enumerate.c **** + 554:src/os/pcd_enumerate.c **** DEBUGE("bmRequestType=0x%2x ", bmRequestType); + 1016 .loc 1 554 0 + 1017 07b0 94079FE5 ldr r0, .L168+16 + 1018 07b4 0610A0E1 mov r1, r6 + 552:src/os/pcd_enumerate.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1019 .loc 1 552 0 + 1020 07b8 2B98A0E1 mov r9, fp, lsr #16 + 550:src/os/pcd_enumerate.c **** wIndex |= (pUDP->UDP_FDR[0] << 8); + 1021 .loc 1 550 0 + 1022 07bc 00E08DE5 str lr, [sp, #0] + 552:src/os/pcd_enumerate.c **** wLength |= (pUDP->UDP_FDR[0] << 8); + 1023 .loc 1 552 0 + 1024 07c0 04908DE5 str r9, [sp, #4] + 1025 .loc 1 554 0 + 1026 07c4 FEFFFFEB bl debugp + 555:src/os/pcd_enumerate.c **** + 556:src/os/pcd_enumerate.c **** if (bmRequestType & 0x80) { + 1027 .loc 1 556 0 + 1028 07c8 800016E3 tst r6, #128 + 546:src/os/pcd_enumerate.c **** bRequest = pUDP->UDP_FDR[0]; + 1029 .loc 1 546 0 + 1030 07cc FF7007E2 and r7, r7, #255 + 1031 .LVL82: + 548:src/os/pcd_enumerate.c **** wValue |= (pUDP->UDP_FDR[0] << 8); + 1032 .loc 1 548 0 + 1033 07d0 2888A0E1 mov r8, r8, lsr #16 + 1034 .LVL83: + 1035 .loc 1 556 0 + 1036 07d4 6D00001A bne .L159 + 1037 .L65: + 557:src/os/pcd_enumerate.c **** DEBUGE("DATA_IN=1 "); + 558:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 559:src/os/pcd_enumerate.c **** while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 560:src/os/pcd_enumerate.c **** } + 561:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RXSETUP; + 1038 .loc 1 561 0 + 1039 07d8 30C09AE5 ldr ip, [sl, #48] + 1040 07dc 04E0CCE3 bic lr, ip, #4 + 1041 07e0 30E08AE5 str lr, [sl, #48] + 1042 .L67: + 562:src/os/pcd_enumerate.c **** while ((pUDP->UDP_CSR[0] & AT91C_UDP_RXSETUP)) ; + 1043 .loc 1 562 0 + 1044 07e4 30009AE5 ldr r0, [sl, #48] + 1045 07e8 049010E2 ands r9, r0, #4 + 1046 07ec FCFFFF1A bne .L67 + 563:src/os/pcd_enumerate.c **** + 564:src/os/pcd_enumerate.c **** DEBUGE("dfu_state = %u ", *dfu->dfu_state); + 1047 .loc 1 564 0 + 1048 07f0 48B79FE5 ldr fp, .L168+4 + 1049 07f4 E8309BE5 ldr r3, [fp, #232] + 1050 07f8 50079FE5 ldr r0, .L168+20 + 1051 07fc 001093E5 ldr r1, [r3, #0] + 1052 0800 FEFFFFEB bl debugp + 565:src/os/pcd_enumerate.c **** /* Handle supported standard device request Cf Table 9-3 in USB + 566:src/os/pcd_enumerate.c **** * speciication Rev 1.1 */ + 567:src/os/pcd_enumerate.c **** switch ((bRequest << 8) | bmRequestType) { + 1053 .loc 1 567 0 + 1054 0804 48279FE5 ldr r2, .L168+24 + 1055 0808 073486E1 orr r3, r6, r7, asl #8 + 1056 080c 020053E1 cmp r3, r2 + 1057 0810 F800000A beq .L76 + 1058 0814 360000DA ble .L160 + 1059 0818 220D53E3 cmp r3, #2176 + 1060 081c 9300000A beq .L80 + 1061 0820 6C0000CA bgt .L86 + 1062 0824 050C53E3 cmp r3, #1280 + 1063 0828 6B01000A beq .L78 + 1064 082c 1A0D53E3 cmp r3, #1664 + 1065 0830 FD00000A beq .L79 + 1066 0834 1CE79FE5 ldr lr, .L168+28 + 1067 0838 0E0053E1 cmp r3, lr + 1068 083c 3500001A bne .L68 + 1069 .LBB71: + 568:src/os/pcd_enumerate.c **** u_int8_t desc_type, desc_index; + 569:src/os/pcd_enumerate.c **** case STD_GET_DESCRIPTOR: + 570:src/os/pcd_enumerate.c **** DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", + 571:src/os/pcd_enumerate.c **** wValue, wIndex); + 572:src/os/pcd_enumerate.c **** desc_type = wValue >> 8; + 573:src/os/pcd_enumerate.c **** desc_index = wValue & 0xff; + 574:src/os/pcd_enumerate.c **** switch (desc_type) { + 575:src/os/pcd_enumerate.c **** case USB_DT_DEVICE: + 576:src/os/pcd_enumerate.c **** /* Return Device Descriptor */ + 577:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 578:src/os/pcd_enumerate.c **** if (*dfu->dfu_state != DFU_STATE_appIDLE) + 579:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 580:src/os/pcd_enumerate.c **** dfu->dfu_dev_descriptor, + 581:src/os/pcd_enumerate.c **** MIN(dfu->dfu_dev_descriptor->bLength, + 582:src/os/pcd_enumerate.c **** wLength)); + 583:src/os/pcd_enumerate.c **** else + 584:src/os/pcd_enumerate.c **** #endif + 585:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &dev_descriptor, + 586:src/os/pcd_enumerate.c **** MIN(sizeof(dev_descriptor), wLength)); + 587:src/os/pcd_enumerate.c **** break; + 588:src/os/pcd_enumerate.c **** case USB_DT_CONFIG: + 589:src/os/pcd_enumerate.c **** /* Return Configuration Descriptor */ + 590:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 591:src/os/pcd_enumerate.c **** if (*dfu->dfu_state != DFU_STATE_appIDLE) + 592:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 593:src/os/pcd_enumerate.c **** dfu->dfu_cfg_descriptor, + 594:src/os/pcd_enumerate.c **** MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + 595:src/os/pcd_enumerate.c **** wLength)); + 596:src/os/pcd_enumerate.c **** else + 597:src/os/pcd_enumerate.c **** #endif + 598:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &cfg_descriptor, + 599:src/os/pcd_enumerate.c **** MIN(sizeof(cfg_descriptor), wLength)); + 600:src/os/pcd_enumerate.c **** break; + 601:src/os/pcd_enumerate.c **** case USB_DT_STRING: + 602:src/os/pcd_enumerate.c **** #ifdef CONFIG_USB_STRING + 603:src/os/pcd_enumerate.c **** /* Return String descriptor */ + 604:src/os/pcd_enumerate.c **** if (desc_index > ARRAY_SIZE(usb_strings)) + 605:src/os/pcd_enumerate.c **** goto out_stall; + 606:src/os/pcd_enumerate.c **** DEBUGE("bLength=%u, wLength=%u\n", + 607:src/os/pcd_enumerate.c **** usb_strings[desc_index]->bLength, wLength); + 608:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) usb_strings[desc_index], + 609:src/os/pcd_enumerate.c **** MIN(usb_strings[desc_index]->bLength, + 610:src/os/pcd_enumerate.c **** wLength)); + 611:src/os/pcd_enumerate.c **** #else + 612:src/os/pcd_enumerate.c **** goto out_stall; + 613:src/os/pcd_enumerate.c **** #endif + 614:src/os/pcd_enumerate.c **** break; + 615:src/os/pcd_enumerate.c **** case USB_DT_CS_DEVICE: + 616:src/os/pcd_enumerate.c **** /* Return Function descriptor */ + 617:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &dfu->dfu_cfg_descriptor->func_dfu, + 618:src/os/pcd_enumerate.c **** MIN(sizeof(dfu->dfu_cfg_descriptor->func_dfu), wLength)); + 619:src/os/pcd_enumerate.c **** break; + 620:src/os/pcd_enumerate.c **** case USB_DT_INTERFACE: + 621:src/os/pcd_enumerate.c **** /* Return Interface descriptor */ + 622:src/os/pcd_enumerate.c **** if (desc_index > cfg_descriptor.ucfg.bNumInterfaces) + 623:src/os/pcd_enumerate.c **** goto out_stall; + 624:src/os/pcd_enumerate.c **** switch (desc_index) { + 625:src/os/pcd_enumerate.c **** case 0: + 626:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 627:src/os/pcd_enumerate.c **** &cfg_descriptor.uif, + 628:src/os/pcd_enumerate.c **** MIN(sizeof(cfg_descriptor.uif), + 629:src/os/pcd_enumerate.c **** wLength)); + 630:src/os/pcd_enumerate.c **** break; + 631:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 632:src/os/pcd_enumerate.c **** case 1: + 633:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 634:src/os/pcd_enumerate.c **** &cfg_descriptor.uif_dfu[0], + 635:src/os/pcd_enumerate.c **** MIN(sizeof(cfg_descriptor.uif_dfu[0]), + 636:src/os/pcd_enumerate.c **** wLength)); + 637:src/os/pcd_enumerate.c **** break; + 638:src/os/pcd_enumerate.c **** case 2: + 639:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 640:src/os/pcd_enumerate.c **** &cfg_descriptor.uif_dfu[1], + 641:src/os/pcd_enumerate.c **** MIN(sizeof(cfg_descriptor.uif_dfu[1]), + 642:src/os/pcd_enumerate.c **** wLength)); + 643:src/os/pcd_enumerate.c **** break; + 644:src/os/pcd_enumerate.c **** #endif + 645:src/os/pcd_enumerate.c **** default: + 646:src/os/pcd_enumerate.c **** goto out_stall; + 647:src/os/pcd_enumerate.c **** break; + 648:src/os/pcd_enumerate.c **** } + 649:src/os/pcd_enumerate.c **** break; + 650:src/os/pcd_enumerate.c **** default: + 651:src/os/pcd_enumerate.c **** goto out_stall; + 652:src/os/pcd_enumerate.c **** break; + 653:src/os/pcd_enumerate.c **** } + 654:src/os/pcd_enumerate.c **** break; + 655:src/os/pcd_enumerate.c **** case STD_SET_ADDRESS: + 656:src/os/pcd_enumerate.c **** DEBUGE("SET_ADDRESS "); + 657:src/os/pcd_enumerate.c **** if (wValue > 127) + 658:src/os/pcd_enumerate.c **** goto out_stall; + 659:src/os/pcd_enumerate.c **** + 660:src/os/pcd_enumerate.c **** switch (upcd.state) { + 661:src/os/pcd_enumerate.c **** case USB_STATE_DEFAULT: + 662:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 663:src/os/pcd_enumerate.c **** if (wValue == 0) { + 664:src/os/pcd_enumerate.c **** /* do nothing */ + 665:src/os/pcd_enumerate.c **** } else { + 666:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 667:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 668:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 669:src/os/pcd_enumerate.c **** } + 670:src/os/pcd_enumerate.c **** break; + 671:src/os/pcd_enumerate.c **** case USB_STATE_ADDRESS: + 672:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 673:src/os/pcd_enumerate.c **** if (wValue == 0) { + 674:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 675:src/os/pcd_enumerate.c **** } else { + 676:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 677:src/os/pcd_enumerate.c **** } + 678:src/os/pcd_enumerate.c **** break; + 679:src/os/pcd_enumerate.c **** default: + 680:src/os/pcd_enumerate.c **** goto out_stall; + 681:src/os/pcd_enumerate.c **** break; + 682:src/os/pcd_enumerate.c **** } + 683:src/os/pcd_enumerate.c **** break; + 684:src/os/pcd_enumerate.c **** case STD_SET_CONFIGURATION: + 685:src/os/pcd_enumerate.c **** DEBUGE("SET_CONFIG "); + 686:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_ADDRESS && + 687:src/os/pcd_enumerate.c **** upcd.state != USB_STATE_CONFIGURED) { + 688:src/os/pcd_enumerate.c **** goto out_stall; + 689:src/os/pcd_enumerate.c **** } + 690:src/os/pcd_enumerate.c **** if ((wValue & 0xff) == 0) { + 691:src/os/pcd_enumerate.c **** DEBUGE("VALUE==0 "); + 692:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 693:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 694:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = 0; + 695:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] = 0; + 696:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] = 0; + 697:src/os/pcd_enumerate.c **** } else if ((wValue & 0xff) <= + 698:src/os/pcd_enumerate.c **** dev_descriptor.bNumConfigurations) { + 699:src/os/pcd_enumerate.c **** DEBUGE("VALUE!=0 "); + 700:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_CONFIGURED; + 701:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + 702:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + 703:src/os/pcd_enumerate.c **** AT91C_UDP_EPTYPE_BULK_OUT; + 704:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + 705:src/os/pcd_enumerate.c **** AT91C_UDP_EPTYPE_BULK_IN; + 706:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + 707:src/os/pcd_enumerate.c **** AT91C_UDP_EPTYPE_INT_IN; + 708:src/os/pcd_enumerate.c **** } else { + 709:src/os/pcd_enumerate.c **** /* invalid configuration */ + 710:src/os/pcd_enumerate.c **** goto out_stall; + 711:src/os/pcd_enumerate.c **** break; + 712:src/os/pcd_enumerate.c **** } + 713:src/os/pcd_enumerate.c **** upcd.cur_config = wValue; + 714:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 715:src/os/pcd_enumerate.c **** pUDP->UDP_IER = (AT91C_UDP_EPINT0 | AT91C_UDP_EPINT1 | + 716:src/os/pcd_enumerate.c **** AT91C_UDP_EPINT2 | AT91C_UDP_EPINT3); + 717:src/os/pcd_enumerate.c **** break; + 718:src/os/pcd_enumerate.c **** case STD_GET_CONFIGURATION: + 719:src/os/pcd_enumerate.c **** DEBUGE("GET_CONFIG "); + 720:src/os/pcd_enumerate.c **** switch (upcd.state) { + 721:src/os/pcd_enumerate.c **** case USB_STATE_ADDRESS: + 722:src/os/pcd_enumerate.c **** case USB_STATE_CONFIGURED: + 723:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&(upcd.cur_config), + 724:src/os/pcd_enumerate.c **** sizeof(upcd.cur_config)); + 725:src/os/pcd_enumerate.c **** break; + 726:src/os/pcd_enumerate.c **** default: + 727:src/os/pcd_enumerate.c **** goto out_stall; + 728:src/os/pcd_enumerate.c **** break; + 729:src/os/pcd_enumerate.c **** } + 730:src/os/pcd_enumerate.c **** break; + 731:src/os/pcd_enumerate.c **** case STD_GET_INTERFACE: + 732:src/os/pcd_enumerate.c **** DEBUGE("GET_INTERFACE "); + 733:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_CONFIGURED) + 734:src/os/pcd_enumerate.c **** goto out_stall; + 735:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&(upcd.cur_altsett), + 736:src/os/pcd_enumerate.c **** sizeof(upcd.cur_altsett)); + 737:src/os/pcd_enumerate.c **** break; + 738:src/os/pcd_enumerate.c **** case STD_GET_STATUS_ZERO: + 739:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_ZERO "); + 740:src/os/pcd_enumerate.c **** wStatus = 0; + 741:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 742:src/os/pcd_enumerate.c **** break; + 743:src/os/pcd_enumerate.c **** case STD_GET_STATUS_INTERFACE: + 744:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_INTERFACE "); + 745:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_DEFAULT || + 746:src/os/pcd_enumerate.c **** (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + 747:src/os/pcd_enumerate.c **** goto out_stall; + 748:src/os/pcd_enumerate.c **** wStatus = 0; + 749:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 750:src/os/pcd_enumerate.c **** break; + 751:src/os/pcd_enumerate.c **** case STD_GET_STATUS_ENDPOINT: + 752:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + 753:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_DEFAULT || + 754:src/os/pcd_enumerate.c **** (upcd.state == USB_STATE_ADDRESS && wIndex != 0)) + 755:src/os/pcd_enumerate.c **** goto out_stall; + 756:src/os/pcd_enumerate.c **** wStatus = 0; + 757:src/os/pcd_enumerate.c **** wIndex &= 0x0F; + 758:src/os/pcd_enumerate.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 759:src/os/pcd_enumerate.c **** wStatus = + 760:src/os/pcd_enumerate.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 761:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, + 762:src/os/pcd_enumerate.c **** sizeof(wStatus)); + 763:src/os/pcd_enumerate.c **** } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 764:src/os/pcd_enumerate.c **** && (wIndex == 0)) { + 765:src/os/pcd_enumerate.c **** wStatus = + 766:src/os/pcd_enumerate.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 767:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, + 768:src/os/pcd_enumerate.c **** sizeof(wStatus)); + 769:src/os/pcd_enumerate.c **** } else + 770:src/os/pcd_enumerate.c **** goto out_stall; + 771:src/os/pcd_enumerate.c **** break; + 772:src/os/pcd_enumerate.c **** case STD_SET_FEATURE_ZERO: + 773:src/os/pcd_enumerate.c **** DEBUGE("SET_FEATURE_ZERO "); + 774:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_ADDRESS && + 775:src/os/pcd_enumerate.c **** (wIndex & 0xff) != 0) + 776:src/os/pcd_enumerate.c **** goto out_stall; + 777:src/os/pcd_enumerate.c **** /* FIXME: implement this */ + 778:src/os/pcd_enumerate.c **** goto out_stall; + 779:src/os/pcd_enumerate.c **** break; + 780:src/os/pcd_enumerate.c **** case STD_SET_FEATURE_INTERFACE: + 781:src/os/pcd_enumerate.c **** DEBUGE("SET_FEATURE_INTERFACE "); + 782:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_ADDRESS && + 783:src/os/pcd_enumerate.c **** (wIndex & 0xff) != 0) + 784:src/os/pcd_enumerate.c **** goto out_stall; + 785:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 786:src/os/pcd_enumerate.c **** break; + 787:src/os/pcd_enumerate.c **** case STD_SET_FEATURE_ENDPOINT: + 788:src/os/pcd_enumerate.c **** DEBUGE("SET_FEATURE_ENDPOINT "); + 1070 .loc 1 788 0 + 1071 0840 14079FE5 ldr r0, .L168+32 + 1072 0844 FEFFFFEB bl debugp + 789:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_ADDRESS && + 1073 .loc 1 789 0 + 1074 0848 0430D5E5 ldrb r3, [r5, #4] @ zero_extendqisi2 + 1075 084c 060053E3 cmp r3, #6 + 1076 0850 7801000A beq .L161 + 1077 .L112: + 790:src/os/pcd_enumerate.c **** (wIndex & 0xff) != 0) + 791:src/os/pcd_enumerate.c **** goto out_stall; + 792:src/os/pcd_enumerate.c **** if (wValue != USB_ENDPOINT_HALT) + 1078 .loc 1 792 0 + 1079 0854 000058E3 cmp r8, #0 + 1080 0858 3500001A bne .L87 + 793:src/os/pcd_enumerate.c **** goto out_stall; + 794:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1081 .loc 1 794 0 + 1082 085c DC669FE5 ldr r6, .L168+4 + 1083 .LVL84: + 1084 0860 D8C096E5 ldr ip, [r6, #216] + 1085 0864 0FE0A0E1 mov lr, pc + 1086 0868 1CFF2FE1 bx ip + 1087 .LVL85: + 795:src/os/pcd_enumerate.c **** wIndex &= 0x0F; + 796:src/os/pcd_enumerate.c **** if ((wValue == 0) && wIndex && (wIndex <= 3)) { + 1088 .loc 1 796 0 + 1089 086c 00209DE5 ldr r2, [sp, #0] + 1090 0870 0F0012E3 tst r2, #15 + 1091 0874 0F3002E2 and r3, r2, #15 + 1092 0878 2D00000A beq .L87 + 1093 087c 030053E3 cmp r3, #3 + 1094 0880 2B00008A bhi .L87 + 797:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[wIndex] = 0; + 1095 .loc 1 797 0 + 1096 0884 0C0083E2 add r0, r3, #12 + 1097 0888 00818AE7 str r8, [sl, r0, asl #2] + 798:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1098 .loc 1 798 0 + 1099 088c D8C096E5 ldr ip, [r6, #216] + 1100 0890 0FE0A0E1 mov lr, pc + 1101 0894 1CFF2FE1 bx ip + 1102 0898 ECFEFFEA b .L60 + 1103 .LVL86: + 1104 .L157: + 1105 .LBE71: + 535:src/os/pcd_enumerate.c **** DEBUGE("no setup packet "); + 1106 .loc 1 535 0 + 1107 089c BC069FE5 ldr r0, .L168+36 + 1108 08a0 FEFFFFEB bl debugp + 1109 08a4 E9FEFFEA b .L60 + 1110 .LVL87: + 1111 .L154: + 1112 .LBE68: + 1113 .LBE66: + 1114 .LBB76: + 388:src/os/pcd_enumerate.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_RCV_DONE); + 1115 .loc 1 388 0 + 1116 08a8 0210A0E3 mov r1, #2 + 1117 08ac FEFFFFEB bl req_ctx_set_state + 1118 .LVL88: + 389:src/os/pcd_enumerate.c **** upcd.ep[1].incomplete.rctx = NULL; + 1119 .loc 1 389 0 + 1120 08b0 0000A0E3 mov r0, #0 + 1121 08b4 1C0086E5 str r0, [r6, #28] + 1122 08b8 2EFFFFEA b .L113 + 1123 .LVL89: + 1124 .L156: + 1125 .LBE76: + 1126 .LBB77: + 1127 .LBB74: + 530:src/os/pcd_enumerate.c **** DEBUGE("ACK_BANK0 "); + 1128 .loc 1 530 0 + 1129 08bc A0069FE5 ldr r0, .L168+40 + 1130 08c0 FEFFFFEB bl debugp + 531:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] &= ~AT91C_UDP_RX_DATA_BK0; + 1131 .loc 1 531 0 + 1132 08c4 30209AE5 ldr r2, [sl, #48] + 1133 08c8 0230C2E3 bic r3, r2, #2 + 1134 08cc 30308AE5 str r3, [sl, #48] + 1135 08d0 9BFFFFEA b .L62 + 1136 .L155: + 525:src/os/pcd_enumerate.c **** DEBUGE("ACK_STALLSENT "); + 1137 .loc 1 525 0 + 1138 08d4 8C069FE5 ldr r0, .L168+44 + 1139 08d8 FEFFFFEB bl debugp + 526:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] = ~AT91C_UDP_STALLSENT; + 1140 .loc 1 526 0 + 1141 08dc 0810E0E3 mvn r1, #8 + 1142 08e0 30108AE5 str r1, [sl, #48] + 1143 08e4 94FFFFEA b .L61 + 1144 .LVL90: + 1145 .L158: + 541:src/os/pcd_enumerate.c **** DEBUGE("empty packet "); + 1146 .loc 1 541 0 + 1147 08e8 7C069FE5 ldr r0, .L168+48 + 1148 08ec FEFFFFEB bl debugp + 1149 08f0 D6FEFFEA b .L60 + 1150 .LVL91: + 1151 .L160: + 567:src/os/pcd_enumerate.c **** switch ((bRequest << 8) | bmRequestType) { + 1152 .loc 1 567 0 + 1153 08f4 010C53E3 cmp r3, #256 + 1154 08f8 7E00000A beq .L72 + 1155 08fc 2C0000CA bgt .L85 + 1156 0900 810053E3 cmp r3, #129 + 1157 0904 A300000A beq .L70 + 1158 0908 820053E3 cmp r3, #130 + 1159 090c 7C00000A beq .L71 + 1160 0910 800053E3 cmp r3, #128 + 1161 0914 B000000A beq .L162 + 1162 .L68: + 1163 .LBB72: + 799:src/os/pcd_enumerate.c **** } else + 800:src/os/pcd_enumerate.c **** goto out_stall; + 801:src/os/pcd_enumerate.c **** break; + 802:src/os/pcd_enumerate.c **** case STD_CLEAR_FEATURE_ZERO: + 803:src/os/pcd_enumerate.c **** DEBUGE("CLEAR_FEATURE_ZERO "); + 804:src/os/pcd_enumerate.c **** goto out_stall; + 805:src/os/pcd_enumerate.c **** break; + 806:src/os/pcd_enumerate.c **** case STD_CLEAR_FEATURE_INTERFACE: + 807:src/os/pcd_enumerate.c **** DEBUGP("CLEAR_FEATURE_INTERFACE "); + 808:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 809:src/os/pcd_enumerate.c **** break; + 810:src/os/pcd_enumerate.c **** case STD_CLEAR_FEATURE_ENDPOINT: + 811:src/os/pcd_enumerate.c **** DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + 812:src/os/pcd_enumerate.c **** if (wValue != USB_ENDPOINT_HALT) + 813:src/os/pcd_enumerate.c **** goto out_stall; + 814:src/os/pcd_enumerate.c **** wIndex &= 0x0F; + 815:src/os/pcd_enumerate.c **** if ((wValue == 0) && wIndex && (wIndex <= 3)) { + 816:src/os/pcd_enumerate.c **** reset_ep(wIndex); + 817:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 818:src/os/pcd_enumerate.c **** } else + 819:src/os/pcd_enumerate.c **** goto out_stall; + 820:src/os/pcd_enumerate.c **** break; + 821:src/os/pcd_enumerate.c **** case STD_SET_INTERFACE: + 822:src/os/pcd_enumerate.c **** DEBUGE("SET INTERFACE "); + 823:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_CONFIGURED) + 824:src/os/pcd_enumerate.c **** goto out_stall; + 825:src/os/pcd_enumerate.c **** if (wIndex > cfg_descriptor.ucfg.bNumInterfaces) + 826:src/os/pcd_enumerate.c **** goto out_stall; + 827:src/os/pcd_enumerate.c **** upcd.cur_interface = wIndex; + 828:src/os/pcd_enumerate.c **** upcd.cur_altsett = wValue; + 829:src/os/pcd_enumerate.c **** /* USB spec mandates that if we only support one altsetting in + 830:src/os/pcd_enumerate.c **** * the given interface, we shall respond with STALL in the + 831:src/os/pcd_enumerate.c **** * status stage */ + 832:src/os/pcd_enumerate.c **** udp_ep0_send_stall(); + 833:src/os/pcd_enumerate.c **** break; + 834:src/os/pcd_enumerate.c **** default: + 835:src/os/pcd_enumerate.c **** DEBUGE("DEFAULT(req=0x%02x, type=0x%02x) ", + 1164 .loc 1 835 0 + 1165 0918 50069FE5 ldr r0, .L168+52 + 1166 091c 0710A0E1 mov r1, r7 + 1167 0920 0620A0E1 mov r2, r6 + 1168 0924 FEFFFFEB bl debugp + 836:src/os/pcd_enumerate.c **** bRequest, bmRequestType); + 837:src/os/pcd_enumerate.c **** #ifdef CONFIG_DFU + 838:src/os/pcd_enumerate.c **** if ((bmRequestType & 0x3f) == USB_TYPE_DFU) { + 1169 .loc 1 838 0 + 1170 0928 3FC006E2 and ip, r6, #63 + 1171 092c 21005CE3 cmp ip, #33 + 1172 0930 5C01000A beq .L163 + 1173 .LVL92: + 1174 .L87: + 1175 .LBE72: + 839:src/os/pcd_enumerate.c **** dfu->dfu_ep0_handler(bmRequestType, bRequest, wValue, + 840:src/os/pcd_enumerate.c **** wLength); + 841:src/os/pcd_enumerate.c **** } else + 842:src/os/pcd_enumerate.c **** #endif + 843:src/os/pcd_enumerate.c **** goto out_stall; + 844:src/os/pcd_enumerate.c **** break; + 845:src/os/pcd_enumerate.c **** } + 846:src/os/pcd_enumerate.c **** return; + 847:src/os/pcd_enumerate.c **** out_stall: + 848:src/os/pcd_enumerate.c **** DEBUGE("STALL!! "); + 1176 .loc 1 848 0 + 1177 0934 38069FE5 ldr r0, .L168+56 + 1178 0938 FEFFFFEB bl debugp + 849:src/os/pcd_enumerate.c **** udp_ep0_send_stall(); + 1179 .loc 1 849 0 + 1180 093c FC359FE5 ldr r3, .L168+4 + 1181 0940 DCC093E5 ldr ip, [r3, #220] + 1182 0944 0FE0A0E1 mov lr, pc + 1183 0948 1CFF2FE1 bx ip + 1184 094c BFFEFFEA b .L60 + 1185 .LVL93: + 1186 .L114: + 1187 .LBE74: + 1188 .LBE77: + 1189 .LBB78: + 348:src/os/pcd_enumerate.c **** if (pkt_size >= AT91C_EP_IN_SIZE) + 1190 .loc 1 348 0 + 1191 0950 3F0057E3 cmp r7, #63 + 349:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(1, RCTX_STATE_FREE, + 1192 .loc 1 349 0 + 1193 0954 0100A083 movhi r0, #1 + 1194 0958 FE10A083 movhi r1, #254 + 1195 095c 0020A081 movhi r2, r0 + 352:src/os/pcd_enumerate.c **** rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 1196 .loc 1 352 0 + 1197 0960 FE10A093 movls r1, #254 + 1198 0964 0120A093 movls r2, #1 + 1199 0968 08369FE5 ldr r3, .L168+60 + 1200 096c 0FE0A0E1 mov lr, pc + 1201 0970 13FF2FE1 bx r3 + 1202 .LVL94: + 355:src/os/pcd_enumerate.c **** if (!rctx) { + 1203 .loc 1 355 0 + 1204 0974 000050E3 cmp r0, #0 + 1205 0978 2901000A beq .L164 + 361:src/os/pcd_enumerate.c **** rctx->tot_len = 0; + 1206 .loc 1 361 0 + 1207 097c 0020A0E3 mov r2, #0 @ movhi + 1208 0980 0010A0E3 mov r1, #0 + 1209 0984 B620C0E1 strh r2, [r0, #6] @ movhi + 1210 0988 0120A0E1 mov r2, r1 + 1211 098c BDFEFFEA b .L115 + 1212 .LVL95: + 1213 .L159: + 1214 .LBE78: + 1215 .LBB79: + 1216 .LBB67: + 557:src/os/pcd_enumerate.c **** DEBUGE("DATA_IN=1 "); + 1217 .loc 1 557 0 + 1218 0990 E4059FE5 ldr r0, .L168+64 + 1219 0994 FEFFFFEB bl debugp + 558:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[0] |= AT91C_UDP_DIR; + 1220 .loc 1 558 0 + 1221 0998 30109AE5 ldr r1, [sl, #48] + 1222 099c 803081E3 orr r3, r1, #128 + 1223 09a0 30308AE5 str r3, [sl, #48] + 1224 .L66: + 559:src/os/pcd_enumerate.c **** while (!(pUDP->UDP_CSR[0] & AT91C_UDP_DIR)) ; + 1225 .loc 1 559 0 + 1226 09a4 30B09AE5 ldr fp, [sl, #48] + 1227 09a8 80001BE3 tst fp, #128 + 1228 09ac FCFFFF0A beq .L66 + 1229 09b0 88FFFFEA b .L65 + 1230 .L85: + 567:src/os/pcd_enumerate.c **** switch ((bRequest << 8) | bmRequestType) { + 1231 .loc 1 567 0 + 1232 09b4 C4159FE5 ldr r1, .L168+68 + 1233 09b8 010053E1 cmp r3, r1 + 1234 09bc F600000A beq .L74 + 1235 09c0 EF0000BA blt .L73 + 1236 09c4 030C53E3 cmp r3, #768 + 1237 09c8 D2FFFF1A bne .L68 + 1238 .LBB70: + 773:src/os/pcd_enumerate.c **** DEBUGE("SET_FEATURE_ZERO "); + 1239 .loc 1 773 0 + 1240 09cc B0059FE5 ldr r0, .L168+72 + 1241 09d0 FEFFFFEB bl debugp + 1242 09d4 D6FFFFEA b .L87 + 1243 .L86: + 1244 .LBE70: + 567:src/os/pcd_enumerate.c **** switch ((bRequest << 8) | bmRequestType) { + 1245 .loc 1 567 0 + 1246 09d8 A8259FE5 ldr r2, .L168+76 + 1247 09dc 020053E1 cmp r3, r2 + 1248 09e0 3B00000A beq .L82 + 1249 09e4 80C082E2 add ip, r2, #128 + 1250 09e8 0C0053E1 cmp r3, ip + 1251 09ec 2900000A beq .L83 + 1252 09f0 090C53E3 cmp r3, #2304 + 1253 09f4 C7FFFF1A bne .L68 + 1254 .LBB69: + 685:src/os/pcd_enumerate.c **** DEBUGE("SET_CONFIG "); + 1255 .loc 1 685 0 + 1256 09f8 8C059FE5 ldr r0, .L168+80 + 1257 09fc FEFFFFEB bl debugp + 686:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_ADDRESS && + 1258 .loc 1 686 0 + 1259 0a00 04C0D5E5 ldrb ip, [r5, #4] @ zero_extendqisi2 + 1260 0a04 06304CE2 sub r3, ip, #6 + 1261 0a08 010053E3 cmp r3, #1 + 1262 0a0c C8FFFF8A bhi .L87 + 690:src/os/pcd_enumerate.c **** if ((wValue & 0xff) == 0) { + 1263 .loc 1 690 0 + 1264 0a10 FF3018E2 ands r3, r8, #255 + 1265 0a14 1801000A beq .L165 + 697:src/os/pcd_enumerate.c **** } else if ((wValue & 0xff) <= + 1266 .loc 1 697 0 + 1267 0a18 010053E3 cmp r3, #1 + 1268 0a1c C4FFFF1A bne .L87 + 699:src/os/pcd_enumerate.c **** DEBUGE("VALUE!=0 "); + 1269 .loc 1 699 0 + 1270 0a20 68059FE5 ldr r0, .L168+84 + 1271 0a24 FEFFFFEB bl debugp + 702:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + 1272 .loc 1 702 0 + 1273 0a28 820CA0E3 mov r0, #33280 + 704:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + 1274 .loc 1 704 0 + 1275 0a2c 01CB80E2 add ip, r0, #1024 + 700:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_CONFIGURED; + 1276 .loc 1 700 0 + 1277 0a30 0710A0E3 mov r1, #7 + 701:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + 1278 .loc 1 701 0 + 1279 0a34 0220A0E3 mov r2, #2 + 706:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + 1280 .loc 1 706 0 + 1281 0a38 013C8CE2 add r3, ip, #256 + 700:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_CONFIGURED; + 1282 .loc 1 700 0 + 1283 0a3c 0410C5E5 strb r1, [r5, #4] + 701:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_CONFG; + 1284 .loc 1 701 0 + 1285 0a40 04208AE5 str r2, [sl, #4] + 702:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = AT91C_UDP_EPEDS | + 1286 .loc 1 702 0 + 1287 0a44 34008AE5 str r0, [sl, #52] + 704:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] = AT91C_UDP_EPEDS | + 1288 .loc 1 704 0 + 1289 0a48 38C08AE5 str ip, [sl, #56] + 706:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] = AT91C_UDP_EPEDS | + 1290 .loc 1 706 0 + 1291 0a4c 3C308AE5 str r3, [sl, #60] + 1292 .L108: + 713:src/os/pcd_enumerate.c **** upcd.cur_config = wValue; + 1293 .loc 1 713 0 + 1294 0a50 0580C5E5 strb r8, [r5, #5] + 714:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1295 .loc 1 714 0 + 1296 0a54 E4C49FE5 ldr ip, .L168+4 + 1297 0a58 D8C09CE5 ldr ip, [ip, #216] + 1298 0a5c 0FE0A0E1 mov lr, pc + 1299 0a60 1CFF2FE1 bx ip + 715:src/os/pcd_enumerate.c **** pUDP->UDP_IER = (AT91C_UDP_EPINT0 | AT91C_UDP_EPINT1 | + 1300 .loc 1 715 0 + 1301 0a64 0F30A0E3 mov r3, #15 + 1302 0a68 10308AE5 str r3, [sl, #16] + 1303 0a6c 77FEFFEA b .L60 + 1304 .L80: + 719:src/os/pcd_enumerate.c **** DEBUGE("GET_CONFIG "); + 1305 .loc 1 719 0 + 1306 0a70 1C059FE5 ldr r0, .L168+88 + 1307 0a74 FEFFFFEB bl debugp + 720:src/os/pcd_enumerate.c **** switch (upcd.state) { + 1308 .loc 1 720 0 + 1309 0a78 0420D5E5 ldrb r2, [r5, #4] @ zero_extendqisi2 + 1310 0a7c 060042E2 sub r0, r2, #6 + 1311 0a80 010050E3 cmp r0, #1 + 1312 0a84 AAFFFF8A bhi .L87 + 723:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&(upcd.cur_config), + 1313 .loc 1 723 0 + 1314 0a88 08059FE5 ldr r0, .L168+92 + 1315 0a8c 0110A0E3 mov r1, #1 + 1316 0a90 5AFDFFEB bl udp_ep0_send_data + 1317 0a94 6DFEFFEA b .L60 + 1318 .L83: + 822:src/os/pcd_enumerate.c **** DEBUGE("SET INTERFACE "); + 1319 .loc 1 822 0 + 1320 0a98 FC049FE5 ldr r0, .L168+96 + 1321 0a9c FEFFFFEB bl debugp + 823:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_CONFIGURED) + 1322 .loc 1 823 0 + 1323 0aa0 0410D5E5 ldrb r1, [r5, #4] @ zero_extendqisi2 + 1324 0aa4 070051E3 cmp r1, #7 + 1325 0aa8 8C349FE5 ldr r3, .L168 + 1326 0aac A0FFFF1A bne .L87 + 825:src/os/pcd_enumerate.c **** if (wIndex > cfg_descriptor.ucfg.bNumInterfaces) + 1327 .loc 1 825 0 + 1328 0ab0 00109DE5 ldr r1, [sp, #0] + 1329 0ab4 030051E3 cmp r1, #3 + 1330 0ab8 9DFFFF8A bhi .L87 + 827:src/os/pcd_enumerate.c **** upcd.cur_interface = wIndex; + 1331 .loc 1 827 0 + 1332 0abc 0610C3E5 strb r1, [r3, #6] + 828:src/os/pcd_enumerate.c **** upcd.cur_altsett = wValue; + 1333 .loc 1 828 0 + 1334 0ac0 0780C3E5 strb r8, [r3, #7] + 832:src/os/pcd_enumerate.c **** udp_ep0_send_stall(); + 1335 .loc 1 832 0 + 1336 0ac4 DCC09BE5 ldr ip, [fp, #220] + 1337 0ac8 0FE0A0E1 mov lr, pc + 1338 0acc 1CFF2FE1 bx ip + 1339 0ad0 5EFEFFEA b .L60 + 1340 .L82: + 732:src/os/pcd_enumerate.c **** DEBUGE("GET_INTERFACE "); + 1341 .loc 1 732 0 + 1342 0ad4 C4049FE5 ldr r0, .L168+100 + 1343 0ad8 FEFFFFEB bl debugp + 733:src/os/pcd_enumerate.c **** if (upcd.state != USB_STATE_CONFIGURED) + 1344 .loc 1 733 0 + 1345 0adc 0410D5E5 ldrb r1, [r5, #4] @ zero_extendqisi2 + 1346 0ae0 070051E3 cmp r1, #7 + 1347 0ae4 92FFFF1A bne .L87 + 735:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&(upcd.cur_altsett), + 1348 .loc 1 735 0 + 1349 0ae8 B4049FE5 ldr r0, .L168+104 + 1350 0aec 0110A0E3 mov r1, #1 + 1351 0af0 42FDFFEB bl udp_ep0_send_data + 1352 0af4 55FEFFEA b .L60 + 1353 .L72: + 803:src/os/pcd_enumerate.c **** DEBUGE("CLEAR_FEATURE_ZERO "); + 1354 .loc 1 803 0 + 1355 0af8 A8049FE5 ldr r0, .L168+108 + 1356 0afc FEFFFFEB bl debugp + 1357 0b00 8BFFFFEA b .L87 + 1358 .L71: + 752:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_ENDPOINT(EPidx=%u) ", wIndex&0x0f); + 1359 .loc 1 752 0 + 1360 0b04 00609DE5 ldr r6, [sp, #0] + 1361 .LVL96: + 1362 0b08 0F6006E2 and r6, r6, #15 + 1363 0b0c 98049FE5 ldr r0, .L168+112 + 1364 0b10 0610A0E1 mov r1, r6 + 1365 0b14 FEFFFFEB bl debugp + 753:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_DEFAULT || + 1366 .loc 1 753 0 + 1367 0b18 0430D5E5 ldrb r3, [r5, #4] @ zero_extendqisi2 + 1368 0b1c 050053E3 cmp r3, #5 + 1369 0b20 83FFFF0A beq .L87 + 1370 0b24 00C09DE5 ldr ip, [sp, #0] + 1371 0b28 00205CE2 subs r2, ip, #0 + 1372 0b2c 0120A013 movne r2, #1 + 1373 0b30 060053E3 cmp r3, #6 + 1374 0b34 0020A013 movne r2, #0 + 1375 0b38 000052E3 cmp r2, #0 + 1376 0b3c 7CFFFF1A bne .L87 + 758:src/os/pcd_enumerate.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 1377 .loc 1 758 0 + 1378 0b40 04309AE5 ldr r3, [sl, #4] + 1379 0b44 020013E3 tst r3, #2 + 756:src/os/pcd_enumerate.c **** wStatus = 0; + 1380 .loc 1 756 0 + 1381 0b48 BE20CDE1 strh r2, [sp, #14] @ movhi + 1382 .LVL97: + 758:src/os/pcd_enumerate.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 1383 .loc 1 758 0 + 1384 0b4c 0300000A beq .L110 + 1385 0b50 030056E3 cmp r6, #3 + 760:src/os/pcd_enumerate.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1386 .loc 1 760 0 + 1387 0b54 0C608692 addls r6, r6, #12 + 1388 .LVL98: + 1389 0b58 06319A97 ldrls r3, [sl, r6, asl #2] + 758:src/os/pcd_enumerate.c **** if ((pUDP->UDP_GLBSTATE & AT91C_UDP_CONFG) && (wIndex <= 3)) { + 1390 .loc 1 758 0 + 1391 0b5c 0500009A bls .L151 + 1392 .L110: + 763:src/os/pcd_enumerate.c **** } else if ((pUDP->UDP_GLBSTATE & AT91C_UDP_FADDEN) + 1393 .loc 1 763 0 + 1394 0b60 04309AE5 ldr r3, [sl, #4] + 1395 0b64 010013E3 tst r3, #1 + 1396 0b68 71FFFF0A beq .L87 + 764:src/os/pcd_enumerate.c **** && (wIndex == 0)) { + 1397 .loc 1 764 0 + 1398 0b6c 000056E3 cmp r6, #0 + 1399 0b70 6FFFFF1A bne .L87 + 766:src/os/pcd_enumerate.c **** (pUDP->UDP_CSR[wIndex] & AT91C_UDP_EPEDS) ? 0 : 1; + 1400 .loc 1 766 0 + 1401 0b74 30309AE5 ldr r3, [sl, #48] + 1402 .L151: + 1403 0b78 020913E3 tst r3, #32768 + 1404 0b7c 10008DE2 add r0, sp, #16 + 1405 0b80 0020A013 movne r2, #0 + 1406 0b84 0120A003 moveq r2, #1 + 1407 0b88 B22060E1 strh r2, [r0, #-2]! @ movhi + 1408 .LVL99: + 767:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, + 1409 .loc 1 767 0 + 1410 0b8c 0210A0E3 mov r1, #2 + 1411 0b90 1AFDFFEB bl udp_ep0_send_data + 1412 0b94 2DFEFFEA b .L60 + 1413 .LVL100: + 1414 .L70: + 744:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_INTERFACE "); + 1415 .loc 1 744 0 + 1416 0b98 10049FE5 ldr r0, .L168+116 + 1417 0b9c FEFFFFEB bl debugp + 745:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_DEFAULT || + 1418 .loc 1 745 0 + 1419 0ba0 0430D5E5 ldrb r3, [r5, #4] @ zero_extendqisi2 + 1420 0ba4 050053E3 cmp r3, #5 + 1421 0ba8 61FFFF0A beq .L87 + 1422 0bac 00E09DE5 ldr lr, [sp, #0] + 1423 0bb0 00205EE2 subs r2, lr, #0 + 1424 0bb4 0120A013 movne r2, #1 + 1425 0bb8 060053E3 cmp r3, #6 + 1426 0bbc 0020A013 movne r2, #0 + 1427 0bc0 000052E3 cmp r2, #0 + 1428 0bc4 5AFFFF1A bne .L87 + 748:src/os/pcd_enumerate.c **** wStatus = 0; + 1429 .loc 1 748 0 + 1430 0bc8 10008DE2 add r0, sp, #16 + 1431 0bcc B22060E1 strh r2, [r0, #-2]! @ movhi + 1432 .LVL101: + 749:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 1433 .loc 1 749 0 + 1434 0bd0 0210A0E3 mov r1, #2 + 1435 0bd4 09FDFFEB bl udp_ep0_send_data + 1436 0bd8 1CFEFFEA b .L60 + 1437 .LVL102: + 1438 .L162: + 739:src/os/pcd_enumerate.c **** DEBUGE("GET_STATUS_ZERO "); + 1439 .loc 1 739 0 + 1440 0bdc D0039FE5 ldr r0, .L168+120 + 1441 0be0 FEFFFFEB bl debugp + 740:src/os/pcd_enumerate.c **** wStatus = 0; + 1442 .loc 1 740 0 + 1443 0be4 10008DE2 add r0, sp, #16 + 1444 0be8 B29060E1 strh r9, [r0, #-2]! @ movhi + 1445 .LVL103: + 741:src/os/pcd_enumerate.c **** udp_ep0_send_data((char *)&wStatus, sizeof(wStatus)); + 1446 .loc 1 741 0 + 1447 0bec 0210A0E3 mov r1, #2 + 1448 0bf0 02FDFFEB bl udp_ep0_send_data + 1449 0bf4 15FEFFEA b .L60 + 1450 .LVL104: + 1451 .L76: + 781:src/os/pcd_enumerate.c **** DEBUGE("SET_FEATURE_INTERFACE "); + 1452 .loc 1 781 0 + 1453 0bf8 B8039FE5 ldr r0, .L168+124 + 1454 0bfc FEFFFFEB bl debugp + 782:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_ADDRESS && + 1455 .loc 1 782 0 + 1456 0c00 0400D5E5 ldrb r0, [r5, #4] @ zero_extendqisi2 + 1457 0c04 060050E3 cmp r0, #6 + 1458 0c08 0200001A bne .L111 + 1459 0c0c 00109DE5 ldr r1, [sp, #0] + 1460 0c10 FF0011E3 tst r1, #255 + 1461 0c14 46FFFF1A bne .L87 + 1462 .L111: + 785:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1463 .loc 1 785 0 + 1464 0c18 20C39FE5 ldr ip, .L168+4 + 1465 0c1c D8C09CE5 ldr ip, [ip, #216] + 1466 0c20 0FE0A0E1 mov lr, pc + 1467 0c24 1CFF2FE1 bx ip + 1468 0c28 08FEFFEA b .L60 + 1469 .L79: + 570:src/os/pcd_enumerate.c **** DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", + 1470 .loc 1 570 0 + 1471 0c2c 88039FE5 ldr r0, .L168+128 + 1472 0c30 00209DE5 ldr r2, [sp, #0] + 1473 0c34 0810A0E1 mov r1, r8 + 1474 0c38 FEFFFFEB bl debugp + 1475 .LVL105: + 574:src/os/pcd_enumerate.c **** switch (desc_type) { + 1476 .loc 1 574 0 + 1477 0c3c 2824A0E1 mov r2, r8, lsr #8 + 1478 0c40 010042E2 sub r0, r2, #1 + 1479 0c44 200050E3 cmp r0, #32 + 1480 0c48 00F19F97 ldrls pc, [pc, r0, asl #2] + 1481 0c4c 38FFFFEA b .L87 + 1482 .L92: + 1483 0c50 380D0000 .word .L88 + 1484 0c54 0C0D0000 .word .L89 + 1485 0c58 34090000 .word .L87 + 1486 0c5c D40C0000 .word .L90 + 1487 0c60 34090000 .word .L87 + 1488 0c64 34090000 .word .L87 + 1489 0c68 34090000 .word .L87 + 1490 0c6c 34090000 .word .L87 + 1491 0c70 34090000 .word .L87 + 1492 0c74 34090000 .word .L87 + 1493 0c78 34090000 .word .L87 + 1494 0c7c 34090000 .word .L87 + 1495 0c80 34090000 .word .L87 + 1496 0c84 34090000 .word .L87 + 1497 0c88 34090000 .word .L87 + 1498 0c8c 34090000 .word .L87 + 1499 0c90 34090000 .word .L87 + 1500 0c94 34090000 .word .L87 + 1501 0c98 34090000 .word .L87 + 1502 0c9c 34090000 .word .L87 + 1503 0ca0 34090000 .word .L87 + 1504 0ca4 34090000 .word .L87 + 1505 0ca8 34090000 .word .L87 + 1506 0cac 34090000 .word .L87 + 1507 0cb0 34090000 .word .L87 + 1508 0cb4 34090000 .word .L87 + 1509 0cb8 34090000 .word .L87 + 1510 0cbc 34090000 .word .L87 + 1511 0cc0 34090000 .word .L87 + 1512 0cc4 34090000 .word .L87 + 1513 0cc8 34090000 .word .L87 + 1514 0ccc 34090000 .word .L87 + 1515 0cd0 640D0000 .word .L91 + 1516 .L90: + 573:src/os/pcd_enumerate.c **** desc_index = wValue & 0xff; + 1517 .loc 1 573 0 + 1518 0cd4 FF8008E2 and r8, r8, #255 + 1519 .LVL106: + 622:src/os/pcd_enumerate.c **** if (desc_index > cfg_descriptor.ucfg.bNumInterfaces) + 1520 .loc 1 622 0 + 1521 0cd8 030058E3 cmp r8, #3 + 1522 0cdc 14FFFF8A bhi .L87 + 624:src/os/pcd_enumerate.c **** switch (desc_index) { + 1523 .loc 1 624 0 + 1524 0ce0 010058E3 cmp r8, #1 + 1525 0ce4 8E00000A beq .L99 + 1526 0ce8 8700003A bcc .L98 + 1527 0cec 020058E3 cmp r8, #2 + 1528 0cf0 0FFFFF1A bne .L87 + 639:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1529 .loc 1 639 0 + 1530 0cf4 04109DE5 ldr r1, [sp, #4] + 1531 0cf8 C0029FE5 ldr r0, .L168+132 + 1532 0cfc 090051E3 cmp r1, #9 + 1533 0d00 0910A023 movcs r1, #9 + 1534 0d04 BDFCFFEB bl udp_ep0_send_data + 1535 0d08 D0FDFFEA b .L60 + 1536 .LVL107: + 1537 .L89: + 591:src/os/pcd_enumerate.c **** if (*dfu->dfu_state != DFU_STATE_appIDLE) + 1538 .loc 1 591 0 + 1539 0d0c 2C329FE5 ldr r3, .L168+4 + 1540 0d10 E80093E5 ldr r0, [r3, #232] + 1541 0d14 00C090E5 ldr ip, [r0, #0] + 1542 0d18 00005CE3 cmp ip, #0 + 1543 0d1c 6A00001A bne .L166 + 598:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &cfg_descriptor, + 1544 .loc 1 598 0 + 1545 0d20 04109DE5 ldr r1, [sp, #4] + 1546 0d24 98029FE5 ldr r0, .L168+136 + 1547 0d28 390051E3 cmp r1, #57 + 1548 0d2c 3910A023 movcs r1, #57 + 1549 0d30 B2FCFFEB bl udp_ep0_send_data + 1550 0d34 C5FDFFEA b .L60 + 1551 .L88: + 578:src/os/pcd_enumerate.c **** if (*dfu->dfu_state != DFU_STATE_appIDLE) + 1552 .loc 1 578 0 + 1553 0d38 00329FE5 ldr r3, .L168+4 + 1554 0d3c E8E093E5 ldr lr, [r3, #232] + 1555 0d40 00109EE5 ldr r1, [lr, #0] + 1556 0d44 000051E3 cmp r1, #0 + 1557 0d48 6800001A bne .L167 + 585:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &dev_descriptor, + 1558 .loc 1 585 0 + 1559 0d4c 04109DE5 ldr r1, [sp, #4] + 1560 0d50 70029FE5 ldr r0, .L168+140 + 1561 0d54 120051E3 cmp r1, #18 + 1562 0d58 1210A023 movcs r1, #18 + 1563 0d5c A7FCFFEB bl udp_ep0_send_data + 1564 0d60 BAFDFFEA b .L60 + 1565 .L91: + 617:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) &dfu->dfu_cfg_descriptor->func_dfu, + 1566 .loc 1 617 0 + 1567 0d64 D4C19FE5 ldr ip, .L168+4 + 1568 0d68 04109DE5 ldr r1, [sp, #4] + 1569 0d6c F0309CE5 ldr r3, [ip, #240] + 1570 0d70 090051E3 cmp r1, #9 + 1571 0d74 0910A023 movcs r1, #9 + 1572 0d78 1B0083E2 add r0, r3, #27 + 1573 0d7c 9FFCFFEB bl udp_ep0_send_data + 1574 0d80 B2FDFFEA b .L60 + 1575 .LVL108: + 1576 .L73: + 807:src/os/pcd_enumerate.c **** DEBUGP("CLEAR_FEATURE_INTERFACE "); + 1577 .loc 1 807 0 + 1578 0d84 40029FE5 ldr r0, .L168+144 + 1579 0d88 FEFFFFEB bl debugp + 808:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1580 .loc 1 808 0 + 1581 0d8c D8C09BE5 ldr ip, [fp, #216] + 1582 0d90 0FE0A0E1 mov lr, pc + 1583 0d94 1CFF2FE1 bx ip + 1584 0d98 ACFDFFEA b .L60 + 1585 .L74: + 811:src/os/pcd_enumerate.c **** DEBUGE("CLEAR_FEATURE_ENDPOINT(EPidx=%u) ", wIndex & 0x0f); + 1586 .loc 1 811 0 + 1587 0d9c 00609DE5 ldr r6, [sp, #0] + 1588 .LVL109: + 1589 0da0 0F6006E2 and r6, r6, #15 + 1590 0da4 24029FE5 ldr r0, .L168+148 + 1591 0da8 0610A0E1 mov r1, r6 + 1592 0dac FEFFFFEB bl debugp + 812:src/os/pcd_enumerate.c **** if (wValue != USB_ENDPOINT_HALT) + 1593 .loc 1 812 0 + 1594 0db0 000058E3 cmp r8, #0 + 1595 0db4 DEFEFF1A bne .L87 + 1596 .LVL110: + 815:src/os/pcd_enumerate.c **** if ((wValue == 0) && wIndex && (wIndex <= 3)) { + 1597 .loc 1 815 0 + 1598 0db8 000056E2 subs r0, r6, #0 + 1599 0dbc DCFEFF0A beq .L87 + 1600 0dc0 030056E3 cmp r6, #3 + 1601 0dc4 DAFEFF8A bhi .L87 + 816:src/os/pcd_enumerate.c **** reset_ep(wIndex); + 1602 .loc 1 816 0 + 1603 0dc8 F0FCFFEB bl reset_ep + 817:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1604 .loc 1 817 0 + 1605 0dcc D8C09BE5 ldr ip, [fp, #216] + 1606 0dd0 0FE0A0E1 mov lr, pc + 1607 0dd4 1CFF2FE1 bx ip + 1608 0dd8 9CFDFFEA b .L60 + 1609 .LVL111: + 1610 .L78: + 656:src/os/pcd_enumerate.c **** DEBUGE("SET_ADDRESS "); + 1611 .loc 1 656 0 + 1612 0ddc F0019FE5 ldr r0, .L168+152 + 1613 0de0 FEFFFFEB bl debugp + 657:src/os/pcd_enumerate.c **** if (wValue > 127) + 1614 .loc 1 657 0 + 1615 0de4 7F0058E3 cmp r8, #127 + 1616 0de8 D1FEFF8A bhi .L87 + 660:src/os/pcd_enumerate.c **** switch (upcd.state) { + 1617 .loc 1 660 0 + 1618 0dec 0430D5E5 ldrb r3, [r5, #4] @ zero_extendqisi2 + 1619 0df0 050053E3 cmp r3, #5 + 1620 0df4 1300000A beq .L104 + 1621 0df8 060053E3 cmp r3, #6 + 1622 0dfc CCFEFF1A bne .L87 + 672:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1623 .loc 1 672 0 + 1624 0e00 D8C09BE5 ldr ip, [fp, #216] + 1625 0e04 0FE0A0E1 mov lr, pc + 1626 0e08 1CFF2FE1 bx ip + 673:src/os/pcd_enumerate.c **** if (wValue == 0) { + 1627 .loc 1 673 0 + 1628 0e0c 000058E3 cmp r8, #0 + 674:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 1629 .loc 1 674 0 + 1630 0e10 0510A003 moveq r1, #5 + 676:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1631 .loc 1 676 0 + 1632 0e14 018C8813 orrne r8, r8, #256 + 1633 .LVL112: + 674:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_DEFAULT; + 1634 .loc 1 674 0 + 1635 0e18 0410C505 streqb r1, [r5, #4] + 676:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1636 .loc 1 676 0 + 1637 0e1c 08808A15 strne r8, [sl, #8] + 1638 0e20 8AFDFFEA b .L60 + 1639 .LVL113: + 1640 .L164: + 1641 .LBE69: + 1642 .LBE67: + 1643 .LBE79: + 1644 .LBB80: + 357:src/os/pcd_enumerate.c **** pUDP->UDP_IDR = AT91C_UDP_EPINT1; + 1645 .loc 1 357 0 + 1646 0e24 02E0A0E3 mov lr, #2 + 1647 0e28 14E084E5 str lr, [r4, #20] + 358:src/os/pcd_enumerate.c **** DEBUGP("NO_RCTX_AVAIL! "); + 1648 .loc 1 358 0 + 1649 0e2c A4019FE5 ldr r0, .L168+156 + 1650 .LVL114: + 1651 0e30 FEFFFFEB bl debugp + 359:src/os/pcd_enumerate.c **** goto cont_ep2; + 1652 .loc 1 359 0 + 1653 0e34 CFFDFFEA b .L113 + 1654 .LVL115: + 1655 .L161: + 1656 .LBE80: + 1657 .LBB81: + 1658 .LBB75: + 1659 .LBB73: + 789:src/os/pcd_enumerate.c **** if (upcd.state == USB_STATE_ADDRESS && + 1660 .loc 1 789 0 + 1661 0e38 00E09DE5 ldr lr, [sp, #0] + 1662 0e3c FF001EE3 tst lr, #255 + 1663 0e40 BBFEFF1A bne .L87 + 1664 0e44 82FEFFEA b .L112 + 1665 .L104: + 662:src/os/pcd_enumerate.c **** udp_ep0_send_zlp(); + 1666 .loc 1 662 0 + 1667 0e48 D8C09BE5 ldr ip, [fp, #216] + 1668 0e4c 0FE0A0E1 mov lr, pc + 1669 0e50 1CFF2FE1 bx ip + 663:src/os/pcd_enumerate.c **** if (wValue == 0) { + 1670 .loc 1 663 0 + 1671 0e54 000058E3 cmp r8, #0 + 1672 0e58 7CFDFF0A beq .L60 + 667:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1673 .loc 1 667 0 + 1674 0e5c 0120A0E3 mov r2, #1 + 666:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1675 .loc 1 666 0 + 1676 0e60 018C88E3 orr r8, r8, #256 + 1677 .LVL116: + 668:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 1678 .loc 1 668 0 + 1679 0e64 D0009FE5 ldr r0, .L168 + 666:src/os/pcd_enumerate.c **** pUDP->UDP_FADDR = (AT91C_UDP_FEN | wValue); + 1680 .loc 1 666 0 + 1681 0e68 08808AE5 str r8, [sl, #8] + 667:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1682 .loc 1 667 0 + 1683 0e6c 04208AE5 str r2, [sl, #4] + 668:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 1684 .loc 1 668 0 + 1685 0e70 0620A0E3 mov r2, #6 + 1686 0e74 0420C0E5 strb r2, [r0, #4] + 1687 0e78 74FDFFEA b .L60 + 1688 .LVL117: + 1689 .L165: + 691:src/os/pcd_enumerate.c **** DEBUGE("VALUE==0 "); + 1690 .loc 1 691 0 + 1691 0e7c 58019FE5 ldr r0, .L168+160 + 1692 0e80 FEFFFFEB bl debugp + 694:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = 0; + 1693 .loc 1 694 0 + 1694 0e84 0000A0E3 mov r0, #0 + 692:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 1695 .loc 1 692 0 + 1696 0e88 0610A0E3 mov r1, #6 + 693:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1697 .loc 1 693 0 + 1698 0e8c 0120A0E3 mov r2, #1 + 692:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_ADDRESS; + 1699 .loc 1 692 0 + 1700 0e90 0410C5E5 strb r1, [r5, #4] + 693:src/os/pcd_enumerate.c **** pUDP->UDP_GLBSTATE = AT91C_UDP_FADDEN; + 1701 .loc 1 693 0 + 1702 0e94 04208AE5 str r2, [sl, #4] + 694:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[1] = 0; + 1703 .loc 1 694 0 + 1704 0e98 34008AE5 str r0, [sl, #52] + 695:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[2] = 0; + 1705 .loc 1 695 0 + 1706 0e9c 38008AE5 str r0, [sl, #56] + 696:src/os/pcd_enumerate.c **** pUDP->UDP_CSR[3] = 0; + 1707 .loc 1 696 0 + 1708 0ea0 3C008AE5 str r0, [sl, #60] + 1709 0ea4 E9FEFFEA b .L108 + 1710 .L163: + 839:src/os/pcd_enumerate.c **** dfu->dfu_ep0_handler(bmRequestType, bRequest, wValue, + 1711 .loc 1 839 0 + 1712 0ea8 0600A0E1 mov r0, r6 + 1713 0eac 0710A0E1 mov r1, r7 + 1714 0eb0 0820A0E1 mov r2, r8 + 1715 0eb4 04309DE5 ldr r3, [sp, #4] + 1716 0eb8 80C09FE5 ldr ip, .L168+4 + 1717 0ebc E0C09CE5 ldr ip, [ip, #224] + 1718 0ec0 0FE0A0E1 mov lr, pc + 1719 0ec4 1CFF2FE1 bx ip + 1720 0ec8 60FDFFEA b .L60 + 1721 .LVL118: + 1722 .L166: + 593:src/os/pcd_enumerate.c **** dfu->dfu_cfg_descriptor, + 1723 .loc 1 593 0 + 1724 0ecc F00093E5 ldr r0, [r3, #240] + 594:src/os/pcd_enumerate.c **** MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + 1725 .loc 1 594 0 + 1726 0ed0 02E0D0E5 ldrb lr, [r0, #2] @ zero_extendqisi2 + 1727 0ed4 0310D0E5 ldrb r1, [r0, #3] @ zero_extendqisi2 + 592:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1728 .loc 1 592 0 + 1729 0ed8 04209DE5 ldr r2, [sp, #4] + 594:src/os/pcd_enumerate.c **** MIN(dfu->dfu_cfg_descriptor->ucfg.wTotalLength, + 1730 .loc 1 594 0 + 1731 0edc 01148EE1 orr r1, lr, r1, asl #8 + 592:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1732 .loc 1 592 0 + 1733 0ee0 010052E1 cmp r2, r1 + 1734 0ee4 0210A031 movcc r1, r2 + 1735 0ee8 44FCFFEB bl udp_ep0_send_data + 1736 0eec 57FDFFEA b .L60 + 1737 .L167: + 580:src/os/pcd_enumerate.c **** dfu->dfu_dev_descriptor, + 1738 .loc 1 580 0 + 1739 0ef0 EC0093E5 ldr r0, [r3, #236] + 579:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1740 .loc 1 579 0 + 1741 0ef4 04309DE5 ldr r3, [sp, #4] + 581:src/os/pcd_enumerate.c **** MIN(dfu->dfu_dev_descriptor->bLength, + 1742 .loc 1 581 0 + 1743 0ef8 0010D0E5 ldrb r1, [r0, #0] @ zero_extendqisi2 + 579:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1744 .loc 1 579 0 + 1745 0efc 010053E1 cmp r3, r1 + 1746 0f00 0310A031 movcc r1, r3 + 1747 0f04 3DFCFFEB bl udp_ep0_send_data + 1748 0f08 50FDFFEA b .L60 + 1749 .LVL119: + 1750 .L98: + 626:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1751 .loc 1 626 0 + 1752 0f0c 04109DE5 ldr r1, [sp, #4] + 1753 0f10 C8009FE5 ldr r0, .L168+164 + 1754 0f14 090051E3 cmp r1, #9 + 1755 0f18 0910A023 movcs r1, #9 + 1756 0f1c 37FCFFEB bl udp_ep0_send_data + 1757 0f20 4AFDFFEA b .L60 + 1758 .L99: + 633:src/os/pcd_enumerate.c **** udp_ep0_send_data((const char *) + 1759 .loc 1 633 0 + 1760 0f24 04109DE5 ldr r1, [sp, #4] + 1761 0f28 B4009FE5 ldr r0, .L168+168 + 1762 0f2c 090051E3 cmp r1, #9 + 1763 0f30 0910A023 movcs r1, #9 + 1764 0f34 31FCFFEB bl udp_ep0_send_data + 1765 0f38 44FDFFEA b .L60 + 1766 .L169: + 1767 .align 2 + 1768 .L168: + 1769 0f3c 00000000 .word .LANCHOR0 + 1770 0f40 003F1000 .word 1064704 + 1771 0f44 88000000 .word .LC8 + 1772 0f48 C4000000 .word .LC12 + 1773 0f4c DC000000 .word .LC14 + 1774 0f50 00010000 .word .LC16 + 1775 0f54 01030000 .word 769 + 1776 0f58 02030000 .word 770 + 1777 0f5c 08020000 .word .LC29 + 1778 0f60 B0000000 .word .LC11 + 1779 0f64 A4000000 .word .LC10 + 1780 0f68 94000000 .word .LC9 + 1781 0f6c CC000000 .word .LC13 + 1782 0f70 84020000 .word .LC34 + 1783 0f74 A8020000 .word .LC35 + 1784 0f78 00000000 .word req_ctx_find_get + 1785 0f7c F4000000 .word .LC15 + 1786 0f80 02010000 .word 258 + 1787 0f84 DC010000 .word .LC27 + 1788 0f88 810A0000 .word 2689 + 1789 0f8c 50010000 .word .LC19 + 1790 0f90 68010000 .word .LC21 + 1791 0f94 74010000 .word .LC22 + 1792 0f98 05000000 .word .LANCHOR0+5 + 1793 0f9c 74020000 .word .LC33 + 1794 0fa0 80010000 .word .LC23 + 1795 0fa4 07000000 .word .LANCHOR0+7 + 1796 0fa8 20020000 .word .LC30 + 1797 0fac BC010000 .word .LC26 + 1798 0fb0 A4010000 .word .LC25 + 1799 0fb4 90010000 .word .LC24 + 1800 0fb8 F0010000 .word .LC28 + 1801 0fbc 10010000 .word .LC17 + 1802 0fc0 64000000 .word .LANCHOR1+100 + 1803 0fc4 34000000 .word .LANCHOR1+52 + 1804 0fc8 20000000 .word .LANCHOR1+32 + 1805 0fcc 34020000 .word .LC31 + 1806 0fd0 50020000 .word .LC32 + 1807 0fd4 40010000 .word .LC18 + 1808 0fd8 B4020000 .word .LC36 + 1809 0fdc 5C010000 .word .LC20 + 1810 0fe0 3D000000 .word .LANCHOR1+61 + 1811 0fe4 5B000000 .word .LANCHOR1+91 + 1812 .LBE73: + 1813 .LBE75: + 1814 .LBE81: + 1815 .cfi_endproc + 1816 .LFE283: + 1818 .align 2 + 1819 .global udp_unthrottle + 1821 udp_unthrottle: + 1822 .LFB280: + 182:src/os/pcd_enumerate.c **** { + 1823 .loc 1 182 0 + 1824 .cfi_startproc + 1825 @ Function supports interworking. + 1826 @ args = 0, pretend = 0, frame = 0 + 1827 @ frame_needed = 0, uses_anonymous_args = 0 + 1828 @ link register save eliminated. + 183:src/os/pcd_enumerate.c **** AT91PS_UDP pUDP = upcd.pUdp; + 1829 .loc 1 183 0 + 1830 0fe8 0C009FE5 ldr r0, .L171 + 1831 0fec 003090E5 ldr r3, [r0, #0] + 1832 .LVL120: + 184:src/os/pcd_enumerate.c **** pUDP->UDP_IER = AT91C_UDP_EPINT1; + 1833 .loc 1 184 0 + 1834 0ff0 0220A0E3 mov r2, #2 + 1835 0ff4 102083E5 str r2, [r3, #16] + 185:src/os/pcd_enumerate.c **** } + 1836 .loc 1 185 0 + 1837 0ff8 1EFF2FE1 bx lr + 1838 .L172: + 1839 .align 2 + 1840 .L171: + 1841 0ffc 00000000 .word .LANCHOR0 + 1842 .cfi_endproc + 1843 .LFE280: + 1845 .align 2 + 1846 .global udp_refill_ep + 1848 udp_refill_ep: + 1849 .LFB282: + 264:src/os/pcd_enumerate.c **** { + 1850 .loc 1 264 0 + 1851 .cfi_startproc + 1852 @ Function supports interworking. + 1853 @ args = 0, pretend = 0, frame = 0 + 1854 @ frame_needed = 0, uses_anonymous_args = 0 + 1855 .LVL121: + 1856 1000 10402DE9 stmfd sp!, {r4, lr} + 1857 .LCFI6: + 1858 .cfi_def_cfa_offset 8 + 1859 .LBB82: + 268:src/os/pcd_enumerate.c **** local_irq_save(flags); + 1860 .loc 1 268 0 + 1861 @ 268 "src/os/pcd_enumerate.c" 1 + 1862 1004 00400FE1 mrs r4, cpsr @ local_irq_save + 1863 1008 803084E3 orr r3, r4, #128 + 1864 100c 03F021E1 msr cpsr_c, r3 + 1865 @ 0 "" 2 + 1866 .LBE82: + 269:src/os/pcd_enumerate.c **** ret = __udp_refill_ep(ep); + 1867 .loc 1 269 0 + 1868 .cfi_offset 14, -4 + 1869 .cfi_offset 4, -8 + 1870 1010 8AFCFFEB bl __udp_refill_ep + 1871 .LVL122: + 270:src/os/pcd_enumerate.c **** local_irq_restore(flags); + 1872 .loc 1 270 0 + 1873 @ 270 "src/os/pcd_enumerate.c" 1 + 1874 1014 04F021E1 msr cpsr_c, r4 @ local_irq_restore + 1875 + 1876 @ 0 "" 2 + 273:src/os/pcd_enumerate.c **** } + 1877 .loc 1 273 0 + 1878 1018 1040BDE8 ldmfd sp!, {r4, lr} + 1879 101c 1EFF2FE1 bx lr + 1880 .cfi_endproc + 1881 .LFE282: + 1883 .align 2 + 1884 .global udp_pullup_on + 1886 udp_pullup_on: + 1887 .LFB284: + 466:src/os/pcd_enumerate.c **** { + 1888 .loc 1 466 0 + 1889 .cfi_startproc + 1890 @ Function supports interworking. + 1891 @ args = 0, pretend = 0, frame = 0 + 1892 @ frame_needed = 0, uses_anonymous_args = 0 + 1893 @ link register save eliminated. + 1894 .LVL123: + 1895 .LBB83: + 1896 .LBB84: + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1897 .loc 3 505 0 + 1898 1020 0B3CE0E3 mvn r3, #2816 + 1899 1024 0105A0E3 mov r0, #4194304 + 1900 .LBE84: + 1901 .LBE83: + 1902 .LBB86: + 1903 .LBB87: + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 1904 .loc 3 516 0 + 1905 1028 0128A0E3 mov r2, #65536 + 1906 .LBE87: + 1907 .LBE86: + 1908 .LBB89: + 1909 .LBB85: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1910 .loc 3 505 0 + 1911 102c CF0003E5 str r0, [r3, #-207] + 1912 .LVL124: + 1913 .LBE85: + 1914 .LBE89: + 1915 .LBB90: + 1916 .LBB88: + 1917 .loc 3 516 0 + 1918 1030 CB2003E5 str r2, [r3, #-203] + 1919 .LBE88: + 1920 .LBE90: + 471:src/os/pcd_enumerate.c **** } + 1921 .loc 1 471 0 + 1922 1034 1EFF2FE1 bx lr + 1923 .cfi_endproc + 1924 .LFE284: + 1926 .align 2 + 1927 .global udp_pullup_off + 1929 udp_pullup_off: + 1930 .LFB285: + 474:src/os/pcd_enumerate.c **** { + 1931 .loc 1 474 0 + 1932 .cfi_startproc + 1933 @ Function supports interworking. + 1934 @ args = 0, pretend = 0, frame = 0 + 1935 @ frame_needed = 0, uses_anonymous_args = 0 + 1936 @ link register save eliminated. + 1937 .LVL125: + 1938 .LBB91: + 1939 .LBB92: + 1940 .loc 3 516 0 + 1941 1038 0B3CE0E3 mvn r3, #2816 + 1942 103c 0105A0E3 mov r0, #4194304 + 1943 .LBE92: + 1944 .LBE91: + 1945 .LBB94: + 1946 .LBB95: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1947 .loc 3 505 0 + 1948 1040 0128A0E3 mov r2, #65536 + 1949 .LBE95: + 1950 .LBE94: + 1951 .LBB97: + 1952 .LBB93: + 1953 .loc 3 516 0 + 1954 1044 CB0003E5 str r0, [r3, #-203] + 1955 .LVL126: + 1956 .LBE93: + 1957 .LBE97: + 1958 .LBB98: + 1959 .LBB96: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1960 .loc 3 505 0 + 1961 1048 CF2003E5 str r2, [r3, #-207] + 1962 .LBE96: + 1963 .LBE98: + 479:src/os/pcd_enumerate.c **** } + 1964 .loc 1 479 0 + 1965 104c 1EFF2FE1 bx lr + 1966 .cfi_endproc + 1967 .LFE285: + 1969 .align 2 + 1970 .global udp_open + 1972 udp_open: + 1973 .LFB286: + 483:src/os/pcd_enumerate.c **** { + 1974 .loc 1 483 0 + 1975 .cfi_startproc + 1976 @ Function supports interworking. + 1977 @ args = 0, pretend = 0, frame = 0 + 1978 @ frame_needed = 0, uses_anonymous_args = 0 + 1979 1050 30402DE9 stmfd sp!, {r4, r5, lr} + 1980 .LCFI7: + 1981 .cfi_def_cfa_offset 12 + 484:src/os/pcd_enumerate.c **** DEBUGPCRF("entering"); + 1982 .loc 1 484 0 + 1983 1054 84009FE5 ldr r0, .L177 + 483:src/os/pcd_enumerate.c **** { + 1984 .loc 1 483 0 + 1985 1058 0CD04DE2 sub sp, sp, #12 + 1986 .LCFI8: + 1987 .cfi_def_cfa_offset 24 + 484:src/os/pcd_enumerate.c **** DEBUGPCRF("entering"); + 1988 .loc 1 484 0 + 1989 105c 80109FE5 ldr r1, .L177+4 + 1990 1060 792FA0E3 mov r2, #484 + 485:src/os/pcd_enumerate.c **** udp_init(); + 1991 .loc 1 485 0 + 1992 1064 7C409FE5 ldr r4, .L177+8 + 1993 .cfi_offset 14, -4 + 1994 .cfi_offset 5, -8 + 1995 .cfi_offset 4, -12 + 484:src/os/pcd_enumerate.c **** DEBUGPCRF("entering"); + 1996 .loc 1 484 0 + 1997 1068 FEFFFFEB bl debugp + 485:src/os/pcd_enumerate.c **** udp_init(); + 1998 .loc 1 485 0 + 1999 106c D0C094E5 ldr ip, [r4, #208] + 2000 1070 0FE0A0E1 mov lr, pc + 2001 1074 1CFF2FE1 bx ip + 486:src/os/pcd_enumerate.c **** upcd.pUdp = AT91C_BASE_UDP; + 2002 .loc 1 486 0 + 2003 1078 6CC09FE5 ldr ip, .L177+12 + 488:src/os/pcd_enumerate.c **** upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 2004 .loc 1 488 0 + 2005 107c 02E0A0E3 mov lr, #2 + 486:src/os/pcd_enumerate.c **** upcd.pUdp = AT91C_BASE_UDP; + 2006 .loc 1 486 0 + 2007 1080 68509FE5 ldr r5, .L177+16 + 488:src/os/pcd_enumerate.c **** upcd.cur_rcv_bank = AT91C_UDP_RX_DATA_BK0; + 2008 .loc 1 488 0 + 2009 1084 08E08CE5 str lr, [ip, #8] + 491:src/os/pcd_enumerate.c **** upcd.state = USB_STATE_POWERED; + 2010 .loc 1 491 0 + 2011 1088 04E0CCE5 strb lr, [ip, #4] + 493:src/os/pcd_enumerate.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 2012 .loc 1 493 0 + 2013 108c 0E20A0E1 mov r2, lr + 487:src/os/pcd_enumerate.c **** upcd.cur_config = 0; + 2014 .loc 1 487 0 + 2015 1090 0040A0E3 mov r4, #0 + 493:src/os/pcd_enumerate.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 2016 .loc 1 493 0 + 2017 1094 58E09FE5 ldr lr, .L177+20 + 486:src/os/pcd_enumerate.c **** upcd.pUdp = AT91C_BASE_UDP; + 2018 .loc 1 486 0 + 2019 1098 00508CE5 str r5, [ip, #0] + 487:src/os/pcd_enumerate.c **** upcd.cur_config = 0; + 2020 .loc 1 487 0 + 2021 109c 0540CCE5 strb r4, [ip, #5] + 493:src/os/pcd_enumerate.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_UDP, + 2022 .loc 1 493 0 + 2023 10a0 0B10A0E3 mov r1, #11 + 2024 10a4 0430A0E1 mov r3, r4 + 2025 10a8 48009FE5 ldr r0, .L177+24 + 2026 10ac 00E08DE5 str lr, [sp, #0] + 2027 10b0 FEFFFFEB bl AT91F_AIC_ConfigureIt + 2028 .LVL127: + 2029 .LBB99: + 2030 .LBB104: + 2031 .LBB106: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2032 .loc 3 505 0 + 2033 10b4 0B3CE0E3 mvn r3, #2816 + 2034 .LBE106: + 2035 .LBE104: + 2036 .LBE99: + 2037 .LBB110: + 2038 .LBB111: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 2039 .loc 3 70 0 + 2040 10b8 021BA0E3 mov r1, #2048 + 2041 10bc 0FCCE0E3 mvn ip, #3840 + 2042 .LBE111: + 2043 .LBE110: + 2044 .LBB113: + 2045 .LBB103: + 2046 .LBB105: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2047 .loc 3 505 0 + 2048 10c0 0105A0E3 mov r0, #4194304 + 2049 .LBE105: + 2050 .LBE103: + 2051 .LBB100: + 2052 .LBB101: + 2053 .loc 3 516 0 + 2054 10c4 0128A0E3 mov r2, #65536 + 2055 .LBE101: + 2056 .LBE100: + 2057 .LBE113: + 2058 .LBB114: + 2059 .LBB112: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 2060 .loc 3 70 0 + 2061 10c8 21108CE5 str r1, [ip, #33] + 2062 .LVL128: + 2063 .LBE112: + 2064 .LBE114: + 2065 .LBB115: + 2066 .LBB108: + 2067 .LBB107: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2068 .loc 3 505 0 + 2069 10cc CF0003E5 str r0, [r3, #-207] + 2070 .LVL129: + 2071 .LBE107: + 2072 .LBE108: + 2073 .LBB109: + 2074 .LBB102: + 2075 .loc 3 516 0 + 2076 10d0 CB2003E5 str r2, [r3, #-203] + 2077 .LBE102: + 2078 .LBE109: + 2079 .LBE115: + 502:src/os/pcd_enumerate.c **** } + 2080 .loc 1 502 0 + 2081 10d4 0CD08DE2 add sp, sp, #12 + 2082 10d8 3040BDE8 ldmfd sp!, {r4, r5, lr} + 2083 10dc 1EFF2FE1 bx lr + 2084 .L178: + 2085 .align 2 + 2086 .L177: + 2087 10e0 C4020000 .word .LC37 + 2088 10e4 70000000 .word .LANCHOR1+112 + 2089 10e8 003F1000 .word 1064704 + 2090 10ec 00000000 .word .LANCHOR0 + 2091 10f0 0000FBFF .word -327680 + 2092 10f4 00000000 .word udp_irq + 2093 10f8 00F0FFFF .word -4096 + 2094 .cfi_endproc + 2095 .LFE286: + 2097 .align 2 + 2098 .global udp_reset + 2100 udp_reset: + 2101 .LFB287: + 505:src/os/pcd_enumerate.c **** { + 2102 .loc 1 505 0 + 2103 .cfi_startproc + 2104 @ Function supports interworking. + 2105 @ args = 0, pretend = 0, frame = 8 + 2106 @ frame_needed = 0, uses_anonymous_args = 0 + 2107 @ link register save eliminated. + 2108 .LVL130: + 2109 10fc 08D04DE2 sub sp, sp, #8 + 2110 .LCFI9: + 2111 .cfi_def_cfa_offset 8 + 2112 .LBB116: + 2113 .LBB121: + 2114 .LBB123: + 2115 .loc 3 516 0 + 2116 1100 0B1CE0E3 mvn r1, #2816 + 2117 .LBE123: + 2118 .LBE121: + 2119 .LBB118: + 2120 .LBB119: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2121 .loc 3 505 0 + 2122 1104 0128A0E3 mov r2, #65536 + 2123 .LBE119: + 2124 .LBE118: + 2125 .LBB117: + 2126 .LBB122: + 2127 .loc 3 516 0 + 2128 1108 01C5A0E3 mov ip, #4194304 + 2129 .LBE122: + 2130 .LBE117: + 2131 .LBE116: + 509:src/os/pcd_enumerate.c **** for (i = 0; i < 0xffff; i++) + 2132 .loc 1 509 0 + 2133 110c 0000A0E3 mov r0, #0 + 2134 .LBB127: + 2135 .LBB125: + 2136 .LBB124: + 2137 .loc 3 516 0 + 2138 1110 CBC001E5 str ip, [r1, #-203] + 2139 .LVL131: + 2140 .LBE124: + 2141 .LBE125: + 2142 .LBB126: + 2143 .LBB120: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2144 .loc 3 505 0 + 2145 1114 CF2001E5 str r2, [r1, #-207] + 2146 .LBE120: + 2147 .LBE126: + 2148 .LBE127: + 509:src/os/pcd_enumerate.c **** for (i = 0; i < 0xffff; i++) + 2149 .loc 1 509 0 + 2150 1118 04008DE5 str r0, [sp, #4] + 2151 .LVL132: + 2152 111c 04309DE5 ldr r3, [sp, #4] + 2153 1120 022042E2 sub r2, r2, #2 + 2154 1124 020053E1 cmp r3, r2 + 2155 1128 050000CA bgt .L180 + 2156 .L182: + 509:src/os/pcd_enumerate.c **** for (i = 0; i < 0xffff; i++) + 2157 .loc 1 509 0 is_stmt 0 discriminator 2 + 2158 112c 04109DE5 ldr r1, [sp, #4] + 2159 1130 010081E2 add r0, r1, #1 + 2160 .LVL133: + 2161 1134 04008DE5 str r0, [sp, #4] + 2162 .LVL134: + 2163 1138 04309DE5 ldr r3, [sp, #4] + 2164 113c 020053E1 cmp r3, r2 + 2165 1140 F9FFFFDA ble .L182 + 2166 .L180: + 2167 .LVL135: + 2168 .LBB128: + 2169 .LBB129: + 2170 .LBB130: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2171 .loc 3 505 0 is_stmt 1 + 2172 1144 0BCCE0E3 mvn ip, #2816 + 2173 1148 0135A0E3 mov r3, #4194304 + 2174 .LBE130: + 2175 .LBE129: + 2176 .LBB132: + 2177 .LBB133: + 2178 .loc 3 516 0 + 2179 114c 0128A0E3 mov r2, #65536 + 2180 .LBE133: + 2181 .LBE132: + 2182 .LBB135: + 2183 .LBB131: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 2184 .loc 3 505 0 + 2185 1150 CF300CE5 str r3, [ip, #-207] + 2186 .LVL136: + 2187 .LBE131: + 2188 .LBE135: + 2189 .LBB136: + 2190 .LBB134: + 2191 .loc 3 516 0 + 2192 1154 CB200CE5 str r2, [ip, #-203] + 2193 .LBE134: + 2194 .LBE136: + 2195 .LBE128: + 512:src/os/pcd_enumerate.c **** } + 2196 .loc 1 512 0 + 2197 1158 08D08DE2 add sp, sp, #8 + 2198 115c 1EFF2FE1 bx lr + 2199 .cfi_endproc + 2200 .LFE287: + 2202 .global dev_descriptor + 2203 .global cfg_descriptor + 2204 .section .rodata + 2205 .align 2 + 2206 .set .LANCHOR1,. + 0 + 2209 epstate: + 2210 0000 FF000000 .word 255 + 2211 0004 00000000 .space 4 + 2212 0008 FF000000 .word 255 + 2213 000c 00000000 .space 4 + 2214 0010 11000000 .word 17 + 2215 0014 10000000 .word 16 + 2216 0018 13000000 .word 19 + 2217 001c 12000000 .word 18 + 2220 dev_descriptor: + 2221 0020 12 .byte 18 + 2222 0021 01 .byte 1 + 2223 0022 0001 .short 256 + 2224 0024 FF .byte -1 + 2225 0025 FF .byte -1 + 2226 0026 FF .byte -1 + 2227 0027 08 .byte 8 + 2228 0028 C016 .short 5824 + 2229 002a 6B07 .short 1899 + 2230 002c 3000 .short 48 + 2231 002e 00 .byte 0 + 2232 002f 00 .byte 0 + 2233 0030 00 .byte 0 + 2234 0031 01 .byte 1 + 2235 0032 0000 .space 2 + 2238 cfg_descriptor: + 2239 0034 09 .byte 9 + 2240 0035 02 .byte 2 + 2241 0036 3900 .short 57 + 2242 0038 03 .byte 3 + 2243 0039 01 .byte 1 + 2244 003a 00 .byte 0 + 2245 003b 80 .byte -128 + 2246 003c FA .byte -6 + 2247 003d 09 .byte 9 + 2248 003e 04 .byte 4 + 2249 003f 00 .byte 0 + 2250 0040 00 .byte 0 + 2251 0041 03 .byte 3 + 2252 0042 FF .byte -1 + 2253 0043 00 .byte 0 + 2254 0044 FF .byte -1 + 2255 0045 00 .byte 0 + 2256 0046 07 .byte 7 + 2257 0047 05 .byte 5 + 2258 0048 01 .byte 1 + 2259 0049 02 .byte 2 + 2260 004a 4000 .short 64 + 2261 004c 00 .byte 0 + 2262 004d 07 .byte 7 + 2263 004e 05 .byte 5 + 2264 004f 82 .byte -126 + 2265 0050 02 .byte 2 + 2266 0051 4000 .2byte 64 + 2267 0053 00 .byte 0 + 2268 0054 07 .byte 7 + 2269 0055 05 .byte 5 + 2270 0056 83 .byte -125 + 2271 0057 03 .byte 3 + 2272 0058 4000 .short 64 + 2273 005a FF .byte -1 + 2274 005b 09 .byte 9 + 2275 005c 04 .byte 4 + 2276 005d 01 .byte 1 + 2277 005e 00 .byte 0 + 2278 005f 00 .byte 0 + 2279 0060 FE .byte -2 + 2280 0061 01 .byte 1 + 2281 0062 01 .byte 1 + 2282 0063 00 .byte 0 + 2283 0064 09 .byte 9 + 2284 0065 04 .byte 4 + 2285 0066 02 .byte 2 + 2286 0067 00 .byte 0 + 2287 0068 00 .byte 0 + 2288 0069 FE .byte -2 + 2289 006a 01 .byte 1 + 2290 006b 01 .byte 1 + 2291 006c 00 .byte 0 + 2292 006d 000000 .space 3 + 2295 __FUNCTION__.6158: + 2296 0070 7564705F .ascii "udp_open\000" + 2296 6F70656E + 2296 00 + 2297 0079 000000 .section .rodata.str1.4,"aMS",%progbits,1 + 2298 .align 2 + 2299 .LC0: + 2300 0000 73656E64 .ascii "send_data: %u bytes \000" + 2300 5F646174 + 2300 613A2025 + 2300 75206279 + 2300 74657320 + 2301 0015 000000 .space 3 + 2302 .LC1: + 2303 0018 6669666F .ascii "fifo_fill \000" + 2303 5F66696C + 2303 6C2000 + 2304 0023 00 .space 1 + 2305 .LC2: + 2306 0024 77616974 .ascii "wait_txcomp_clear \000" + 2306 5F747863 + 2306 6F6D705F + 2306 636C6561 + 2306 722000 + 2307 0037 00 .space 1 + 2308 .LC3: + 2309 0038 7365745F .ascii "set_txpktrdy \000" + 2309 7478706B + 2309 74726479 + 2309 2000 + 2310 0046 0000 .space 2 + 2311 .LC4: + 2312 0048 77616974 .ascii "wait_txcomp \000" + 2312 5F747863 + 2312 6F6D7020 + 2312 00 + 2313 0055 000000 .space 3 + 2314 .LC5: + 2315 0058 73746F70 .ascii "stopped by status out \000" + 2315 70656420 + 2315 62792073 + 2315 74617475 + 2315 73206F75 + 2316 006f 00 .space 1 + 2317 .LC6: + 2318 0070 636C6561 .ascii "clear_txcomp \000" + 2318 725F7478 + 2318 636F6D70 + 2318 2000 + 2319 007e 0000 .space 2 + 2320 .LC7: + 2321 0080 646F6E65 .ascii "done \000" + 2321 2000 + 2322 0086 0000 .space 2 + 2323 .LC8: + 2324 0088 4353523D .ascii "CSR=0x%04x \000" + 2324 30782530 + 2324 34782000 + 2325 .LC9: + 2326 0094 41434B5F .ascii "ACK_STALLSENT \000" + 2326 5354414C + 2326 4C53454E + 2326 542000 + 2327 00a3 00 .space 1 + 2328 .LC10: + 2329 00a4 41434B5F .ascii "ACK_BANK0 \000" + 2329 42414E4B + 2329 302000 + 2330 00af 00 .space 1 + 2331 .LC11: + 2332 00b0 6E6F2073 .ascii "no setup packet \000" + 2332 65747570 + 2332 20706163 + 2332 6B657420 + 2332 00 + 2333 00c1 000000 .space 3 + 2334 .LC12: + 2335 00c4 6C656E3D .ascii "len=%d \000" + 2335 25642000 + 2336 .LC13: + 2337 00cc 656D7074 .ascii "empty packet \000" + 2337 79207061 + 2337 636B6574 + 2337 2000 + 2338 00da 0000 .space 2 + 2339 .LC14: + 2340 00dc 626D5265 .ascii "bmRequestType=0x%2x \000" + 2340 71756573 + 2340 74547970 + 2340 653D3078 + 2340 25327820 + 2341 00f1 000000 .space 3 + 2342 .LC15: + 2343 00f4 44415441 .ascii "DATA_IN=1 \000" + 2343 5F494E3D + 2343 312000 + 2344 00ff 00 .space 1 + 2345 .LC16: + 2346 0100 6466755F .ascii "dfu_state = %u \000" + 2346 73746174 + 2346 65203D20 + 2346 25752000 + 2347 .LC17: + 2348 0110 4745545F .ascii "GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) \000" + 2348 44455343 + 2348 52495054 + 2348 4F522877 + 2348 56616C75 + 2349 013e 0000 .space 2 + 2350 .LC18: + 2351 0140 5345545F .ascii "SET_ADDRESS \000" + 2351 41444452 + 2351 45535320 + 2351 00 + 2352 014d 000000 .space 3 + 2353 .LC19: + 2354 0150 5345545F .ascii "SET_CONFIG \000" + 2354 434F4E46 + 2354 49472000 + 2355 .LC20: + 2356 015c 56414C55 .ascii "VALUE==0 \000" + 2356 453D3D30 + 2356 2000 + 2357 0166 0000 .space 2 + 2358 .LC21: + 2359 0168 56414C55 .ascii "VALUE!=0 \000" + 2359 45213D30 + 2359 2000 + 2360 0172 0000 .space 2 + 2361 .LC22: + 2362 0174 4745545F .ascii "GET_CONFIG \000" + 2362 434F4E46 + 2362 49472000 + 2363 .LC23: + 2364 0180 4745545F .ascii "GET_INTERFACE \000" + 2364 494E5445 + 2364 52464143 + 2364 452000 + 2365 018f 00 .space 1 + 2366 .LC24: + 2367 0190 4745545F .ascii "GET_STATUS_ZERO \000" + 2367 53544154 + 2367 55535F5A + 2367 45524F20 + 2367 00 + 2368 01a1 000000 .space 3 + 2369 .LC25: + 2370 01a4 4745545F .ascii "GET_STATUS_INTERFACE \000" + 2370 53544154 + 2370 55535F49 + 2370 4E544552 + 2370 46414345 + 2371 01ba 0000 .space 2 + 2372 .LC26: + 2373 01bc 4745545F .ascii "GET_STATUS_ENDPOINT(EPidx=%u) \000" + 2373 53544154 + 2373 55535F45 + 2373 4E44504F + 2373 494E5428 + 2374 01db 00 .space 1 + 2375 .LC27: + 2376 01dc 5345545F .ascii "SET_FEATURE_ZERO \000" + 2376 46454154 + 2376 5552455F + 2376 5A45524F + 2376 2000 + 2377 01ee 0000 .space 2 + 2378 .LC28: + 2379 01f0 5345545F .ascii "SET_FEATURE_INTERFACE \000" + 2379 46454154 + 2379 5552455F + 2379 494E5445 + 2379 52464143 + 2380 0207 00 .space 1 + 2381 .LC29: + 2382 0208 5345545F .ascii "SET_FEATURE_ENDPOINT \000" + 2382 46454154 + 2382 5552455F + 2382 454E4450 + 2382 4F494E54 + 2383 021e 0000 .space 2 + 2384 .LC30: + 2385 0220 434C4541 .ascii "CLEAR_FEATURE_ZERO \000" + 2385 525F4645 + 2385 41545552 + 2385 455F5A45 + 2385 524F2000 + 2386 .LC31: + 2387 0234 434C4541 .ascii "CLEAR_FEATURE_INTERFACE \000" + 2387 525F4645 + 2387 41545552 + 2387 455F494E + 2387 54455246 + 2388 024d 000000 .space 3 + 2389 .LC32: + 2390 0250 434C4541 .ascii "CLEAR_FEATURE_ENDPOINT(EPidx=%u) \000" + 2390 525F4645 + 2390 41545552 + 2390 455F454E + 2390 44504F49 + 2391 0272 0000 .space 2 + 2392 .LC33: + 2393 0274 53455420 .ascii "SET INTERFACE \000" + 2393 494E5445 + 2393 52464143 + 2393 452000 + 2394 0283 00 .space 1 + 2395 .LC34: + 2396 0284 44454641 .ascii "DEFAULT(req=0x%02x, type=0x%02x) \000" + 2396 554C5428 + 2396 7265713D + 2396 30782530 + 2396 32782C20 + 2397 02a6 0000 .space 2 + 2398 .LC35: + 2399 02a8 5354414C .ascii "STALL!! \000" + 2399 4C212120 + 2399 00 + 2400 02b1 000000 .space 3 + 2401 .LC36: + 2402 02b4 4E4F5F52 .ascii "NO_RCTX_AVAIL! \000" + 2402 4354585F + 2402 41564149 + 2402 4C212000 + 2403 .LC37: + 2404 02c4 25732825 .ascii "%s(%d): entering\015\012\000" + 2404 64293A20 + 2404 656E7465 + 2404 72696E67 + 2404 0D0A00 + 2405 02d7 00 .bss + 2406 .align 2 + 2407 .set .LANCHOR0,. + 0 + 2410 upcd: + 2411 0000 00000000 .space 60 + 2411 00000000 + 2411 00000000 + 2411 00000000 + 2411 00000000 + 2412 .text + 2413 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 pcd_enumerate.c +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:23 .text:00000000 udp_ep0_send_data +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:206 .text:0000016c $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:218 .text:00000190 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:220 .text:00000190 reset_ep +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:306 .text:00000234 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:312 .text:00000240 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:314 .text:00000240 __udp_refill_ep +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:553 .text:00000414 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:559 .text:00000420 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:561 .text:00000420 udp_irq +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1483 .text:00000c50 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1518 .text:00000cd4 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1769 .text:00000f3c $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1818 .text:00000fe8 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1821 .text:00000fe8 udp_unthrottle +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1841 .text:00000ffc $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1845 .text:00001000 $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1848 .text:00001000 udp_refill_ep +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1886 .text:00001020 udp_pullup_on +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1929 .text:00001038 udp_pullup_off +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:1972 .text:00001050 udp_open +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2087 .text:000010e0 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2097 .text:000010fc $a +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2100 .text:000010fc udp_reset +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2220 .rodata:00000020 dev_descriptor +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2238 .rodata:00000034 cfg_descriptor +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2205 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2209 .rodata:00000000 epstate +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2295 .rodata:00000070 __FUNCTION__.6158 +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2298 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2406 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccHwO61c.s:2410 .bss:00000000 upcd + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +debugp +req_ctx_find_get +req_ctx_put +req_ctx_set_state +AT91F_AIC_ConfigureIt diff --git a/firmware/src/os/pio_irq.c b/firmware/src/os/pio_irq.c new file mode 100644 index 0000000..098868c --- /dev/null +++ b/firmware/src/os/pio_irq.c @@ -0,0 +1,149 @@ +/* PIO IRQ Implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include + +struct pioirq_state { + irq_handler_t *handlers[NR_PIO]; + u_int32_t usbmask; + u_int32_t usb_throttled; /* atomic? */ +}; + +static struct pioirq_state pirqs; + +/* low-level handler, used by Cstartup_app.S PIOA fast forcing and + * by regular interrupt handler below */ +void __ramfunc __pio_irq_demux(u_int32_t pio) +{ + u_int8_t send_usb = 0; + int i; + + DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + + for (i = 0; i < NR_PIO; i++) { + if (pio & (1 << i) && pirqs.handlers[i]) + pirqs.handlers[i](i); + if (pirqs.usbmask & (1 << i)) + send_usb = 1; + } + + if (send_usb && !pirqs.usb_throttled) { + struct req_ctx *irq_rctx; + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_PIOIRQ_BUSY); + if (!irq_rctx) { + /* we cannot disable the interrupt, since we have + * non-usb listeners */ + pirqs.usb_throttled = 1; + } else { + struct openpcd_hdr *opcdh; + u_int32_t *regmask; + opcdh = (struct openpcd_hdr *) irq_rctx->data; + regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); + opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + opcdh->reg = 0x00; + opcdh->flags = 0x00; + opcdh->val = 0x00; + + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + } + } + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_PIOA); +} + +/* regular interrupt handler, in case fast forcing for PIOA disabled */ +static void pio_irq_demux(void) +{ + u_int32_t pio = AT91F_PIO_GetInterruptStatus(AT91C_BASE_PIOA); + __pio_irq_demux(pio); +} + +void pio_irq_enable(u_int32_t pio) +{ + AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, pio); +} + +void pio_irq_disable(u_int32_t pio) +{ + AT91F_PIO_InterruptDisable(AT91C_BASE_PIOA, pio); +} + +int pio_irq_register(u_int32_t pio, irq_handler_t *handler) +{ + u_int8_t num = ffs(pio); + + if (num == 0) + return -EINVAL; + num--; + + if (pirqs.handlers[num]) + return -EBUSY; + + pio_irq_disable(pio); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, pio); + pirqs.handlers[num] = handler; + DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + + return 0; +} + +void pio_irq_unregister(u_int32_t pio) +{ + u_int8_t num = ffs(pio); + + if (num == 0) + return; + num--; + + pio_irq_disable(pio); + pirqs.handlers[num] = NULL; +} + +static int pio_irq_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + + switch (poh->cmd) { + case OPENPCD_CMD_PIO_IRQ: + pirqs.usbmask = poh->val; + break; + default: + DEBUGP("UNKNOWN "); + return -EINVAL; + } + + return 0; +} + +void pio_irq_init(void) +{ + AT91F_PIOA_CfgPMC(); + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, + AT91C_AIC_PRIOR_LOWEST, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &pio_irq_demux); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA); +} diff --git a/firmware/src/os/pio_irq.h b/firmware/src/os/pio_irq.h new file mode 100644 index 0000000..33f4656 --- /dev/null +++ b/firmware/src/os/pio_irq.h @@ -0,0 +1,13 @@ +#ifndef _PIO_IRQ_H +#define _PIO_IRQ_H + +#define NR_PIO 32 +typedef void irq_handler_t(u_int32_t pio); + +extern void pio_irq_enable(u_int32_t pio); +extern void pio_irq_disable(u_int32_t pio); +extern int pio_irq_register(u_int32_t pio, irq_handler_t *func); +extern void pio_irq_unregister(u_int32_t pio); +extern void pio_irq_init(void); + +#endif diff --git a/firmware/src/os/pio_irq.lst b/firmware/src/os/pio_irq.lst new file mode 100644 index 0000000..5a74d6d --- /dev/null +++ b/firmware/src/os/pio_irq.lst @@ -0,0 +1,1695 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "pio_irq.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .section .fastrun,"ax",%progbits + 22 .align 2 + 23 .global __pio_irq_demux + 25 __pio_irq_demux: + 26 .LFB273: + 27 .file 1 "src/os/pio_irq.c" + 1:src/os/pio_irq.c **** /* PIO IRQ Implementation for OpenPCD + 2:src/os/pio_irq.c **** * (C) 2006 by Harald Welte + 3:src/os/pio_irq.c **** * + 4:src/os/pio_irq.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/pio_irq.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/pio_irq.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/pio_irq.c **** * (at your option) any later version. + 8:src/os/pio_irq.c **** * + 9:src/os/pio_irq.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/pio_irq.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/pio_irq.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/pio_irq.c **** * GNU General Public License for more details. + 13:src/os/pio_irq.c **** * + 14:src/os/pio_irq.c **** * You should have received a copy of the GNU General Public License + 15:src/os/pio_irq.c **** * along with this program; if not, write to the Free Software + 16:src/os/pio_irq.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/pio_irq.c **** * + 18:src/os/pio_irq.c **** */ + 19:src/os/pio_irq.c **** + 20:src/os/pio_irq.c **** #include + 21:src/os/pio_irq.c **** #include + 22:src/os/pio_irq.c **** #include + 23:src/os/pio_irq.c **** #include + 24:src/os/pio_irq.c **** #include + 25:src/os/pio_irq.c **** #include + 26:src/os/pio_irq.c **** #include + 27:src/os/pio_irq.c **** + 28:src/os/pio_irq.c **** struct pioirq_state { + 29:src/os/pio_irq.c **** irq_handler_t *handlers[NR_PIO]; + 30:src/os/pio_irq.c **** u_int32_t usbmask; + 31:src/os/pio_irq.c **** u_int32_t usb_throttled; /* atomic? */ + 32:src/os/pio_irq.c **** }; + 33:src/os/pio_irq.c **** + 34:src/os/pio_irq.c **** static struct pioirq_state pirqs; + 35:src/os/pio_irq.c **** + 36:src/os/pio_irq.c **** /* low-level handler, used by Cstartup_app.S PIOA fast forcing and + 37:src/os/pio_irq.c **** * by regular interrupt handler below */ + 38:src/os/pio_irq.c **** void __ramfunc __pio_irq_demux(u_int32_t pio) + 39:src/os/pio_irq.c **** { + 28 .loc 1 39 0 + 29 .cfi_startproc + 30 @ Function supports interworking. + 31 @ args = 0, pretend = 0, frame = 0 + 32 @ frame_needed = 0, uses_anonymous_args = 0 + 33 .LVL0: + 34 0000 F0472DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 35 .LCFI0: + 36 .cfi_def_cfa_offset 32 + 37 .loc 1 39 0 + 38 0004 0040A0E1 mov r4, r0 + 39 .cfi_offset 14, -4 + 40 .cfi_offset 10, -8 + 41 .cfi_offset 9, -12 + 42 .cfi_offset 8, -16 + 43 .cfi_offset 7, -20 + 44 .cfi_offset 6, -24 + 45 .cfi_offset 5, -28 + 46 .cfi_offset 4, -32 + 40:src/os/pio_irq.c **** u_int8_t send_usb = 0; + 41:src/os/pio_irq.c **** int i; + 42:src/os/pio_irq.c **** + 43:src/os/pio_irq.c **** DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); + 47 .loc 1 43 0 + 48 0008 04119FE5 ldr r1, .L15 + 49 000c 04019FE5 ldr r0, .L15+4 + 50 .LVL1: + 51 0010 2B20A0E3 mov r2, #43 + 52 0014 0430A0E1 mov r3, r4 + 53 0018 FEFFFFEB bl debugp + 54 .LVL2: + 55 001c F8609FE5 ldr r6, .L15+8 + 44:src/os/pio_irq.c **** + 45:src/os/pio_irq.c **** for (i = 0; i < NR_PIO; i++) { + 56 .loc 1 45 0 + 57 0020 0000A0E3 mov r0, #0 + 40:src/os/pio_irq.c **** u_int8_t send_usb = 0; + 58 .loc 1 40 0 + 59 0024 00A0A0E1 mov sl, r0 + 46:src/os/pio_irq.c **** if (pio & (1 << i) && pirqs.handlers[i]) + 60 .loc 1 46 0 + 61 0028 0190A0E3 mov r9, #1 + 62 .LVL3: + 63 .L4: + 64 002c 1980A0E1 mov r8, r9, asl r0 + 45:src/os/pio_irq.c **** for (i = 0; i < NR_PIO; i++) { + 65 .loc 1 45 0 + 66 0030 015080E2 add r5, r0, #1 + 67 .loc 1 46 0 + 68 0034 040018E1 tst r8, r4 + 69 0038 1975A0E1 mov r7, r9, asl r5 + 70 003c 0300000A beq .L2 + 71 .loc 1 46 0 is_stmt 0 discriminator 1 + 72 0040 003196E7 ldr r3, [r6, r0, asl #2] + 73 0044 000053E3 cmp r3, #0 + 47:src/os/pio_irq.c **** pirqs.handlers[i](i); + 74 .loc 1 47 0 is_stmt 1 + 75 0048 0FE0A011 movne lr, pc + 76 004c 13FF2F11 bxne r3 + 77 .L2: + 48:src/os/pio_irq.c **** if (pirqs.usbmask & (1 << i)) + 78 .loc 1 48 0 + 79 0050 803096E5 ldr r3, [r6, #128] + 49:src/os/pio_irq.c **** send_usb = 1; + 80 .loc 1 49 0 + 81 0054 030018E1 tst r8, r3 + 82 0058 01A0A013 movne sl, #1 + 46:src/os/pio_irq.c **** if (pio & (1 << i) && pirqs.handlers[i]) + 83 .loc 1 46 0 + 84 005c 040017E1 tst r7, r4 + 85 0060 0400000A beq .L8 + 86 0064 053196E7 ldr r3, [r6, r5, asl #2] + 87 0068 000053E3 cmp r3, #0 + 47:src/os/pio_irq.c **** pirqs.handlers[i](i); + 88 .loc 1 47 0 + 89 006c 0500A0E1 mov r0, r5 + 46:src/os/pio_irq.c **** if (pio & (1 << i) && pirqs.handlers[i]) + 90 .loc 1 46 0 + 47:src/os/pio_irq.c **** pirqs.handlers[i](i); + 91 .loc 1 47 0 + 92 0070 0FE0A011 movne lr, pc + 93 0074 13FF2F11 bxne r3 + 94 .L8: + 48:src/os/pio_irq.c **** if (pirqs.usbmask & (1 << i)) + 95 .loc 1 48 0 + 96 0078 80E096E5 ldr lr, [r6, #128] + 45:src/os/pio_irq.c **** for (i = 0; i < NR_PIO; i++) { + 97 .loc 1 45 0 + 98 007c 010085E2 add r0, r5, #1 + 99 .loc 1 49 0 + 100 0080 0E0017E1 tst r7, lr + 101 0084 01A0A013 movne sl, #1 + 102 .LVL4: + 45:src/os/pio_irq.c **** for (i = 0; i < NR_PIO; i++) { + 103 .loc 1 45 0 + 104 0088 200050E3 cmp r0, #32 + 105 008c E6FFFF1A bne .L4 + 50:src/os/pio_irq.c **** } + 51:src/os/pio_irq.c **** + 52:src/os/pio_irq.c **** if (send_usb && !pirqs.usb_throttled) { + 106 .loc 1 52 0 + 107 0090 00005AE3 cmp sl, #0 + 108 0094 0200000A beq .L5 + 109 .loc 1 52 0 is_stmt 0 discriminator 1 + 110 0098 844096E5 ldr r4, [r6, #132] + 111 .LVL5: + 112 009c 000054E3 cmp r4, #0 + 113 00a0 0400000A beq .L13 + 114 .LVL6: + 115 .L5: + 116 .LBB30: + 117 .LBB31: + 118 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 119 .loc 2 97 0 is_stmt 1 + 120 00a4 0420A0E3 mov r2, #4 + 121 00a8 0F3CE0E3 mvn r3, #3840 + 122 00ac 292083E5 str r2, [r3, #41] + 123 .LBE31: + 124 .LBE30: + 53:src/os/pio_irq.c **** struct req_ctx *irq_rctx; + 54:src/os/pio_irq.c **** irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 55:src/os/pio_irq.c **** RCTX_STATE_PIOIRQ_BUSY); + 56:src/os/pio_irq.c **** if (!irq_rctx) { + 57:src/os/pio_irq.c **** /* we cannot disable the interrupt, since we have + 58:src/os/pio_irq.c **** * non-usb listeners */ + 59:src/os/pio_irq.c **** pirqs.usb_throttled = 1; + 60:src/os/pio_irq.c **** } else { + 61:src/os/pio_irq.c **** struct openpcd_hdr *opcdh; + 62:src/os/pio_irq.c **** u_int32_t *regmask; + 63:src/os/pio_irq.c **** opcdh = (struct openpcd_hdr *) irq_rctx->data; + 64:src/os/pio_irq.c **** regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); + 65:src/os/pio_irq.c **** opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + 66:src/os/pio_irq.c **** opcdh->reg = 0x00; + 67:src/os/pio_irq.c **** opcdh->flags = 0x00; + 68:src/os/pio_irq.c **** opcdh->val = 0x00; + 69:src/os/pio_irq.c **** + 70:src/os/pio_irq.c **** irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + 71:src/os/pio_irq.c **** req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 72:src/os/pio_irq.c **** } + 73:src/os/pio_irq.c **** } + 74:src/os/pio_irq.c **** + 75:src/os/pio_irq.c **** AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_PIOA); + 76:src/os/pio_irq.c **** } + 125 .loc 1 76 0 + 126 00b0 F047BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, lr} + 127 00b4 1EFF2FE1 bx lr + 128 .LVL7: + 129 .L13: + 130 .LBB32: + 54:src/os/pio_irq.c **** irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 131 .loc 1 54 0 + 132 00b8 0400A0E1 mov r0, r4 + 133 .LVL8: + 134 00bc FE10A0E3 mov r1, #254 + 135 00c0 8020A0E3 mov r2, #128 + 136 00c4 54C09FE5 ldr ip, .L15+12 + 137 00c8 0FE0A0E1 mov lr, pc + 138 00cc 1CFF2FE1 bx ip + 139 .LVL9: + 56:src/os/pio_irq.c **** if (!irq_rctx) { + 140 .loc 1 56 0 + 141 00d0 003050E2 subs r3, r0, #0 + 142 00d4 0A00000A beq .L14 + 143 .LBB33: + 63:src/os/pio_irq.c **** opcdh = (struct openpcd_hdr *) irq_rctx->data; + 144 .loc 1 63 0 + 145 00d8 08C093E5 ldr ip, [r3, #8] + 146 .LVL10: + 65:src/os/pio_irq.c **** opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + 147 .loc 1 65 0 + 148 00dc 0C10E0E3 mvn r1, #12 + 70:src/os/pio_irq.c **** irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + 149 .loc 1 70 0 + 150 00e0 08E0A0E3 mov lr, #8 @ movhi + 65:src/os/pio_irq.c **** opcdh->cmd = OPENPCD_CMD_PIO_IRQ; + 151 .loc 1 65 0 + 152 00e4 0010CCE5 strb r1, [ip, #0] + 66:src/os/pio_irq.c **** opcdh->reg = 0x00; + 153 .loc 1 66 0 + 154 00e8 0240CCE5 strb r4, [ip, #2] + 67:src/os/pio_irq.c **** opcdh->flags = 0x00; + 155 .loc 1 67 0 + 156 00ec 0140CCE5 strb r4, [ip, #1] + 68:src/os/pio_irq.c **** opcdh->val = 0x00; + 157 .loc 1 68 0 + 158 00f0 0340CCE5 strb r4, [ip, #3] + 71:src/os/pio_irq.c **** req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 159 .loc 1 71 0 + 160 00f4 1210A0E3 mov r1, #18 + 70:src/os/pio_irq.c **** irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + 161 .loc 1 70 0 + 162 00f8 B6E0C3E1 strh lr, [r3, #6] @ movhi + 71:src/os/pio_irq.c **** req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 163 .loc 1 71 0 + 164 00fc FEFFFFEB bl req_ctx_set_state + 165 .LVL11: + 166 0100 E7FFFFEA b .L5 + 167 .LVL12: + 168 .L14: + 169 .LBE33: + 59:src/os/pio_irq.c **** pirqs.usb_throttled = 1; + 170 .loc 1 59 0 + 171 0104 10009FE5 ldr r0, .L15+8 + 172 .LVL13: + 173 0108 0120A0E3 mov r2, #1 + 174 010c 842080E5 str r2, [r0, #132] + 175 0110 E3FFFFEA b .L5 + 176 .L16: + 177 .align 2 + 178 .L15: + 179 0114 00000000 .word .LANCHOR0 + 180 0118 00000000 .word .LC0 + 181 011c 00000000 .word .LANCHOR1 + 182 0120 00000000 .word req_ctx_find_get + 183 .LBE32: + 184 .cfi_endproc + 185 .LFE273: + 187 .text + 188 .align 2 + 190 pio_irq_demux: + 191 .LFB274: + 77:src/os/pio_irq.c **** + 78:src/os/pio_irq.c **** /* regular interrupt handler, in case fast forcing for PIOA disabled */ + 79:src/os/pio_irq.c **** static void pio_irq_demux(void) + 80:src/os/pio_irq.c **** { + 192 .loc 1 80 0 + 193 .cfi_startproc + 194 @ Function supports interworking. + 195 @ args = 0, pretend = 0, frame = 0 + 196 @ frame_needed = 0, uses_anonymous_args = 0 + 197 .LVL14: + 198 .LBB34: + 199 .LBB35: + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 200 .loc 2 708 0 + 201 0000 0B0CE0E3 mvn r0, #2816 + 202 .LBE35: + 203 .LBE34: + 204 .loc 1 80 0 + 205 0004 08402DE9 stmfd sp!, {r3, lr} + 206 .LCFI1: + 207 .cfi_def_cfa_offset 8 + 208 .LBB37: + 209 .LBB36: + 210 .loc 2 708 0 + 211 0008 B30010E5 ldr r0, [r0, #-179] + 212 .LBE36: + 213 .LBE37: + 81:src/os/pio_irq.c **** u_int32_t pio = AT91F_PIO_GetInterruptStatus(AT91C_BASE_PIOA); + 82:src/os/pio_irq.c **** __pio_irq_demux(pio); + 214 .loc 1 82 0 + 215 000c 0C309FE5 ldr r3, .L18 + 216 .cfi_offset 14, -4 + 217 .cfi_offset 3, -8 + 218 0010 0FE0A0E1 mov lr, pc + 219 0014 13FF2FE1 bx r3 + 83:src/os/pio_irq.c **** } + 220 .loc 1 83 0 + 221 0018 0840BDE8 ldmfd sp!, {r3, lr} + 222 001c 1EFF2FE1 bx lr + 223 .L19: + 224 .align 2 + 225 .L18: + 226 0020 00000000 .word __pio_irq_demux + 227 .cfi_endproc + 228 .LFE274: + 230 .align 2 + 231 .global pio_irq_enable + 233 pio_irq_enable: + 234 .LFB275: + 84:src/os/pio_irq.c **** + 85:src/os/pio_irq.c **** void pio_irq_enable(u_int32_t pio) + 86:src/os/pio_irq.c **** { + 235 .loc 1 86 0 + 236 .cfi_startproc + 237 @ Function supports interworking. + 238 @ args = 0, pretend = 0, frame = 0 + 239 @ frame_needed = 0, uses_anonymous_args = 0 + 240 @ link register save eliminated. + 241 .LVL15: + 242 .LBB38: + 243 .LBB39: + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 244 .loc 2 677 0 + 245 0024 0B3CE0E3 mvn r3, #2816 + 246 0028 BF0003E5 str r0, [r3, #-191] + 247 .LBE39: + 248 .LBE38: + 87:src/os/pio_irq.c **** AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, pio); + 88:src/os/pio_irq.c **** } + 249 .loc 1 88 0 + 250 002c 1EFF2FE1 bx lr + 251 .cfi_endproc + 252 .LFE275: + 254 .align 2 + 255 .global pio_irq_disable + 257 pio_irq_disable: + 258 .LFB276: + 89:src/os/pio_irq.c **** + 90:src/os/pio_irq.c **** void pio_irq_disable(u_int32_t pio) + 91:src/os/pio_irq.c **** { + 259 .loc 1 91 0 + 260 .cfi_startproc + 261 @ Function supports interworking. + 262 @ args = 0, pretend = 0, frame = 0 + 263 @ frame_needed = 0, uses_anonymous_args = 0 + 264 @ link register save eliminated. + 265 .LVL16: + 266 .LBB40: + 267 .LBB41: + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 268 .loc 2 688 0 + 269 0030 0B3CE0E3 mvn r3, #2816 + 270 0034 BB0003E5 str r0, [r3, #-187] + 271 .LBE41: + 272 .LBE40: + 92:src/os/pio_irq.c **** AT91F_PIO_InterruptDisable(AT91C_BASE_PIOA, pio); + 93:src/os/pio_irq.c **** } + 273 .loc 1 93 0 + 274 0038 1EFF2FE1 bx lr + 275 .cfi_endproc + 276 .LFE276: + 278 .global __ffssi2 + 279 .align 2 + 280 .global pio_irq_register + 282 pio_irq_register: + 283 .LFB277: + 94:src/os/pio_irq.c **** + 95:src/os/pio_irq.c **** int pio_irq_register(u_int32_t pio, irq_handler_t *handler) + 96:src/os/pio_irq.c **** { + 284 .loc 1 96 0 + 285 .cfi_startproc + 286 @ Function supports interworking. + 287 @ args = 0, pretend = 0, frame = 0 + 288 @ frame_needed = 0, uses_anonymous_args = 0 + 289 .LVL17: + 290 003c F0402DE9 stmfd sp!, {r4, r5, r6, r7, lr} + 291 .LCFI2: + 292 .cfi_def_cfa_offset 20 + 293 0040 0CD04DE2 sub sp, sp, #12 + 294 .LCFI3: + 295 .cfi_def_cfa_offset 32 + 296 .loc 1 96 0 + 297 0044 0040A0E1 mov r4, r0 + 298 .cfi_offset 14, -4 + 299 .cfi_offset 7, -8 + 300 .cfi_offset 6, -12 + 301 .cfi_offset 5, -16 + 302 .cfi_offset 4, -20 + 303 0048 0150A0E1 mov r5, r1 + 97:src/os/pio_irq.c **** u_int8_t num = ffs(pio); + 304 .loc 1 97 0 + 305 004c FEFFFFEB bl __ffssi2 + 306 .LVL18: + 98:src/os/pio_irq.c **** + 99:src/os/pio_irq.c **** if (num == 0) + 307 .loc 1 99 0 + 308 0050 FF0010E2 ands r0, r0, #255 + 309 .LVL19: + 100:src/os/pio_irq.c **** return -EINVAL; + 310 .loc 1 100 0 + 311 0054 1500E003 mvneq r0, #21 + 99:src/os/pio_irq.c **** if (num == 0) + 312 .loc 1 99 0 + 313 0058 0200001A bne .L26 + 314 .L23: + 101:src/os/pio_irq.c **** num--; + 102:src/os/pio_irq.c **** + 103:src/os/pio_irq.c **** if (pirqs.handlers[num]) + 104:src/os/pio_irq.c **** return -EBUSY; + 105:src/os/pio_irq.c **** + 106:src/os/pio_irq.c **** pio_irq_disable(pio); + 107:src/os/pio_irq.c **** AT91F_PIO_CfgInput(AT91C_BASE_PIOA, pio); + 108:src/os/pio_irq.c **** pirqs.handlers[num] = handler; + 109:src/os/pio_irq.c **** DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 110:src/os/pio_irq.c **** + 111:src/os/pio_irq.c **** return 0; + 112:src/os/pio_irq.c **** } + 315 .loc 1 112 0 + 316 005c 0CD08DE2 add sp, sp, #12 + 317 0060 F040BDE8 ldmfd sp!, {r4, r5, r6, r7, lr} + 318 0064 1EFF2FE1 bx lr + 319 .L26: + 320 .LVL20: + 101:src/os/pio_irq.c **** num--; + 321 .loc 1 101 0 + 322 0068 010040E2 sub r0, r0, #1 + 323 .LVL21: + 103:src/os/pio_irq.c **** if (pirqs.handlers[num]) + 324 .loc 1 103 0 + 325 006c 44609FE5 ldr r6, .L27 + 326 0070 FFC000E2 and ip, r0, #255 + 327 0074 0C7196E7 ldr r7, [r6, ip, asl #2] + 328 0078 000057E3 cmp r7, #0 + 104:src/os/pio_irq.c **** return -EBUSY; + 329 .loc 1 104 0 + 330 007c 0F00E013 mvnne r0, #15 + 331 .LVL22: + 103:src/os/pio_irq.c **** if (pirqs.handlers[num]) + 332 .loc 1 103 0 + 333 0080 F5FFFF1A bne .L23 + 334 .LVL23: + 335 .LBB42: + 336 .LBB43: + 337 .LBB44: + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 338 .loc 2 688 0 + 339 0084 0BECE0E3 mvn lr, #2816 + 340 0088 BB400EE5 str r4, [lr, #-187] + 341 .LVL24: + 342 .LBE44: + 343 .LBE43: + 344 .LBE42: + 109:src/os/pio_irq.c **** DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 345 .loc 1 109 0 + 346 008c 28009FE5 ldr r0, .L27+4 + 347 .LBB45: + 348 .LBB46: + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 349 .loc 2 417 0 + 350 0090 EB400EE5 str r4, [lr, #-235] + 351 .LBE46: + 352 .LBE45: + 109:src/os/pio_irq.c **** DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 353 .loc 1 109 0 + 354 0094 24109FE5 ldr r1, .L27+8 + 355 .LBB48: + 356 .LBB47: + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 357 .loc 2 418 0 + 358 0098 FF400EE5 str r4, [lr, #-255] + 359 .LBE47: + 360 .LBE48: + 109:src/os/pio_irq.c **** DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 361 .loc 1 109 0 + 362 009c 6D20A0E3 mov r2, #109 + 363 00a0 0530A0E1 mov r3, r5 + 108:src/os/pio_irq.c **** pirqs.handlers[num] = handler; + 364 .loc 1 108 0 + 365 00a4 0C5186E7 str r5, [r6, ip, asl #2] + 109:src/os/pio_irq.c **** DEBUGPCRF("registering handler %p for PIOA %u", handler, num); + 366 .loc 1 109 0 + 367 00a8 00C08DE5 str ip, [sp, #0] + 368 00ac FEFFFFEB bl debugp + 111:src/os/pio_irq.c **** return 0; + 369 .loc 1 111 0 + 370 00b0 0700A0E1 mov r0, r7 + 371 00b4 E8FFFFEA b .L23 + 372 .L28: + 373 .align 2 + 374 .L27: + 375 00b8 00000000 .word .LANCHOR1 + 376 00bc 24000000 .word .LC1 + 377 00c0 10000000 .word .LANCHOR0+16 + 378 .cfi_endproc + 379 .LFE277: + 381 .align 2 + 382 .global pio_irq_unregister + 384 pio_irq_unregister: + 385 .LFB278: + 113:src/os/pio_irq.c **** + 114:src/os/pio_irq.c **** void pio_irq_unregister(u_int32_t pio) + 115:src/os/pio_irq.c **** { + 386 .loc 1 115 0 + 387 .cfi_startproc + 388 @ Function supports interworking. + 389 @ args = 0, pretend = 0, frame = 0 + 390 @ frame_needed = 0, uses_anonymous_args = 0 + 391 .LVL25: + 392 00c4 10402DE9 stmfd sp!, {r4, lr} + 393 .LCFI4: + 394 .cfi_def_cfa_offset 8 + 395 .loc 1 115 0 + 396 00c8 0040A0E1 mov r4, r0 + 397 .cfi_offset 14, -4 + 398 .cfi_offset 4, -8 + 116:src/os/pio_irq.c **** u_int8_t num = ffs(pio); + 399 .loc 1 116 0 + 400 00cc FEFFFFEB bl __ffssi2 + 401 .LVL26: + 117:src/os/pio_irq.c **** + 118:src/os/pio_irq.c **** if (num == 0) + 402 .loc 1 118 0 + 403 00d0 FF0010E2 ands r0, r0, #255 + 404 .LVL27: + 405 00d4 0600000A beq .L29 + 406 .LVL28: + 119:src/os/pio_irq.c **** return; + 120:src/os/pio_irq.c **** num--; + 407 .loc 1 120 0 + 408 00d8 01C040E2 sub ip, r0, #1 + 121:src/os/pio_irq.c **** + 122:src/os/pio_irq.c **** pio_irq_disable(pio); + 123:src/os/pio_irq.c **** pirqs.handlers[num] = NULL; + 409 .loc 1 123 0 + 410 00dc 18309FE5 ldr r3, .L31 + 411 00e0 FF000CE2 and r0, ip, #255 + 412 .LVL29: + 413 .LBB49: + 414 .LBB50: + 415 .LBB51: + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 416 .loc 2 688 0 + 417 00e4 0B1CE0E3 mvn r1, #2816 + 418 .LBE51: + 419 .LBE50: + 420 .LBE49: + 421 .loc 1 123 0 + 422 00e8 0020A0E3 mov r2, #0 + 423 .LBB54: + 424 .LBB53: + 425 .LBB52: + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 426 .loc 2 688 0 + 427 00ec BB4001E5 str r4, [r1, #-187] + 428 .LBE52: + 429 .LBE53: + 430 .LBE54: + 431 .loc 1 123 0 + 432 00f0 002183E7 str r2, [r3, r0, asl #2] + 433 .LVL30: + 434 .L29: + 124:src/os/pio_irq.c **** } + 435 .loc 1 124 0 + 436 00f4 1040BDE8 ldmfd sp!, {r4, lr} + 437 00f8 1EFF2FE1 bx lr + 438 .L32: + 439 .align 2 + 440 .L31: + 441 00fc 00000000 .word .LANCHOR1 + 442 .cfi_endproc + 443 .LFE278: + 445 .align 2 + 446 .global pio_irq_init + 448 pio_irq_init: + 449 .LFB280: + 125:src/os/pio_irq.c **** + 126:src/os/pio_irq.c **** static int pio_irq_usb_in(struct req_ctx *rctx) + 127:src/os/pio_irq.c **** { + 128:src/os/pio_irq.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 129:src/os/pio_irq.c **** + 130:src/os/pio_irq.c **** switch (poh->cmd) { + 131:src/os/pio_irq.c **** case OPENPCD_CMD_PIO_IRQ: + 132:src/os/pio_irq.c **** pirqs.usbmask = poh->val; + 133:src/os/pio_irq.c **** break; + 134:src/os/pio_irq.c **** default: + 135:src/os/pio_irq.c **** DEBUGP("UNKNOWN "); + 136:src/os/pio_irq.c **** return -EINVAL; + 137:src/os/pio_irq.c **** } + 138:src/os/pio_irq.c **** + 139:src/os/pio_irq.c **** return 0; + 140:src/os/pio_irq.c **** } + 141:src/os/pio_irq.c **** + 142:src/os/pio_irq.c **** void pio_irq_init(void) + 143:src/os/pio_irq.c **** { + 450 .loc 1 143 0 + 451 .cfi_startproc + 452 @ Function supports interworking. + 453 @ args = 0, pretend = 0, frame = 0 + 454 @ frame_needed = 0, uses_anonymous_args = 0 + 455 .LVL31: + 456 0100 10402DE9 stmfd sp!, {r4, lr} + 457 .LCFI5: + 458 .cfi_def_cfa_offset 8 + 144:src/os/pio_irq.c **** AT91F_PIOA_CfgPMC(); + 145:src/os/pio_irq.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, + 459 .loc 1 145 0 + 460 0104 0020A0E3 mov r2, #0 + 461 .LBB55: + 462 .LBB56: + 463 .LBB57: + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 464 .loc 2 940 0 + 465 0108 0440A0E3 mov r4, #4 + 466 .cfi_offset 14, -4 + 467 .cfi_offset 4, -8 + 468 010c 03ECE0E3 mvn lr, #768 + 469 .LBE57: + 470 .LBE56: + 471 .LBE55: + 472 .loc 1 145 0 + 473 0110 2CC09FE5 ldr ip, .L34 + 143:src/os/pio_irq.c **** { + 474 .loc 1 143 0 + 475 0114 08D04DE2 sub sp, sp, #8 + 476 .LCFI6: + 477 .cfi_def_cfa_offset 16 + 478 .loc 1 145 0 + 479 0118 0230A0E1 mov r3, r2 + 480 .LBB60: + 481 .LBB59: + 482 .LBB58: + 483 .loc 2 940 0 + 484 011c EF400EE5 str r4, [lr, #-239] + 485 .LBE58: + 486 .LBE59: + 487 .LBE60: + 488 .loc 1 145 0 + 489 0120 20009FE5 ldr r0, .L34+4 + 490 0124 0210A0E3 mov r1, #2 + 491 0128 00C08DE5 str ip, [sp, #0] + 492 012c FEFFFFEB bl AT91F_AIC_ConfigureIt + 493 .LVL32: + 494 .LBB61: + 495 .LBB62: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 496 .loc 2 70 0 + 497 0130 0F3CE0E3 mvn r3, #3840 + 498 0134 214083E5 str r4, [r3, #33] + 499 .LBE62: + 500 .LBE61: + 146:src/os/pio_irq.c **** AT91C_AIC_PRIOR_LOWEST, + 147:src/os/pio_irq.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &pio_irq_demux); + 148:src/os/pio_irq.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA); + 149:src/os/pio_irq.c **** } + 501 .loc 1 149 0 + 502 0138 08D08DE2 add sp, sp, #8 + 503 013c 1040BDE8 ldmfd sp!, {r4, lr} + 504 0140 1EFF2FE1 bx lr + 505 .L35: + 506 .align 2 + 507 .L34: + 508 0144 00000000 .word pio_irq_demux + 509 0148 00F0FFFF .word -4096 + 510 .cfi_endproc + 511 .LFE280: + 513 .section .rodata + 514 .align 2 + 515 .set .LANCHOR0,. + 0 + 518 __FUNCTION__.5785: + 519 0000 5F5F7069 .ascii "__pio_irq_demux\000" + 519 6F5F6972 + 519 715F6465 + 519 6D757800 + 522 __FUNCTION__.5807: + 523 0010 70696F5F .ascii "pio_irq_register\000" + 523 6972715F + 523 72656769 + 523 73746572 + 523 00 + 524 0021 000000 .section .rodata.str1.4,"aMS",%progbits,1 + 525 .align 2 + 526 .LC0: + 527 0000 25732825 .ascii "%s(%d): PIO_ISR_STATUS = 0x%08x\015\012\000" + 527 64293A20 + 527 50494F5F + 527 4953525F + 527 53544154 + 528 0022 0000 .space 2 + 529 .LC1: + 530 0024 25732825 .ascii "%s(%d): registering handler %p for PIOA %u\015\012\000" + 530 64293A20 + 530 72656769 + 530 73746572 + 530 696E6720 + 531 0051 000000 .bss + 532 .align 2 + 533 .set .LANCHOR1,. + 0 + 536 pirqs: + 537 0000 00000000 .space 136 + 537 00000000 + 537 00000000 + 537 00000000 + 537 00000000 + 538 .text + 539 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 pio_irq.c +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:22 .fastrun:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:25 .fastrun:00000000 __pio_irq_demux +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:179 .fastrun:00000114 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:188 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:190 .text:00000000 pio_irq_demux +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:226 .text:00000020 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:230 .text:00000024 $a +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:233 .text:00000024 pio_irq_enable +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:257 .text:00000030 pio_irq_disable +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:282 .text:0000003c pio_irq_register +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:375 .text:000000b8 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:381 .text:000000c4 $a +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:384 .text:000000c4 pio_irq_unregister +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:441 .text:000000fc $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:445 .text:00000100 $a +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:448 .text:00000100 pio_irq_init +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:508 .text:00000144 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:514 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:518 .rodata:00000000 __FUNCTION__.5785 +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:522 .rodata:00000010 __FUNCTION__.5807 +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:525 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:532 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTjx0mf.s:536 .bss:00000000 pirqs + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +debugp +req_ctx_set_state +req_ctx_find_get +__ffssi2 +AT91F_AIC_ConfigureIt diff --git a/firmware/src/os/pit.c b/firmware/src/os/pit.c new file mode 100644 index 0000000..50ec19f --- /dev/null +++ b/firmware/src/os/pit.c @@ -0,0 +1,157 @@ +/* Periodic Interval Timer Implementation for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + * + * TODO: handle jiffies wrap correctly! + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "../openpcd.h" + +/* PIT runs at MCK/16 (= 3MHz) */ +#define PIV_MS(x) (x * 3000) + +static struct timer_list *timers; + +volatile unsigned long jiffies; + +static void __timer_insert(struct timer_list *new) +{ + struct timer_list *tl, *tl_prev = NULL; + + if (!timers) { + /* optimize for the common, fast case */ + new->next = NULL; + timers = new; + return; + } + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl->expires < new->expires) { + /* we need ot add just before this one */ + if (!tl_prev) { + new->next = timers; + timers = new; + } else { + new->next = tl; + tl_prev->next = new; + } + } + tl_prev = tl; + } +} + +static int __timer_remove(struct timer_list *old) +{ + struct timer_list *tl, *tl_prev = NULL; + + for (tl = timers; tl != NULL; tl = tl->next) { + if (tl == old) { + if (tl == timers) + timers = tl->next; + else + tl_prev->next = tl->next; + return 1; + } + tl_prev = tl; + } + + return 0; +} + +int timer_del(struct timer_list *tl) +{ + unsigned long flags; + int ret; + + local_irq_save(flags); + ret = __timer_remove(tl); + local_irq_restore(flags); + + return ret; +} + +void timer_add(struct timer_list *tl) +{ + unsigned long flags; + + local_irq_save(flags); + __timer_insert(tl); + local_irq_restore(flags); +} + +static void pit_irq(u_int32_t sr) +{ + struct timer_list *tl, *next; + + if (!(sr & 0x1)) + return; + + jiffies += *AT91C_PITC_PIVR >> 20; + + /* this is the most simple/stupid algorithm one can come up with, but + * hey, we're on a small embedded platform with only a hand ful + * of timers, at all */ + for (tl = timers; tl != NULL; tl = next) { + next = tl->next; + if (tl->expires <= jiffies) { + /* delete timer from list */ + timer_del(tl); + tl->function(tl->data); + } + } +} + +void pit_mdelay(u_int32_t ms) +{ + u_int32_t end; + + end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; + + while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } +} + +void mdelay(u_int32_t ms) +{ + return pit_mdelay(ms); +} + +void usleep(u_int32_t us) +{ + return; + return pit_mdelay(us/1000); +} + +void pit_init(void) +{ + AT91F_PITC_CfgPMC(); + + AT91F_PITInit(AT91C_BASE_PITC, 1000000/HZ /* uS */, 48 /* MHz */); + + sysirq_register(AT91SAM7_SYSIRQ_PIT, &pit_irq); + + AT91F_PITEnableInt(AT91C_BASE_PITC); +} diff --git a/firmware/src/os/pit.h b/firmware/src/os/pit.h new file mode 100644 index 0000000..4a25cc1 --- /dev/null +++ b/firmware/src/os/pit.h @@ -0,0 +1,25 @@ +#ifndef _PIT_H +#define _PIT_H + +#include + +#define HZ 100 + +/* This API (but not the code) is modelled after the Linux API */ + +struct timer_list { + struct timer_list *next; + unsigned long expires; + void (*function)(void *data); + void *data; +}; + +extern volatile unsigned long jiffies; + +extern void timer_add(struct timer_list *timer); +extern int timer_del(struct timer_list *timer); + +extern void pit_init(void); +extern void pit_mdelay(u_int32_t ms); + +#endif diff --git a/firmware/src/os/pit.lst b/firmware/src/os/pit.lst new file mode 100644 index 0000000..df848ee --- /dev/null +++ b/firmware/src/os/pit.lst @@ -0,0 +1,2144 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "pit.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global timer_del + 24 timer_del: + 25 .LFB275: + 26 .file 1 "src/os/pit.c" + 1:src/os/pit.c **** /* Periodic Interval Timer Implementation for OpenPCD + 2:src/os/pit.c **** * (C) 2006 by Harald Welte + 3:src/os/pit.c **** * + 4:src/os/pit.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/pit.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/pit.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/pit.c **** * (at your option) any later version. + 8:src/os/pit.c **** * + 9:src/os/pit.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/pit.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/pit.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/pit.c **** * GNU General Public License for more details. + 13:src/os/pit.c **** * + 14:src/os/pit.c **** * You should have received a copy of the GNU General Public License + 15:src/os/pit.c **** * along with this program; if not, write to the Free Software + 16:src/os/pit.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/pit.c **** * + 18:src/os/pit.c **** * + 19:src/os/pit.c **** * TODO: handle jiffies wrap correctly! + 20:src/os/pit.c **** */ + 21:src/os/pit.c **** + 22:src/os/pit.c **** #include + 23:src/os/pit.c **** #include + 24:src/os/pit.c **** #include + 25:src/os/pit.c **** + 26:src/os/pit.c **** #include + 27:src/os/pit.c **** #include + 28:src/os/pit.c **** #include + 29:src/os/pit.c **** #include + 30:src/os/pit.c **** #include + 31:src/os/pit.c **** + 32:src/os/pit.c **** #include "../openpcd.h" + 33:src/os/pit.c **** + 34:src/os/pit.c **** /* PIT runs at MCK/16 (= 3MHz) */ + 35:src/os/pit.c **** #define PIV_MS(x) (x * 3000) + 36:src/os/pit.c **** + 37:src/os/pit.c **** static struct timer_list *timers; + 38:src/os/pit.c **** + 39:src/os/pit.c **** volatile unsigned long jiffies; + 40:src/os/pit.c **** + 41:src/os/pit.c **** static void __timer_insert(struct timer_list *new) + 42:src/os/pit.c **** { + 43:src/os/pit.c **** struct timer_list *tl, *tl_prev = NULL; + 44:src/os/pit.c **** + 45:src/os/pit.c **** if (!timers) { + 46:src/os/pit.c **** /* optimize for the common, fast case */ + 47:src/os/pit.c **** new->next = NULL; + 48:src/os/pit.c **** timers = new; + 49:src/os/pit.c **** return; + 50:src/os/pit.c **** } + 51:src/os/pit.c **** + 52:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 53:src/os/pit.c **** if (tl->expires < new->expires) { + 54:src/os/pit.c **** /* we need ot add just before this one */ + 55:src/os/pit.c **** if (!tl_prev) { + 56:src/os/pit.c **** new->next = timers; + 57:src/os/pit.c **** timers = new; + 58:src/os/pit.c **** } else { + 59:src/os/pit.c **** new->next = tl; + 60:src/os/pit.c **** tl_prev->next = new; + 61:src/os/pit.c **** } + 62:src/os/pit.c **** } + 63:src/os/pit.c **** tl_prev = tl; + 64:src/os/pit.c **** } + 65:src/os/pit.c **** } + 66:src/os/pit.c **** + 67:src/os/pit.c **** static int __timer_remove(struct timer_list *old) + 68:src/os/pit.c **** { + 69:src/os/pit.c **** struct timer_list *tl, *tl_prev = NULL; + 70:src/os/pit.c **** + 71:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 72:src/os/pit.c **** if (tl == old) { + 73:src/os/pit.c **** if (tl == timers) + 74:src/os/pit.c **** timers = tl->next; + 75:src/os/pit.c **** else + 76:src/os/pit.c **** tl_prev->next = tl->next; + 77:src/os/pit.c **** return 1; + 78:src/os/pit.c **** } + 79:src/os/pit.c **** tl_prev = tl; + 80:src/os/pit.c **** } + 81:src/os/pit.c **** + 82:src/os/pit.c **** return 0; + 83:src/os/pit.c **** } + 84:src/os/pit.c **** + 85:src/os/pit.c **** int timer_del(struct timer_list *tl) + 86:src/os/pit.c **** { + 27 .loc 1 86 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 34 .LBB28: + 87:src/os/pit.c **** unsigned long flags; + 88:src/os/pit.c **** int ret; + 89:src/os/pit.c **** + 90:src/os/pit.c **** local_irq_save(flags); + 35 .loc 1 90 0 + 36 @ 90 "src/os/pit.c" 1 + 37 0000 00C00FE1 mrs ip, cpsr @ local_irq_save + 38 0004 80308CE3 orr r3, ip, #128 + 39 0008 03F021E1 msr cpsr_c, r3 + 40 @ 0 "" 2 + 41 .LVL1: + 42 .LBE28: + 43 .LBB29: + 44 .LBB31: + 71:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 45 .loc 1 71 0 + 46 000c 60109FE5 ldr r1, .L14 + 47 0010 002091E5 ldr r2, [r1, #0] + 48 .LVL2: + 49 0014 000052E3 cmp r2, #0 + 82:src/os/pit.c **** return 0; + 50 .loc 1 82 0 + 51 0018 0200A001 moveq r0, r2 + 52 .LVL3: + 71:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 53 .loc 1 71 0 + 54 001c 0900000A beq .L2 + 72:src/os/pit.c **** if (tl == old) { + 55 .loc 1 72 0 + 56 0020 020050E1 cmp r0, r2 + 57 0024 0300001A bne .L9 + 58 0028 0D0000EA b .L13 + 59 .LVL4: + 60 .L6: + 61 002c 030050E1 cmp r0, r3 + 62 0030 0600000A beq .L12 + 63 0034 0320A0E1 mov r2, r3 + 64 .LVL5: + 65 .L9: + 71:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 66 .loc 1 71 0 + 67 0038 003092E5 ldr r3, [r2, #0] + 68 .LVL6: + 69 003c 000053E3 cmp r3, #0 + 70 0040 F9FFFF1A bne .L6 + 82:src/os/pit.c **** return 0; + 71 .loc 1 82 0 + 72 0044 0300A0E1 mov r0, r3 + 73 .LVL7: + 74 .L2: + 75 .LBE31: + 76 .LBE29: + 91:src/os/pit.c **** ret = __timer_remove(tl); + 92:src/os/pit.c **** local_irq_restore(flags); + 77 .loc 1 92 0 + 78 @ 92 "src/os/pit.c" 1 + 79 0048 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 80 + 81 @ 0 "" 2 + 93:src/os/pit.c **** + 94:src/os/pit.c **** return ret; + 95:src/os/pit.c **** } + 82 .loc 1 95 0 + 83 004c 1EFF2FE1 bx lr + 84 .LVL8: + 85 .L12: + 86 .LBB33: + 87 .LBB30: + 76:src/os/pit.c **** tl_prev->next = tl->next; + 88 .loc 1 76 0 + 89 0050 003090E5 ldr r3, [r0, #0] + 90 .LVL9: + 77:src/os/pit.c **** return 1; + 91 .loc 1 77 0 + 92 0054 0100A0E3 mov r0, #1 + 76:src/os/pit.c **** tl_prev->next = tl->next; + 93 .loc 1 76 0 + 94 0058 003082E5 str r3, [r2, #0] + 95 .LBE30: + 96 .LBE33: + 92:src/os/pit.c **** local_irq_restore(flags); + 97 .loc 1 92 0 + 98 @ 92 "src/os/pit.c" 1 + 99 005c 0CF021E1 msr cpsr_c, ip @ local_irq_restore + 100 + 101 @ 0 "" 2 + 102 .loc 1 95 0 + 103 0060 1EFF2FE1 bx lr + 104 .LVL10: + 105 .L13: + 106 .LBB34: + 107 .LBB32: + 74:src/os/pit.c **** timers = tl->next; + 108 .loc 1 74 0 + 109 0064 002090E5 ldr r2, [r0, #0] + 77:src/os/pit.c **** return 1; + 110 .loc 1 77 0 + 111 0068 0100A0E3 mov r0, #1 + 74:src/os/pit.c **** timers = tl->next; + 112 .loc 1 74 0 + 113 006c 002081E5 str r2, [r1, #0] + 114 0070 F4FFFFEA b .L2 + 115 .L15: + 116 .align 2 + 117 .L14: + 118 0074 00000000 .word .LANCHOR0 + 119 .LBE32: + 120 .LBE34: + 121 .cfi_endproc + 122 .LFE275: + 124 .align 2 + 126 pit_irq: + 127 .LFB277: + 96:src/os/pit.c **** + 97:src/os/pit.c **** void timer_add(struct timer_list *tl) + 98:src/os/pit.c **** { + 99:src/os/pit.c **** unsigned long flags; + 100:src/os/pit.c **** + 101:src/os/pit.c **** local_irq_save(flags); + 102:src/os/pit.c **** __timer_insert(tl); + 103:src/os/pit.c **** local_irq_restore(flags); + 104:src/os/pit.c **** } + 105:src/os/pit.c **** + 106:src/os/pit.c **** static void pit_irq(u_int32_t sr) + 107:src/os/pit.c **** { + 128 .loc 1 107 0 + 129 .cfi_startproc + 130 @ Function supports interworking. + 131 @ args = 0, pretend = 0, frame = 0 + 132 @ frame_needed = 0, uses_anonymous_args = 0 + 133 .LVL11: + 108:src/os/pit.c **** struct timer_list *tl, *next; + 109:src/os/pit.c **** + 110:src/os/pit.c **** if (!(sr & 0x1)) + 134 .loc 1 110 0 + 135 0078 010010E3 tst r0, #1 + 107:src/os/pit.c **** { + 136 .loc 1 107 0 + 137 007c 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 138 .LCFI0: + 139 .cfi_def_cfa_offset 16 + 140 .loc 1 110 0 + 141 0080 1A00000A beq .L16 + 142 .cfi_offset 14, -4 + 143 .cfi_offset 6, -8 + 144 .cfi_offset 5, -12 + 145 .cfi_offset 4, -16 + 111:src/os/pit.c **** return; + 112:src/os/pit.c **** + 113:src/os/pit.c **** jiffies += *AT91C_PITC_PIVR >> 20; + 146 .loc 1 113 0 + 147 0084 6C609FE5 ldr r6, .L22 + 114:src/os/pit.c **** + 115:src/os/pit.c **** /* this is the most simple/stupid algorithm one can come up with, but + 116:src/os/pit.c **** * hey, we're on a small embedded platform with only a hand ful + 117:src/os/pit.c **** * of timers, at all */ + 118:src/os/pit.c **** for (tl = timers; tl != NULL; tl = next) { + 148 .loc 1 118 0 + 149 0088 6C109FE5 ldr r1, .L22+4 + 113:src/os/pit.c **** jiffies += *AT91C_PITC_PIVR >> 20; + 150 .loc 1 113 0 + 151 008c 0040E0E3 mvn r4, #0 + 152 0090 C72214E5 ldr r2, [r4, #-711] + 153 0094 000096E5 ldr r0, [r6, #0] + 154 .LVL12: + 155 .loc 1 118 0 + 156 0098 004091E5 ldr r4, [r1, #0] + 157 .LVL13: + 113:src/os/pit.c **** jiffies += *AT91C_PITC_PIVR >> 20; + 158 .loc 1 113 0 + 159 009c 223A80E0 add r3, r0, r2, lsr #20 + 160 .loc 1 118 0 + 161 00a0 000054E3 cmp r4, #0 + 113:src/os/pit.c **** jiffies += *AT91C_PITC_PIVR >> 20; + 162 .loc 1 113 0 + 163 00a4 003086E5 str r3, [r6, #0] + 164 .loc 1 118 0 + 165 00a8 0300001A bne .L21 + 166 00ac 0F0000EA b .L16 + 167 .LVL14: + 168 .L18: + 169 .loc 1 118 0 is_stmt 0 discriminator 1 + 170 00b0 000055E3 cmp r5, #0 + 171 00b4 0D00000A beq .L16 + 172 .L20: + 173 .loc 1 118 0 + 174 00b8 0540A0E1 mov r4, r5 + 175 .LVL15: + 176 .L21: + 119:src/os/pit.c **** next = tl->next; + 120:src/os/pit.c **** if (tl->expires <= jiffies) { + 177 .loc 1 120 0 is_stmt 1 + 178 00bc 045094E5 ldr r5, [r4, #4] + 179 00c0 00C096E5 ldr ip, [r6, #0] + 180 00c4 0C0055E1 cmp r5, ip + 119:src/os/pit.c **** next = tl->next; + 181 .loc 1 119 0 + 182 00c8 005094E5 ldr r5, [r4, #0] + 183 .LVL16: + 184 .loc 1 120 0 + 185 00cc F7FFFF8A bhi .L18 + 121:src/os/pit.c **** /* delete timer from list */ + 122:src/os/pit.c **** timer_del(tl); + 186 .loc 1 122 0 + 187 00d0 0400A0E1 mov r0, r4 + 188 00d4 FEFFFFEB bl timer_del + 189 .LVL17: + 123:src/os/pit.c **** tl->function(tl->data); + 190 .loc 1 123 0 + 191 00d8 0C0094E5 ldr r0, [r4, #12] + 192 00dc 08C094E5 ldr ip, [r4, #8] + 193 00e0 0FE0A0E1 mov lr, pc + 194 00e4 1CFF2FE1 bx ip + 195 .LVL18: + 118:src/os/pit.c **** for (tl = timers; tl != NULL; tl = next) { + 196 .loc 1 118 0 + 197 00e8 000055E3 cmp r5, #0 + 198 00ec F1FFFF1A bne .L20 + 199 .LVL19: + 200 .L16: + 124:src/os/pit.c **** } + 125:src/os/pit.c **** } + 126:src/os/pit.c **** } + 201 .loc 1 126 0 + 202 00f0 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 203 00f4 1EFF2FE1 bx lr + 204 .L23: + 205 .align 2 + 206 .L22: + 207 00f8 00000000 .word jiffies + 208 00fc 00000000 .word .LANCHOR0 + 209 .cfi_endproc + 210 .LFE277: + 212 .align 2 + 213 .global timer_add + 215 timer_add: + 216 .LFB276: + 98:src/os/pit.c **** { + 217 .loc 1 98 0 + 218 .cfi_startproc + 219 @ Function supports interworking. + 220 @ args = 0, pretend = 0, frame = 0 + 221 @ frame_needed = 0, uses_anonymous_args = 0 + 222 @ link register save eliminated. + 223 .LVL20: + 224 0100 70002DE9 stmfd sp!, {r4, r5, r6} + 225 .LCFI1: + 226 .cfi_def_cfa_offset 12 + 227 .LBB35: + 101:src/os/pit.c **** local_irq_save(flags); + 228 .loc 1 101 0 + 229 @ 101 "src/os/pit.c" 1 + 230 0104 00600FE1 mrs r6, cpsr @ local_irq_save + 231 0108 803086E3 orr r3, r6, #128 + 232 010c 03F021E1 msr cpsr_c, r3 + 233 @ 0 "" 2 + 234 .LVL21: + 235 .LBE35: + 236 .LBB36: + 237 .LBB37: + 45:src/os/pit.c **** if (!timers) { + 238 .loc 1 45 0 + 239 0110 5C509FE5 ldr r5, .L31 + 240 .cfi_offset 6, -4 + 241 .cfi_offset 5, -8 + 242 .cfi_offset 4, -12 + 243 0114 004095E5 ldr r4, [r5, #0] + 244 0118 000054E3 cmp r4, #0 + 47:src/os/pit.c **** new->next = NULL; + 245 .loc 1 47 0 + 246 011c 00408005 streq r4, [r0, #0] + 48:src/os/pit.c **** timers = new; + 247 .loc 1 48 0 + 248 0120 00008505 streq r0, [r5, #0] + 45:src/os/pit.c **** if (!timers) { + 249 .loc 1 45 0 + 250 0124 0F00000A beq .L26 + 53:src/os/pit.c **** if (tl->expires < new->expires) { + 251 .loc 1 53 0 + 252 0128 04C090E5 ldr ip, [r0, #4] + 253 012c 0430A0E1 mov r3, r4 + 254 0130 0020A0E3 mov r2, #0 + 255 .LVL22: + 256 .L29: + 257 0134 041093E5 ldr r1, [r3, #4] + 258 0138 0C0051E1 cmp r1, ip + 259 013c 0400002A bcs .L27 + 55:src/os/pit.c **** if (!tl_prev) { + 260 .loc 1 55 0 + 261 0140 000052E3 cmp r2, #0 + 59:src/os/pit.c **** new->next = tl; + 262 .loc 1 59 0 + 263 0144 00308015 strne r3, [r0, #0] + 60:src/os/pit.c **** tl_prev->next = new; + 264 .loc 1 60 0 + 265 0148 00008215 strne r0, [r2, #0] + 56:src/os/pit.c **** new->next = timers; + 266 .loc 1 56 0 + 267 014c 00408005 streq r4, [r0, #0] + 57:src/os/pit.c **** timers = new; + 268 .loc 1 57 0 + 269 0150 0040A001 moveq r4, r0 + 270 .L27: + 271 .LVL23: + 52:src/os/pit.c **** for (tl = timers; tl != NULL; tl = tl->next) { + 272 .loc 1 52 0 + 273 0154 0320A0E1 mov r2, r3 + 274 0158 003093E5 ldr r3, [r3, #0] + 275 .LVL24: + 276 015c 000053E3 cmp r3, #0 + 277 0160 F3FFFF1A bne .L29 + 278 0164 004085E5 str r4, [r5, #0] + 279 .LVL25: + 280 .L26: + 281 .LBE37: + 282 .LBE36: + 103:src/os/pit.c **** local_irq_restore(flags); + 283 .loc 1 103 0 + 284 @ 103 "src/os/pit.c" 1 + 285 0168 06F021E1 msr cpsr_c, r6 @ local_irq_restore + 286 + 287 @ 0 "" 2 + 104:src/os/pit.c **** } + 288 .loc 1 104 0 + 289 016c 7000BDE8 ldmfd sp!, {r4, r5, r6} + 290 0170 1EFF2FE1 bx lr + 291 .L32: + 292 .align 2 + 293 .L31: + 294 0174 00000000 .word .LANCHOR0 + 295 .cfi_endproc + 296 .LFE276: + 298 .align 2 + 299 .global pit_mdelay + 301 pit_mdelay: + 302 .LFB278: + 127:src/os/pit.c **** + 128:src/os/pit.c **** void pit_mdelay(u_int32_t ms) + 129:src/os/pit.c **** { + 303 .loc 1 129 0 + 304 .cfi_startproc + 305 @ Function supports interworking. + 306 @ args = 0, pretend = 0, frame = 0 + 307 @ frame_needed = 0, uses_anonymous_args = 0 + 308 @ link register save eliminated. + 309 .LVL26: + 310 .LBB38: + 311 .LBB39: + 312 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); + 313 .loc 2 1428 0 + 314 0178 023CE0E3 mvn r3, #512 + 315 017c C32013E5 ldr r2, [r3, #-195] + 316 .LBE39: + 317 .LBE38: + 130:src/os/pit.c **** u_int32_t end; + 131:src/os/pit.c **** + 132:src/os/pit.c **** end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; + 318 .loc 1 132 0 + 319 0180 20C09FE5 ldr ip, .L36 + 320 0184 020080E0 add r0, r0, r2 + 321 .LVL27: + 322 0188 901C8CE0 umull r1, ip, r0, ip + 323 018c 2C12A0E1 mov r1, ip, lsr #4 + 324 0190 012181E0 add r2, r1, r1, asl #2 + 325 0194 022140E0 sub r2, r0, r2, asl #2 + 326 .L34: + 327 .LVL28: + 328 .LBB40: + 329 .LBB41: + 330 .loc 2 1428 0 discriminator 1 + 331 0198 C30013E5 ldr r0, [r3, #-195] + 332 .LBE41: + 333 .LBE40: + 133:src/os/pit.c **** + 134:src/os/pit.c **** while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } + 334 .loc 1 134 0 discriminator 1 + 335 019c 000052E1 cmp r2, r0 + 336 01a0 FCFFFF3A bcc .L34 + 135:src/os/pit.c **** } + 337 .loc 1 135 0 + 338 01a4 1EFF2FE1 bx lr + 339 .L37: + 340 .align 2 + 341 .L36: + 342 01a8 CDCCCCCC .word -858993459 + 343 .cfi_endproc + 344 .LFE278: + 346 .align 2 + 347 .global mdelay + 349 mdelay: + 350 .LFB279: + 136:src/os/pit.c **** + 137:src/os/pit.c **** void mdelay(u_int32_t ms) + 138:src/os/pit.c **** { + 351 .loc 1 138 0 + 352 .cfi_startproc + 353 @ Function supports interworking. + 354 @ args = 0, pretend = 0, frame = 0 + 355 @ frame_needed = 0, uses_anonymous_args = 0 + 356 @ link register save eliminated. + 357 .LVL29: + 358 .LBB42: + 359 .LBB43: + 360 .LBB44: + 361 .LBB45: + 362 .loc 2 1428 0 + 363 01ac 023CE0E3 mvn r3, #512 + 364 01b0 C32013E5 ldr r2, [r3, #-195] + 365 .LBE45: + 366 .LBE44: + 132:src/os/pit.c **** end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; + 367 .loc 1 132 0 + 368 01b4 20C09FE5 ldr ip, .L41 + 369 01b8 020080E0 add r0, r0, r2 + 370 .LVL30: + 371 01bc 901C8CE0 umull r1, ip, r0, ip + 372 01c0 2C12A0E1 mov r1, ip, lsr #4 + 373 01c4 012181E0 add r2, r1, r1, asl #2 + 374 01c8 022140E0 sub r2, r0, r2, asl #2 + 375 .L39: + 376 .LVL31: + 377 .LBB46: + 378 .LBB47: + 379 .loc 2 1428 0 + 380 01cc C30013E5 ldr r0, [r3, #-195] + 381 .LBE47: + 382 .LBE46: + 134:src/os/pit.c **** while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } + 383 .loc 1 134 0 + 384 01d0 000052E1 cmp r2, r0 + 385 01d4 FCFFFF3A bcc .L39 + 386 .LBE43: + 387 .LBE42: + 139:src/os/pit.c **** return pit_mdelay(ms); + 140:src/os/pit.c **** } + 388 .loc 1 140 0 + 389 01d8 1EFF2FE1 bx lr + 390 .L42: + 391 .align 2 + 392 .L41: + 393 01dc CDCCCCCC .word -858993459 + 394 .cfi_endproc + 395 .LFE279: + 397 .align 2 + 398 .global usleep + 400 usleep: + 401 .LFB280: + 141:src/os/pit.c **** + 142:src/os/pit.c **** void usleep(u_int32_t us) + 143:src/os/pit.c **** { + 402 .loc 1 143 0 + 403 .cfi_startproc + 404 @ Function supports interworking. + 405 @ args = 0, pretend = 0, frame = 0 + 406 @ frame_needed = 0, uses_anonymous_args = 0 + 407 @ link register save eliminated. + 408 .LVL32: + 144:src/os/pit.c **** return; + 145:src/os/pit.c **** return pit_mdelay(us/1000); + 146:src/os/pit.c **** } + 409 .loc 1 146 0 + 410 01e0 1EFF2FE1 bx lr + 411 .cfi_endproc + 412 .LFE280: + 414 .align 2 + 415 .global pit_init + 417 pit_init: + 418 .LFB281: + 147:src/os/pit.c **** + 148:src/os/pit.c **** void pit_init(void) + 149:src/os/pit.c **** { + 419 .loc 1 149 0 + 420 .cfi_startproc + 421 @ Function supports interworking. + 422 @ args = 0, pretend = 0, frame = 0 + 423 @ frame_needed = 0, uses_anonymous_args = 0 + 424 .LVL33: + 425 .LBB48: + 426 .LBB50: +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 427 .loc 2 1366 0 + 428 01e4 40C09FE5 ldr ip, .L45 + 429 .LBE50: + 430 .LBE48: + 431 .loc 1 149 0 + 432 01e8 10402DE9 stmfd sp!, {r4, lr} + 433 .LCFI2: + 434 .cfi_def_cfa_offset 8 + 435 .LBB53: + 436 .LBB54: + 437 .LBB55: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 438 .loc 2 940 0 + 439 01ec 033CE0E3 mvn r3, #768 + 440 .LBE55: + 441 .LBE54: + 442 .LBE53: + 443 .LBB58: + 444 .LBB51: +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 445 .loc 2 1366 0 + 446 01f0 024CE0E3 mvn r4, #512 + 447 .cfi_offset 14, -4 + 448 .cfi_offset 4, -8 + 449 .LBE51: + 450 .LBE58: + 451 .LBB59: + 452 .LBB57: + 453 .LBB56: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 454 .loc 2 940 0 + 455 01f4 02E0A0E3 mov lr, #2 + 456 01f8 EFE003E5 str lr, [r3, #-239] + 457 .LVL34: + 458 .LBE56: + 459 .LBE57: + 460 .LBE59: + 461 .LBB60: + 462 .LBB49: +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 + 463 .loc 2 1366 0 + 464 01fc CFC004E5 str ip, [r4, #-207] +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; + 465 .loc 2 1367 0 + 466 0200 CF1014E5 ldr r1, [r4, #-207] + 467 0204 012481E3 orr r2, r1, #16777216 + 468 .LBE49: + 469 .LBE60: + 150:src/os/pit.c **** AT91F_PITC_CfgPMC(); + 151:src/os/pit.c **** + 152:src/os/pit.c **** AT91F_PITInit(AT91C_BASE_PITC, 1000000/HZ /* uS */, 48 /* MHz */); + 153:src/os/pit.c **** + 154:src/os/pit.c **** sysirq_register(AT91SAM7_SYSIRQ_PIT, &pit_irq); + 470 .loc 1 154 0 + 471 0208 0000A0E3 mov r0, #0 + 472 020c 1C109FE5 ldr r1, .L45+4 + 473 .LBB61: + 474 .LBB52: +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; + 475 .loc 2 1367 0 + 476 0210 CF2004E5 str r2, [r4, #-207] + 477 .LBE52: + 478 .LBE61: + 479 .loc 1 154 0 + 480 0214 FEFFFFEB bl sysirq_register + 481 .LVL35: + 482 .LBB62: + 483 .LBB63: +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; + 484 .loc 2 1388 0 + 485 0218 CF0014E5 ldr r0, [r4, #-207] + 486 021c 023480E3 orr r3, r0, #33554432 + 487 0220 CF3004E5 str r3, [r4, #-207] + 488 .LBE63: + 489 .LBE62: + 155:src/os/pit.c **** + 156:src/os/pit.c **** AT91F_PITEnableInt(AT91C_BASE_PITC); + 157:src/os/pit.c **** } + 490 .loc 1 157 0 + 491 0224 1040BDE8 ldmfd sp!, {r4, lr} + 492 0228 1EFF2FE1 bx lr + 493 .L46: + 494 .align 2 + 495 .L45: + 496 022c 30750000 .word 30000 + 497 0230 00000000 .word pit_irq + 498 .cfi_endproc + 499 .LFE281: + 501 .comm jiffies,4,4 + 502 .bss + 503 .align 2 + 504 .set .LANCHOR0,. + 0 + 507 timers: + 508 0000 00000000 .space 4 + 509 .text + 510 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 pit.c +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:24 .text:00000000 timer_del +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:118 .text:00000074 $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:124 .text:00000078 $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:126 .text:00000078 pit_irq +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:207 .text:000000f8 $d + *COM*:00000004 jiffies +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:212 .text:00000100 $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:215 .text:00000100 timer_add +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:294 .text:00000174 $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:298 .text:00000178 $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:301 .text:00000178 pit_mdelay +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:342 .text:000001a8 $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:346 .text:000001ac $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:349 .text:000001ac mdelay +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:393 .text:000001dc $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:397 .text:000001e0 $a +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:400 .text:000001e0 usleep +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:417 .text:000001e4 pit_init +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:496 .text:0000022c $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:503 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccTQuyds.s:507 .bss:00000000 timers + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +sysirq_register diff --git a/firmware/src/os/power.h b/firmware/src/os/power.h new file mode 100644 index 0000000..bfc6989 --- /dev/null +++ b/firmware/src/os/power.h @@ -0,0 +1,8 @@ +#ifndef _POWER_H + +static inline void cpu_idle(void) +{ + AT91F_PMC_DisablePCK(AT91C_BASE_PMC, AT91C_PMC_PCK); +} + +#endif diff --git a/firmware/src/os/pwm.c b/firmware/src/os/pwm.c new file mode 100644 index 0000000..70858bb --- /dev/null +++ b/firmware/src/os/pwm.c @@ -0,0 +1,177 @@ +/* AT91SAM7 PWM routines for OpenPCD / OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../openpcd.h" + +#define Hz +#define kHz *1000 Hz +#define MHz *1000 kHz +#define MCLK (48 MHz) + +#if 1 +#define DEBUGPWM DEBUGPCRF +#else +#define DEBUGPWM(x, args...) +#endif + +static AT91PS_PWMC pwm = AT91C_BASE_PWMC; + +/* find highest bit set. returns bit (32..1) or 0 in case no bit set */ +static int fhs(u_int32_t val) +{ + int i; + + for (i = 32; i > 0; i--) { + if (val & (1 << (i-1))) + return i; + } + + return 0; +} + +/* set frequency of PWM signal to freq */ +int pwm_freq_set(int channel, u_int32_t freq) +{ + /* in order to get maximum resolution, the pre-scaler must be set to + * something like freq << 16. However, the mimimum pre-scaled frequency + * we can get is MCLK (48MHz), the minimum is MCLK/(1024*255) = + * 48MHz/261120 = 183Hz */ + u_int32_t overall_div; + u_int32_t presc_total; + u_int8_t cpre = 0; + u_int16_t cprd; + + if (freq > MCLK) + return -ERANGE; + + overall_div = MCLK / freq; + DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + + if (overall_div > 0x7fff) { + /* divisor is larger than half the maximum CPRD register, we + * have to configure prescalers */ + presc_total = overall_div >> 15; + + /* find highest 2^n fitting in prescaler (highest bit set) */ + cpre = fhs(presc_total); + if (cpre > 0) { + /* subtract one, because of fhs semantics */ + cpre--; + } + cprd = overall_div / (1 << cpre); + } else + cprd = overall_div; + + DEBUGPCRF("cpre=%u, cprd=%u", cpre, cprd); + AT91F_PWMC_CfgChannel(AT91C_BASE_PWMC, channel, + cpre|AT91C_PWMC_CPOL, cprd, 1); + + return 0; +} + +void pwm_start(int channel) +{ + AT91F_PWMC_StartChannel(AT91C_BASE_PWMC, (1 << channel)); +} + +void pwm_stop(int channel) +{ + AT91F_PWMC_StopChannel(AT91C_BASE_PWMC, (1 << channel)); +} + +void pwm_duty_set_percent(int channel, u_int16_t duty) +{ + u_int32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; + + tmp = tmp << 16; /* extend value by 2^16 */ + tmp = tmp / 100; /* tmp = 1 % of extended cprd */ + tmp = duty * tmp; /* tmp = 'duty' % of extended cprd */ + tmp = tmp >> 16; /* un-extend tmp (divide by 2^16) */ + + DEBUGPWM("Writing %u to Update register\n", tmp); + AT91F_PWMC_UpdateChannel(AT91C_BASE_PWMC, channel, tmp); +} + +static int pwm_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int32_t *freq; + + switch (poh->cmd) { + case OPENPCD_CMD_PWM_ENABLE: + if (poh->val) + pwm_start(0); + else + pwm_stop(0); + break; + case OPENPCD_CMD_PWM_DUTY_SET: + pwm_duty_set_percent(0, poh->val); + break; + case OPENPCD_CMD_PWM_DUTY_GET: + goto respond; + break; + case OPENPCD_CMD_PWM_FREQ_SET: + if (rctx->tot_len < sizeof(*poh)+4) + break; + freq = (u_int32_t *) ((unsigned char *) poh) + sizeof(*poh); + pwm_freq_set(0, *freq); + break; + case OPENPCD_CMD_PWM_FREQ_GET: + goto respond; + break; + default: + break; + } + + req_ctx_put(rctx); + return 0; +respond: + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + udp_refill_ep(2); + return 1; +} + +void pwm_init(void) +{ + /* IMPORTANT: Disable PA17 (SSC TD) output */ + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PIO_PA17); + + /* Set PA23 to Peripheral A (PWM0) */ + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, OPENPCD_PIO_MFIN_PWM); + + /* Enable Clock for PWM controller */ + AT91F_PWMC_CfgPMC(); + + usb_hdlr_register(&pwm_usb_in, OPENPCD_CMD_CLS_PWM); +} + +void pwm_fini(void) +{ + usb_hdlr_unregister(OPENPCD_CMD_CLS_PWM); + AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, (1 << AT91C_ID_PWMC)); +} diff --git a/firmware/src/os/pwm.h b/firmware/src/os/pwm.h new file mode 100644 index 0000000..8836c32 --- /dev/null +++ b/firmware/src/os/pwm.h @@ -0,0 +1,11 @@ +#ifndef _PWM_H +#define _PWM_H + +extern void pwm_freq_set(int channel, u_int32_t freq); +extern void pwm_start(int channel); +extern void pwm_stop(int channel); +extern void pwm_duty_set_percent(int channel, u_int16_t duty); +extern void pwm_init(void); +extern void pwm_fini(void); + +#endif diff --git a/firmware/src/os/pwm.lst b/firmware/src/os/pwm.lst new file mode 100644 index 0000000..14dcec6 --- /dev/null +++ b/firmware/src/os/pwm.lst @@ -0,0 +1,3621 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "pwm.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .global __aeabi_uidiv + 22 .align 2 + 23 .global pwm_freq_set + 25 pwm_freq_set: + 26 .LFB279: + 27 .file 1 "src/os/pwm.c" + 1:src/os/pwm.c **** /* AT91SAM7 PWM routines for OpenPCD / OpenPICC + 2:src/os/pwm.c **** * (C) 2006 by Harald Welte + 3:src/os/pwm.c **** * + 4:src/os/pwm.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/pwm.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/pwm.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/pwm.c **** * (at your option) any later version. + 8:src/os/pwm.c **** * + 9:src/os/pwm.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/pwm.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/pwm.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/pwm.c **** * GNU General Public License for more details. + 13:src/os/pwm.c **** * + 14:src/os/pwm.c **** * You should have received a copy of the GNU General Public License + 15:src/os/pwm.c **** * along with this program; if not, write to the Free Software + 16:src/os/pwm.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/pwm.c **** * + 18:src/os/pwm.c **** */ + 19:src/os/pwm.c **** + 20:src/os/pwm.c **** #include + 21:src/os/pwm.c **** #include + 22:src/os/pwm.c **** #include + 23:src/os/pwm.c **** #include + 24:src/os/pwm.c **** #include + 25:src/os/pwm.c **** #include + 26:src/os/pwm.c **** #include + 27:src/os/pwm.c **** #include + 28:src/os/pwm.c **** #include + 29:src/os/pwm.c **** #include "../openpcd.h" + 30:src/os/pwm.c **** + 31:src/os/pwm.c **** #define Hz + 32:src/os/pwm.c **** #define kHz *1000 Hz + 33:src/os/pwm.c **** #define MHz *1000 kHz + 34:src/os/pwm.c **** #define MCLK (48 MHz) + 35:src/os/pwm.c **** + 36:src/os/pwm.c **** #if 1 + 37:src/os/pwm.c **** #define DEBUGPWM DEBUGPCRF + 38:src/os/pwm.c **** #else + 39:src/os/pwm.c **** #define DEBUGPWM(x, args...) + 40:src/os/pwm.c **** #endif + 41:src/os/pwm.c **** + 42:src/os/pwm.c **** static AT91PS_PWMC pwm = AT91C_BASE_PWMC; + 43:src/os/pwm.c **** + 44:src/os/pwm.c **** /* find highest bit set. returns bit (32..1) or 0 in case no bit set */ + 45:src/os/pwm.c **** static int fhs(u_int32_t val) + 46:src/os/pwm.c **** { + 47:src/os/pwm.c **** int i; + 48:src/os/pwm.c **** + 49:src/os/pwm.c **** for (i = 32; i > 0; i--) { + 50:src/os/pwm.c **** if (val & (1 << (i-1))) + 51:src/os/pwm.c **** return i; + 52:src/os/pwm.c **** } + 53:src/os/pwm.c **** + 54:src/os/pwm.c **** return 0; + 55:src/os/pwm.c **** } + 56:src/os/pwm.c **** + 57:src/os/pwm.c **** /* set frequency of PWM signal to freq */ + 58:src/os/pwm.c **** int pwm_freq_set(int channel, u_int32_t freq) + 59:src/os/pwm.c **** { + 28 .loc 1 59 0 + 29 .cfi_startproc + 30 @ Function supports interworking. + 31 @ args = 0, pretend = 0, frame = 0 + 32 @ frame_needed = 0, uses_anonymous_args = 0 + 33 .LVL0: + 34 0000 F0402DE9 stmfd sp!, {r4, r5, r6, r7, lr} + 35 .LCFI0: + 36 .cfi_def_cfa_offset 20 + 60:src/os/pwm.c **** /* in order to get maximum resolution, the pre-scaler must be set to + 61:src/os/pwm.c **** * something like freq << 16. However, the mimimum pre-scaled frequency + 62:src/os/pwm.c **** * we can get is MCLK (48MHz), the minimum is MCLK/(1024*255) = + 63:src/os/pwm.c **** * 48MHz/261120 = 183Hz */ + 64:src/os/pwm.c **** u_int32_t overall_div; + 65:src/os/pwm.c **** u_int32_t presc_total; + 66:src/os/pwm.c **** u_int8_t cpre = 0; + 67:src/os/pwm.c **** u_int16_t cprd; + 68:src/os/pwm.c **** + 69:src/os/pwm.c **** if (freq > MCLK) + 37 .loc 1 69 0 + 38 0004 00719FE5 ldr r7, .L17 + 39 .cfi_offset 14, -4 + 40 .cfi_offset 7, -8 + 41 .cfi_offset 6, -12 + 42 .cfi_offset 5, -16 + 43 .cfi_offset 4, -20 + 44 0008 070051E1 cmp r1, r7 + 59:src/os/pwm.c **** { + 45 .loc 1 59 0 + 46 000c 0050A0E1 mov r5, r0 + 47 0010 0CD04DE2 sub sp, sp, #12 + 48 .LCFI1: + 49 .cfi_def_cfa_offset 32 + 59:src/os/pwm.c **** { + 50 .loc 1 59 0 + 51 0014 0140A0E1 mov r4, r1 + 70:src/os/pwm.c **** return -ERANGE; + 52 .loc 1 70 0 + 53 0018 2100E083 mvnhi r0, #33 + 54 .LVL1: + 69:src/os/pwm.c **** if (freq > MCLK) + 55 .loc 1 69 0 + 56 001c 0200009A bls .L15 + 57 .LVL2: + 58 .L2: + 71:src/os/pwm.c **** + 72:src/os/pwm.c **** overall_div = MCLK / freq; + 73:src/os/pwm.c **** DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + 74:src/os/pwm.c **** + 75:src/os/pwm.c **** if (overall_div > 0x7fff) { + 76:src/os/pwm.c **** /* divisor is larger than half the maximum CPRD register, we + 77:src/os/pwm.c **** * have to configure prescalers */ + 78:src/os/pwm.c **** presc_total = overall_div >> 15; + 79:src/os/pwm.c **** + 80:src/os/pwm.c **** /* find highest 2^n fitting in prescaler (highest bit set) */ + 81:src/os/pwm.c **** cpre = fhs(presc_total); + 82:src/os/pwm.c **** if (cpre > 0) { + 83:src/os/pwm.c **** /* subtract one, because of fhs semantics */ + 84:src/os/pwm.c **** cpre--; + 85:src/os/pwm.c **** } + 86:src/os/pwm.c **** cprd = overall_div / (1 << cpre); + 87:src/os/pwm.c **** } else + 88:src/os/pwm.c **** cprd = overall_div; + 89:src/os/pwm.c **** + 90:src/os/pwm.c **** DEBUGPCRF("cpre=%u, cprd=%u", cpre, cprd); + 91:src/os/pwm.c **** AT91F_PWMC_CfgChannel(AT91C_BASE_PWMC, channel, + 92:src/os/pwm.c **** cpre|AT91C_PWMC_CPOL, cprd, 1); + 93:src/os/pwm.c **** + 94:src/os/pwm.c **** return 0; + 95:src/os/pwm.c **** } + 59 .loc 1 95 0 + 60 0020 0CD08DE2 add sp, sp, #12 + 61 0024 F040BDE8 ldmfd sp!, {r4, r5, r6, r7, lr} + 62 0028 1EFF2FE1 bx lr + 63 .LVL3: + 64 .L15: + 72:src/os/pwm.c **** overall_div = MCLK / freq; + 65 .loc 1 72 0 + 66 002c 0700A0E1 mov r0, r7 + 67 0030 FEFFFFEB bl __aeabi_uidiv + 68 .LVL4: + 73:src/os/pwm.c **** DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + 69 .loc 1 73 0 + 70 0034 D4109FE5 ldr r1, .L17+4 + 72:src/os/pwm.c **** overall_div = MCLK / freq; + 71 .loc 1 72 0 + 72 0038 0060A0E1 mov r6, r0 + 73 .LVL5: + 73:src/os/pwm.c **** DEBUGPCRF("mclk=%u, freq=%u, overall_div=%u", MCLK, freq, overall_div); + 74 .loc 1 73 0 + 75 003c 4920A0E3 mov r2, #73 + 76 0040 CC009FE5 ldr r0, .L17+8 + 77 .LVL6: + 78 0044 0730A0E1 mov r3, r7 + 79 0048 50008DE8 stmia sp, {r4, r6} @ phole stm + 80 004c FEFFFFEB bl debugp + 75:src/os/pwm.c **** if (overall_div > 0x7fff) { + 81 .loc 1 75 0 + 82 0050 020956E3 cmp r6, #32768 + 78:src/os/pwm.c **** presc_total = overall_div >> 15; + 83 .loc 1 78 0 + 84 0054 A607A021 movcs r0, r6, lsr #15 + 85 .LVL7: + 86 .LBB32: + 87 .LBB33: + 50:src/os/pwm.c **** if (val & (1 << (i-1))) + 88 .loc 1 50 0 + 89 0058 0110A023 movcs r1, #1 + 49:src/os/pwm.c **** for (i = 32; i > 0; i--) { + 90 .loc 1 49 0 + 91 005c 1F40A023 movcs r4, #31 + 92 .LVL8: + 93 .LBE33: + 94 .LBE32: + 75:src/os/pwm.c **** if (overall_div > 0x7fff) { + 95 .loc 1 75 0 + 96 0060 1D00002A bcs .L5 + 88:src/os/pwm.c **** cprd = overall_div; + 97 .loc 1 88 0 + 98 0064 0618A0E1 mov r1, r6, asl #16 + 99 0068 2168A0E1 mov r6, r1, lsr #16 + 100 .LVL9: + 101 006c 024CA0E3 mov r4, #512 + 102 0070 0030A0E3 mov r3, #0 + 103 .LVL10: + 104 .L7: + 90:src/os/pwm.c **** DEBUGPCRF("cpre=%u, cprd=%u", cpre, cprd); + 105 .loc 1 90 0 + 106 0074 9C009FE5 ldr r0, .L17+12 + 107 0078 90109FE5 ldr r1, .L17+4 + 108 007c 5A20A0E3 mov r2, #90 + 109 0080 00608DE5 str r6, [sp, #0] + 110 0084 FEFFFFEB bl debugp + 111 .LVL11: + 112 .LBB35: + 113 .LBB36: + 114 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:include/lib_AT91SAM7.h **** } +1574:include/lib_AT91SAM7.h **** +1575:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:include/lib_AT91SAM7.h **** { +1583:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:include/lib_AT91SAM7.h **** } +1585:include/lib_AT91SAM7.h **** +1586:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:include/lib_AT91SAM7.h **** { +1594:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:include/lib_AT91SAM7.h **** } +1596:include/lib_AT91SAM7.h **** +1597:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:include/lib_AT91SAM7.h **** int val) // chip select register +1608:include/lib_AT91SAM7.h **** { +1609:include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:include/lib_AT91SAM7.h **** } +1612:include/lib_AT91SAM7.h **** +1613:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:include/lib_AT91SAM7.h **** { +1621:include/lib_AT91SAM7.h **** //* Write to the IER register +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:include/lib_AT91SAM7.h **** } +1624:include/lib_AT91SAM7.h **** +1625:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:include/lib_AT91SAM7.h **** { +1633:include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:include/lib_AT91SAM7.h **** } +1636:include/lib_AT91SAM7.h **** +1637:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:include/lib_AT91SAM7.h **** ) +1644:include/lib_AT91SAM7.h **** { +1645:include/lib_AT91SAM7.h **** //* Write to the CR register +1646:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:include/lib_AT91SAM7.h **** } +1648:include/lib_AT91SAM7.h **** +1649:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:include/lib_AT91SAM7.h **** ) +1656:include/lib_AT91SAM7.h **** { +1657:include/lib_AT91SAM7.h **** //* Write to the CR register +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:include/lib_AT91SAM7.h **** } +1660:include/lib_AT91SAM7.h **** +1661:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:include/lib_AT91SAM7.h **** ) +1668:include/lib_AT91SAM7.h **** { +1669:include/lib_AT91SAM7.h **** //* Write to the CR register +1670:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:include/lib_AT91SAM7.h **** } +1672:include/lib_AT91SAM7.h **** +1673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:include/lib_AT91SAM7.h **** int mode) // mode register +1680:include/lib_AT91SAM7.h **** { +1681:include/lib_AT91SAM7.h **** //* Write to the MR register +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:include/lib_AT91SAM7.h **** } +1684:include/lib_AT91SAM7.h **** +1685:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:include/lib_AT91SAM7.h **** { +1693:include/lib_AT91SAM7.h **** //* Write to the MR register +1694:include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:include/lib_AT91SAM7.h **** } +1697:include/lib_AT91SAM7.h **** +1698:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:include/lib_AT91SAM7.h **** { +1709:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +1710:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:include/lib_AT91SAM7.h **** pBuffer, +1712:include/lib_AT91SAM7.h **** szBuffer, +1713:include/lib_AT91SAM7.h **** pNextBuffer, +1714:include/lib_AT91SAM7.h **** szNextBuffer); +1715:include/lib_AT91SAM7.h **** } +1716:include/lib_AT91SAM7.h **** +1717:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:include/lib_AT91SAM7.h **** { +1728:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +1729:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1730:include/lib_AT91SAM7.h **** pBuffer, +1731:include/lib_AT91SAM7.h **** szBuffer, +1732:include/lib_AT91SAM7.h **** pNextBuffer, +1733:include/lib_AT91SAM7.h **** szNextBuffer); +1734:include/lib_AT91SAM7.h **** } +1735:include/lib_AT91SAM7.h **** +1736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1737:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Close +1738:include/lib_AT91SAM7.h **** //* \brief Close SPI: disable IT disable transfert, close PDC +1739:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1740:include/lib_AT91SAM7.h **** extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller +1741:include/lib_AT91SAM7.h **** +1742:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1743:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_PutChar +1744:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +1745:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1746:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_PutChar ( +1747:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1748:include/lib_AT91SAM7.h **** unsigned int character, +1749:include/lib_AT91SAM7.h **** unsigned int cs_number ) +1750:include/lib_AT91SAM7.h **** { +1751:include/lib_AT91SAM7.h **** unsigned int value_for_cs; +1752:include/lib_AT91SAM7.h **** value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +1753:include/lib_AT91SAM7.h **** pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +1754:include/lib_AT91SAM7.h **** } +1755:include/lib_AT91SAM7.h **** +1756:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1757:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetChar +1758:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +1759:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1760:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_GetChar ( +1761:include/lib_AT91SAM7.h **** const AT91PS_SPI pSPI) +1762:include/lib_AT91SAM7.h **** { +1763:include/lib_AT91SAM7.h **** return((pSPI->SPI_RDR) & 0xFFFF); +1764:include/lib_AT91SAM7.h **** } +1765:include/lib_AT91SAM7.h **** +1766:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1767:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetInterruptMaskStatus +1768:include/lib_AT91SAM7.h **** //* \brief Return SPI Interrupt Mask Status +1769:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1770:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +1771:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi) // \arg pointer to a SPI controller +1772:include/lib_AT91SAM7.h **** { +1773:include/lib_AT91SAM7.h **** return pSpi->SPI_IMR; +1774:include/lib_AT91SAM7.h **** } +1775:include/lib_AT91SAM7.h **** +1776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1777:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_IsInterruptMasked +1778:include/lib_AT91SAM7.h **** //* \brief Test if SPI Interrupt is Masked +1779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1780:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_IsInterruptMasked( +1781:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi, // \arg pointer to a SPI controller +1782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1783:include/lib_AT91SAM7.h **** { +1784:include/lib_AT91SAM7.h **** return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +1785:include/lib_AT91SAM7.h **** } +1786:include/lib_AT91SAM7.h **** +1787:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1788:include/lib_AT91SAM7.h **** SOFTWARE API FOR ADC +1789:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1791:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableIt +1792:include/lib_AT91SAM7.h **** //* \brief Enable ADC interrupt +1793:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1794:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableIt ( +1795:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1796:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1797:include/lib_AT91SAM7.h **** { +1798:include/lib_AT91SAM7.h **** //* Write to the IER register +1799:include/lib_AT91SAM7.h **** pADC->ADC_IER = flag; +1800:include/lib_AT91SAM7.h **** } +1801:include/lib_AT91SAM7.h **** +1802:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1803:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableIt +1804:include/lib_AT91SAM7.h **** //* \brief Disable ADC interrupt +1805:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1806:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableIt ( +1807:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1808:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1809:include/lib_AT91SAM7.h **** { +1810:include/lib_AT91SAM7.h **** //* Write to the IDR register +1811:include/lib_AT91SAM7.h **** pADC->ADC_IDR = flag; +1812:include/lib_AT91SAM7.h **** } +1813:include/lib_AT91SAM7.h **** +1814:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1815:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetStatus +1816:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Status +1817:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1818:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +1819:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1820:include/lib_AT91SAM7.h **** { +1821:include/lib_AT91SAM7.h **** return pADC->ADC_SR; +1822:include/lib_AT91SAM7.h **** } +1823:include/lib_AT91SAM7.h **** +1824:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1825:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetInterruptMaskStatus +1826:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Mask Status +1827:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1828:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +1829:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1830:include/lib_AT91SAM7.h **** { +1831:include/lib_AT91SAM7.h **** return pADC->ADC_IMR; +1832:include/lib_AT91SAM7.h **** } +1833:include/lib_AT91SAM7.h **** +1834:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1835:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsInterruptMasked +1836:include/lib_AT91SAM7.h **** //* \brief Test if ADC Interrupt is Masked +1837:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1838:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsInterruptMasked( +1839:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1840:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1841:include/lib_AT91SAM7.h **** { +1842:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +1843:include/lib_AT91SAM7.h **** } +1844:include/lib_AT91SAM7.h **** +1845:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1846:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsStatusSet +1847:include/lib_AT91SAM7.h **** //* \brief Test if ADC Status is Set +1848:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1849:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsStatusSet( +1850:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1851:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1852:include/lib_AT91SAM7.h **** { +1853:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetStatus(pADC) & flag); +1854:include/lib_AT91SAM7.h **** } +1855:include/lib_AT91SAM7.h **** +1856:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1857:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgModeReg +1858:include/lib_AT91SAM7.h **** //* \brief Configure the Mode Register of the ADC controller +1859:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1860:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_CfgModeReg ( +1861:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1862:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1863:include/lib_AT91SAM7.h **** { +1864:include/lib_AT91SAM7.h **** //* Write to the MR register +1865:include/lib_AT91SAM7.h **** pADC->ADC_MR = mode; +1866:include/lib_AT91SAM7.h **** } +1867:include/lib_AT91SAM7.h **** +1868:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1869:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetModeReg +1870:include/lib_AT91SAM7.h **** //* \brief Return the Mode Register of the ADC controller value +1871:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1872:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetModeReg ( +1873:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1874:include/lib_AT91SAM7.h **** ) +1875:include/lib_AT91SAM7.h **** { +1876:include/lib_AT91SAM7.h **** return pADC->ADC_MR; +1877:include/lib_AT91SAM7.h **** } +1878:include/lib_AT91SAM7.h **** +1879:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1880:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgTimings +1881:include/lib_AT91SAM7.h **** //* \brief Configure the different necessary timings of the ADC controller +1882:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1883:include/lib_AT91SAM7.h **** extern void AT91F_ADC_CfgTimings ( +1884:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1885:include/lib_AT91SAM7.h **** unsigned int mck_clock, // in MHz +1886:include/lib_AT91SAM7.h **** unsigned int adc_clock, // in MHz +1887:include/lib_AT91SAM7.h **** unsigned int startup_time, // in us +1888:include/lib_AT91SAM7.h **** unsigned int sample_and_hold_time); // in ns +1889:include/lib_AT91SAM7.h **** +1890:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1891:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableChannel +1892:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1893:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1894:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableChannel ( +1895:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1896:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1897:include/lib_AT91SAM7.h **** { +1898:include/lib_AT91SAM7.h **** //* Write to the CHER register +1899:include/lib_AT91SAM7.h **** pADC->ADC_CHER = channel; +1900:include/lib_AT91SAM7.h **** } +1901:include/lib_AT91SAM7.h **** +1902:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1903:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableChannel +1904:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1905:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1906:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableChannel ( +1907:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1908:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1909:include/lib_AT91SAM7.h **** { +1910:include/lib_AT91SAM7.h **** //* Write to the CHDR register +1911:include/lib_AT91SAM7.h **** pADC->ADC_CHDR = channel; +1912:include/lib_AT91SAM7.h **** } +1913:include/lib_AT91SAM7.h **** +1914:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1915:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetChannelStatus +1916:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1917:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1918:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetChannelStatus ( +1919:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1920:include/lib_AT91SAM7.h **** ) +1921:include/lib_AT91SAM7.h **** { +1922:include/lib_AT91SAM7.h **** return pADC->ADC_CHSR; +1923:include/lib_AT91SAM7.h **** } +1924:include/lib_AT91SAM7.h **** +1925:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1926:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_StartConversion +1927:include/lib_AT91SAM7.h **** //* \brief Software request for a analog to digital conversion +1928:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1929:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_StartConversion ( +1930:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1931:include/lib_AT91SAM7.h **** ) +1932:include/lib_AT91SAM7.h **** { +1933:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_START; +1934:include/lib_AT91SAM7.h **** } +1935:include/lib_AT91SAM7.h **** +1936:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1937:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_SoftReset +1938:include/lib_AT91SAM7.h **** //* \brief Software reset +1939:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1940:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_SoftReset ( +1941:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1942:include/lib_AT91SAM7.h **** ) +1943:include/lib_AT91SAM7.h **** { +1944:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_SWRST; +1945:include/lib_AT91SAM7.h **** } +1946:include/lib_AT91SAM7.h **** +1947:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1948:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetLastConvertedData +1949:include/lib_AT91SAM7.h **** //* \brief Return the Last Converted Data +1950:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1951:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetLastConvertedData ( +1952:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1953:include/lib_AT91SAM7.h **** ) +1954:include/lib_AT91SAM7.h **** { +1955:include/lib_AT91SAM7.h **** return pADC->ADC_LCDR; +1956:include/lib_AT91SAM7.h **** } +1957:include/lib_AT91SAM7.h **** +1958:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1959:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH0 +1960:include/lib_AT91SAM7.h **** //* \brief Return the Channel 0 Converted Data +1961:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1962:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +1963:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1964:include/lib_AT91SAM7.h **** ) +1965:include/lib_AT91SAM7.h **** { +1966:include/lib_AT91SAM7.h **** return pADC->ADC_CDR0; +1967:include/lib_AT91SAM7.h **** } +1968:include/lib_AT91SAM7.h **** +1969:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1970:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH1 +1971:include/lib_AT91SAM7.h **** //* \brief Return the Channel 1 Converted Data +1972:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1973:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +1974:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1975:include/lib_AT91SAM7.h **** ) +1976:include/lib_AT91SAM7.h **** { +1977:include/lib_AT91SAM7.h **** return pADC->ADC_CDR1; +1978:include/lib_AT91SAM7.h **** } +1979:include/lib_AT91SAM7.h **** +1980:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1981:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH2 +1982:include/lib_AT91SAM7.h **** //* \brief Return the Channel 2 Converted Data +1983:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1984:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +1985:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1986:include/lib_AT91SAM7.h **** ) +1987:include/lib_AT91SAM7.h **** { +1988:include/lib_AT91SAM7.h **** return pADC->ADC_CDR2; +1989:include/lib_AT91SAM7.h **** } +1990:include/lib_AT91SAM7.h **** +1991:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1992:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH3 +1993:include/lib_AT91SAM7.h **** //* \brief Return the Channel 3 Converted Data +1994:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1995:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +1996:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1997:include/lib_AT91SAM7.h **** ) +1998:include/lib_AT91SAM7.h **** { +1999:include/lib_AT91SAM7.h **** return pADC->ADC_CDR3; +2000:include/lib_AT91SAM7.h **** } +2001:include/lib_AT91SAM7.h **** +2002:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2003:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH4 +2004:include/lib_AT91SAM7.h **** //* \brief Return the Channel 4 Converted Data +2005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2006:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +2007:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2008:include/lib_AT91SAM7.h **** ) +2009:include/lib_AT91SAM7.h **** { +2010:include/lib_AT91SAM7.h **** return pADC->ADC_CDR4; +2011:include/lib_AT91SAM7.h **** } +2012:include/lib_AT91SAM7.h **** +2013:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2014:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH5 +2015:include/lib_AT91SAM7.h **** //* \brief Return the Channel 5 Converted Data +2016:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2017:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +2018:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2019:include/lib_AT91SAM7.h **** ) +2020:include/lib_AT91SAM7.h **** { +2021:include/lib_AT91SAM7.h **** return pADC->ADC_CDR5; +2022:include/lib_AT91SAM7.h **** } +2023:include/lib_AT91SAM7.h **** +2024:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2025:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH6 +2026:include/lib_AT91SAM7.h **** //* \brief Return the Channel 6 Converted Data +2027:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2028:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +2029:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2030:include/lib_AT91SAM7.h **** ) +2031:include/lib_AT91SAM7.h **** { +2032:include/lib_AT91SAM7.h **** return pADC->ADC_CDR6; +2033:include/lib_AT91SAM7.h **** } +2034:include/lib_AT91SAM7.h **** +2035:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2036:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH7 +2037:include/lib_AT91SAM7.h **** //* \brief Return the Channel 7 Converted Data +2038:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2039:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +2040:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2041:include/lib_AT91SAM7.h **** ) +2042:include/lib_AT91SAM7.h **** { +2043:include/lib_AT91SAM7.h **** return pADC->ADC_CDR7; +2044:include/lib_AT91SAM7.h **** } +2045:include/lib_AT91SAM7.h **** +2046:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2047:include/lib_AT91SAM7.h **** SOFTWARE API FOR SSC +2048:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2049:include/lib_AT91SAM7.h **** //* Define the standard I2S mode configuration +2050:include/lib_AT91SAM7.h **** +2051:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Clock Mode Register +2052:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2053:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2054:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2055:include/lib_AT91SAM7.h **** AT91C_SSC_CKS_DIV +\ +2056:include/lib_AT91SAM7.h **** AT91C_SSC_CKO_CONTINOUS +\ +2057:include/lib_AT91SAM7.h **** AT91C_SSC_CKG_NONE +\ +2058:include/lib_AT91SAM7.h **** AT91C_SSC_START_FALL_RF +\ +2059:include/lib_AT91SAM7.h **** AT91C_SSC_STTOUT +\ +2060:include/lib_AT91SAM7.h **** ((1<<16) & AT91C_SSC_STTDLY) +\ +2061:include/lib_AT91SAM7.h **** ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +2062:include/lib_AT91SAM7.h **** +2063:include/lib_AT91SAM7.h **** +2064:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Frame Mode Register +2065:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2066:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2067:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2068:include/lib_AT91SAM7.h **** (nb_bit_by_slot-1) +\ +2069:include/lib_AT91SAM7.h **** AT91C_SSC_MSBF +\ +2070:include/lib_AT91SAM7.h **** (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +2071:include/lib_AT91SAM7.h **** (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +2072:include/lib_AT91SAM7.h **** AT91C_SSC_FSOS_NEGATIVE) +2073:include/lib_AT91SAM7.h **** +2074:include/lib_AT91SAM7.h **** +2075:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2076:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SetBaudrate +2077:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2078:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2079:include/lib_AT91SAM7.h **** extern void AT91F_SSC_SetBaudrate ( +2080:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2081:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2082:include/lib_AT91SAM7.h **** unsigned int speed); // \arg SSC baudrate +2083:include/lib_AT91SAM7.h **** +2084:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2085:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_Configure +2086:include/lib_AT91SAM7.h **** //* \brief Configure SSC +2087:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2088:include/lib_AT91SAM7.h **** extern void AT91F_SSC_Configure ( +2089:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2090:include/lib_AT91SAM7.h **** unsigned int syst_clock, // \arg System Clock Frequency +2091:include/lib_AT91SAM7.h **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency +2092:include/lib_AT91SAM7.h **** unsigned int clock_rx, // \arg Receiver Clock Parameters +2093:include/lib_AT91SAM7.h **** unsigned int mode_rx, // \arg mode Register to be programmed +2094:include/lib_AT91SAM7.h **** unsigned int clock_tx, // \arg Transmitter Clock Parameters +2095:include/lib_AT91SAM7.h **** unsigned int mode_tx); // \arg mode Register to be programmed +2096:include/lib_AT91SAM7.h **** +2097:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2098:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableRx +2099:include/lib_AT91SAM7.h **** //* \brief Enable receiving datas +2100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2101:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableRx ( +2102:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2103:include/lib_AT91SAM7.h **** { +2104:include/lib_AT91SAM7.h **** //* Enable receiver +2105:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXEN; +2106:include/lib_AT91SAM7.h **** } +2107:include/lib_AT91SAM7.h **** +2108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2109:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableRx +2110:include/lib_AT91SAM7.h **** //* \brief Disable receiving datas +2111:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2112:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableRx ( +2113:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2114:include/lib_AT91SAM7.h **** { +2115:include/lib_AT91SAM7.h **** //* Disable receiver +2116:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXDIS; +2117:include/lib_AT91SAM7.h **** } +2118:include/lib_AT91SAM7.h **** +2119:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2120:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableTx +2121:include/lib_AT91SAM7.h **** //* \brief Enable sending datas +2122:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2123:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableTx ( +2124:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2125:include/lib_AT91SAM7.h **** { +2126:include/lib_AT91SAM7.h **** //* Enable transmitter +2127:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXEN; +2128:include/lib_AT91SAM7.h **** } +2129:include/lib_AT91SAM7.h **** +2130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2131:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableTx +2132:include/lib_AT91SAM7.h **** //* \brief Disable sending datas +2133:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2134:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableTx ( +2135:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2136:include/lib_AT91SAM7.h **** { +2137:include/lib_AT91SAM7.h **** //* Disable transmitter +2138:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXDIS; +2139:include/lib_AT91SAM7.h **** } +2140:include/lib_AT91SAM7.h **** +2141:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2142:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableIt +2143:include/lib_AT91SAM7.h **** //* \brief Enable SSC IT +2144:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2145:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableIt ( +2146:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2147:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2148:include/lib_AT91SAM7.h **** { +2149:include/lib_AT91SAM7.h **** //* Write to the IER register +2150:include/lib_AT91SAM7.h **** pSSC->SSC_IER = flag; +2151:include/lib_AT91SAM7.h **** } +2152:include/lib_AT91SAM7.h **** +2153:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2154:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableIt +2155:include/lib_AT91SAM7.h **** //* \brief Disable SSC IT +2156:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2157:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableIt ( +2158:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2159:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2160:include/lib_AT91SAM7.h **** { +2161:include/lib_AT91SAM7.h **** //* Write to the IDR register +2162:include/lib_AT91SAM7.h **** pSSC->SSC_IDR = flag; +2163:include/lib_AT91SAM7.h **** } +2164:include/lib_AT91SAM7.h **** +2165:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2166:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_ReceiveFrame +2167:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2168:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2169:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_ReceiveFrame ( +2170:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2171:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2172:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2173:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2174:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2175:include/lib_AT91SAM7.h **** { +2176:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2177:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2178:include/lib_AT91SAM7.h **** pBuffer, +2179:include/lib_AT91SAM7.h **** szBuffer, +2180:include/lib_AT91SAM7.h **** pNextBuffer, +2181:include/lib_AT91SAM7.h **** szNextBuffer); +2182:include/lib_AT91SAM7.h **** } +2183:include/lib_AT91SAM7.h **** +2184:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2185:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SendFrame +2186:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2187:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2188:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_SendFrame( +2189:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2190:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2191:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2192:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2193:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2194:include/lib_AT91SAM7.h **** { +2195:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2196:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2197:include/lib_AT91SAM7.h **** pBuffer, +2198:include/lib_AT91SAM7.h **** szBuffer, +2199:include/lib_AT91SAM7.h **** pNextBuffer, +2200:include/lib_AT91SAM7.h **** szNextBuffer); +2201:include/lib_AT91SAM7.h **** } +2202:include/lib_AT91SAM7.h **** +2203:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2204:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_GetInterruptMaskStatus +2205:include/lib_AT91SAM7.h **** //* \brief Return SSC Interrupt Mask Status +2206:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2207:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +2208:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc) // \arg pointer to a SSC controller +2209:include/lib_AT91SAM7.h **** { +2210:include/lib_AT91SAM7.h **** return pSsc->SSC_IMR; +2211:include/lib_AT91SAM7.h **** } +2212:include/lib_AT91SAM7.h **** +2213:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2214:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_IsInterruptMasked +2215:include/lib_AT91SAM7.h **** //* \brief Test if SSC Interrupt is Masked +2216:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2217:include/lib_AT91SAM7.h **** static inline int AT91F_SSC_IsInterruptMasked( +2218:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc, // \arg pointer to a SSC controller +2219:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2220:include/lib_AT91SAM7.h **** { +2221:include/lib_AT91SAM7.h **** return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +2222:include/lib_AT91SAM7.h **** } +2223:include/lib_AT91SAM7.h **** +2224:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2225:include/lib_AT91SAM7.h **** SOFTWARE API FOR USART +2226:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2228:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2229:include/lib_AT91SAM7.h **** //* \brief Calculate the baudrate +2230:include/lib_AT91SAM7.h **** //* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +2231:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +2232:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2233:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2234:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2235:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2236:include/lib_AT91SAM7.h **** +2237:include/lib_AT91SAM7.h **** //* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +2238:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +2239:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2240:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2241:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2242:include/lib_AT91SAM7.h **** AT91C_US_CLKS_EXT ) +2243:include/lib_AT91SAM7.h **** +2244:include/lib_AT91SAM7.h **** //* Standard Synchronous Mode : 8 bits , 1 stop , no parity +2245:include/lib_AT91SAM7.h **** #define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +2246:include/lib_AT91SAM7.h **** AT91C_US_USMODE_NORMAL + \ +2247:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2248:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2249:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2250:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2251:include/lib_AT91SAM7.h **** +2252:include/lib_AT91SAM7.h **** //* SCK used Label +2253:include/lib_AT91SAM7.h **** #define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +2254:include/lib_AT91SAM7.h **** +2255:include/lib_AT91SAM7.h **** //* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +2256:include/lib_AT91SAM7.h **** #define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +2257:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK +\ +2258:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2259:include/lib_AT91SAM7.h **** AT91C_US_PAR_EVEN + \ +2260:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2261:include/lib_AT91SAM7.h **** AT91C_US_CKLO +\ +2262:include/lib_AT91SAM7.h **** AT91C_US_OVER) +2263:include/lib_AT91SAM7.h **** +2264:include/lib_AT91SAM7.h **** //* Standard IRDA mode +2265:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +2266:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2267:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2268:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2269:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2270:include/lib_AT91SAM7.h **** +2271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2272:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2273:include/lib_AT91SAM7.h **** //* \brief Caluculate baud_value according to the main clock and the baud rate +2274:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2275:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Baudrate ( +2276:include/lib_AT91SAM7.h **** const unsigned int main_clock, // \arg peripheral clock +2277:include/lib_AT91SAM7.h **** const unsigned int baud_rate) // \arg UART baudrate +2278:include/lib_AT91SAM7.h **** { +2279:include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +2280:include/lib_AT91SAM7.h **** if ((baud_value % 10) >= 5) +2281:include/lib_AT91SAM7.h **** baud_value = (baud_value / 10) + 1; +2282:include/lib_AT91SAM7.h **** else +2283:include/lib_AT91SAM7.h **** baud_value /= 10; +2284:include/lib_AT91SAM7.h **** return baud_value; +2285:include/lib_AT91SAM7.h **** } +2286:include/lib_AT91SAM7.h **** +2287:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2288:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetBaudrate +2289:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2290:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2291:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetBaudrate ( +2292:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2293:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2294:include/lib_AT91SAM7.h **** unsigned int speed) // \arg UART baudrate +2295:include/lib_AT91SAM7.h **** { +2296:include/lib_AT91SAM7.h **** //* Define the baud rate divisor register +2297:include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +2298:include/lib_AT91SAM7.h **** } +2299:include/lib_AT91SAM7.h **** +2300:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2301:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetTimeguard +2302:include/lib_AT91SAM7.h **** //* \brief Set USART timeguard +2303:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2304:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetTimeguard ( +2305:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2306:include/lib_AT91SAM7.h **** unsigned int timeguard) // \arg timeguard value +2307:include/lib_AT91SAM7.h **** { +2308:include/lib_AT91SAM7.h **** //* Write the Timeguard Register +2309:include/lib_AT91SAM7.h **** pUSART->US_TTGR = timeguard ; +2310:include/lib_AT91SAM7.h **** } +2311:include/lib_AT91SAM7.h **** +2312:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2313:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableIt +2314:include/lib_AT91SAM7.h **** //* \brief Enable USART IT +2315:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2316:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableIt ( +2317:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2318:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2319:include/lib_AT91SAM7.h **** { +2320:include/lib_AT91SAM7.h **** //* Write to the IER register +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; +2322:include/lib_AT91SAM7.h **** } +2323:include/lib_AT91SAM7.h **** +2324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2325:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableIt +2326:include/lib_AT91SAM7.h **** //* \brief Disable USART IT +2327:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2328:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableIt ( +2329:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2330:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2331:include/lib_AT91SAM7.h **** { +2332:include/lib_AT91SAM7.h **** //* Write to the IER register +2333:include/lib_AT91SAM7.h **** pUSART->US_IDR = flag; +2334:include/lib_AT91SAM7.h **** } +2335:include/lib_AT91SAM7.h **** +2336:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2337:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Configure +2338:include/lib_AT91SAM7.h **** //* \brief Configure USART +2339:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2340:include/lib_AT91SAM7.h **** extern void AT91F_US_Configure ( +2341:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2342:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2343:include/lib_AT91SAM7.h **** unsigned int mode , // \arg mode Register to be programmed +2344:include/lib_AT91SAM7.h **** unsigned int baudRate , // \arg baudrate to be programmed +2345:include/lib_AT91SAM7.h **** unsigned int timeguard ); // \arg timeguard to be programmed +2346:include/lib_AT91SAM7.h **** +2347:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2348:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableRx +2349:include/lib_AT91SAM7.h **** //* \brief Enable receiving characters +2350:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2351:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableRx ( +2352:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2353:include/lib_AT91SAM7.h **** { +2354:include/lib_AT91SAM7.h **** //* Enable receiver +2355:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2356:include/lib_AT91SAM7.h **** } +2357:include/lib_AT91SAM7.h **** +2358:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2359:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableTx +2360:include/lib_AT91SAM7.h **** //* \brief Enable sending characters +2361:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2362:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableTx ( +2363:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2364:include/lib_AT91SAM7.h **** { +2365:include/lib_AT91SAM7.h **** //* Enable transmitter +2366:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2367:include/lib_AT91SAM7.h **** } +2368:include/lib_AT91SAM7.h **** +2369:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2370:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetRx +2371:include/lib_AT91SAM7.h **** //* \brief Reset Receiver and re-enable it +2372:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2373:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetRx ( +2374:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2375:include/lib_AT91SAM7.h **** { +2376:include/lib_AT91SAM7.h **** //* Reset receiver +2377:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTRX; +2378:include/lib_AT91SAM7.h **** //* Re-Enable receiver +2379:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2380:include/lib_AT91SAM7.h **** } +2381:include/lib_AT91SAM7.h **** +2382:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2383:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetTx +2384:include/lib_AT91SAM7.h **** //* \brief Reset Transmitter and re-enable it +2385:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2386:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetTx ( +2387:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2388:include/lib_AT91SAM7.h **** { +2389:include/lib_AT91SAM7.h **** //* Reset transmitter +2390:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTTX; +2391:include/lib_AT91SAM7.h **** //* Enable transmitter +2392:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2393:include/lib_AT91SAM7.h **** } +2394:include/lib_AT91SAM7.h **** +2395:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2396:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableRx +2397:include/lib_AT91SAM7.h **** //* \brief Disable Receiver +2398:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2399:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableRx ( +2400:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2401:include/lib_AT91SAM7.h **** { +2402:include/lib_AT91SAM7.h **** //* Disable receiver +2403:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXDIS; +2404:include/lib_AT91SAM7.h **** } +2405:include/lib_AT91SAM7.h **** +2406:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2407:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableTx +2408:include/lib_AT91SAM7.h **** //* \brief Disable Transmitter +2409:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2410:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableTx ( +2411:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2412:include/lib_AT91SAM7.h **** { +2413:include/lib_AT91SAM7.h **** //* Disable transmitter +2414:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXDIS; +2415:include/lib_AT91SAM7.h **** } +2416:include/lib_AT91SAM7.h **** +2417:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2418:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Close +2419:include/lib_AT91SAM7.h **** //* \brief Close USART: disable IT disable receiver and transmitter, close PDC +2420:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2421:include/lib_AT91SAM7.h **** extern void AT91F_US_Close(AT91PS_USART pUSART); // \arg pointer to a USART controller +2422:include/lib_AT91SAM7.h **** +2423:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2424:include/lib_AT91SAM7.h **** //* \fn AT91F_US_TxReady +2425:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be written in US_THR +2426:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2427:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_TxReady ( +2428:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2429:include/lib_AT91SAM7.h **** { +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); +2431:include/lib_AT91SAM7.h **** } +2432:include/lib_AT91SAM7.h **** +2433:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2434:include/lib_AT91SAM7.h **** //* \fn AT91F_US_RxReady +2435:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be read in US_RHR +2436:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2437:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_RxReady ( +2438:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2439:include/lib_AT91SAM7.h **** { +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); +2441:include/lib_AT91SAM7.h **** } +2442:include/lib_AT91SAM7.h **** +2443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2444:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Error +2445:include/lib_AT91SAM7.h **** //* \brief Return the error flag +2446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2447:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Error ( +2448:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2449:include/lib_AT91SAM7.h **** { +2450:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & +2451:include/lib_AT91SAM7.h **** (AT91C_US_OVRE | // Overrun error +2452:include/lib_AT91SAM7.h **** AT91C_US_FRAME | // Framing error +2453:include/lib_AT91SAM7.h **** AT91C_US_PARE)); // Parity error +2454:include/lib_AT91SAM7.h **** } +2455:include/lib_AT91SAM7.h **** +2456:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2457:include/lib_AT91SAM7.h **** //* \fn AT91F_US_PutChar +2458:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +2459:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2460:include/lib_AT91SAM7.h **** static inline void AT91F_US_PutChar ( +2461:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2462:include/lib_AT91SAM7.h **** int character ) +2463:include/lib_AT91SAM7.h **** { +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); +2465:include/lib_AT91SAM7.h **** } +2466:include/lib_AT91SAM7.h **** +2467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2468:include/lib_AT91SAM7.h **** //* \fn AT91F_US_GetChar +2469:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +2470:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2471:include/lib_AT91SAM7.h **** static inline int AT91F_US_GetChar ( +2472:include/lib_AT91SAM7.h **** const AT91PS_USART pUSART) +2473:include/lib_AT91SAM7.h **** { +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); +2475:include/lib_AT91SAM7.h **** } +2476:include/lib_AT91SAM7.h **** +2477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2478:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SendFrame +2479:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2480:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2481:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_SendFrame( +2482:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2483:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2484:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2485:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2486:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2487:include/lib_AT91SAM7.h **** { +2488:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2489:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pUSART->US_RPR), +2490:include/lib_AT91SAM7.h **** pBuffer, +2491:include/lib_AT91SAM7.h **** szBuffer, +2492:include/lib_AT91SAM7.h **** pNextBuffer, +2493:include/lib_AT91SAM7.h **** szNextBuffer); +2494:include/lib_AT91SAM7.h **** } +2495:include/lib_AT91SAM7.h **** +2496:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2497:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ReceiveFrame +2498:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2499:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2500:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_ReceiveFrame ( +2501:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2502:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2503:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2504:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2505:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2506:include/lib_AT91SAM7.h **** { +2507:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2508:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pUSART->US_RPR), +2509:include/lib_AT91SAM7.h **** pBuffer, +2510:include/lib_AT91SAM7.h **** szBuffer, +2511:include/lib_AT91SAM7.h **** pNextBuffer, +2512:include/lib_AT91SAM7.h **** szNextBuffer); +2513:include/lib_AT91SAM7.h **** } +2514:include/lib_AT91SAM7.h **** +2515:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2516:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetIrdaFilter +2517:include/lib_AT91SAM7.h **** //* \brief Set the value of IrDa filter tregister +2518:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2519:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetIrdaFilter ( +2520:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2521:include/lib_AT91SAM7.h **** unsigned char value +2522:include/lib_AT91SAM7.h **** ) +2523:include/lib_AT91SAM7.h **** { +2524:include/lib_AT91SAM7.h **** pUSART->US_IF = value; +2525:include/lib_AT91SAM7.h **** } +2526:include/lib_AT91SAM7.h **** +2527:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2528:include/lib_AT91SAM7.h **** SOFTWARE API FOR TWI +2529:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2531:include/lib_AT91SAM7.h **** //* \fn AT91F_TWI_EnableIt +2532:include/lib_AT91SAM7.h **** //* \brief Enable TWI IT +2533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2534:include/lib_AT91SAM7.h **** static inline void AT91F_TWI_EnableIt ( +2535:include/lib_AT91SAM7.h **** AT91PS_TWI pTWI, // \arg pointer to a TWI controller +2536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2537:include/lib_AT91SAM7.h **** { +2538:include/lib_AT91SAM7.h **** //* Write to the IER register +2539:include/lib_AT91SAM7.h **** pTWI->TWI_IER = flag; +2540:include/lib_AT91SAM7.h **** } +2541:include/lib_AT91SAM7.h **** +2542:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2543:include/lib_AT91SAM7.h **** //* \fn AT91F_TWI_DisableIt +2544:include/lib_AT91SAM7.h **** //* \brief Disable TWI IT +2545:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2546:include/lib_AT91SAM7.h **** static inline void AT91F_TWI_DisableIt ( +2547:include/lib_AT91SAM7.h **** AT91PS_TWI pTWI, // \arg pointer to a TWI controller +2548:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2549:include/lib_AT91SAM7.h **** { +2550:include/lib_AT91SAM7.h **** //* Write to the IDR register +2551:include/lib_AT91SAM7.h **** pTWI->TWI_IDR = flag; +2552:include/lib_AT91SAM7.h **** } +2553:include/lib_AT91SAM7.h **** +2554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2555:include/lib_AT91SAM7.h **** //* \fn AT91F_TWI_Configure +2556:include/lib_AT91SAM7.h **** //* \brief Configure TWI in master mode +2557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2558:include/lib_AT91SAM7.h **** static inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI contro +2559:include/lib_AT91SAM7.h **** { +2560:include/lib_AT91SAM7.h **** //* Disable interrupts +2561:include/lib_AT91SAM7.h **** pTWI->TWI_IDR = (unsigned int) -1; +2562:include/lib_AT91SAM7.h **** +2563:include/lib_AT91SAM7.h **** //* Reset peripheral +2564:include/lib_AT91SAM7.h **** pTWI->TWI_CR = AT91C_TWI_SWRST; +2565:include/lib_AT91SAM7.h **** +2566:include/lib_AT91SAM7.h **** //* Set Master mode +2567:include/lib_AT91SAM7.h **** pTWI->TWI_CR = AT91C_TWI_MSEN; +2568:include/lib_AT91SAM7.h **** +2569:include/lib_AT91SAM7.h **** } +2570:include/lib_AT91SAM7.h **** +2571:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2572:include/lib_AT91SAM7.h **** //* \fn AT91F_TWI_GetInterruptMaskStatus +2573:include/lib_AT91SAM7.h **** //* \brief Return TWI Interrupt Mask Status +2574:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2575:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status +2576:include/lib_AT91SAM7.h **** AT91PS_TWI pTwi) // \arg pointer to a TWI controller +2577:include/lib_AT91SAM7.h **** { +2578:include/lib_AT91SAM7.h **** return pTwi->TWI_IMR; +2579:include/lib_AT91SAM7.h **** } +2580:include/lib_AT91SAM7.h **** +2581:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2582:include/lib_AT91SAM7.h **** //* \fn AT91F_TWI_IsInterruptMasked +2583:include/lib_AT91SAM7.h **** //* \brief Test if TWI Interrupt is Masked +2584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2585:include/lib_AT91SAM7.h **** static inline int AT91F_TWI_IsInterruptMasked( +2586:include/lib_AT91SAM7.h **** AT91PS_TWI pTwi, // \arg pointer to a TWI controller +2587:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2588:include/lib_AT91SAM7.h **** { +2589:include/lib_AT91SAM7.h **** return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); +2590:include/lib_AT91SAM7.h **** } +2591:include/lib_AT91SAM7.h **** +2592:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2593:include/lib_AT91SAM7.h **** SOFTWARE API FOR TC +2594:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2596:include/lib_AT91SAM7.h **** //* \fn AT91F_TC_InterruptEnable +2597:include/lib_AT91SAM7.h **** //* \brief Enable TC Interrupt +2598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2599:include/lib_AT91SAM7.h **** static inline void AT91F_TC_InterruptEnable( +2600:include/lib_AT91SAM7.h **** AT91PS_TC pTc, // \arg pointer to a TC controller +2601:include/lib_AT91SAM7.h **** unsigned int flag) // \arg TC interrupt to be enabled +2602:include/lib_AT91SAM7.h **** { +2603:include/lib_AT91SAM7.h **** pTc->TC_IER = flag; +2604:include/lib_AT91SAM7.h **** } +2605:include/lib_AT91SAM7.h **** +2606:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2607:include/lib_AT91SAM7.h **** //* \fn AT91F_TC_InterruptDisable +2608:include/lib_AT91SAM7.h **** //* \brief Disable TC Interrupt +2609:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2610:include/lib_AT91SAM7.h **** static inline void AT91F_TC_InterruptDisable( +2611:include/lib_AT91SAM7.h **** AT91PS_TC pTc, // \arg pointer to a TC controller +2612:include/lib_AT91SAM7.h **** unsigned int flag) // \arg TC interrupt to be disabled +2613:include/lib_AT91SAM7.h **** { +2614:include/lib_AT91SAM7.h **** pTc->TC_IDR = flag; +2615:include/lib_AT91SAM7.h **** } +2616:include/lib_AT91SAM7.h **** +2617:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2618:include/lib_AT91SAM7.h **** //* \fn AT91F_TC_GetInterruptMaskStatus +2619:include/lib_AT91SAM7.h **** //* \brief Return TC Interrupt Mask Status +2620:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2621:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status +2622:include/lib_AT91SAM7.h **** AT91PS_TC pTc) // \arg pointer to a TC controller +2623:include/lib_AT91SAM7.h **** { +2624:include/lib_AT91SAM7.h **** return pTc->TC_IMR; +2625:include/lib_AT91SAM7.h **** } +2626:include/lib_AT91SAM7.h **** +2627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2628:include/lib_AT91SAM7.h **** //* \fn AT91F_TC_IsInterruptMasked +2629:include/lib_AT91SAM7.h **** //* \brief Test if TC Interrupt is Masked +2630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2631:include/lib_AT91SAM7.h **** static inline int AT91F_TC_IsInterruptMasked( +2632:include/lib_AT91SAM7.h **** AT91PS_TC pTc, // \arg pointer to a TC controller +2633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2634:include/lib_AT91SAM7.h **** { +2635:include/lib_AT91SAM7.h **** return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); +2636:include/lib_AT91SAM7.h **** } +2637:include/lib_AT91SAM7.h **** +2638:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2639:include/lib_AT91SAM7.h **** SOFTWARE API FOR PWMC +2640:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2642:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_GetStatus +2643:include/lib_AT91SAM7.h **** //* \brief Return PWM Interrupt Status +2644:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2645:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status +2646:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM) // pointer to a PWM controller +2647:include/lib_AT91SAM7.h **** { +2648:include/lib_AT91SAM7.h **** return pPWM->PWMC_SR; +2649:include/lib_AT91SAM7.h **** } +2650:include/lib_AT91SAM7.h **** +2651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2652:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_InterruptEnable +2653:include/lib_AT91SAM7.h **** //* \brief Enable PWM Interrupt +2654:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2655:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_InterruptEnable( +2656:include/lib_AT91SAM7.h **** AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +2657:include/lib_AT91SAM7.h **** unsigned int flag) // \arg PWM interrupt to be enabled +2658:include/lib_AT91SAM7.h **** { +2659:include/lib_AT91SAM7.h **** pPwm->PWMC_IER = flag; +2660:include/lib_AT91SAM7.h **** } +2661:include/lib_AT91SAM7.h **** +2662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2663:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_InterruptDisable +2664:include/lib_AT91SAM7.h **** //* \brief Disable PWM Interrupt +2665:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2666:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_InterruptDisable( +2667:include/lib_AT91SAM7.h **** AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +2668:include/lib_AT91SAM7.h **** unsigned int flag) // \arg PWM interrupt to be disabled +2669:include/lib_AT91SAM7.h **** { +2670:include/lib_AT91SAM7.h **** pPwm->PWMC_IDR = flag; +2671:include/lib_AT91SAM7.h **** } +2672:include/lib_AT91SAM7.h **** +2673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2674:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_GetInterruptMaskStatus +2675:include/lib_AT91SAM7.h **** //* \brief Return PWM Interrupt Mask Status +2676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2677:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status +2678:include/lib_AT91SAM7.h **** AT91PS_PWMC pPwm) // \arg pointer to a PWM controller +2679:include/lib_AT91SAM7.h **** { +2680:include/lib_AT91SAM7.h **** return pPwm->PWMC_IMR; +2681:include/lib_AT91SAM7.h **** } +2682:include/lib_AT91SAM7.h **** +2683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2684:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_IsInterruptMasked +2685:include/lib_AT91SAM7.h **** //* \brief Test if PWM Interrupt is Masked +2686:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2687:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PWMC_IsInterruptMasked( +2688:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2689:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2690:include/lib_AT91SAM7.h **** { +2691:include/lib_AT91SAM7.h **** return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); +2692:include/lib_AT91SAM7.h **** } +2693:include/lib_AT91SAM7.h **** +2694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2695:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_IsStatusSet +2696:include/lib_AT91SAM7.h **** //* \brief Test if PWM Interrupt is Set +2697:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2698:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PWMC_IsStatusSet( +2699:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2700:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2701:include/lib_AT91SAM7.h **** { +2702:include/lib_AT91SAM7.h **** return (AT91F_PWMC_GetStatus(pPWM) & flag); +2703:include/lib_AT91SAM7.h **** } +2704:include/lib_AT91SAM7.h **** +2705:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2706:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_CfgChannel +2707:include/lib_AT91SAM7.h **** //* \brief Test if PWM Interrupt is Set +2708:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2709:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_CfgChannel( +2710:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2711:include/lib_AT91SAM7.h **** unsigned int channelId, // \arg PWM channel ID +2712:include/lib_AT91SAM7.h **** unsigned int mode, // \arg PWM mode +2713:include/lib_AT91SAM7.h **** unsigned int period, // \arg PWM period +2714:include/lib_AT91SAM7.h **** unsigned int duty) // \arg PWM duty cycle +2715:include/lib_AT91SAM7.h **** { +2716:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 115 .loc 2 2716 0 + 116 0088 8CC09FE5 ldr ip, .L17+16 + 117 008c 102085E2 add r2, r5, #16 + 118 0090 8212A0E1 mov r1, r2, asl #5 +2717:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; +2718:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; + 119 .loc 2 2718 0 + 120 0094 0C30A0E1 mov r3, ip + 121 0098 8552A0E1 mov r5, r5, asl #5 + 122 .LVL12: +2716:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 123 .loc 2 2716 0 + 124 009c 0C0081E0 add r0, r1, ip + 125 .loc 2 2718 0 + 126 00a0 033085E0 add r3, r5, r3 +2716:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 127 .loc 2 2716 0 + 128 00a4 0DC941E2 sub ip, r1, #212992 +2717:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + 129 .loc 2 2717 0 + 130 00a8 0120A0E3 mov r2, #1 + 131 .LVL13: +2716:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CMR = mode; + 132 .loc 2 2716 0 + 133 00ac FF4000E5 str r4, [r0, #-255] +2717:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; + 134 .loc 2 2717 0 + 135 00b0 04208CE5 str r2, [ip, #4] + 136 .LBE36: + 137 .LBE35: + 94:src/os/pwm.c **** return 0; + 138 .loc 1 94 0 + 139 00b4 0000A0E3 mov r0, #0 + 140 .LBB38: + 141 .LBB37: + 142 .loc 2 2718 0 + 143 00b8 096183E5 str r6, [r3, #265] + 144 .LBE37: + 145 .LBE38: + 94:src/os/pwm.c **** return 0; + 146 .loc 1 94 0 + 147 00bc D7FFFFEA b .L2 + 148 .LVL14: + 149 .L16: + 150 .LBB39: + 151 .LBB34: + 49:src/os/pwm.c **** for (i = 32; i > 0; i--) { + 152 .loc 1 49 0 + 153 00c0 000053E3 cmp r3, #0 + 154 00c4 0340A0E1 mov r4, r3 + 50:src/os/pwm.c **** if (val & (1 << (i-1))) + 155 .loc 1 50 0 + 156 00c8 012043E2 sub r2, r3, #1 + 49:src/os/pwm.c **** for (i = 32; i > 0; i--) { + 157 .loc 1 49 0 + 158 00cc 0900000A beq .L6 + 50:src/os/pwm.c **** if (val & (1 << (i-1))) + 159 .loc 1 50 0 + 160 00d0 113210E0 ands r3, r0, r1, asl r2 + 161 00d4 0300001A bne .L4 + 49:src/os/pwm.c **** for (i = 32; i > 0; i--) { + 162 .loc 1 49 0 + 163 00d8 0240A0E1 mov r4, r2 + 164 .L5: + 50:src/os/pwm.c **** if (val & (1 << (i-1))) + 165 .loc 1 50 0 + 166 00dc 013044E2 sub r3, r4, #1 + 167 00e0 112310E0 ands r2, r0, r1, asl r3 + 168 00e4 F5FFFF0A beq .L16 + 169 .L4: + 170 .LVL15: + 171 .LBE34: + 172 .LBE39: + 82:src/os/pwm.c **** if (cpre > 0) { + 173 .loc 1 82 0 + 174 00e8 FF4014E2 ands r4, r4, #255 + 175 .LVL16: + 84:src/os/pwm.c **** cpre--; + 176 .loc 1 84 0 + 177 00ec 01404412 subne r4, r4, #1 + 178 00f0 FF400412 andne r4, r4, #255 + 82:src/os/pwm.c **** if (cpre > 0) { + 179 .loc 1 82 0 + 180 00f4 0430A0E1 mov r3, r4 + 181 .L6: + 182 .LVL17: + 86:src/os/pwm.c **** cprd = overall_div / (1 << cpre); + 183 .loc 1 86 0 + 184 00f8 3603A0E1 mov r0, r6, lsr r3 + 185 .LVL18: + 186 00fc 0068A0E1 mov r6, r0, asl #16 + 187 .LVL19: + 188 0100 2668A0E1 mov r6, r6, lsr #16 + 189 .LVL20: + 190 0104 024C84E3 orr r4, r4, #512 + 191 .LVL21: + 192 0108 D9FFFFEA b .L7 + 193 .L18: + 194 .align 2 + 195 .L17: + 196 010c 006CDC02 .word 48000000 + 197 0110 00000000 .word .LANCHOR0 + 198 0114 00000000 .word .LC0 + 199 0118 2C000000 .word .LC1 + 200 011c FFC0FCFF .word -212737 + 201 .cfi_endproc + 202 .LFE279: + 204 .align 2 + 205 .global pwm_start + 207 pwm_start: + 208 .LFB280: + 96:src/os/pwm.c **** + 97:src/os/pwm.c **** void pwm_start(int channel) + 98:src/os/pwm.c **** { + 209 .loc 1 98 0 + 210 .cfi_startproc + 211 @ Function supports interworking. + 212 @ args = 0, pretend = 0, frame = 0 + 213 @ frame_needed = 0, uses_anonymous_args = 0 + 214 @ link register save eliminated. + 215 .LVL22: + 99:src/os/pwm.c **** AT91F_PWMC_StartChannel(AT91C_BASE_PWMC, (1 << channel)); + 216 .loc 1 99 0 + 217 0120 0110A0E3 mov r1, #1 + 218 0124 1130A0E1 mov r3, r1, asl r0 + 219 .LVL23: + 220 .LBB40: + 221 .LBB41: +2719:include/lib_AT91SAM7.h **** } +2720:include/lib_AT91SAM7.h **** +2721:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2722:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_StartChannel +2723:include/lib_AT91SAM7.h **** //* \brief Enable channel +2724:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2725:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_StartChannel( +2726:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2727:include/lib_AT91SAM7.h **** unsigned int flag) // \arg Channels IDs to be enabled +2728:include/lib_AT91SAM7.h **** { +2729:include/lib_AT91SAM7.h **** pPWM->PWMC_ENA = flag; + 222 .loc 2 2729 0 + 223 0128 04209FE5 ldr r2, .L20 + 224 012c FB3002E5 str r3, [r2, #-251] + 225 .LBE41: + 226 .LBE40: + 100:src/os/pwm.c **** } + 227 .loc 1 100 0 + 228 0130 1EFF2FE1 bx lr + 229 .L21: + 230 .align 2 + 231 .L20: + 232 0134 FFC0FCFF .word -212737 + 233 .cfi_endproc + 234 .LFE280: + 236 .align 2 + 237 .global pwm_stop + 239 pwm_stop: + 240 .LFB281: + 101:src/os/pwm.c **** + 102:src/os/pwm.c **** void pwm_stop(int channel) + 103:src/os/pwm.c **** { + 241 .loc 1 103 0 + 242 .cfi_startproc + 243 @ Function supports interworking. + 244 @ args = 0, pretend = 0, frame = 0 + 245 @ frame_needed = 0, uses_anonymous_args = 0 + 246 @ link register save eliminated. + 247 .LVL24: + 104:src/os/pwm.c **** AT91F_PWMC_StopChannel(AT91C_BASE_PWMC, (1 << channel)); + 248 .loc 1 104 0 + 249 0138 0110A0E3 mov r1, #1 + 250 013c 1130A0E1 mov r3, r1, asl r0 + 251 .LVL25: + 252 .LBB42: + 253 .LBB43: +2730:include/lib_AT91SAM7.h **** } +2731:include/lib_AT91SAM7.h **** +2732:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2733:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_StopChannel +2734:include/lib_AT91SAM7.h **** //* \brief Disable channel +2735:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2736:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_StopChannel( +2737:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2738:include/lib_AT91SAM7.h **** unsigned int flag) // \arg Channels IDs to be enabled +2739:include/lib_AT91SAM7.h **** { +2740:include/lib_AT91SAM7.h **** pPWM->PWMC_DIS = flag; + 254 .loc 2 2740 0 + 255 0140 04209FE5 ldr r2, .L23 + 256 0144 F73002E5 str r3, [r2, #-247] + 257 .LBE43: + 258 .LBE42: + 105:src/os/pwm.c **** } + 259 .loc 1 105 0 + 260 0148 1EFF2FE1 bx lr + 261 .L24: + 262 .align 2 + 263 .L23: + 264 014c FFC0FCFF .word -212737 + 265 .cfi_endproc + 266 .LFE281: + 268 .align 2 + 269 .global pwm_duty_set_percent + 271 pwm_duty_set_percent: + 272 .LFB282: + 106:src/os/pwm.c **** + 107:src/os/pwm.c **** void pwm_duty_set_percent(int channel, u_int16_t duty) + 108:src/os/pwm.c **** { + 273 .loc 1 108 0 + 274 .cfi_startproc + 275 @ Function supports interworking. + 276 @ args = 0, pretend = 0, frame = 0 + 277 @ frame_needed = 0, uses_anonymous_args = 0 + 278 .LVL26: + 279 0150 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 280 .LCFI2: + 281 .cfi_def_cfa_offset 16 + 109:src/os/pwm.c **** u_int32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; + 282 .loc 1 109 0 + 283 0154 40409FE5 ldr r4, .L26 + 284 .cfi_offset 14, -4 + 285 .cfi_offset 5, -8 + 286 .cfi_offset 4, -12 + 287 .cfi_offset 3, -16 + 288 0158 80C2A0E1 mov ip, r0, asl #5 + 289 015c 04408CE0 add r4, ip, r4 + 290 0160 092194E5 ldr r2, [r4, #265] + 291 .LVL27: + 110:src/os/pwm.c **** + 111:src/os/pwm.c **** tmp = tmp << 16; /* extend value by 2^16 */ + 112:src/os/pwm.c **** tmp = tmp / 100; /* tmp = 1 % of extended cprd */ + 292 .loc 1 112 0 + 293 0164 34309FE5 ldr r3, .L26+4 + 111:src/os/pwm.c **** tmp = tmp << 16; /* extend value by 2^16 */ + 294 .loc 1 111 0 + 295 0168 0208A0E1 mov r0, r2, asl #16 + 296 .LVL28: + 297 .loc 1 112 0 + 298 016c 932080E0 umull r2, r0, r3, r0 + 299 .LVL29: + 300 0170 A052A0E1 mov r5, r0, lsr #5 + 301 .LVL30: + 113:src/os/pwm.c **** tmp = duty * tmp; /* tmp = 'duty' % of extended cprd */ + 302 .loc 1 113 0 + 303 0174 910505E0 mul r5, r1, r5 + 304 .LVL31: + 114:src/os/pwm.c **** tmp = tmp >> 16; /* un-extend tmp (divide by 2^16) */ + 305 .loc 1 114 0 + 306 0178 2558A0E1 mov r5, r5, lsr #16 + 307 .LVL32: + 115:src/os/pwm.c **** + 116:src/os/pwm.c **** DEBUGPWM("Writing %u to Update register\n", tmp); + 308 .loc 1 116 0 + 309 017c 20009FE5 ldr r0, .L26+8 + 310 0180 20109FE5 ldr r1, .L26+12 + 311 .LVL33: + 312 0184 7420A0E3 mov r2, #116 + 313 0188 0530A0E1 mov r3, r5 + 314 018c FEFFFFEB bl debugp + 315 .LVL34: + 316 .LBB44: + 317 .LBB45: +2741:include/lib_AT91SAM7.h **** } +2742:include/lib_AT91SAM7.h **** +2743:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2744:include/lib_AT91SAM7.h **** //* \fn AT91F_PWM_UpdateChannel +2745:include/lib_AT91SAM7.h **** //* \brief Update Period or Duty Cycle +2746:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2747:include/lib_AT91SAM7.h **** static inline void AT91F_PWMC_UpdateChannel( +2748:include/lib_AT91SAM7.h **** AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +2749:include/lib_AT91SAM7.h **** unsigned int channelId, // \arg PWM channel ID +2750:include/lib_AT91SAM7.h **** unsigned int update) // \arg Channels IDs to be enabled +2751:include/lib_AT91SAM7.h **** { +2752:include/lib_AT91SAM7.h **** pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; + 318 .loc 2 2752 0 + 319 0190 115184E5 str r5, [r4, #273] + 320 .LBE45: + 321 .LBE44: + 117:src/os/pwm.c **** AT91F_PWMC_UpdateChannel(AT91C_BASE_PWMC, channel, tmp); + 118:src/os/pwm.c **** } + 322 .loc 1 118 0 + 323 0194 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 324 0198 1EFF2FE1 bx lr + 325 .L27: + 326 .align 2 + 327 .L26: + 328 019c FFC0FCFF .word -212737 + 329 01a0 1F85EB51 .word 1374389535 + 330 01a4 48000000 .word .LC2 + 331 01a8 10000000 .word .LANCHOR0+16 + 332 .cfi_endproc + 333 .LFE282: + 335 .align 2 + 337 pwm_usb_in: + 338 .LFB283: + 119:src/os/pwm.c **** + 120:src/os/pwm.c **** static int pwm_usb_in(struct req_ctx *rctx) + 121:src/os/pwm.c **** { + 339 .loc 1 121 0 + 340 .cfi_startproc + 341 @ Function supports interworking. + 342 @ args = 0, pretend = 0, frame = 0 + 343 @ frame_needed = 0, uses_anonymous_args = 0 + 344 .LVL35: + 345 01ac 10402DE9 stmfd sp!, {r4, lr} + 346 .LCFI3: + 347 .cfi_def_cfa_offset 8 + 122:src/os/pwm.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 348 .loc 1 122 0 + 349 01b0 083090E5 ldr r3, [r0, #8] + 350 .LVL36: + 123:src/os/pwm.c **** u_int32_t *freq; + 124:src/os/pwm.c **** + 125:src/os/pwm.c **** switch (poh->cmd) { + 351 .loc 1 125 0 + 352 01b4 0010D3E5 ldrb r1, [r3, #0] @ zero_extendqisi2 + 353 01b8 412041E2 sub r2, r1, #65 + 121:src/os/pwm.c **** { + 354 .loc 1 121 0 + 355 01bc 0040A0E1 mov r4, r0 + 356 .cfi_offset 14, -4 + 357 .cfi_offset 4, -8 + 358 .loc 1 125 0 + 359 01c0 040052E3 cmp r2, #4 + 360 01c4 02F19F97 ldrls pc, [pc, r2, asl #2] + 361 01c8 070000EA b .L29 + 362 .L34: + 363 01cc 34020000 .word .L30 + 364 01d0 E0010000 .word .L31 + 365 01d4 1C020000 .word .L32 + 366 01d8 00020000 .word .L33 + 367 01dc 1C020000 .word .L32 + 368 .LVL37: + 369 .L31: + 126:src/os/pwm.c **** case OPENPCD_CMD_PWM_ENABLE: + 127:src/os/pwm.c **** if (poh->val) + 128:src/os/pwm.c **** pwm_start(0); + 129:src/os/pwm.c **** else + 130:src/os/pwm.c **** pwm_stop(0); + 131:src/os/pwm.c **** break; + 132:src/os/pwm.c **** case OPENPCD_CMD_PWM_DUTY_SET: + 133:src/os/pwm.c **** pwm_duty_set_percent(0, poh->val); + 370 .loc 1 133 0 + 371 01e0 0000A0E3 mov r0, #0 + 372 .LVL38: + 373 01e4 0310D3E5 ldrb r1, [r3, #3] @ zero_extendqisi2 + 374 01e8 FEFFFFEB bl pwm_duty_set_percent + 375 .LVL39: + 376 .L29: + 134:src/os/pwm.c **** break; + 135:src/os/pwm.c **** case OPENPCD_CMD_PWM_DUTY_GET: + 136:src/os/pwm.c **** goto respond; + 137:src/os/pwm.c **** break; + 138:src/os/pwm.c **** case OPENPCD_CMD_PWM_FREQ_SET: + 139:src/os/pwm.c **** if (rctx->tot_len < sizeof(*poh)+4) + 140:src/os/pwm.c **** break; + 141:src/os/pwm.c **** freq = (u_int32_t *) ((unsigned char *) poh) + sizeof(*poh); + 142:src/os/pwm.c **** pwm_freq_set(0, *freq); + 143:src/os/pwm.c **** break; + 144:src/os/pwm.c **** case OPENPCD_CMD_PWM_FREQ_GET: + 145:src/os/pwm.c **** goto respond; + 146:src/os/pwm.c **** break; + 147:src/os/pwm.c **** default: + 148:src/os/pwm.c **** break; + 149:src/os/pwm.c **** } + 150:src/os/pwm.c **** + 151:src/os/pwm.c **** req_ctx_put(rctx); + 377 .loc 1 151 0 + 378 01ec 0400A0E1 mov r0, r4 + 379 01f0 FEFFFFEB bl req_ctx_put + 152:src/os/pwm.c **** return 0; + 380 .loc 1 152 0 + 381 01f4 0000A0E3 mov r0, #0 + 382 .L36: + 153:src/os/pwm.c **** respond: + 154:src/os/pwm.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 155:src/os/pwm.c **** udp_refill_ep(2); + 156:src/os/pwm.c **** return 1; + 157:src/os/pwm.c **** } + 383 .loc 1 157 0 + 384 01f8 1040BDE8 ldmfd sp!, {r4, lr} + 385 01fc 1EFF2FE1 bx lr + 386 .LVL40: + 387 .L33: + 139:src/os/pwm.c **** if (rctx->tot_len < sizeof(*poh)+4) + 388 .loc 1 139 0 + 389 0200 B6E0D0E1 ldrh lr, [r0, #6] + 390 0204 07005EE3 cmp lr, #7 + 391 0208 F7FFFF9A bls .L29 + 392 .LVL41: + 142:src/os/pwm.c **** pwm_freq_set(0, *freq); + 393 .loc 1 142 0 + 394 020c 101093E5 ldr r1, [r3, #16] + 395 0210 0000A0E3 mov r0, #0 + 396 0214 FEFFFFEB bl pwm_freq_set + 397 .LVL42: + 143:src/os/pwm.c **** break; + 398 .loc 1 143 0 + 399 0218 F3FFFFEA b .L29 + 400 .LVL43: + 401 .L32: + 154:src/os/pwm.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 402 .loc 1 154 0 + 403 021c 1010A0E3 mov r1, #16 + 404 0220 FEFFFFEB bl req_ctx_set_state + 405 .LVL44: + 155:src/os/pwm.c **** udp_refill_ep(2); + 406 .loc 1 155 0 + 407 0224 0200A0E3 mov r0, #2 + 408 0228 FEFFFFEB bl udp_refill_ep + 156:src/os/pwm.c **** return 1; + 409 .loc 1 156 0 + 410 022c 0100A0E3 mov r0, #1 + 411 0230 F0FFFFEA b .L36 + 412 .LVL45: + 413 .L30: + 127:src/os/pwm.c **** if (poh->val) + 414 .loc 1 127 0 + 415 0234 03C0D3E5 ldrb ip, [r3, #3] @ zero_extendqisi2 + 416 .LBB46: + 417 .LBB47: + 418 .LBB48: +2729:include/lib_AT91SAM7.h **** pPWM->PWMC_ENA = flag; + 419 .loc 2 2729 0 + 420 0238 10309FE5 ldr r3, .L37 + 421 .LVL46: + 422 .LBE48: + 423 .LBE47: + 424 .LBE46: + 127:src/os/pwm.c **** if (poh->val) + 425 .loc 1 127 0 + 426 023c 00005CE3 cmp ip, #0 + 427 .LVL47: + 428 .LBB51: + 429 .LBB50: + 430 .LBB49: +2729:include/lib_AT91SAM7.h **** pPWM->PWMC_ENA = flag; + 431 .loc 2 2729 0 + 432 0240 0100A0E3 mov r0, #1 + 433 0244 FB000315 strne r0, [r3, #-251] + 434 .LVL48: + 435 .LBE49: + 436 .LBE50: + 437 .LBE51: + 438 .LBB52: + 439 .LBB53: + 440 .LBB54: +2740:include/lib_AT91SAM7.h **** pPWM->PWMC_DIS = flag; + 441 .loc 2 2740 0 + 442 0248 F7000305 streq r0, [r3, #-247] + 443 024c E6FFFFEA b .L29 + 444 .L38: + 445 .align 2 + 446 .L37: + 447 0250 FFC0FCFF .word -212737 + 448 .LBE54: + 449 .LBE53: + 450 .LBE52: + 451 .cfi_endproc + 452 .LFE283: + 454 .align 2 + 455 .global pwm_init + 457 pwm_init: + 458 .LFB284: + 158:src/os/pwm.c **** + 159:src/os/pwm.c **** void pwm_init(void) + 160:src/os/pwm.c **** { + 459 .loc 1 160 0 + 460 .cfi_startproc + 461 @ Function supports interworking. + 462 @ args = 0, pretend = 0, frame = 0 + 463 @ frame_needed = 0, uses_anonymous_args = 0 + 464 .LVL49: + 465 0254 08402DE9 stmfd sp!, {r3, lr} + 466 .LCFI4: + 467 .cfi_def_cfa_offset 8 + 468 .LBB55: + 469 .LBB56: + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 470 .loc 2 417 0 + 471 0258 0B2CE0E3 mvn r2, #2816 + 472 025c 0238A0E3 mov r3, #131072 + 473 .cfi_offset 14, -4 + 474 .cfi_offset 3, -8 + 475 .LBE56: + 476 .LBE55: + 477 .LBB58: + 478 .LBB60: + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 479 .loc 2 392 0 + 480 0260 02E5A0E3 mov lr, #8388608 + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 481 .loc 2 391 0 + 482 0264 00C0A0E3 mov ip, #0 + 483 .LBE60: + 484 .LBE58: + 485 .LBB62: + 486 .LBB57: + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 487 .loc 2 417 0 + 488 0268 EB3002E5 str r3, [r2, #-235] + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 489 .loc 2 418 0 + 490 026c FF3002E5 str r3, [r2, #-255] + 491 .LVL50: + 492 .LBE57: + 493 .LBE62: + 494 .LBB63: + 495 .LBB59: + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 496 .loc 2 391 0 + 497 0270 8FC002E5 str ip, [r2, #-143] + 498 .LBE59: + 499 .LBE63: + 500 .LBB64: + 501 .LBB66: + 502 .LBB68: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 503 .loc 2 940 0 + 504 0274 033CE0E3 mvn r3, #768 + 505 .LBE68: + 506 .LBE66: + 507 .LBE64: + 508 .LBB71: + 509 .LBB61: + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 510 .loc 2 392 0 + 511 0278 8BE002E5 str lr, [r2, #-139] + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 512 .loc 2 393 0 + 513 027c FBE002E5 str lr, [r2, #-251] + 514 .LVL51: + 515 .LBE61: + 516 .LBE71: + 517 .LBB72: + 518 .LBB65: + 519 .LBB67: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 520 .loc 2 940 0 + 521 0280 012BA0E3 mov r2, #1024 + 522 .LBE67: + 523 .LBE65: + 524 .LBE72: + 161:src/os/pwm.c **** /* IMPORTANT: Disable PA17 (SSC TD) output */ + 162:src/os/pwm.c **** AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PIO_PA17); + 163:src/os/pwm.c **** + 164:src/os/pwm.c **** /* Set PA23 to Peripheral A (PWM0) */ + 165:src/os/pwm.c **** AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, OPENPCD_PIO_MFIN_PWM); + 166:src/os/pwm.c **** + 167:src/os/pwm.c **** /* Enable Clock for PWM controller */ + 168:src/os/pwm.c **** AT91F_PWMC_CfgPMC(); + 169:src/os/pwm.c **** + 170:src/os/pwm.c **** usb_hdlr_register(&pwm_usb_in, OPENPCD_CMD_CLS_PWM); + 525 .loc 1 170 0 + 526 0284 0410A0E3 mov r1, #4 + 527 .LBB73: + 528 .LBB70: + 529 .LBB69: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 530 .loc 2 940 0 + 531 0288 EF2003E5 str r2, [r3, #-239] + 532 .LBE69: + 533 .LBE70: + 534 .LBE73: + 535 .loc 1 170 0 + 536 028c 08009FE5 ldr r0, .L40 + 537 0290 FEFFFFEB bl usb_hdlr_register + 171:src/os/pwm.c **** } + 538 .loc 1 171 0 + 539 0294 0840BDE8 ldmfd sp!, {r3, lr} + 540 0298 1EFF2FE1 bx lr + 541 .L41: + 542 .align 2 + 543 .L40: + 544 029c 00000000 .word pwm_usb_in + 545 .cfi_endproc + 546 .LFE284: + 548 .align 2 + 549 .global pwm_fini + 551 pwm_fini: + 552 .LFB285: + 172:src/os/pwm.c **** + 173:src/os/pwm.c **** void pwm_fini(void) + 174:src/os/pwm.c **** { + 553 .loc 1 174 0 + 554 .cfi_startproc + 555 @ Function supports interworking. + 556 @ args = 0, pretend = 0, frame = 0 + 557 @ frame_needed = 0, uses_anonymous_args = 0 + 558 02a0 08402DE9 stmfd sp!, {r3, lr} + 559 .LCFI5: + 560 .cfi_def_cfa_offset 8 + 175:src/os/pwm.c **** usb_hdlr_unregister(OPENPCD_CMD_CLS_PWM); + 561 .loc 1 175 0 + 562 02a4 0400A0E3 mov r0, #4 + 563 .cfi_offset 14, -4 + 564 .cfi_offset 3, -8 + 565 02a8 FEFFFFEB bl usb_hdlr_unregister + 566 .LVL52: + 567 .LBB74: + 568 .LBB75: + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 569 .loc 2 951 0 + 570 02ac 012BA0E3 mov r2, #1024 + 571 02b0 033CE0E3 mvn r3, #768 + 572 02b4 EB2003E5 str r2, [r3, #-235] + 573 .LBE75: + 574 .LBE74: + 176:src/os/pwm.c **** AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, (1 << AT91C_ID_PWMC)); + 177:src/os/pwm.c **** } + 575 .loc 1 177 0 + 576 02b8 0840BDE8 ldmfd sp!, {r3, lr} + 577 02bc 1EFF2FE1 bx lr + 578 .cfi_endproc + 579 .LFE285: + 581 .section .rodata + 582 .align 2 + 583 .set .LANCHOR0,. + 0 + 586 __FUNCTION__.6063: + 587 0000 70776D5F .ascii "pwm_freq_set\000" + 587 66726571 + 587 5F736574 + 587 00 + 588 000d 000000 .space 3 + 591 __FUNCTION__.6075: + 592 0010 70776D5F .ascii "pwm_duty_set_percent\000" + 592 64757479 + 592 5F736574 + 592 5F706572 + 592 63656E74 + 593 0025 000000 .section .rodata.str1.4,"aMS",%progbits,1 + 594 .align 2 + 595 .LC0: + 596 0000 25732825 .ascii "%s(%d): mclk=%u, freq=%u, overall_div=%u\015\012\000" + 596 64293A20 + 596 6D636C6B + 596 3D25752C + 596 20667265 + 597 002b 00 .space 1 + 598 .LC1: + 599 002c 25732825 .ascii "%s(%d): cpre=%u, cprd=%u\015\012\000" + 599 64293A20 + 599 63707265 + 599 3D25752C + 599 20637072 + 600 0047 00 .space 1 + 601 .LC2: + 602 0048 25732825 .ascii "%s(%d): Writing %u to Update register\012\015\012\000" + 602 64293A20 + 602 57726974 + 602 696E6720 + 602 25752074 + 603 0071 000000 .text + 604 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 pwm.c +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:22 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:25 .text:00000000 pwm_freq_set +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:196 .text:0000010c $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:204 .text:00000120 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:207 .text:00000120 pwm_start +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:232 .text:00000134 $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:236 .text:00000138 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:239 .text:00000138 pwm_stop +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:264 .text:0000014c $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:268 .text:00000150 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:271 .text:00000150 pwm_duty_set_percent +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:328 .text:0000019c $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:335 .text:000001ac $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:337 .text:000001ac pwm_usb_in +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:363 .text:000001cc $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:371 .text:000001e0 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:447 .text:00000250 $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:454 .text:00000254 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:457 .text:00000254 pwm_init +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:544 .text:0000029c $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:548 .text:000002a0 $a +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:551 .text:000002a0 pwm_fini +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:582 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:586 .rodata:00000000 __FUNCTION__.6063 +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:591 .rodata:00000010 __FUNCTION__.6075 +C:\Users\netz\AppData\Local\Temp\cca1f5yF.s:594 .rodata.str1.4:00000000 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +__aeabi_uidiv +debugp +req_ctx_put +req_ctx_set_state +udp_refill_ep +usb_hdlr_register +usb_hdlr_unregister diff --git a/firmware/src/os/req_ctx.c b/firmware/src/os/req_ctx.c new file mode 100644 index 0000000..36c3059 --- /dev/null +++ b/firmware/src/os/req_ctx.c @@ -0,0 +1,100 @@ +/* AT91SAM7 USB Request Context for OpenPCD / OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include + +#include "../openpcd.h" + +/* FIXME: locking, FIFO order processing */ + +#define NUM_RCTX_SMALL 8 +#define NUM_RCTX_LARGE 4 + +#define NUM_REQ_CTX (NUM_RCTX_SMALL+NUM_RCTX_LARGE) + +static u_int8_t rctx_data[NUM_RCTX_SMALL][RCTX_SIZE_SMALL]; +static u_int8_t rctx_data_large[NUM_RCTX_LARGE][RCTX_SIZE_LARGE]; + +static struct req_ctx req_ctx[NUM_REQ_CTX]; + +struct req_ctx __ramfunc *req_ctx_find_get(int large, + unsigned long old_state, + unsigned long new_state) +{ + unsigned long flags; + u_int8_t i; + + if (large) + i = NUM_RCTX_SMALL; + else + i = 0; + + for (; i < NUM_REQ_CTX; i++) { + local_irq_save(flags); + if (req_ctx[i].state == old_state) { + req_ctx[i].state = new_state; + local_irq_restore(flags); + return &req_ctx[i]; + } + local_irq_restore(flags); + } + + return NULL; +} + +u_int8_t req_ctx_num(struct req_ctx *ctx) +{ + return ((char *)ctx - (char *)&req_ctx[0])/sizeof(*ctx); +} + +void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state) +{ + unsigned long flags; + + /* FIXME: do we need this kind of locking, we're UP! */ + local_irq_save(flags); + ctx->state = new_state; + local_irq_restore(flags); +} + +void req_ctx_put(struct req_ctx *ctx) +{ + req_ctx_set_state(ctx, RCTX_STATE_FREE); +} + +void req_ctx_init(void) +{ + int i; + + for (i = 0; i < NUM_RCTX_SMALL; i++) { + req_ctx[i].size = RCTX_SIZE_SMALL; + req_ctx[i].data = rctx_data[i]; + req_ctx[i].state = RCTX_STATE_FREE; + } + + for (i = 0; i < NUM_RCTX_LARGE; i++) { + req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + } +} diff --git a/firmware/src/os/req_ctx.h b/firmware/src/os/req_ctx.h new file mode 100644 index 0000000..ac9ab3f --- /dev/null +++ b/firmware/src/os/req_ctx.h @@ -0,0 +1,49 @@ +#ifndef _REQ_CTX_H +#define _REQ_CTX_H + +#define RCTX_SIZE_LARGE 2048 +#define RCTX_SIZE_SMALL 64 + +#define MAX_HDRSIZE sizeof(struct openpcd_hdr) +#define MAX_REQSIZE (64-MAX_HDRSIZE) + +#define req_buf_payload(x) (x->data[x->hdr_len]) +#define req_buf_hdr(x) (x->data[0]) + +#include +#include + +struct req_ctx { + volatile u_int32_t state; + u_int16_t size; + u_int16_t tot_len; + u_int8_t *data; +}; + +#define RCTX_STATE_FREE 0xfe +#define RCTX_STATE_UDP_RCV_BUSY 0x01 +#define RCTX_STATE_UDP_RCV_DONE 0x02 +#define RCTX_STATE_MAIN_PROCESSING 0x03 +#define RCTX_STATE_RC632IRQ_BUSY 0x04 + +#define RCTX_STATE_UDP_EP2_PENDING 0x10 +#define RCTX_STATE_UDP_EP2_BUSY 0x11 + +#define RCTX_STATE_UDP_EP3_PENDING 0x12 +#define RCTX_STATE_UDP_EP3_BUSY 0x13 + +#define RCTX_STATE_SSC_RX_BUSY 0x20 + +#define RCTX_STATE_LIBRFID_BUSY 0x30 + +#define RCTX_STATE_PIOIRQ_BUSY 0x80 + +#define RCTX_STATE_INVALID 0xff + +extern struct req_ctx __ramfunc *req_ctx_find_get(int large, unsigned long old_state, unsigned long new_state); +extern struct req_ctx *req_ctx_find_busy(void); +extern void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state); +extern void req_ctx_put(struct req_ctx *ctx); +extern u_int8_t req_ctx_num(struct req_ctx *ctx); + +#endif /* _REQ_CTX_H */ diff --git a/firmware/src/os/req_ctx.lst b/firmware/src/os/req_ctx.lst new file mode 100644 index 0000000..8d9a31c --- /dev/null +++ b/firmware/src/os/req_ctx.lst @@ -0,0 +1,482 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "req_ctx.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .section .fastrun,"ax",%progbits + 22 .align 2 + 23 .global req_ctx_find_get + 25 req_ctx_find_get: + 26 .LFB280: + 27 .file 1 "src/os/req_ctx.c" + 1:src/os/req_ctx.c **** /* AT91SAM7 USB Request Context for OpenPCD / OpenPICC + 2:src/os/req_ctx.c **** * (C) 2006 by Harald Welte + 3:src/os/req_ctx.c **** * + 4:src/os/req_ctx.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/req_ctx.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/req_ctx.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/req_ctx.c **** * (at your option) any later version. + 8:src/os/req_ctx.c **** * + 9:src/os/req_ctx.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/req_ctx.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/req_ctx.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/req_ctx.c **** * GNU General Public License for more details. + 13:src/os/req_ctx.c **** * + 14:src/os/req_ctx.c **** * You should have received a copy of the GNU General Public License + 15:src/os/req_ctx.c **** * along with this program; if not, write to the Free Software + 16:src/os/req_ctx.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/req_ctx.c **** * + 18:src/os/req_ctx.c **** */ + 19:src/os/req_ctx.c **** + 20:src/os/req_ctx.c **** #include + 21:src/os/req_ctx.c **** #include + 22:src/os/req_ctx.c **** #include + 23:src/os/req_ctx.c **** #include + 24:src/os/req_ctx.c **** #include + 25:src/os/req_ctx.c **** #include + 26:src/os/req_ctx.c **** + 27:src/os/req_ctx.c **** #include "../openpcd.h" + 28:src/os/req_ctx.c **** + 29:src/os/req_ctx.c **** /* FIXME: locking, FIFO order processing */ + 30:src/os/req_ctx.c **** + 31:src/os/req_ctx.c **** #define NUM_RCTX_SMALL 8 + 32:src/os/req_ctx.c **** #define NUM_RCTX_LARGE 4 + 33:src/os/req_ctx.c **** + 34:src/os/req_ctx.c **** #define NUM_REQ_CTX (NUM_RCTX_SMALL+NUM_RCTX_LARGE) + 35:src/os/req_ctx.c **** + 36:src/os/req_ctx.c **** static u_int8_t rctx_data[NUM_RCTX_SMALL][RCTX_SIZE_SMALL]; + 37:src/os/req_ctx.c **** static u_int8_t rctx_data_large[NUM_RCTX_LARGE][RCTX_SIZE_LARGE]; + 38:src/os/req_ctx.c **** + 39:src/os/req_ctx.c **** static struct req_ctx req_ctx[NUM_REQ_CTX]; + 40:src/os/req_ctx.c **** + 41:src/os/req_ctx.c **** struct req_ctx __ramfunc *req_ctx_find_get(int large, + 42:src/os/req_ctx.c **** unsigned long old_state, + 43:src/os/req_ctx.c **** unsigned long new_state) + 44:src/os/req_ctx.c **** { + 28 .loc 1 44 0 + 29 .cfi_startproc + 30 @ Function supports interworking. + 31 @ args = 0, pretend = 0, frame = 0 + 32 @ frame_needed = 0, uses_anonymous_args = 0 + 33 @ link register save eliminated. + 34 .LVL0: + 35 0000 30002DE9 stmfd sp!, {r4, r5} + 36 .LCFI0: + 37 .cfi_def_cfa_offset 8 + 45:src/os/req_ctx.c **** unsigned long flags; + 46:src/os/req_ctx.c **** u_int8_t i; + 47:src/os/req_ctx.c **** + 48:src/os/req_ctx.c **** if (large) + 49:src/os/req_ctx.c **** i = NUM_RCTX_SMALL; + 38 .loc 1 49 0 + 39 0004 000050E3 cmp r0, #0 + 40 0008 54309FE5 ldr r3, .L10 + 41 000c 0800A013 movne r0, #8 + 42 .LVL1: + 43 0010 0000A003 moveq r0, #0 + 44 .L5: + 45 .LBB5: + 50:src/os/req_ctx.c **** else + 51:src/os/req_ctx.c **** i = 0; + 52:src/os/req_ctx.c **** + 53:src/os/req_ctx.c **** for (; i < NUM_REQ_CTX; i++) { + 54:src/os/req_ctx.c **** local_irq_save(flags); + 46 .loc 1 54 0 + 47 @ 54 "src/os/req_ctx.c" 1 + 48 0014 00400FE1 mrs r4, cpsr @ local_irq_save + 49 0018 80C084E3 orr ip, r4, #128 + 50 001c 0CF021E1 msr cpsr_c, ip + 51 @ 0 "" 2 + 52 .LBE5: + 55:src/os/req_ctx.c **** if (req_ctx[i].state == old_state) { + 53 .loc 1 55 0 + 54 0020 80C080E0 add ip, r0, r0, asl #1 + 55 0024 0C5193E7 ldr r5, [r3, ip, asl #2] + 56 .cfi_offset 5, -4 + 57 .cfi_offset 4, -8 + 58 0028 010055E1 cmp r5, r1 + 59 002c 0CC183E0 add ip, r3, ip, asl #2 + 60 0030 0700000A beq .L9 + 56:src/os/req_ctx.c **** req_ctx[i].state = new_state; + 57:src/os/req_ctx.c **** local_irq_restore(flags); + 58:src/os/req_ctx.c **** return &req_ctx[i]; + 59:src/os/req_ctx.c **** } + 60:src/os/req_ctx.c **** local_irq_restore(flags); + 61 .loc 1 60 0 + 62 @ 60 "src/os/req_ctx.c" 1 + 63 0034 04F021E1 msr cpsr_c, r4 @ local_irq_restore + 64 + 65 @ 0 "" 2 + 53:src/os/req_ctx.c **** for (; i < NUM_REQ_CTX; i++) { + 66 .loc 1 53 0 + 67 0038 010080E2 add r0, r0, #1 + 68 003c FF0000E2 and r0, r0, #255 + 69 .LVL2: + 70 0040 0B0050E3 cmp r0, #11 + 71 0044 F2FFFF9A bls .L5 + 61:src/os/req_ctx.c **** } + 62:src/os/req_ctx.c **** + 63:src/os/req_ctx.c **** return NULL; + 72 .loc 1 63 0 + 73 0048 0000A0E3 mov r0, #0 + 74 .LVL3: + 75 .L4: + 64:src/os/req_ctx.c **** } + 76 .loc 1 64 0 + 77 004c 3000BDE8 ldmfd sp!, {r4, r5} + 78 0050 1EFF2FE1 bx lr + 79 .L9: + 56:src/os/req_ctx.c **** req_ctx[i].state = new_state; + 80 .loc 1 56 0 + 81 0054 00208CE5 str r2, [ip, #0] + 57:src/os/req_ctx.c **** local_irq_restore(flags); + 82 .loc 1 57 0 + 83 @ 57 "src/os/req_ctx.c" 1 + 84 0058 04F021E1 msr cpsr_c, r4 @ local_irq_restore + 85 + 86 @ 0 "" 2 + 58:src/os/req_ctx.c **** return &req_ctx[i]; + 87 .loc 1 58 0 + 88 005c 0C00A0E1 mov r0, ip + 89 0060 F9FFFFEA b .L4 + 90 .L11: + 91 .align 2 + 92 .L10: + 93 0064 00000000 .word .LANCHOR0 + 94 .cfi_endproc + 95 .LFE280: + 97 .text + 98 .align 2 + 99 .global req_ctx_num + 101 req_ctx_num: + 102 .LFB281: + 65:src/os/req_ctx.c **** + 66:src/os/req_ctx.c **** u_int8_t req_ctx_num(struct req_ctx *ctx) + 67:src/os/req_ctx.c **** { + 103 .loc 1 67 0 + 104 .cfi_startproc + 105 @ Function supports interworking. + 106 @ args = 0, pretend = 0, frame = 0 + 107 @ frame_needed = 0, uses_anonymous_args = 0 + 108 @ link register save eliminated. + 109 .LVL4: + 68:src/os/req_ctx.c **** return ((char *)ctx - (char *)&req_ctx[0])/sizeof(*ctx); + 110 .loc 1 68 0 + 111 0000 14309FE5 ldr r3, .L13 + 112 0004 14209FE5 ldr r2, .L13+4 + 113 0008 001063E0 rsb r1, r3, r0 + 114 000c 923181E0 umull r3, r1, r2, r1 + 67:src/os/req_ctx.c **** { + 115 .loc 1 67 0 + 116 0010 A101A0E1 mov r0, r1, lsr #3 + 117 .LVL5: + 69:src/os/req_ctx.c **** } + 118 .loc 1 69 0 + 119 0014 FF0000E2 and r0, r0, #255 + 120 0018 1EFF2FE1 bx lr + 121 .L14: + 122 .align 2 + 123 .L13: + 124 001c 00000000 .word .LANCHOR0 + 125 0020 ABAAAAAA .word -1431655765 + 126 .cfi_endproc + 127 .LFE281: + 129 .align 2 + 130 .global req_ctx_set_state + 132 req_ctx_set_state: + 133 .LFB282: + 70:src/os/req_ctx.c **** + 71:src/os/req_ctx.c **** void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state) + 72:src/os/req_ctx.c **** { + 134 .loc 1 72 0 + 135 .cfi_startproc + 136 @ Function supports interworking. + 137 @ args = 0, pretend = 0, frame = 0 + 138 @ frame_needed = 0, uses_anonymous_args = 0 + 139 @ link register save eliminated. + 140 .LVL6: + 141 .LBB6: + 73:src/os/req_ctx.c **** unsigned long flags; + 74:src/os/req_ctx.c **** + 75:src/os/req_ctx.c **** /* FIXME: do we need this kind of locking, we're UP! */ + 76:src/os/req_ctx.c **** local_irq_save(flags); + 142 .loc 1 76 0 + 143 @ 76 "src/os/req_ctx.c" 1 + 144 0024 00300FE1 mrs r3, cpsr @ local_irq_save + 145 0028 802083E3 orr r2, r3, #128 + 146 002c 02F021E1 msr cpsr_c, r2 + 147 @ 0 "" 2 + 148 .LBE6: + 77:src/os/req_ctx.c **** ctx->state = new_state; + 149 .loc 1 77 0 + 150 0030 001080E5 str r1, [r0, #0] + 78:src/os/req_ctx.c **** local_irq_restore(flags); + 151 .loc 1 78 0 + 152 @ 78 "src/os/req_ctx.c" 1 + 153 0034 03F021E1 msr cpsr_c, r3 @ local_irq_restore + 154 + 155 @ 0 "" 2 + 79:src/os/req_ctx.c **** } + 156 .loc 1 79 0 + 157 0038 1EFF2FE1 bx lr + 158 .cfi_endproc + 159 .LFE282: + 161 .align 2 + 162 .global req_ctx_put + 164 req_ctx_put: + 165 .LFB283: + 80:src/os/req_ctx.c **** + 81:src/os/req_ctx.c **** void req_ctx_put(struct req_ctx *ctx) + 82:src/os/req_ctx.c **** { + 166 .loc 1 82 0 + 167 .cfi_startproc + 168 @ Function supports interworking. + 169 @ args = 0, pretend = 0, frame = 0 + 170 @ frame_needed = 0, uses_anonymous_args = 0 + 171 @ link register save eliminated. + 172 .LVL7: + 173 .LBB7: + 174 .LBB8: + 175 .LBB9: + 76:src/os/req_ctx.c **** local_irq_save(flags); + 176 .loc 1 76 0 + 177 @ 76 "src/os/req_ctx.c" 1 + 178 003c 00300FE1 mrs r3, cpsr @ local_irq_save + 179 0040 802083E3 orr r2, r3, #128 + 180 0044 02F021E1 msr cpsr_c, r2 + 181 @ 0 "" 2 + 182 .LBE9: + 77:src/os/req_ctx.c **** ctx->state = new_state; + 183 .loc 1 77 0 + 184 0048 FE20A0E3 mov r2, #254 + 185 004c 002080E5 str r2, [r0, #0] + 78:src/os/req_ctx.c **** local_irq_restore(flags); + 186 .loc 1 78 0 + 187 @ 78 "src/os/req_ctx.c" 1 + 188 0050 03F021E1 msr cpsr_c, r3 @ local_irq_restore + 189 + 190 @ 0 "" 2 + 191 .LBE8: + 192 .LBE7: + 83:src/os/req_ctx.c **** req_ctx_set_state(ctx, RCTX_STATE_FREE); + 84:src/os/req_ctx.c **** } + 193 .loc 1 84 0 + 194 0054 1EFF2FE1 bx lr + 195 .cfi_endproc + 196 .LFE283: + 198 .align 2 + 199 .global req_ctx_init + 201 req_ctx_init: + 202 .LFB284: + 85:src/os/req_ctx.c **** + 86:src/os/req_ctx.c **** void req_ctx_init(void) + 87:src/os/req_ctx.c **** { + 203 .loc 1 87 0 + 204 .cfi_startproc + 205 @ Function supports interworking. + 206 @ args = 0, pretend = 0, frame = 0 + 207 @ frame_needed = 0, uses_anonymous_args = 0 + 208 @ link register save eliminated. + 209 .LVL8: + 88:src/os/req_ctx.c **** int i; + 89:src/os/req_ctx.c **** + 90:src/os/req_ctx.c **** for (i = 0; i < NUM_RCTX_SMALL; i++) { + 91:src/os/req_ctx.c **** req_ctx[i].size = RCTX_SIZE_SMALL; + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 210 .loc 1 92 0 + 211 0058 C4309FE5 ldr r3, .L18 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 94:src/os/req_ctx.c **** } + 95:src/os/req_ctx.c **** + 96:src/os/req_ctx.c **** for (i = 0; i < NUM_RCTX_LARGE; i++) { + 97:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 98:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i]; + 212 .loc 1 98 0 + 213 005c 29CE83E2 add ip, r3, #656 + 87:src/os/req_ctx.c **** { + 214 .loc 1 87 0 + 215 0060 F00F2DE9 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp} + 216 .LCFI1: + 217 .cfi_def_cfa_offset 32 + 91:src/os/req_ctx.c **** req_ctx[i].size = RCTX_SIZE_SMALL; + 218 .loc 1 91 0 + 219 0064 4010A0E3 mov r1, #64 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 220 .loc 1 93 0 + 221 0068 FE20A0E3 mov r2, #254 + 222 .loc 1 98 0 + 223 006c 014A8CE2 add r4, ip, #4096 + 224 .cfi_offset 11, -4 + 225 .cfi_offset 10, -8 + 226 .cfi_offset 9, -12 + 227 .cfi_offset 8, -16 + 228 .cfi_offset 7, -20 + 229 .cfi_offset 6, -24 + 230 .cfi_offset 5, -28 + 231 .cfi_offset 4, -32 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 232 .loc 1 93 0 + 233 0070 002083E5 str r2, [r3, #0] + 234 .LVL9: + 97:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 235 .loc 1 97 0 + 236 0074 020BA0E3 mov r0, #2048 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 237 .loc 1 93 0 + 238 0078 0C2083E5 str r2, [r3, #12] + 239 .LVL10: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 240 .loc 1 92 0 + 241 007c 909083E2 add r9, r3, #144 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 242 .loc 1 93 0 + 243 0080 182083E5 str r2, [r3, #24] + 244 .LVL11: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 245 .loc 1 92 0 + 246 0084 D0A083E2 add sl, r3, #208 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 247 .loc 1 93 0 + 248 0088 242083E5 str r2, [r3, #36] + 249 .LVL12: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 250 .loc 1 92 0 + 251 008c 118E83E2 add r8, r3, #272 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 252 .loc 1 93 0 + 253 0090 302083E5 str r2, [r3, #48] + 254 .LVL13: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 255 .loc 1 92 0 + 256 0094 157E83E2 add r7, r3, #336 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 257 .loc 1 93 0 + 258 0098 3C2083E5 str r2, [r3, #60] + 259 .LVL14: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 260 .loc 1 92 0 + 261 009c 196E83E2 add r6, r3, #400 + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 262 .loc 1 93 0 + 263 00a0 482083E5 str r2, [r3, #72] + 264 .LVL15: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 265 .loc 1 92 0 + 266 00a4 1D5E83E2 add r5, r3, #464 + 267 00a8 21BE83E2 add fp, r3, #528 + 268 .loc 1 98 0 + 269 00ac 804083E5 str r4, [r3, #128] + 91:src/os/req_ctx.c **** req_ctx[i].size = RCTX_SIZE_SMALL; + 270 .loc 1 91 0 + 271 00b0 B410C3E1 strh r1, [r3, #4] @ movhi + 272 .loc 1 98 0 + 273 00b4 064B8CE2 add r4, ip, #6144 + 91:src/os/req_ctx.c **** req_ctx[i].size = RCTX_SIZE_SMALL; + 274 .loc 1 91 0 + 275 00b8 B011C3E1 strh r1, [r3, #16] @ movhi + 276 00bc BC11C3E1 strh r1, [r3, #28] @ movhi + 277 00c0 B812C3E1 strh r1, [r3, #40] @ movhi + 278 00c4 B413C3E1 strh r1, [r3, #52] @ movhi + 279 00c8 B014C3E1 strh r1, [r3, #64] @ movhi + 280 00cc BC14C3E1 strh r1, [r3, #76] @ movhi + 281 00d0 B815C3E1 strh r1, [r3, #88] @ movhi + 93:src/os/req_ctx.c **** req_ctx[i].state = RCTX_STATE_FREE; + 282 .loc 1 93 0 + 283 00d4 542083E5 str r2, [r3, #84] + 284 .LVL16: + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 285 .loc 1 92 0 + 286 00d8 251E83E2 add r1, r3, #592 + 287 .loc 1 98 0 + 288 00dc A92E83E2 add r2, r3, #2704 + 92:src/os/req_ctx.c **** req_ctx[i].data = rctx_data[i]; + 289 .loc 1 92 0 + 290 00e0 089083E5 str r9, [r3, #8] + 291 00e4 14A083E5 str sl, [r3, #20] + 292 00e8 208083E5 str r8, [r3, #32] + 293 00ec 2C7083E5 str r7, [r3, #44] + 294 00f0 386083E5 str r6, [r3, #56] + 295 00f4 445083E5 str r5, [r3, #68] + 296 00f8 50B083E5 str fp, [r3, #80] + 297 00fc 5C1083E5 str r1, [r3, #92] + 97:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 298 .loc 1 97 0 + 299 0100 B406C3E1 strh r0, [r3, #100] @ movhi + 300 .loc 1 98 0 + 301 0104 68C083E5 str ip, [r3, #104] + 302 .LVL17: + 97:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 303 .loc 1 97 0 + 304 0108 B007C3E1 strh r0, [r3, #112] @ movhi + 305 .loc 1 98 0 + 306 010c 742083E5 str r2, [r3, #116] + 307 .LVL18: + 97:src/os/req_ctx.c **** req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE; + 308 .loc 1 97 0 + 309 0110 BC07C3E1 strh r0, [r3, #124] @ movhi + 310 0114 B808C3E1 strh r0, [r3, #136] @ movhi + 311 .loc 1 98 0 + 312 0118 8C4083E5 str r4, [r3, #140] + 313 .LVL19: + 99:src/os/req_ctx.c **** } + 100:src/os/req_ctx.c **** } + 314 .loc 1 100 0 + 315 011c F00FBDE8 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp} + 316 0120 1EFF2FE1 bx lr + 317 .L19: + 318 .align 2 + 319 .L18: + 320 0124 00000000 .word .LANCHOR0 + 321 .cfi_endproc + 322 .LFE284: + 324 .bss + 325 .align 2 + 326 .set .LANCHOR0,. + 0 + 329 req_ctx: + 330 0000 00000000 .space 144 + 330 00000000 + 330 00000000 + 330 00000000 + 330 00000000 + 333 rctx_data: + 334 0090 00000000 .space 512 + 334 00000000 + 334 00000000 + 334 00000000 + 334 00000000 + 337 rctx_data_large: + 338 0290 00000000 .space 8192 + 338 00000000 + 338 00000000 + 338 00000000 + 338 00000000 + 339 .text + 340 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 req_ctx.c +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:22 .fastrun:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:25 .fastrun:00000000 req_ctx_find_get +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:93 .fastrun:00000064 $d +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:98 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:101 .text:00000000 req_ctx_num +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:124 .text:0000001c $d +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:129 .text:00000024 $a +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:132 .text:00000024 req_ctx_set_state +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:164 .text:0000003c req_ctx_put +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:201 .text:00000058 req_ctx_init +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:320 .text:00000124 $d +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:325 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:329 .bss:00000000 req_ctx +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:333 .bss:00000090 rctx_data +C:\Users\netz\AppData\Local\Temp\ccBzISlZ.s:337 .bss:00000290 rctx_data_large + .debug_frame:00000010 $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/src/os/syscalls.c b/firmware/src/os/syscalls.c new file mode 100644 index 0000000..18f755a --- /dev/null +++ b/firmware/src/os/syscalls.c @@ -0,0 +1,169 @@ +/***********************************************************************/ +/* */ +/* SYSCALLS.C: System Calls */ +/* most of this is from newlib-lpc and a Keil-demo */ +/* */ +/* These are "reentrant functions" as needed by */ +/* the WinARM-newlib-config, see newlib-manual. */ +/* Collected and modified by Martin Thomas */ +/* */ +/***********************************************************************/ + + +#include +#include +#include + +#include + +static void my_putc(char c) +{ + while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + AT91F_US_PutChar((AT91PS_USART)AT91C_BASE_DBGU, c); +} + +static int my_kbhit( void ) +{ + if ((AT91F_US_RxReady((AT91PS_USART)AT91C_BASE_DBGU)) == 0) return 0; + else return 1; +} + +static char my_getc( void ) +{ + return AT91F_US_GetChar((AT91PS_USART)AT91C_BASE_DBGU); +} + +_ssize_t _read_r( + struct _reent *r, + int file, + void *ptr, + size_t len) +{ + char c; + unsigned int i; + unsigned char *p; + + p = (unsigned char*)ptr; + + for (i = 0; i < len; i++) { + // c = uart0Getch(); + // c = uart0GetchW(); + while ( !my_kbhit() ) ; + c = (char) my_getc(); + if (c == 0x0D) { + *p='\0'; + break; + } + *p++ = c; + ////// uart0_putc(c); + } + return len - i; +} + + +_ssize_t _write_r ( + struct _reent *r, + int file, + const void *ptr, + size_t len) +{ + int i; + const unsigned char *p; + + p = (const unsigned char*) ptr; + + for (i = 0; i < len; i++) { + if (*p == '\n' ) my_putc('\r'); + my_putc(*p++); + } + + return len; +} + + +int _close_r( + struct _reent *r, + int file) +{ + return 0; +} + + +_off_t _lseek_r( + struct _reent *r, + int file, + _off_t ptr, + int dir) +{ + return (_off_t)0; /* Always indicate we are at file beginning. */ +} + + +int _fstat_r( + struct _reent *r, + int file, + struct stat *st) +{ + /* Always set as character device. */ + st->st_mode = S_IFCHR; + /* assigned to strong type with implicit */ + /* signed/unsigned conversion. Required by */ + /* newlib. */ + + return 0; +} + + +int isatty(int file); /* avoid warning */ + +int isatty(int file) +{ + return 1; +} + + +#if 0 +static void _exit (int n) { +label: goto label; /* endless loop */ +} +#endif + + +/* "malloc clue function" from newlib-lpc/Keil-Demo/"generic" */ + +/**** Locally used variables. ****/ +// mt: "cleaner": extern char* end; +extern char end[]; /* end is set in the linker command */ + /* file and is the end of statically */ + /* allocated data (thus start of heap). */ + +static char *heap_ptr; /* Points to current end of the heap. */ + +/************************** _sbrk_r ************************************* + * Support function. Adjusts end of heap to provide more memory to + * memory allocator. Simple and dumb with no sanity checks. + + * struct _reent *r -- re-entrancy structure, used by newlib to + * support multiple threads of operation. + * ptrdiff_t nbytes -- number of bytes to add. + * Returns pointer to start of new heap area. + * + * Note: This implementation is not thread safe (despite taking a + * _reent structure as a parameter). + * Since _s_r is not used in the current implementation, + * the following messages must be suppressed. + */ +void * _sbrk_r( + struct _reent *_s_r, + ptrdiff_t nbytes) +{ + char *base; /* errno should be set to ENOMEM on error */ + + if (!heap_ptr) { /* Initialize if first time through. */ + heap_ptr = end; + } + base = heap_ptr; /* Point to end of heap. */ + heap_ptr += nbytes; /* Increase heap. */ + + return base; /* Return pointer to start of new heap area. */ +} diff --git a/firmware/src/os/syscalls.lst b/firmware/src/os/syscalls.lst new file mode 100644 index 0000000..d6ee3d2 --- /dev/null +++ b/firmware/src/os/syscalls.lst @@ -0,0 +1,3157 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "syscalls.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global _read_r + 24 _read_r: + 25 .LFB276: + 26 .file 1 "src/os/syscalls.c" + 1:src/os/syscalls.c **** /***********************************************************************/ + 2:src/os/syscalls.c **** /* */ + 3:src/os/syscalls.c **** /* SYSCALLS.C: System Calls */ + 4:src/os/syscalls.c **** /* most of this is from newlib-lpc and a Keil-demo */ + 5:src/os/syscalls.c **** /* */ + 6:src/os/syscalls.c **** /* These are "reentrant functions" as needed by */ + 7:src/os/syscalls.c **** /* the WinARM-newlib-config, see newlib-manual. */ + 8:src/os/syscalls.c **** /* Collected and modified by Martin Thomas */ + 9:src/os/syscalls.c **** /* */ + 10:src/os/syscalls.c **** /***********************************************************************/ + 11:src/os/syscalls.c **** + 12:src/os/syscalls.c **** + 13:src/os/syscalls.c **** #include + 14:src/os/syscalls.c **** #include + 15:src/os/syscalls.c **** #include + 16:src/os/syscalls.c **** + 17:src/os/syscalls.c **** #include + 18:src/os/syscalls.c **** + 19:src/os/syscalls.c **** static void my_putc(char c) + 20:src/os/syscalls.c **** { + 21:src/os/syscalls.c **** while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + 22:src/os/syscalls.c **** AT91F_US_PutChar((AT91PS_USART)AT91C_BASE_DBGU, c); + 23:src/os/syscalls.c **** } + 24:src/os/syscalls.c **** + 25:src/os/syscalls.c **** static int my_kbhit( void ) + 26:src/os/syscalls.c **** { + 27:src/os/syscalls.c **** if ((AT91F_US_RxReady((AT91PS_USART)AT91C_BASE_DBGU)) == 0) return 0; + 28:src/os/syscalls.c **** else return 1; + 29:src/os/syscalls.c **** } + 30:src/os/syscalls.c **** + 31:src/os/syscalls.c **** static char my_getc( void ) + 32:src/os/syscalls.c **** { + 33:src/os/syscalls.c **** return AT91F_US_GetChar((AT91PS_USART)AT91C_BASE_DBGU); + 34:src/os/syscalls.c **** } + 35:src/os/syscalls.c **** + 36:src/os/syscalls.c **** _ssize_t _read_r( + 37:src/os/syscalls.c **** struct _reent *r, + 38:src/os/syscalls.c **** int file, + 39:src/os/syscalls.c **** void *ptr, + 40:src/os/syscalls.c **** size_t len) + 41:src/os/syscalls.c **** { + 27 .loc 1 41 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 42:src/os/syscalls.c **** char c; + 43:src/os/syscalls.c **** unsigned int i; + 44:src/os/syscalls.c **** unsigned char *p; + 45:src/os/syscalls.c **** + 46:src/os/syscalls.c **** p = (unsigned char*)ptr; + 47:src/os/syscalls.c **** + 48:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 34 .loc 1 48 0 + 35 0000 000053E3 cmp r3, #0 + 36 .LVL1: + 37 0004 0300A001 moveq r0, r3 + 38 .LVL2: + 39 0008 0C00000A beq .L2 + 40 .LVL3: + 41 000c 0000A0E3 mov r0, #0 + 42 .LBB30: + 43 .LBB31: + 44 .LBB32: + 45 .LBB33: + 46 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:include/lib_AT91SAM7.h **** } +1574:include/lib_AT91SAM7.h **** +1575:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:include/lib_AT91SAM7.h **** { +1583:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:include/lib_AT91SAM7.h **** } +1585:include/lib_AT91SAM7.h **** +1586:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:include/lib_AT91SAM7.h **** { +1594:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:include/lib_AT91SAM7.h **** } +1596:include/lib_AT91SAM7.h **** +1597:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:include/lib_AT91SAM7.h **** int val) // chip select register +1608:include/lib_AT91SAM7.h **** { +1609:include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:include/lib_AT91SAM7.h **** } +1612:include/lib_AT91SAM7.h **** +1613:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:include/lib_AT91SAM7.h **** { +1621:include/lib_AT91SAM7.h **** //* Write to the IER register +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:include/lib_AT91SAM7.h **** } +1624:include/lib_AT91SAM7.h **** +1625:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:include/lib_AT91SAM7.h **** { +1633:include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:include/lib_AT91SAM7.h **** } +1636:include/lib_AT91SAM7.h **** +1637:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:include/lib_AT91SAM7.h **** ) +1644:include/lib_AT91SAM7.h **** { +1645:include/lib_AT91SAM7.h **** //* Write to the CR register +1646:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:include/lib_AT91SAM7.h **** } +1648:include/lib_AT91SAM7.h **** +1649:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:include/lib_AT91SAM7.h **** ) +1656:include/lib_AT91SAM7.h **** { +1657:include/lib_AT91SAM7.h **** //* Write to the CR register +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:include/lib_AT91SAM7.h **** } +1660:include/lib_AT91SAM7.h **** +1661:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:include/lib_AT91SAM7.h **** ) +1668:include/lib_AT91SAM7.h **** { +1669:include/lib_AT91SAM7.h **** //* Write to the CR register +1670:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:include/lib_AT91SAM7.h **** } +1672:include/lib_AT91SAM7.h **** +1673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:include/lib_AT91SAM7.h **** int mode) // mode register +1680:include/lib_AT91SAM7.h **** { +1681:include/lib_AT91SAM7.h **** //* Write to the MR register +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:include/lib_AT91SAM7.h **** } +1684:include/lib_AT91SAM7.h **** +1685:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:include/lib_AT91SAM7.h **** { +1693:include/lib_AT91SAM7.h **** //* Write to the MR register +1694:include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:include/lib_AT91SAM7.h **** } +1697:include/lib_AT91SAM7.h **** +1698:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:include/lib_AT91SAM7.h **** { +1709:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +1710:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:include/lib_AT91SAM7.h **** pBuffer, +1712:include/lib_AT91SAM7.h **** szBuffer, +1713:include/lib_AT91SAM7.h **** pNextBuffer, +1714:include/lib_AT91SAM7.h **** szNextBuffer); +1715:include/lib_AT91SAM7.h **** } +1716:include/lib_AT91SAM7.h **** +1717:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:include/lib_AT91SAM7.h **** { +1728:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +1729:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1730:include/lib_AT91SAM7.h **** pBuffer, +1731:include/lib_AT91SAM7.h **** szBuffer, +1732:include/lib_AT91SAM7.h **** pNextBuffer, +1733:include/lib_AT91SAM7.h **** szNextBuffer); +1734:include/lib_AT91SAM7.h **** } +1735:include/lib_AT91SAM7.h **** +1736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1737:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Close +1738:include/lib_AT91SAM7.h **** //* \brief Close SPI: disable IT disable transfert, close PDC +1739:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1740:include/lib_AT91SAM7.h **** extern void AT91F_SPI_Close(AT91PS_SPI pSPI); // \arg pointer to a SPI controller +1741:include/lib_AT91SAM7.h **** +1742:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1743:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_PutChar +1744:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +1745:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1746:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_PutChar ( +1747:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1748:include/lib_AT91SAM7.h **** unsigned int character, +1749:include/lib_AT91SAM7.h **** unsigned int cs_number ) +1750:include/lib_AT91SAM7.h **** { +1751:include/lib_AT91SAM7.h **** unsigned int value_for_cs; +1752:include/lib_AT91SAM7.h **** value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +1753:include/lib_AT91SAM7.h **** pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +1754:include/lib_AT91SAM7.h **** } +1755:include/lib_AT91SAM7.h **** +1756:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1757:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetChar +1758:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +1759:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1760:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_GetChar ( +1761:include/lib_AT91SAM7.h **** const AT91PS_SPI pSPI) +1762:include/lib_AT91SAM7.h **** { +1763:include/lib_AT91SAM7.h **** return((pSPI->SPI_RDR) & 0xFFFF); +1764:include/lib_AT91SAM7.h **** } +1765:include/lib_AT91SAM7.h **** +1766:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1767:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_GetInterruptMaskStatus +1768:include/lib_AT91SAM7.h **** //* \brief Return SPI Interrupt Mask Status +1769:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1770:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +1771:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi) // \arg pointer to a SPI controller +1772:include/lib_AT91SAM7.h **** { +1773:include/lib_AT91SAM7.h **** return pSpi->SPI_IMR; +1774:include/lib_AT91SAM7.h **** } +1775:include/lib_AT91SAM7.h **** +1776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1777:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_IsInterruptMasked +1778:include/lib_AT91SAM7.h **** //* \brief Test if SPI Interrupt is Masked +1779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1780:include/lib_AT91SAM7.h **** static inline int AT91F_SPI_IsInterruptMasked( +1781:include/lib_AT91SAM7.h **** AT91PS_SPI pSpi, // \arg pointer to a SPI controller +1782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1783:include/lib_AT91SAM7.h **** { +1784:include/lib_AT91SAM7.h **** return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +1785:include/lib_AT91SAM7.h **** } +1786:include/lib_AT91SAM7.h **** +1787:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1788:include/lib_AT91SAM7.h **** SOFTWARE API FOR ADC +1789:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1791:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableIt +1792:include/lib_AT91SAM7.h **** //* \brief Enable ADC interrupt +1793:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1794:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableIt ( +1795:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1796:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1797:include/lib_AT91SAM7.h **** { +1798:include/lib_AT91SAM7.h **** //* Write to the IER register +1799:include/lib_AT91SAM7.h **** pADC->ADC_IER = flag; +1800:include/lib_AT91SAM7.h **** } +1801:include/lib_AT91SAM7.h **** +1802:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1803:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableIt +1804:include/lib_AT91SAM7.h **** //* \brief Disable ADC interrupt +1805:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1806:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableIt ( +1807:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1808:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1809:include/lib_AT91SAM7.h **** { +1810:include/lib_AT91SAM7.h **** //* Write to the IDR register +1811:include/lib_AT91SAM7.h **** pADC->ADC_IDR = flag; +1812:include/lib_AT91SAM7.h **** } +1813:include/lib_AT91SAM7.h **** +1814:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1815:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetStatus +1816:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Status +1817:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1818:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +1819:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1820:include/lib_AT91SAM7.h **** { +1821:include/lib_AT91SAM7.h **** return pADC->ADC_SR; +1822:include/lib_AT91SAM7.h **** } +1823:include/lib_AT91SAM7.h **** +1824:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1825:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetInterruptMaskStatus +1826:include/lib_AT91SAM7.h **** //* \brief Return ADC Interrupt Mask Status +1827:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1828:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +1829:include/lib_AT91SAM7.h **** AT91PS_ADC pADC) // pointer to a ADC controller +1830:include/lib_AT91SAM7.h **** { +1831:include/lib_AT91SAM7.h **** return pADC->ADC_IMR; +1832:include/lib_AT91SAM7.h **** } +1833:include/lib_AT91SAM7.h **** +1834:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1835:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsInterruptMasked +1836:include/lib_AT91SAM7.h **** //* \brief Test if ADC Interrupt is Masked +1837:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1838:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsInterruptMasked( +1839:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1840:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1841:include/lib_AT91SAM7.h **** { +1842:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +1843:include/lib_AT91SAM7.h **** } +1844:include/lib_AT91SAM7.h **** +1845:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1846:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_IsStatusSet +1847:include/lib_AT91SAM7.h **** //* \brief Test if ADC Status is Set +1848:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1849:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_IsStatusSet( +1850:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // \arg pointer to a ADC controller +1851:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1852:include/lib_AT91SAM7.h **** { +1853:include/lib_AT91SAM7.h **** return (AT91F_ADC_GetStatus(pADC) & flag); +1854:include/lib_AT91SAM7.h **** } +1855:include/lib_AT91SAM7.h **** +1856:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1857:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgModeReg +1858:include/lib_AT91SAM7.h **** //* \brief Configure the Mode Register of the ADC controller +1859:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1860:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_CfgModeReg ( +1861:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1862:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1863:include/lib_AT91SAM7.h **** { +1864:include/lib_AT91SAM7.h **** //* Write to the MR register +1865:include/lib_AT91SAM7.h **** pADC->ADC_MR = mode; +1866:include/lib_AT91SAM7.h **** } +1867:include/lib_AT91SAM7.h **** +1868:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1869:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetModeReg +1870:include/lib_AT91SAM7.h **** //* \brief Return the Mode Register of the ADC controller value +1871:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1872:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetModeReg ( +1873:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1874:include/lib_AT91SAM7.h **** ) +1875:include/lib_AT91SAM7.h **** { +1876:include/lib_AT91SAM7.h **** return pADC->ADC_MR; +1877:include/lib_AT91SAM7.h **** } +1878:include/lib_AT91SAM7.h **** +1879:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1880:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_CfgTimings +1881:include/lib_AT91SAM7.h **** //* \brief Configure the different necessary timings of the ADC controller +1882:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1883:include/lib_AT91SAM7.h **** extern void AT91F_ADC_CfgTimings ( +1884:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1885:include/lib_AT91SAM7.h **** unsigned int mck_clock, // in MHz +1886:include/lib_AT91SAM7.h **** unsigned int adc_clock, // in MHz +1887:include/lib_AT91SAM7.h **** unsigned int startup_time, // in us +1888:include/lib_AT91SAM7.h **** unsigned int sample_and_hold_time); // in ns +1889:include/lib_AT91SAM7.h **** +1890:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1891:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_EnableChannel +1892:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1893:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1894:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_EnableChannel ( +1895:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1896:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1897:include/lib_AT91SAM7.h **** { +1898:include/lib_AT91SAM7.h **** //* Write to the CHER register +1899:include/lib_AT91SAM7.h **** pADC->ADC_CHER = channel; +1900:include/lib_AT91SAM7.h **** } +1901:include/lib_AT91SAM7.h **** +1902:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1903:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_DisableChannel +1904:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1905:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1906:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_DisableChannel ( +1907:include/lib_AT91SAM7.h **** AT91PS_ADC pADC, // pointer to a ADC controller +1908:include/lib_AT91SAM7.h **** unsigned int channel) // mode register +1909:include/lib_AT91SAM7.h **** { +1910:include/lib_AT91SAM7.h **** //* Write to the CHDR register +1911:include/lib_AT91SAM7.h **** pADC->ADC_CHDR = channel; +1912:include/lib_AT91SAM7.h **** } +1913:include/lib_AT91SAM7.h **** +1914:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1915:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetChannelStatus +1916:include/lib_AT91SAM7.h **** //* \brief Return ADC Timer Register Value +1917:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1918:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetChannelStatus ( +1919:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1920:include/lib_AT91SAM7.h **** ) +1921:include/lib_AT91SAM7.h **** { +1922:include/lib_AT91SAM7.h **** return pADC->ADC_CHSR; +1923:include/lib_AT91SAM7.h **** } +1924:include/lib_AT91SAM7.h **** +1925:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1926:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_StartConversion +1927:include/lib_AT91SAM7.h **** //* \brief Software request for a analog to digital conversion +1928:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1929:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_StartConversion ( +1930:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1931:include/lib_AT91SAM7.h **** ) +1932:include/lib_AT91SAM7.h **** { +1933:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_START; +1934:include/lib_AT91SAM7.h **** } +1935:include/lib_AT91SAM7.h **** +1936:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1937:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_SoftReset +1938:include/lib_AT91SAM7.h **** //* \brief Software reset +1939:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1940:include/lib_AT91SAM7.h **** static inline void AT91F_ADC_SoftReset ( +1941:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1942:include/lib_AT91SAM7.h **** ) +1943:include/lib_AT91SAM7.h **** { +1944:include/lib_AT91SAM7.h **** pADC->ADC_CR = AT91C_ADC_SWRST; +1945:include/lib_AT91SAM7.h **** } +1946:include/lib_AT91SAM7.h **** +1947:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1948:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetLastConvertedData +1949:include/lib_AT91SAM7.h **** //* \brief Return the Last Converted Data +1950:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1951:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetLastConvertedData ( +1952:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1953:include/lib_AT91SAM7.h **** ) +1954:include/lib_AT91SAM7.h **** { +1955:include/lib_AT91SAM7.h **** return pADC->ADC_LCDR; +1956:include/lib_AT91SAM7.h **** } +1957:include/lib_AT91SAM7.h **** +1958:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1959:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH0 +1960:include/lib_AT91SAM7.h **** //* \brief Return the Channel 0 Converted Data +1961:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1962:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +1963:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1964:include/lib_AT91SAM7.h **** ) +1965:include/lib_AT91SAM7.h **** { +1966:include/lib_AT91SAM7.h **** return pADC->ADC_CDR0; +1967:include/lib_AT91SAM7.h **** } +1968:include/lib_AT91SAM7.h **** +1969:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1970:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH1 +1971:include/lib_AT91SAM7.h **** //* \brief Return the Channel 1 Converted Data +1972:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1973:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +1974:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1975:include/lib_AT91SAM7.h **** ) +1976:include/lib_AT91SAM7.h **** { +1977:include/lib_AT91SAM7.h **** return pADC->ADC_CDR1; +1978:include/lib_AT91SAM7.h **** } +1979:include/lib_AT91SAM7.h **** +1980:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1981:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH2 +1982:include/lib_AT91SAM7.h **** //* \brief Return the Channel 2 Converted Data +1983:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1984:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +1985:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1986:include/lib_AT91SAM7.h **** ) +1987:include/lib_AT91SAM7.h **** { +1988:include/lib_AT91SAM7.h **** return pADC->ADC_CDR2; +1989:include/lib_AT91SAM7.h **** } +1990:include/lib_AT91SAM7.h **** +1991:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1992:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH3 +1993:include/lib_AT91SAM7.h **** //* \brief Return the Channel 3 Converted Data +1994:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1995:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +1996:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +1997:include/lib_AT91SAM7.h **** ) +1998:include/lib_AT91SAM7.h **** { +1999:include/lib_AT91SAM7.h **** return pADC->ADC_CDR3; +2000:include/lib_AT91SAM7.h **** } +2001:include/lib_AT91SAM7.h **** +2002:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2003:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH4 +2004:include/lib_AT91SAM7.h **** //* \brief Return the Channel 4 Converted Data +2005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2006:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +2007:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2008:include/lib_AT91SAM7.h **** ) +2009:include/lib_AT91SAM7.h **** { +2010:include/lib_AT91SAM7.h **** return pADC->ADC_CDR4; +2011:include/lib_AT91SAM7.h **** } +2012:include/lib_AT91SAM7.h **** +2013:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2014:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH5 +2015:include/lib_AT91SAM7.h **** //* \brief Return the Channel 5 Converted Data +2016:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2017:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +2018:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2019:include/lib_AT91SAM7.h **** ) +2020:include/lib_AT91SAM7.h **** { +2021:include/lib_AT91SAM7.h **** return pADC->ADC_CDR5; +2022:include/lib_AT91SAM7.h **** } +2023:include/lib_AT91SAM7.h **** +2024:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2025:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH6 +2026:include/lib_AT91SAM7.h **** //* \brief Return the Channel 6 Converted Data +2027:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2028:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +2029:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2030:include/lib_AT91SAM7.h **** ) +2031:include/lib_AT91SAM7.h **** { +2032:include/lib_AT91SAM7.h **** return pADC->ADC_CDR6; +2033:include/lib_AT91SAM7.h **** } +2034:include/lib_AT91SAM7.h **** +2035:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2036:include/lib_AT91SAM7.h **** //* \fn AT91F_ADC_GetConvertedDataCH7 +2037:include/lib_AT91SAM7.h **** //* \brief Return the Channel 7 Converted Data +2038:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2039:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +2040:include/lib_AT91SAM7.h **** AT91PS_ADC pADC // pointer to a ADC controller +2041:include/lib_AT91SAM7.h **** ) +2042:include/lib_AT91SAM7.h **** { +2043:include/lib_AT91SAM7.h **** return pADC->ADC_CDR7; +2044:include/lib_AT91SAM7.h **** } +2045:include/lib_AT91SAM7.h **** +2046:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2047:include/lib_AT91SAM7.h **** SOFTWARE API FOR SSC +2048:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2049:include/lib_AT91SAM7.h **** //* Define the standard I2S mode configuration +2050:include/lib_AT91SAM7.h **** +2051:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Clock Mode Register +2052:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2053:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2054:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2055:include/lib_AT91SAM7.h **** AT91C_SSC_CKS_DIV +\ +2056:include/lib_AT91SAM7.h **** AT91C_SSC_CKO_CONTINOUS +\ +2057:include/lib_AT91SAM7.h **** AT91C_SSC_CKG_NONE +\ +2058:include/lib_AT91SAM7.h **** AT91C_SSC_START_FALL_RF +\ +2059:include/lib_AT91SAM7.h **** AT91C_SSC_STTOUT +\ +2060:include/lib_AT91SAM7.h **** ((1<<16) & AT91C_SSC_STTDLY) +\ +2061:include/lib_AT91SAM7.h **** ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +2062:include/lib_AT91SAM7.h **** +2063:include/lib_AT91SAM7.h **** +2064:include/lib_AT91SAM7.h **** //* Configuration to set in the SSC Transmit Frame Mode Register +2065:include/lib_AT91SAM7.h **** //* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +2066:include/lib_AT91SAM7.h **** //* nb_slot_by_frame : number of channels +2067:include/lib_AT91SAM7.h **** #define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +2068:include/lib_AT91SAM7.h **** (nb_bit_by_slot-1) +\ +2069:include/lib_AT91SAM7.h **** AT91C_SSC_MSBF +\ +2070:include/lib_AT91SAM7.h **** (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +2071:include/lib_AT91SAM7.h **** (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +2072:include/lib_AT91SAM7.h **** AT91C_SSC_FSOS_NEGATIVE) +2073:include/lib_AT91SAM7.h **** +2074:include/lib_AT91SAM7.h **** +2075:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2076:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SetBaudrate +2077:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2078:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2079:include/lib_AT91SAM7.h **** extern void AT91F_SSC_SetBaudrate ( +2080:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2081:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2082:include/lib_AT91SAM7.h **** unsigned int speed); // \arg SSC baudrate +2083:include/lib_AT91SAM7.h **** +2084:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2085:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_Configure +2086:include/lib_AT91SAM7.h **** //* \brief Configure SSC +2087:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2088:include/lib_AT91SAM7.h **** extern void AT91F_SSC_Configure ( +2089:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2090:include/lib_AT91SAM7.h **** unsigned int syst_clock, // \arg System Clock Frequency +2091:include/lib_AT91SAM7.h **** unsigned int baud_rate, // \arg Expected Baud Rate Frequency +2092:include/lib_AT91SAM7.h **** unsigned int clock_rx, // \arg Receiver Clock Parameters +2093:include/lib_AT91SAM7.h **** unsigned int mode_rx, // \arg mode Register to be programmed +2094:include/lib_AT91SAM7.h **** unsigned int clock_tx, // \arg Transmitter Clock Parameters +2095:include/lib_AT91SAM7.h **** unsigned int mode_tx); // \arg mode Register to be programmed +2096:include/lib_AT91SAM7.h **** +2097:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2098:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableRx +2099:include/lib_AT91SAM7.h **** //* \brief Enable receiving datas +2100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2101:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableRx ( +2102:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2103:include/lib_AT91SAM7.h **** { +2104:include/lib_AT91SAM7.h **** //* Enable receiver +2105:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXEN; +2106:include/lib_AT91SAM7.h **** } +2107:include/lib_AT91SAM7.h **** +2108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2109:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableRx +2110:include/lib_AT91SAM7.h **** //* \brief Disable receiving datas +2111:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2112:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableRx ( +2113:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2114:include/lib_AT91SAM7.h **** { +2115:include/lib_AT91SAM7.h **** //* Disable receiver +2116:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_RXDIS; +2117:include/lib_AT91SAM7.h **** } +2118:include/lib_AT91SAM7.h **** +2119:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2120:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableTx +2121:include/lib_AT91SAM7.h **** //* \brief Enable sending datas +2122:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2123:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableTx ( +2124:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2125:include/lib_AT91SAM7.h **** { +2126:include/lib_AT91SAM7.h **** //* Enable transmitter +2127:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXEN; +2128:include/lib_AT91SAM7.h **** } +2129:include/lib_AT91SAM7.h **** +2130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2131:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableTx +2132:include/lib_AT91SAM7.h **** //* \brief Disable sending datas +2133:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2134:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableTx ( +2135:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC) // \arg pointer to a SSC controller +2136:include/lib_AT91SAM7.h **** { +2137:include/lib_AT91SAM7.h **** //* Disable transmitter +2138:include/lib_AT91SAM7.h **** pSSC->SSC_CR = AT91C_SSC_TXDIS; +2139:include/lib_AT91SAM7.h **** } +2140:include/lib_AT91SAM7.h **** +2141:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2142:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_EnableIt +2143:include/lib_AT91SAM7.h **** //* \brief Enable SSC IT +2144:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2145:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_EnableIt ( +2146:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2147:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2148:include/lib_AT91SAM7.h **** { +2149:include/lib_AT91SAM7.h **** //* Write to the IER register +2150:include/lib_AT91SAM7.h **** pSSC->SSC_IER = flag; +2151:include/lib_AT91SAM7.h **** } +2152:include/lib_AT91SAM7.h **** +2153:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2154:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_DisableIt +2155:include/lib_AT91SAM7.h **** //* \brief Disable SSC IT +2156:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2157:include/lib_AT91SAM7.h **** static inline void AT91F_SSC_DisableIt ( +2158:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, // \arg pointer to a SSC controller +2159:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2160:include/lib_AT91SAM7.h **** { +2161:include/lib_AT91SAM7.h **** //* Write to the IDR register +2162:include/lib_AT91SAM7.h **** pSSC->SSC_IDR = flag; +2163:include/lib_AT91SAM7.h **** } +2164:include/lib_AT91SAM7.h **** +2165:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2166:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_ReceiveFrame +2167:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2168:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2169:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_ReceiveFrame ( +2170:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2171:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +2172:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2173:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +2174:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2175:include/lib_AT91SAM7.h **** { +2176:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( +2177:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2178:include/lib_AT91SAM7.h **** pBuffer, +2179:include/lib_AT91SAM7.h **** szBuffer, +2180:include/lib_AT91SAM7.h **** pNextBuffer, +2181:include/lib_AT91SAM7.h **** szNextBuffer); +2182:include/lib_AT91SAM7.h **** } +2183:include/lib_AT91SAM7.h **** +2184:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2185:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_SendFrame +2186:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +2187:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2188:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_SendFrame( +2189:include/lib_AT91SAM7.h **** AT91PS_SSC pSSC, +2190:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +2191:include/lib_AT91SAM7.h **** unsigned int szBuffer, +2192:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +2193:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +2194:include/lib_AT91SAM7.h **** { +2195:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( +2196:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSSC->SSC_RPR), +2197:include/lib_AT91SAM7.h **** pBuffer, +2198:include/lib_AT91SAM7.h **** szBuffer, +2199:include/lib_AT91SAM7.h **** pNextBuffer, +2200:include/lib_AT91SAM7.h **** szNextBuffer); +2201:include/lib_AT91SAM7.h **** } +2202:include/lib_AT91SAM7.h **** +2203:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2204:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_GetInterruptMaskStatus +2205:include/lib_AT91SAM7.h **** //* \brief Return SSC Interrupt Mask Status +2206:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2207:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +2208:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc) // \arg pointer to a SSC controller +2209:include/lib_AT91SAM7.h **** { +2210:include/lib_AT91SAM7.h **** return pSsc->SSC_IMR; +2211:include/lib_AT91SAM7.h **** } +2212:include/lib_AT91SAM7.h **** +2213:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2214:include/lib_AT91SAM7.h **** //* \fn AT91F_SSC_IsInterruptMasked +2215:include/lib_AT91SAM7.h **** //* \brief Test if SSC Interrupt is Masked +2216:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2217:include/lib_AT91SAM7.h **** static inline int AT91F_SSC_IsInterruptMasked( +2218:include/lib_AT91SAM7.h **** AT91PS_SSC pSsc, // \arg pointer to a SSC controller +2219:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +2220:include/lib_AT91SAM7.h **** { +2221:include/lib_AT91SAM7.h **** return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +2222:include/lib_AT91SAM7.h **** } +2223:include/lib_AT91SAM7.h **** +2224:include/lib_AT91SAM7.h **** /* ***************************************************************************** +2225:include/lib_AT91SAM7.h **** SOFTWARE API FOR USART +2226:include/lib_AT91SAM7.h **** ***************************************************************************** */ +2227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2228:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2229:include/lib_AT91SAM7.h **** //* \brief Calculate the baudrate +2230:include/lib_AT91SAM7.h **** //* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +2231:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +2232:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2233:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2234:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2235:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2236:include/lib_AT91SAM7.h **** +2237:include/lib_AT91SAM7.h **** //* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +2238:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +2239:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2240:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2241:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2242:include/lib_AT91SAM7.h **** AT91C_US_CLKS_EXT ) +2243:include/lib_AT91SAM7.h **** +2244:include/lib_AT91SAM7.h **** //* Standard Synchronous Mode : 8 bits , 1 stop , no parity +2245:include/lib_AT91SAM7.h **** #define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +2246:include/lib_AT91SAM7.h **** AT91C_US_USMODE_NORMAL + \ +2247:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2248:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2249:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2250:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2251:include/lib_AT91SAM7.h **** +2252:include/lib_AT91SAM7.h **** //* SCK used Label +2253:include/lib_AT91SAM7.h **** #define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +2254:include/lib_AT91SAM7.h **** +2255:include/lib_AT91SAM7.h **** //* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +2256:include/lib_AT91SAM7.h **** #define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +2257:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK +\ +2258:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2259:include/lib_AT91SAM7.h **** AT91C_US_PAR_EVEN + \ +2260:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2261:include/lib_AT91SAM7.h **** AT91C_US_CKLO +\ +2262:include/lib_AT91SAM7.h **** AT91C_US_OVER) +2263:include/lib_AT91SAM7.h **** +2264:include/lib_AT91SAM7.h **** //* Standard IRDA mode +2265:include/lib_AT91SAM7.h **** #define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +2266:include/lib_AT91SAM7.h **** AT91C_US_NBSTOP_1_BIT + \ +2267:include/lib_AT91SAM7.h **** AT91C_US_PAR_NONE + \ +2268:include/lib_AT91SAM7.h **** AT91C_US_CHRL_8_BITS + \ +2269:include/lib_AT91SAM7.h **** AT91C_US_CLKS_CLOCK ) +2270:include/lib_AT91SAM7.h **** +2271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2272:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Baudrate +2273:include/lib_AT91SAM7.h **** //* \brief Caluculate baud_value according to the main clock and the baud rate +2274:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2275:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Baudrate ( +2276:include/lib_AT91SAM7.h **** const unsigned int main_clock, // \arg peripheral clock +2277:include/lib_AT91SAM7.h **** const unsigned int baud_rate) // \arg UART baudrate +2278:include/lib_AT91SAM7.h **** { +2279:include/lib_AT91SAM7.h **** unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +2280:include/lib_AT91SAM7.h **** if ((baud_value % 10) >= 5) +2281:include/lib_AT91SAM7.h **** baud_value = (baud_value / 10) + 1; +2282:include/lib_AT91SAM7.h **** else +2283:include/lib_AT91SAM7.h **** baud_value /= 10; +2284:include/lib_AT91SAM7.h **** return baud_value; +2285:include/lib_AT91SAM7.h **** } +2286:include/lib_AT91SAM7.h **** +2287:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2288:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetBaudrate +2289:include/lib_AT91SAM7.h **** //* \brief Set the baudrate according to the CPU clock +2290:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2291:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetBaudrate ( +2292:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2293:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2294:include/lib_AT91SAM7.h **** unsigned int speed) // \arg UART baudrate +2295:include/lib_AT91SAM7.h **** { +2296:include/lib_AT91SAM7.h **** //* Define the baud rate divisor register +2297:include/lib_AT91SAM7.h **** pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +2298:include/lib_AT91SAM7.h **** } +2299:include/lib_AT91SAM7.h **** +2300:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2301:include/lib_AT91SAM7.h **** //* \fn AT91F_US_SetTimeguard +2302:include/lib_AT91SAM7.h **** //* \brief Set USART timeguard +2303:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2304:include/lib_AT91SAM7.h **** static inline void AT91F_US_SetTimeguard ( +2305:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2306:include/lib_AT91SAM7.h **** unsigned int timeguard) // \arg timeguard value +2307:include/lib_AT91SAM7.h **** { +2308:include/lib_AT91SAM7.h **** //* Write the Timeguard Register +2309:include/lib_AT91SAM7.h **** pUSART->US_TTGR = timeguard ; +2310:include/lib_AT91SAM7.h **** } +2311:include/lib_AT91SAM7.h **** +2312:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2313:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableIt +2314:include/lib_AT91SAM7.h **** //* \brief Enable USART IT +2315:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2316:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableIt ( +2317:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2318:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be enabled +2319:include/lib_AT91SAM7.h **** { +2320:include/lib_AT91SAM7.h **** //* Write to the IER register +2321:include/lib_AT91SAM7.h **** pUSART->US_IER = flag; +2322:include/lib_AT91SAM7.h **** } +2323:include/lib_AT91SAM7.h **** +2324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2325:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableIt +2326:include/lib_AT91SAM7.h **** //* \brief Disable USART IT +2327:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2328:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableIt ( +2329:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2330:include/lib_AT91SAM7.h **** unsigned int flag) // \arg IT to be disabled +2331:include/lib_AT91SAM7.h **** { +2332:include/lib_AT91SAM7.h **** //* Write to the IER register +2333:include/lib_AT91SAM7.h **** pUSART->US_IDR = flag; +2334:include/lib_AT91SAM7.h **** } +2335:include/lib_AT91SAM7.h **** +2336:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2337:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Configure +2338:include/lib_AT91SAM7.h **** //* \brief Configure USART +2339:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2340:include/lib_AT91SAM7.h **** extern void AT91F_US_Configure ( +2341:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, // \arg pointer to a USART controller +2342:include/lib_AT91SAM7.h **** unsigned int mainClock, // \arg peripheral clock +2343:include/lib_AT91SAM7.h **** unsigned int mode , // \arg mode Register to be programmed +2344:include/lib_AT91SAM7.h **** unsigned int baudRate , // \arg baudrate to be programmed +2345:include/lib_AT91SAM7.h **** unsigned int timeguard ); // \arg timeguard to be programmed +2346:include/lib_AT91SAM7.h **** +2347:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2348:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableRx +2349:include/lib_AT91SAM7.h **** //* \brief Enable receiving characters +2350:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2351:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableRx ( +2352:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2353:include/lib_AT91SAM7.h **** { +2354:include/lib_AT91SAM7.h **** //* Enable receiver +2355:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2356:include/lib_AT91SAM7.h **** } +2357:include/lib_AT91SAM7.h **** +2358:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2359:include/lib_AT91SAM7.h **** //* \fn AT91F_US_EnableTx +2360:include/lib_AT91SAM7.h **** //* \brief Enable sending characters +2361:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2362:include/lib_AT91SAM7.h **** static inline void AT91F_US_EnableTx ( +2363:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2364:include/lib_AT91SAM7.h **** { +2365:include/lib_AT91SAM7.h **** //* Enable transmitter +2366:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2367:include/lib_AT91SAM7.h **** } +2368:include/lib_AT91SAM7.h **** +2369:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2370:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetRx +2371:include/lib_AT91SAM7.h **** //* \brief Reset Receiver and re-enable it +2372:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2373:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetRx ( +2374:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2375:include/lib_AT91SAM7.h **** { +2376:include/lib_AT91SAM7.h **** //* Reset receiver +2377:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTRX; +2378:include/lib_AT91SAM7.h **** //* Re-Enable receiver +2379:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXEN; +2380:include/lib_AT91SAM7.h **** } +2381:include/lib_AT91SAM7.h **** +2382:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2383:include/lib_AT91SAM7.h **** //* \fn AT91F_US_ResetTx +2384:include/lib_AT91SAM7.h **** //* \brief Reset Transmitter and re-enable it +2385:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2386:include/lib_AT91SAM7.h **** static inline void AT91F_US_ResetTx ( +2387:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2388:include/lib_AT91SAM7.h **** { +2389:include/lib_AT91SAM7.h **** //* Reset transmitter +2390:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RSTTX; +2391:include/lib_AT91SAM7.h **** //* Enable transmitter +2392:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXEN; +2393:include/lib_AT91SAM7.h **** } +2394:include/lib_AT91SAM7.h **** +2395:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2396:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableRx +2397:include/lib_AT91SAM7.h **** //* \brief Disable Receiver +2398:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2399:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableRx ( +2400:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2401:include/lib_AT91SAM7.h **** { +2402:include/lib_AT91SAM7.h **** //* Disable receiver +2403:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_RXDIS; +2404:include/lib_AT91SAM7.h **** } +2405:include/lib_AT91SAM7.h **** +2406:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2407:include/lib_AT91SAM7.h **** //* \fn AT91F_US_DisableTx +2408:include/lib_AT91SAM7.h **** //* \brief Disable Transmitter +2409:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2410:include/lib_AT91SAM7.h **** static inline void AT91F_US_DisableTx ( +2411:include/lib_AT91SAM7.h **** AT91PS_USART pUSART) // \arg pointer to a USART controller +2412:include/lib_AT91SAM7.h **** { +2413:include/lib_AT91SAM7.h **** //* Disable transmitter +2414:include/lib_AT91SAM7.h **** pUSART->US_CR = AT91C_US_TXDIS; +2415:include/lib_AT91SAM7.h **** } +2416:include/lib_AT91SAM7.h **** +2417:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2418:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Close +2419:include/lib_AT91SAM7.h **** //* \brief Close USART: disable IT disable receiver and transmitter, close PDC +2420:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2421:include/lib_AT91SAM7.h **** extern void AT91F_US_Close(AT91PS_USART pUSART); // \arg pointer to a USART controller +2422:include/lib_AT91SAM7.h **** +2423:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2424:include/lib_AT91SAM7.h **** //* \fn AT91F_US_TxReady +2425:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be written in US_THR +2426:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2427:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_TxReady ( +2428:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2429:include/lib_AT91SAM7.h **** { +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); +2431:include/lib_AT91SAM7.h **** } +2432:include/lib_AT91SAM7.h **** +2433:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2434:include/lib_AT91SAM7.h **** //* \fn AT91F_US_RxReady +2435:include/lib_AT91SAM7.h **** //* \brief Return 1 if a character can be read in US_RHR +2436:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2437:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_RxReady ( +2438:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2439:include/lib_AT91SAM7.h **** { +2440:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_RXRDY); + 47 .loc 2 2440 0 + 48 0010 0DCCE0E3 mvn ip, #3328 + 49 .LVL4: + 50 .L10: + 51 .loc 2 2440 0 is_stmt 0 discriminator 1 + 52 0014 EB101CE5 ldr r1, [ip, #-235] + 53 .LBE33: + 54 .LBE32: + 27:src/os/syscalls.c **** if ((AT91F_US_RxReady((AT91PS_USART)AT91C_BASE_DBGU)) == 0) return 0; + 55 .loc 1 27 0 is_stmt 1 discriminator 1 + 56 0018 010011E3 tst r1, #1 + 57 001c FCFFFF0A beq .L10 + 58 .LVL5: + 59 .LBE31: + 60 .LBE30: + 61 .LBB34: + 62 .LBB35: + 63 .LBB36: + 64 .LBB37: +2441:include/lib_AT91SAM7.h **** } +2442:include/lib_AT91SAM7.h **** +2443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2444:include/lib_AT91SAM7.h **** //* \fn AT91F_US_Error +2445:include/lib_AT91SAM7.h **** //* \brief Return the error flag +2446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2447:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_US_Error ( +2448:include/lib_AT91SAM7.h **** AT91PS_USART pUSART ) // \arg pointer to a USART controller +2449:include/lib_AT91SAM7.h **** { +2450:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & +2451:include/lib_AT91SAM7.h **** (AT91C_US_OVRE | // Overrun error +2452:include/lib_AT91SAM7.h **** AT91C_US_FRAME | // Framing error +2453:include/lib_AT91SAM7.h **** AT91C_US_PARE)); // Parity error +2454:include/lib_AT91SAM7.h **** } +2455:include/lib_AT91SAM7.h **** +2456:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2457:include/lib_AT91SAM7.h **** //* \fn AT91F_US_PutChar +2458:include/lib_AT91SAM7.h **** //* \brief Send a character,does not check if ready to send +2459:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2460:include/lib_AT91SAM7.h **** static inline void AT91F_US_PutChar ( +2461:include/lib_AT91SAM7.h **** AT91PS_USART pUSART, +2462:include/lib_AT91SAM7.h **** int character ) +2463:include/lib_AT91SAM7.h **** { +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); +2465:include/lib_AT91SAM7.h **** } +2466:include/lib_AT91SAM7.h **** +2467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2468:include/lib_AT91SAM7.h **** //* \fn AT91F_US_GetChar +2469:include/lib_AT91SAM7.h **** //* \brief Receive a character,does not check if a character is available +2470:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +2471:include/lib_AT91SAM7.h **** static inline int AT91F_US_GetChar ( +2472:include/lib_AT91SAM7.h **** const AT91PS_USART pUSART) +2473:include/lib_AT91SAM7.h **** { +2474:include/lib_AT91SAM7.h **** return((pUSART->US_RHR) & 0x1FF); + 65 .loc 2 2474 0 + 66 0020 E7101CE5 ldr r1, [ip, #-231] + 67 .LBE37: + 68 .LBE36: + 33:src/os/syscalls.c **** return AT91F_US_GetChar((AT91PS_USART)AT91C_BASE_DBGU); + 69 .loc 1 33 0 + 70 0024 FF1001E2 and r1, r1, #255 + 71 .LBE35: + 72 .LBE34: + 49:src/os/syscalls.c **** // c = uart0Getch(); + 50:src/os/syscalls.c **** // c = uart0GetchW(); + 51:src/os/syscalls.c **** while ( !my_kbhit() ) ; + 52:src/os/syscalls.c **** c = (char) my_getc(); + 53:src/os/syscalls.c **** if (c == 0x0D) { + 73 .loc 1 53 0 + 74 0028 0D0051E3 cmp r1, #13 + 75 002c 0500000A beq .L14 + 48:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 76 .loc 1 48 0 + 77 0030 010080E2 add r0, r0, #1 + 78 0034 030050E1 cmp r0, r3 + 54:src/os/syscalls.c **** *p='\0'; + 55:src/os/syscalls.c **** break; + 56:src/os/syscalls.c **** } + 57:src/os/syscalls.c **** *p++ = c; + 79 .loc 1 57 0 + 80 0038 0110C2E4 strb r1, [r2], #1 + 81 .LVL6: + 48:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 82 .loc 1 48 0 + 83 003c F4FFFF1A bne .L10 + 84 .LVL7: + 85 .L2: + 58:src/os/syscalls.c **** ////// uart0_putc(c); + 59:src/os/syscalls.c **** } + 60:src/os/syscalls.c **** return len - i; + 61:src/os/syscalls.c **** } + 86 .loc 1 61 0 + 87 0040 030060E0 rsb r0, r0, r3 + 88 0044 1EFF2FE1 bx lr + 89 .LVL8: + 90 .L14: + 54:src/os/syscalls.c **** *p='\0'; + 91 .loc 1 54 0 + 92 0048 00C0A0E3 mov ip, #0 + 93 004c 00C0C2E5 strb ip, [r2, #0] + 94 .loc 1 61 0 + 95 0050 030060E0 rsb r0, r0, r3 + 96 0054 1EFF2FE1 bx lr + 97 .cfi_endproc + 98 .LFE276: + 100 .align 2 + 101 .global _write_r + 103 _write_r: + 104 .LFB277: + 62:src/os/syscalls.c **** + 63:src/os/syscalls.c **** + 64:src/os/syscalls.c **** _ssize_t _write_r ( + 65:src/os/syscalls.c **** struct _reent *r, + 66:src/os/syscalls.c **** int file, + 67:src/os/syscalls.c **** const void *ptr, + 68:src/os/syscalls.c **** size_t len) + 69:src/os/syscalls.c **** { + 105 .loc 1 69 0 + 106 .cfi_startproc + 107 @ Function supports interworking. + 108 @ args = 0, pretend = 0, frame = 0 + 109 @ frame_needed = 0, uses_anonymous_args = 0 + 110 @ link register save eliminated. + 111 .LVL9: + 70:src/os/syscalls.c **** int i; + 71:src/os/syscalls.c **** const unsigned char *p; + 72:src/os/syscalls.c **** + 73:src/os/syscalls.c **** p = (const unsigned char*) ptr; + 74:src/os/syscalls.c **** + 75:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 112 .loc 1 75 0 + 113 0058 000053E2 subs r0, r3, #0 + 114 .LVL10: + 69:src/os/syscalls.c **** { + 115 .loc 1 69 0 + 116 005c 70002DE9 stmfd sp!, {r4, r5, r6} + 117 .LCFI0: + 118 .cfi_def_cfa_offset 12 + 119 .loc 1 75 0 + 120 0060 0C00000A beq .L16 + 121 .cfi_offset 6, -4 + 122 .cfi_offset 5, -8 + 123 .cfi_offset 4, -12 + 124 .LVL11: + 125 .LBB38: + 126 .LBB40: + 127 .LBB45: + 128 .LBB47: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 129 .loc 2 2430 0 + 130 0064 0D1CE0E3 mvn r1, #3328 + 131 .LVL12: + 132 .LBE47: + 133 .LBE45: + 134 .LBE40: + 135 .LBE38: + 136 .file 3 "e:\\programme\\mingw\\libexec\\arm\\bin\\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-n + 1:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** /* This header file provides the reentrancy. */ + 2:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 3:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** /* The reentrant system calls here serve two purposes: + 4:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 5:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 1) Provide reentrant versions of the system calls the ANSI C library + 6:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** requires. + 7:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 2) Provide these system calls in a namespace clean way. + 8:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 9:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** It is intended that *all* system calls that the ANSI C library needs + 10:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** be declared here. It documents them all in one place. All library access + 11:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** to the system is via some form of these functions. + 12:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 13:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** The target may provide the needed syscalls by any of the following: + 14:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 15:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 1) Define the reentrant versions of the syscalls directly. + 16:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** (eg: _open_r, _close_r, etc.). Please keep the namespace clean. + 17:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** When you do this, set "syscall_dir" to "syscalls" and add + 18:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** -DREENTRANT_SYSCALLS_PROVIDED to newlib_cflags in configure.host. + 19:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 20:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 2) Define namespace clean versions of the system calls by prefixing + 21:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** them with '_' (eg: _open, _close, etc.). Technically, there won't be + 22:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** true reentrancy at the syscall level, but the library will be namespace + 23:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** clean. + 24:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** When you do this, set "syscall_dir" to "syscalls" in configure.host. + 25:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 26:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 3) Define or otherwise provide the regular versions of the syscalls + 27:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** (eg: open, close, etc.). The library won't be reentrant nor namespace + 28:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** clean, but at least it will work. + 29:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** When you do this, add -DMISSING_SYSCALL_NAMES to newlib_cflags in + 30:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** configure.host. + 31:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 32:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** 4) Define or otherwise provide the regular versions of the syscalls, + 33:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** and do not supply functional interfaces for any of the reentrant + 34:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** calls. With this method, the reentrant syscalls are redefined to + 35:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** directly call the regular system call without the reentrancy argument. + 36:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** When you do this, specify both -DREENTRANT_SYSCALLS_PROVIDED and + 37:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** -DMISSING_SYSCALL_NAMES via newlib_cflags in configure.host and do + 38:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** not specify "syscall_dir". + 39:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 40:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** Stubs of the reentrant versions of the syscalls exist in the libc/reent + 41:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** source directory and are provided if REENTRANT_SYSCALLS_PROVIDED isn't + 42:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** defined. These stubs call the native system calls: _open, _close, etc. + 43:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** if MISSING_SYSCALL_NAMES is *not* defined, otherwise they call the + 44:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** non-underscored versions: open, close, etc. when MISSING_SYSCALL_NAMES + 45:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** *is* defined. + 46:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 47:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** By default, newlib functions call the reentrant syscalls internally, + 48:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** passing a reentrancy structure as an argument. This reentrancy structure + 49:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** contains data that is thread-specific. For example, the errno value is + 50:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** kept in the reentrancy structure. If multiple threads exist, each will + 51:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** keep a separate errno value which is intuitive since the application flow + 52:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** cannot check for failure reliably otherwise. + 53:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 54:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** The reentrant syscalls are either provided by the platform, by the + 55:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** libc/reent stubs, or in the case of both MISSING_SYSCALL_NAMES and + 56:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** REENTRANT_SYSCALLS_PROVIDED being defined, the calls are redefined to + 57:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** simply call the regular syscalls with no reentrancy struct argument. + 58:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 59:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** A single-threaded application does not need to worry about the reentrancy + 60:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** structure. It is used internally. + 61:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 62:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** A multi-threaded application needs either to manually manage reentrancy + 63:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** structures or use dynamic reentrancy. + 64:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 65:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** Manually managing reentrancy structures entails calling special reentrant + 66:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** versions of newlib functions that have an additional reentrancy argument. + 67:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** For example, _printf_r. By convention, the first argument is the + 68:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** reentrancy structure. By default, the normal version of the function + 69:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** uses the default reentrancy structure: _REENT. The reentrancy structure + 70:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** is passed internally, eventually to the reentrant syscalls themselves. + 71:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** How the structures are stored and accessed in this model is up to the + 72:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** application. + 73:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 74:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** Dynamic reentrancy is specified by the __DYNAMIC_REENT__ flag. This + 75:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** flag denotes setting up a macro to replace _REENT with a function call + 76:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** to __getreent(). This function needs to be implemented by the platform + 77:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** and it is meant to return the reentrancy structure for the current + 78:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** thread. When the regular C functions (e.g. printf) go to call internal + 79:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** routines with the default _REENT structure, they end up calling with + 80:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** the reentrancy structure for the thread. Thus, application code does not + 81:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** need to call the _r routines nor worry about reentrancy structures. */ + 82:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 83:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** /* WARNING: All identifiers here must begin with an underscore. This file is + 84:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** included by stdio.h and others and we therefore must only use identifiers + 85:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** in the namespace allotted to us. */ + 86:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 87:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #ifndef _REENT_H_ + 88:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #ifdef __cplusplus + 89:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern "C" { + 90:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #endif + 91:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _REENT_H_ + 92:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 93:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #include + 94:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #include + 95:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #include + 96:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 97:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define __need_size_t + 98:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define __need_ptrdiff_t + 99:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #include + 100:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 101:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** /* FIXME: not namespace clean */ + 102:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** struct stat; + 103:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** struct tms; + 104:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** struct timeval; + 105:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** struct timezone; + 106:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 107:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #if defined(REENTRANT_SYSCALLS_PROVIDED) && defined(MISSING_SYSCALL_NAMES) + 108:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 109:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _close_r(__reent, __fd) close(__fd) + 110:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _execve_r(__reent, __f, __arg, __env) execve(__f, __arg, __env) + 111:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _fcntl_r(__reent, __fd, __cmd, __arg) fcntl(__fd, __cmd, __arg) + 112:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _fork_r(__reent) fork() + 113:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _fstat_r(__reent, __fdes, __stat) fstat(__fdes, __stat) + 114:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _getpid_r(__reent) getpid() + 115:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _isatty_r(__reent, __desc) isatty(__desc) + 116:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _kill_r(__reent, __pid, __signal) kill(__pid, __signal) + 117:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _link_r(__reent, __oldpath, __newpath) link(__oldpath, __newpath) + 118:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _lseek_r(__reent, __fdes, __off, __w) lseek(__fdes, __off, __w) + 119:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _mkdir_r(__reent, __path, __m) mkdir(__path, __m) + 120:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _open_r(__reent, __path, __flag, __m) open(__path, __flag, __m) + 121:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _read_r(__reent, __fd, __buff, __cnt) read(__fd, __buff, __cnt) + 122:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _rename_r(__reent, __old, __new) rename(__old, __new) + 123:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _sbrk_r(__reent, __incr) sbrk(__incr) + 124:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _stat_r(__reent, __path, __buff) stat(__path, __buff) + 125:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _times_r(__reent, __time) times(__time) + 126:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _unlink_r(__reent, __path) unlink(__path) + 127:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _wait_r(__reent, __status) wait(__status) + 128:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _write_r(__reent, __fd, __buff, __cnt) write(__fd, __buff, __cnt) + 129:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _gettimeofday_r(__reent, __tp, __tzp) gettimeofday(__tp, __tzp) + 130:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 131:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #ifdef __LARGE64_FILES + 132:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _lseek64_r(__reent, __fd, __off, __w) lseek64(__fd, __off, __w) + 133:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _fstat64_r(__reent, __fd, __buff) fstat64(__fd, __buff) + 134:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #define _open64_r(__reent, __path, __flag, __m) open64(__path, __flag, __m) + 135:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #endif + 136:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 137:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** #else + 138:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** /* Reentrant versions of system calls. */ + 139:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** + 140:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _close_r _PARAMS ((struct _reent *, int)); + 141:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *)); + 142:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); + 143:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _fork_r _PARAMS ((struct _reent *)); + 144:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); + 145:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _getpid_r _PARAMS ((struct _reent *)); + 146:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _isatty_r _PARAMS ((struct _reent *, int)); + 147:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _kill_r _PARAMS ((struct _reent *, int, int)); + 148:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _link_r _PARAMS ((struct _reent *, const char *, const char *)); + 149:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int)); + 150:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _mkdir_r _PARAMS ((struct _reent *, const char *, int)); + 151:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _open_r _PARAMS ((struct _reent *, const char *, int, int)); + 152:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t)); + 153:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _rename_r _PARAMS ((struct _reent *, const char *, const char *)); + 154:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern void *_sbrk_r _PARAMS ((struct _reent *, ptrdiff_t)); + 155:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); + 156:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); + 157:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _unlink_r _PARAMS ((struct _reent *, const char *)); + 158:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern int _wait_r _PARAMS ((struct _reent *, int *)); + 159:e:\programme\mingw\libexec\arm\bin\../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/include\reent.h **** extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); + 137 .loc 3 159 0 + 138 0068 005082E0 add r5, r2, r0 + 139 .LBB52: + 140 .LBB39: + 141 .LBB44: + 142 .LBB46: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 143 .loc 2 2430 0 + 144 006c 0140A0E1 mov r4, r1 + 145 .LBE46: + 146 .LBE44: + 147 .LBB41: + 148 .LBB42: +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); + 149 .loc 2 2464 0 + 150 0070 0D60A0E3 mov r6, #13 + 151 .LVL13: + 152 .L20: + 153 .LBE42: + 154 .LBE41: + 155 .LBE39: + 156 .LBE52: + 76:src/os/syscalls.c **** if (*p == '\n' ) my_putc('\r'); + 157 .loc 1 76 0 + 158 0074 01C0D2E4 ldrb ip, [r2], #1 @ zero_extendqisi2 + 159 0078 0A005CE3 cmp ip, #10 + 160 007c 0700000A beq .L22 + 161 .L21: + 162 .LVL14: + 163 .LBB53: + 164 .LBB54: + 165 .LBB55: + 166 .LBB56: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 167 .loc 2 2430 0 + 168 0080 EB3011E5 ldr r3, [r1, #-235] + 169 .LBE56: + 170 .LBE55: + 21:src/os/syscalls.c **** while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + 171 .loc 1 21 0 + 172 0084 020013E3 tst r3, #2 + 173 0088 FCFFFF0A beq .L21 + 174 .LVL15: + 175 .LBE54: + 176 .LBE53: + 75:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 177 .loc 1 75 0 + 178 008c 050052E1 cmp r2, r5 + 179 .LBB60: + 180 .LBB59: + 181 .LBB57: + 182 .LBB58: +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); + 183 .loc 2 2464 0 + 184 0090 E3C004E5 str ip, [r4, #-227] + 185 .LBE58: + 186 .LBE57: + 187 .LBE59: + 188 .LBE60: + 75:src/os/syscalls.c **** for (i = 0; i < len; i++) { + 189 .loc 1 75 0 + 190 0094 F6FFFF1A bne .L20 + 191 .LVL16: + 192 .L16: + 77:src/os/syscalls.c **** my_putc(*p++); + 78:src/os/syscalls.c **** } + 79:src/os/syscalls.c **** + 80:src/os/syscalls.c **** return len; + 81:src/os/syscalls.c **** } + 193 .loc 1 81 0 + 194 0098 7000BDE8 ldmfd sp!, {r4, r5, r6} + 195 009c 1EFF2FE1 bx lr + 196 .L22: + 197 .LVL17: + 198 .LBB61: + 199 .LBB51: + 200 .LBB49: + 201 .LBB48: +2430:include/lib_AT91SAM7.h **** return (pUSART->US_CSR & AT91C_US_TXRDY); + 202 .loc 2 2430 0 + 203 00a0 EB3011E5 ldr r3, [r1, #-235] + 204 .LBE48: + 205 .LBE49: + 21:src/os/syscalls.c **** while (!AT91F_US_TxReady((AT91PS_USART)AT91C_BASE_DBGU)); + 206 .loc 1 21 0 + 207 00a4 020013E3 tst r3, #2 + 208 00a8 FCFFFF0A beq .L22 + 209 .LVL18: + 210 .LBB50: + 211 .LBB43: +2464:include/lib_AT91SAM7.h **** pUSART->US_THR = (character & 0x1FF); + 212 .loc 2 2464 0 + 213 00ac E36004E5 str r6, [r4, #-227] + 214 00b0 01C052E5 ldrb ip, [r2, #-1] @ zero_extendqisi2 + 215 .LVL19: + 216 00b4 F1FFFFEA b .L21 + 217 .LBE43: + 218 .LBE50: + 219 .LBE51: + 220 .LBE61: + 221 .cfi_endproc + 222 .LFE277: + 224 .align 2 + 225 .global _close_r + 227 _close_r: + 228 .LFB278: + 82:src/os/syscalls.c **** + 83:src/os/syscalls.c **** + 84:src/os/syscalls.c **** int _close_r( + 85:src/os/syscalls.c **** struct _reent *r, + 86:src/os/syscalls.c **** int file) + 87:src/os/syscalls.c **** { + 229 .loc 1 87 0 + 230 .cfi_startproc + 231 @ Function supports interworking. + 232 @ args = 0, pretend = 0, frame = 0 + 233 @ frame_needed = 0, uses_anonymous_args = 0 + 234 @ link register save eliminated. + 235 .LVL20: + 88:src/os/syscalls.c **** return 0; + 89:src/os/syscalls.c **** } + 236 .loc 1 89 0 + 237 00b8 0000A0E3 mov r0, #0 + 238 .LVL21: + 239 00bc 1EFF2FE1 bx lr + 240 .cfi_endproc + 241 .LFE278: + 243 .align 2 + 244 .global _lseek_r + 246 _lseek_r: + 247 .LFB279: + 90:src/os/syscalls.c **** + 91:src/os/syscalls.c **** + 92:src/os/syscalls.c **** _off_t _lseek_r( + 93:src/os/syscalls.c **** struct _reent *r, + 94:src/os/syscalls.c **** int file, + 95:src/os/syscalls.c **** _off_t ptr, + 96:src/os/syscalls.c **** int dir) + 97:src/os/syscalls.c **** { + 248 .loc 1 97 0 + 249 .cfi_startproc + 250 @ Function supports interworking. + 251 @ args = 0, pretend = 0, frame = 0 + 252 @ frame_needed = 0, uses_anonymous_args = 0 + 253 @ link register save eliminated. + 254 .LVL22: + 98:src/os/syscalls.c **** return (_off_t)0; /* Always indicate we are at file beginning. */ + 99:src/os/syscalls.c **** } + 255 .loc 1 99 0 + 256 00c0 0000A0E3 mov r0, #0 + 257 .LVL23: + 258 00c4 1EFF2FE1 bx lr + 259 .cfi_endproc + 260 .LFE279: + 262 .align 2 + 263 .global _fstat_r + 265 _fstat_r: + 266 .LFB280: + 100:src/os/syscalls.c **** + 101:src/os/syscalls.c **** + 102:src/os/syscalls.c **** int _fstat_r( + 103:src/os/syscalls.c **** struct _reent *r, + 104:src/os/syscalls.c **** int file, + 105:src/os/syscalls.c **** struct stat *st) + 106:src/os/syscalls.c **** { + 267 .loc 1 106 0 + 268 .cfi_startproc + 269 @ Function supports interworking. + 270 @ args = 0, pretend = 0, frame = 0 + 271 @ frame_needed = 0, uses_anonymous_args = 0 + 272 @ link register save eliminated. + 273 .LVL24: + 107:src/os/syscalls.c **** /* Always set as character device. */ + 108:src/os/syscalls.c **** st->st_mode = S_IFCHR; + 274 .loc 1 108 0 + 275 00c8 023AA0E3 mov r3, #8192 + 276 00cc 083082E5 str r3, [r2, #8] + 109:src/os/syscalls.c **** /* assigned to strong type with implicit */ + 110:src/os/syscalls.c **** /* signed/unsigned conversion. Required by */ + 111:src/os/syscalls.c **** /* newlib. */ + 112:src/os/syscalls.c **** + 113:src/os/syscalls.c **** return 0; + 114:src/os/syscalls.c **** } + 277 .loc 1 114 0 + 278 00d0 0000A0E3 mov r0, #0 + 279 .LVL25: + 280 00d4 1EFF2FE1 bx lr + 281 .cfi_endproc + 282 .LFE280: + 284 .align 2 + 285 .global isatty + 287 isatty: + 288 .LFB281: + 115:src/os/syscalls.c **** + 116:src/os/syscalls.c **** + 117:src/os/syscalls.c **** int isatty(int file); /* avoid warning */ + 118:src/os/syscalls.c **** + 119:src/os/syscalls.c **** int isatty(int file) + 120:src/os/syscalls.c **** { + 289 .loc 1 120 0 + 290 .cfi_startproc + 291 @ Function supports interworking. + 292 @ args = 0, pretend = 0, frame = 0 + 293 @ frame_needed = 0, uses_anonymous_args = 0 + 294 @ link register save eliminated. + 295 .LVL26: + 121:src/os/syscalls.c **** return 1; + 122:src/os/syscalls.c **** } + 296 .loc 1 122 0 + 297 00d8 0100A0E3 mov r0, #1 + 298 .LVL27: + 299 00dc 1EFF2FE1 bx lr + 300 .cfi_endproc + 301 .LFE281: + 303 .align 2 + 304 .global _sbrk_r + 306 _sbrk_r: + 307 .LFB282: + 123:src/os/syscalls.c **** + 124:src/os/syscalls.c **** + 125:src/os/syscalls.c **** #if 0 + 126:src/os/syscalls.c **** static void _exit (int n) { + 127:src/os/syscalls.c **** label: goto label; /* endless loop */ + 128:src/os/syscalls.c **** } + 129:src/os/syscalls.c **** #endif + 130:src/os/syscalls.c **** + 131:src/os/syscalls.c **** + 132:src/os/syscalls.c **** /* "malloc clue function" from newlib-lpc/Keil-Demo/"generic" */ + 133:src/os/syscalls.c **** + 134:src/os/syscalls.c **** /**** Locally used variables. ****/ + 135:src/os/syscalls.c **** // mt: "cleaner": extern char* end; + 136:src/os/syscalls.c **** extern char end[]; /* end is set in the linker command */ + 137:src/os/syscalls.c **** /* file and is the end of statically */ + 138:src/os/syscalls.c **** /* allocated data (thus start of heap). */ + 139:src/os/syscalls.c **** + 140:src/os/syscalls.c **** static char *heap_ptr; /* Points to current end of the heap. */ + 141:src/os/syscalls.c **** + 142:src/os/syscalls.c **** /************************** _sbrk_r ************************************* + 143:src/os/syscalls.c **** * Support function. Adjusts end of heap to provide more memory to + 144:src/os/syscalls.c **** * memory allocator. Simple and dumb with no sanity checks. + 145:src/os/syscalls.c **** + 146:src/os/syscalls.c **** * struct _reent *r -- re-entrancy structure, used by newlib to + 147:src/os/syscalls.c **** * support multiple threads of operation. + 148:src/os/syscalls.c **** * ptrdiff_t nbytes -- number of bytes to add. + 149:src/os/syscalls.c **** * Returns pointer to start of new heap area. + 150:src/os/syscalls.c **** * + 151:src/os/syscalls.c **** * Note: This implementation is not thread safe (despite taking a + 152:src/os/syscalls.c **** * _reent structure as a parameter). + 153:src/os/syscalls.c **** * Since _s_r is not used in the current implementation, + 154:src/os/syscalls.c **** * the following messages must be suppressed. + 155:src/os/syscalls.c **** */ + 156:src/os/syscalls.c **** void * _sbrk_r( + 157:src/os/syscalls.c **** struct _reent *_s_r, + 158:src/os/syscalls.c **** ptrdiff_t nbytes) + 159:src/os/syscalls.c **** { + 308 .loc 1 159 0 + 309 .cfi_startproc + 310 @ Function supports interworking. + 311 @ args = 0, pretend = 0, frame = 0 + 312 @ frame_needed = 0, uses_anonymous_args = 0 + 313 @ link register save eliminated. + 314 .LVL28: + 160:src/os/syscalls.c **** char *base; /* errno should be set to ENOMEM on error */ + 161:src/os/syscalls.c **** + 162:src/os/syscalls.c **** if (!heap_ptr) { /* Initialize if first time through. */ + 315 .loc 1 162 0 + 316 00e0 18309FE5 ldr r3, .L32 + 317 00e4 000093E5 ldr r0, [r3, #0] + 318 .LVL29: + 319 00e8 14209FE5 ldr r2, .L32+4 + 320 00ec 000050E3 cmp r0, #0 + 321 00f0 0200A001 moveq r0, r2 + 163:src/os/syscalls.c **** heap_ptr = end; + 164:src/os/syscalls.c **** } + 165:src/os/syscalls.c **** base = heap_ptr; /* Point to end of heap. */ + 166:src/os/syscalls.c **** heap_ptr += nbytes; /* Increase heap. */ + 322 .loc 1 166 0 + 323 00f4 011080E0 add r1, r0, r1 + 324 .LVL30: + 325 00f8 001083E5 str r1, [r3, #0] + 167:src/os/syscalls.c **** + 168:src/os/syscalls.c **** return base; /* Return pointer to start of new heap area. */ + 169:src/os/syscalls.c **** } + 326 .loc 1 169 0 + 327 00fc 1EFF2FE1 bx lr + 328 .L33: + 329 .align 2 + 330 .L32: + 331 0100 00000000 .word .LANCHOR0 + 332 0104 00000000 .word end + 333 .cfi_endproc + 334 .LFE282: + 336 .bss + 337 .align 2 + 338 .set .LANCHOR0,. + 0 + 341 heap_ptr: + 342 0000 00000000 .space 4 + 343 .text + 344 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 syscalls.c +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:24 .text:00000000 _read_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:103 .text:00000058 _write_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:227 .text:000000b8 _close_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:246 .text:000000c0 _lseek_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:265 .text:000000c8 _fstat_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:287 .text:000000d8 isatty +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:306 .text:000000e0 _sbrk_r +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:331 .text:00000100 $d +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:337 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\cco7Lxd1.s:341 .bss:00000000 heap_ptr + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +end diff --git a/firmware/src/os/system_irq.c b/firmware/src/os/system_irq.c new file mode 100644 index 0000000..dc787eb --- /dev/null +++ b/firmware/src/os/system_irq.c @@ -0,0 +1,172 @@ +/* SAM7S system interrupt demultiplexer + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#undef DEBUG + +#include +#include +#include + +#include +#include + +#include "../openpcd.h" + +static sysirq_hdlr *sysirq_hdlrs[AT91SAM7_SYSIRQ_COUNT]; + +static void sys_irq(void) +{ + u_int32_t sr; + DEBUGP("sys_irq "); + + /* Somehow Atmel decided to do really stupid interrupt sharing + * for commonly-used interrupts such as the timer irq */ + + /* dbgu */ + if (*AT91C_DBGU_IMR) { + sr = *AT91C_DBGU_CSR; + if (sr & *AT91C_DBGU_IMR) { + DEBUGP("DBGU("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU](sr); + } else { + *AT91C_DBGU_IDR = *AT91C_DBGU_IMR; + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + + /* pit_irq */ + if (*AT91C_PITC_PIMR & AT91C_PITC_PITIEN) { + sr = *AT91C_PITC_PISR; + if (sr & AT91C_PITC_PITS) { + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT]) { + sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT](sr); + } else { + DEBUGP("no handler DISABLE_PIT "); + *AT91C_PITC_PIMR &= ~AT91C_PITC_PITIEN; + } + } + } + + /* rtt_irq */ + if (*AT91C_RTTC_RTMR & (AT91C_RTTC_ALMIEN|AT91C_RTTC_RTTINCIEN)) { + sr = *AT91C_RTTC_RTSR; + if (sr) { + DEBUGP("RTT("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT](sr); + } else { + *AT91C_RTTC_RTMR &= ~(AT91C_RTTC_ALMIEN| + AT91C_RTTC_RTTINCIEN); + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + + /* pmc_irq */ + if (*AT91C_PMC_IMR) { + sr = *AT91C_PMC_SR; + if (sr & *AT91C_PMC_IMR) { + DEBUGP("PMC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC](sr); + } else { + *AT91C_PMC_IDR = *AT91C_PMC_IMR; + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + + /* rstc_irq */ + if (*AT91C_RSTC_RMR & (AT91C_RSTC_URSTIEN|AT91C_RSTC_BODIEN)) { + sr = *AT91C_RSTC_RSR; + if (sr & (AT91C_RSTC_URSTS|AT91C_RSTC_BODSTS)) { + DEBUGP("RSTC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC](sr); + } else { + *AT91C_RSTC_RMR &= ~(AT91C_RSTC_URSTIEN| + AT91C_RSTC_BODIEN); + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + + /* mc_irq */ + if (*AT91C_MC_FMR & (AT91C_MC_LOCKE | AT91C_MC_PROGE)) { + sr = *AT91C_MC_FSR; + if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + DEBUGP("EFC("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC](sr); + } else { + *AT91C_MC_FMR &= ~(AT91C_MC_LOCKE | + AT91C_MC_PROGE); + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + + /* wdt_irq */ + if (*AT91C_WDTC_WDMR & AT91C_WDTC_WDFIEN) { + sr = *AT91C_WDTC_WDSR; + if (sr) { + DEBUGP("WDT("); + if (sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT]) { + DEBUGP("handler "); + sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT](sr); + } else { + /* we can't disable it... */ + DEBUGP("no handler "); + } + DEBUGP(") "); + } + } + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SYS); + DEBUGPCR("END"); +} + +void sysirq_register(enum sysirqs irq, sysirq_hdlr *hdlr) +{ + if (irq >= AT91SAM7_SYSIRQ_COUNT) + return; + + sysirq_hdlrs[irq] = hdlr; +} + +void sysirq_init(void) +{ + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, + OPENPCD_IRQ_PRIO_SYS, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + &sys_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); +} diff --git a/firmware/src/os/system_irq.h b/firmware/src/os/system_irq.h new file mode 100644 index 0000000..195b7b9 --- /dev/null +++ b/firmware/src/os/system_irq.h @@ -0,0 +1,22 @@ +#ifndef _SYSTEM_IRQ_H +#define _SYSTEM_IRQ_H + +#include + +enum sysirqs { + AT91SAM7_SYSIRQ_PIT = 0, + AT91SAM7_SYSIRQ_DBGU = 1, + AT91SAM7_SYSIRQ_EFC = 2, + AT91SAM7_SYSIRQ_WDT = 3, + AT91SAM7_SYSIRQ_RTT = 4, + AT91SAM7_SYSIRQ_RSTC = 5, + AT91SAM7_SYSIRQ_PMC = 6, + AT91SAM7_SYSIRQ_COUNT +}; + +typedef void sysirq_hdlr(u_int32_t sr); + +extern void sysirq_register(enum sysirqs irq, sysirq_hdlr *hdlr); +extern void sysirq_init(void); + +#endif diff --git a/firmware/src/os/system_irq.lst b/firmware/src/os/system_irq.lst new file mode 100644 index 0000000..a2b4934 --- /dev/null +++ b/firmware/src/os/system_irq.lst @@ -0,0 +1,670 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "system_irq.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 sys_irq: + 24 .LFB273: + 25 .file 1 "src/os/system_irq.c" + 1:src/os/system_irq.c **** /* SAM7S system interrupt demultiplexer + 2:src/os/system_irq.c **** * (C) 2006 by Harald Welte + 3:src/os/system_irq.c **** * + 4:src/os/system_irq.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/system_irq.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/system_irq.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/system_irq.c **** * (at your option) any later version. + 8:src/os/system_irq.c **** * + 9:src/os/system_irq.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/system_irq.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/system_irq.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/system_irq.c **** * GNU General Public License for more details. + 13:src/os/system_irq.c **** * + 14:src/os/system_irq.c **** * You should have received a copy of the GNU General Public License + 15:src/os/system_irq.c **** * along with this program; if not, write to the Free Software + 16:src/os/system_irq.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/system_irq.c **** * + 18:src/os/system_irq.c **** */ + 19:src/os/system_irq.c **** + 20:src/os/system_irq.c **** #undef DEBUG + 21:src/os/system_irq.c **** + 22:src/os/system_irq.c **** #include + 23:src/os/system_irq.c **** #include + 24:src/os/system_irq.c **** #include + 25:src/os/system_irq.c **** + 26:src/os/system_irq.c **** #include + 27:src/os/system_irq.c **** #include + 28:src/os/system_irq.c **** + 29:src/os/system_irq.c **** #include "../openpcd.h" + 30:src/os/system_irq.c **** + 31:src/os/system_irq.c **** static sysirq_hdlr *sysirq_hdlrs[AT91SAM7_SYSIRQ_COUNT]; + 32:src/os/system_irq.c **** + 33:src/os/system_irq.c **** static void sys_irq(void) + 34:src/os/system_irq.c **** { + 26 .loc 1 34 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 35:src/os/system_irq.c **** u_int32_t sr; + 36:src/os/system_irq.c **** DEBUGP("sys_irq "); + 37:src/os/system_irq.c **** + 38:src/os/system_irq.c **** /* Somehow Atmel decided to do really stupid interrupt sharing + 39:src/os/system_irq.c **** * for commonly-used interrupts such as the timer irq */ + 40:src/os/system_irq.c **** + 41:src/os/system_irq.c **** /* dbgu */ + 42:src/os/system_irq.c **** if (*AT91C_DBGU_IMR) { + 31 .loc 1 42 0 + 32 0000 0020E0E3 mvn r2, #0 + 34:src/os/system_irq.c **** { + 33 .loc 1 34 0 + 34 0004 08402DE9 stmfd sp!, {r3, lr} + 35 .LCFI0: + 36 .cfi_def_cfa_offset 8 + 37 .loc 1 42 0 + 38 0008 EF3D12E5 ldr r3, [r2, #-3567] + 39 .cfi_offset 14, -4 + 40 .cfi_offset 3, -8 + 41 000c 000053E3 cmp r3, #0 + 42 0010 0300000A beq .L2 + 43:src/os/system_irq.c **** sr = *AT91C_DBGU_CSR; + 43 .loc 1 43 0 + 44 0014 EB0D12E5 ldr r0, [r2, #-3563] + 45 .LVL0: + 44:src/os/system_irq.c **** if (sr & *AT91C_DBGU_IMR) { + 46 .loc 1 44 0 + 47 0018 EF1D12E5 ldr r1, [r2, #-3567] + 48 001c 000011E1 tst r1, r0 + 49 0020 6200001A bne .L18 + 50 .LVL1: + 51 .L2: + 45:src/os/system_irq.c **** DEBUGP("DBGU("); + 46:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU]) { + 47:src/os/system_irq.c **** DEBUGP("handler "); + 48:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU](sr); + 49:src/os/system_irq.c **** } else { + 50:src/os/system_irq.c **** *AT91C_DBGU_IDR = *AT91C_DBGU_IMR; + 51:src/os/system_irq.c **** DEBUGP("no handler "); + 52:src/os/system_irq.c **** } + 53:src/os/system_irq.c **** DEBUGP(") "); + 54:src/os/system_irq.c **** } + 55:src/os/system_irq.c **** } + 56:src/os/system_irq.c **** + 57:src/os/system_irq.c **** /* pit_irq */ + 58:src/os/system_irq.c **** if (*AT91C_PITC_PIMR & AT91C_PITC_PITIEN) { + 52 .loc 1 58 0 + 53 0024 0020E0E3 mvn r2, #0 + 54 0028 CF3212E5 ldr r3, [r2, #-719] + 55 002c 020413E3 tst r3, #33554432 + 56 0030 0200000A beq .L4 + 59:src/os/system_irq.c **** sr = *AT91C_PITC_PISR; + 57 .loc 1 59 0 + 58 0034 CB0212E5 ldr r0, [r2, #-715] + 59 .LVL2: + 60:src/os/system_irq.c **** if (sr & AT91C_PITC_PITS) { + 60 .loc 1 60 0 + 61 0038 010010E3 tst r0, #1 + 62 003c 5400001A bne .L19 + 63 .LVL3: + 64 .L4: + 61:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT]) { + 62:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT](sr); + 63:src/os/system_irq.c **** } else { + 64:src/os/system_irq.c **** DEBUGP("no handler DISABLE_PIT "); + 65:src/os/system_irq.c **** *AT91C_PITC_PIMR &= ~AT91C_PITC_PITIEN; + 66:src/os/system_irq.c **** } + 67:src/os/system_irq.c **** } + 68:src/os/system_irq.c **** } + 69:src/os/system_irq.c **** + 70:src/os/system_irq.c **** /* rtt_irq */ + 71:src/os/system_irq.c **** if (*AT91C_RTTC_RTMR & (AT91C_RTTC_ALMIEN|AT91C_RTTC_RTTINCIEN)) { + 65 .loc 1 71 0 + 66 0040 0020E0E3 mvn r2, #0 + 67 0044 DF3212E5 ldr r3, [r2, #-735] + 68 0048 030813E3 tst r3, #196608 + 69 004c 0200000A beq .L6 + 72:src/os/system_irq.c **** sr = *AT91C_RTTC_RTSR; + 70 .loc 1 72 0 + 71 0050 D30212E5 ldr r0, [r2, #-723] + 72 .LVL4: + 73:src/os/system_irq.c **** if (sr) { + 73 .loc 1 73 0 + 74 0054 000050E3 cmp r0, #0 + 75 0058 4600001A bne .L20 + 76 .LVL5: + 77 .L6: + 74:src/os/system_irq.c **** DEBUGP("RTT("); + 75:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT]) { + 76:src/os/system_irq.c **** DEBUGP("handler "); + 77:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT](sr); + 78:src/os/system_irq.c **** } else { + 79:src/os/system_irq.c **** *AT91C_RTTC_RTMR &= ~(AT91C_RTTC_ALMIEN| + 80:src/os/system_irq.c **** AT91C_RTTC_RTTINCIEN); + 81:src/os/system_irq.c **** DEBUGP("no handler "); + 82:src/os/system_irq.c **** } + 83:src/os/system_irq.c **** DEBUGP(") "); + 84:src/os/system_irq.c **** } + 85:src/os/system_irq.c **** } + 86:src/os/system_irq.c **** + 87:src/os/system_irq.c **** /* pmc_irq */ + 88:src/os/system_irq.c **** if (*AT91C_PMC_IMR) { + 78 .loc 1 88 0 + 79 005c 0020E0E3 mvn r2, #0 + 80 0060 933312E5 ldr r3, [r2, #-915] + 81 0064 000053E3 cmp r3, #0 + 82 0068 0300000A beq .L8 + 89:src/os/system_irq.c **** sr = *AT91C_PMC_SR; + 83 .loc 1 89 0 + 84 006c 970312E5 ldr r0, [r2, #-919] + 85 .LVL6: + 90:src/os/system_irq.c **** if (sr & *AT91C_PMC_IMR) { + 86 .loc 1 90 0 + 87 0070 931312E5 ldr r1, [r2, #-915] + 88 0074 000011E1 tst r1, r0 + 89 0078 3700001A bne .L21 + 90 .LVL7: + 91 .L8: + 91:src/os/system_irq.c **** DEBUGP("PMC("); + 92:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC]) { + 93:src/os/system_irq.c **** DEBUGP("handler "); + 94:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC](sr); + 95:src/os/system_irq.c **** } else { + 96:src/os/system_irq.c **** *AT91C_PMC_IDR = *AT91C_PMC_IMR; + 97:src/os/system_irq.c **** DEBUGP("no handler "); + 98:src/os/system_irq.c **** } + 99:src/os/system_irq.c **** DEBUGP(") "); + 100:src/os/system_irq.c **** } + 101:src/os/system_irq.c **** } + 102:src/os/system_irq.c **** + 103:src/os/system_irq.c **** /* rstc_irq */ + 104:src/os/system_irq.c **** if (*AT91C_RSTC_RMR & (AT91C_RSTC_URSTIEN|AT91C_RSTC_BODIEN)) { + 92 .loc 1 104 0 + 93 007c 0020E0E3 mvn r2, #0 + 94 0080 F71212E5 ldr r1, [r2, #-759] + 95 0084 A0C19FE5 ldr ip, .L23 + 96 0088 0C3001E0 and r3, r1, ip + 97 008c 000053E3 cmp r3, #0 + 98 0090 0200000A beq .L10 + 105:src/os/system_irq.c **** sr = *AT91C_RSTC_RSR; + 99 .loc 1 105 0 + 100 0094 FB0212E5 ldr r0, [r2, #-763] + 101 .LVL8: + 106:src/os/system_irq.c **** if (sr & (AT91C_RSTC_URSTS|AT91C_RSTC_BODSTS)) { + 102 .loc 1 106 0 + 103 0098 030010E3 tst r0, #3 + 104 009c 2700001A bne .L22 + 105 .LVL9: + 106 .L10: + 107:src/os/system_irq.c **** DEBUGP("RSTC("); + 108:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC]) { + 109:src/os/system_irq.c **** DEBUGP("handler "); + 110:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC](sr); + 111:src/os/system_irq.c **** } else { + 112:src/os/system_irq.c **** *AT91C_RSTC_RMR &= ~(AT91C_RSTC_URSTIEN| + 113:src/os/system_irq.c **** AT91C_RSTC_BODIEN); + 114:src/os/system_irq.c **** DEBUGP("no handler "); + 115:src/os/system_irq.c **** } + 116:src/os/system_irq.c **** DEBUGP(") "); + 117:src/os/system_irq.c **** } + 118:src/os/system_irq.c **** } + 119:src/os/system_irq.c **** + 120:src/os/system_irq.c **** /* mc_irq */ + 121:src/os/system_irq.c **** if (*AT91C_MC_FMR & (AT91C_MC_LOCKE | AT91C_MC_PROGE)) { + 107 .loc 1 121 0 + 108 00a0 0030E0E3 mvn r3, #0 + 109 00a4 9F2013E5 ldr r2, [r3, #-159] + 110 00a8 0C0012E3 tst r2, #12 + 111 00ac 0B00000A beq .L12 + 122:src/os/system_irq.c **** sr = *AT91C_MC_FSR; + 112 .loc 1 122 0 + 113 00b0 970013E5 ldr r0, [r3, #-151] + 114 .LVL10: + 123:src/os/system_irq.c **** if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + 115 .loc 1 123 0 + 116 00b4 9F3013E5 ldr r3, [r3, #-159] + 117 00b8 040013E3 tst r3, #4 + 118 00bc 1800000A beq .L13 + 119 .loc 1 123 0 is_stmt 0 discriminator 1 + 120 00c0 040010E3 tst r0, #4 + 121 00c4 1600000A beq .L13 + 122 .L14: + 124:src/os/system_irq.c **** (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + 125:src/os/system_irq.c **** DEBUGP("EFC("); + 126:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC]) { + 123 .loc 1 126 0 is_stmt 1 + 124 00c8 60219FE5 ldr r2, .L23+4 + 125 00cc 083092E5 ldr r3, [r2, #8] + 126 00d0 000053E3 cmp r3, #0 + 127 00d4 4F00000A beq .L15 + 127:src/os/system_irq.c **** DEBUGP("handler "); + 128:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_EFC](sr); + 128 .loc 1 128 0 + 129 00d8 0FE0A0E1 mov lr, pc + 130 00dc 13FF2FE1 bx r3 + 131 .LVL11: + 132 .L12: + 129:src/os/system_irq.c **** } else { + 130:src/os/system_irq.c **** *AT91C_MC_FMR &= ~(AT91C_MC_LOCKE | + 131:src/os/system_irq.c **** AT91C_MC_PROGE); + 132:src/os/system_irq.c **** DEBUGP("no handler "); + 133:src/os/system_irq.c **** } + 134:src/os/system_irq.c **** DEBUGP(") "); + 135:src/os/system_irq.c **** } + 136:src/os/system_irq.c **** } + 137:src/os/system_irq.c **** + 138:src/os/system_irq.c **** /* wdt_irq */ + 139:src/os/system_irq.c **** if (*AT91C_WDTC_WDMR & AT91C_WDTC_WDFIEN) { + 133 .loc 1 139 0 + 134 00e0 0030E0E3 mvn r3, #0 + 135 00e4 BB1213E5 ldr r1, [r3, #-699] + 136 00e8 010A11E3 tst r1, #4096 + 137 00ec 0700000A beq .L16 + 140:src/os/system_irq.c **** sr = *AT91C_WDTC_WDSR; + 138 .loc 1 140 0 + 139 00f0 B70213E5 ldr r0, [r3, #-695] + 140 .LVL12: + 141:src/os/system_irq.c **** if (sr) { + 141 .loc 1 141 0 + 142 00f4 000050E3 cmp r0, #0 + 143 00f8 0400000A beq .L16 + 142:src/os/system_irq.c **** DEBUGP("WDT("); + 143:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT]) { + 144 .loc 1 143 0 + 145 00fc 2C219FE5 ldr r2, .L23+4 + 146 0100 0C3092E5 ldr r3, [r2, #12] + 147 0104 000053E3 cmp r3, #0 + 144:src/os/system_irq.c **** DEBUGP("handler "); + 145:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_WDT](sr); + 148 .loc 1 145 0 + 149 0108 0FE0A011 movne lr, pc + 150 010c 13FF2F11 bxne r3 + 151 .LVL13: + 152 .L16: + 153 .LBB6: + 154 .LBB7: + 155 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 156 .loc 2 97 0 + 157 0110 0200A0E3 mov r0, #2 + 158 0114 0F3CE0E3 mvn r3, #3840 + 159 0118 290083E5 str r0, [r3, #41] + 160 .LBE7: + 161 .LBE6: + 146:src/os/system_irq.c **** } else { + 147:src/os/system_irq.c **** /* we can't disable it... */ + 148:src/os/system_irq.c **** DEBUGP("no handler "); + 149:src/os/system_irq.c **** } + 150:src/os/system_irq.c **** DEBUGP(") "); + 151:src/os/system_irq.c **** } + 152:src/os/system_irq.c **** } + 153:src/os/system_irq.c **** AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SYS); + 154:src/os/system_irq.c **** DEBUGPCR("END"); + 155:src/os/system_irq.c **** } + 162 .loc 1 155 0 + 163 011c 0840BDE8 ldmfd sp!, {r3, lr} + 164 0120 1EFF2FE1 bx lr + 165 .LVL14: + 166 .L13: + 124:src/os/system_irq.c **** (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + 167 .loc 1 124 0 discriminator 2 + 168 0124 0010E0E3 mvn r1, #0 + 169 0128 9FC011E5 ldr ip, [r1, #-159] + 123:src/os/system_irq.c **** if ((*AT91C_MC_FMR & AT91C_MC_LOCKE && (sr & AT91C_MC_LOCKE))|| + 170 .loc 1 123 0 discriminator 2 + 171 012c 08001CE3 tst ip, #8 + 172 0130 EAFFFF0A beq .L12 + 124:src/os/system_irq.c **** (*AT91C_MC_FMR & AT91C_MC_PROGE && (sr & AT91C_MC_PROGE))){ + 173 .loc 1 124 0 + 174 0134 080010E3 tst r0, #8 + 175 0138 E8FFFF0A beq .L12 + 176 013c E1FFFFEA b .L14 + 177 .L22: + 108:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC]) { + 178 .loc 1 108 0 + 179 0140 E8309FE5 ldr r3, .L23+4 + 180 0144 143093E5 ldr r3, [r3, #20] + 181 0148 000053E3 cmp r3, #0 + 182 014c 2500000A beq .L11 + 110:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_RSTC](sr); + 183 .loc 1 110 0 + 184 0150 0FE0A0E1 mov lr, pc + 185 0154 13FF2FE1 bx r3 + 186 .LVL15: + 187 0158 D0FFFFEA b .L10 + 188 .LVL16: + 189 .L21: + 92:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC]) { + 190 .loc 1 92 0 + 191 015c CCC09FE5 ldr ip, .L23+4 + 192 0160 18309CE5 ldr r3, [ip, #24] + 193 0164 000053E3 cmp r3, #0 + 194 0168 1B00000A beq .L9 + 94:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_PMC](sr); + 195 .loc 1 94 0 + 196 016c 0FE0A0E1 mov lr, pc + 197 0170 13FF2FE1 bx r3 + 198 .LVL17: + 199 0174 C0FFFFEA b .L8 + 200 .LVL18: + 201 .L20: + 75:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT]) { + 202 .loc 1 75 0 + 203 0178 B0109FE5 ldr r1, .L23+4 + 204 017c 103091E5 ldr r3, [r1, #16] + 205 0180 000053E3 cmp r3, #0 + 206 0184 1000000A beq .L7 + 77:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_RTT](sr); + 207 .loc 1 77 0 + 208 0188 0FE0A0E1 mov lr, pc + 209 018c 13FF2FE1 bx r3 + 210 .LVL19: + 211 0190 B1FFFFEA b .L6 + 212 .LVL20: + 213 .L19: + 61:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT]) { + 214 .loc 1 61 0 + 215 0194 94109FE5 ldr r1, .L23+4 + 216 0198 003091E5 ldr r3, [r1, #0] + 217 019c 000053E3 cmp r3, #0 + 218 01a0 1800000A beq .L5 + 62:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_PIT](sr); + 219 .loc 1 62 0 + 220 01a4 0FE0A0E1 mov lr, pc + 221 01a8 13FF2FE1 bx r3 + 222 .LVL21: + 223 01ac A3FFFFEA b .L4 + 224 .LVL22: + 225 .L18: + 46:src/os/system_irq.c **** if (sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU]) { + 226 .loc 1 46 0 + 227 01b0 78C09FE5 ldr ip, .L23+4 + 228 01b4 04309CE5 ldr r3, [ip, #4] + 229 01b8 000053E3 cmp r3, #0 + 230 01bc 0E00000A beq .L3 + 48:src/os/system_irq.c **** sysirq_hdlrs[AT91SAM7_SYSIRQ_DBGU](sr); + 231 .loc 1 48 0 + 232 01c0 0FE0A0E1 mov lr, pc + 233 01c4 13FF2FE1 bx r3 + 234 .LVL23: + 235 01c8 95FFFFEA b .L2 + 236 .LVL24: + 237 .L7: + 79:src/os/system_irq.c **** *AT91C_RTTC_RTMR &= ~(AT91C_RTTC_ALMIEN| + 238 .loc 1 79 0 + 239 01cc DF0212E5 ldr r0, [r2, #-735] + 240 .LVL25: + 241 01d0 03C8C0E3 bic ip, r0, #196608 + 242 01d4 DFC202E5 str ip, [r2, #-735] + 243 01d8 9FFFFFEA b .L6 + 244 .LVL26: + 245 .L9: + 96:src/os/system_irq.c **** *AT91C_PMC_IDR = *AT91C_PMC_IMR; + 246 .loc 1 96 0 + 247 01dc 930312E5 ldr r0, [r2, #-915] + 248 .LVL27: + 249 01e0 9B0302E5 str r0, [r2, #-923] + 250 01e4 A4FFFFEA b .L8 + 251 .LVL28: + 252 .L11: + 112:src/os/system_irq.c **** *AT91C_RSTC_RMR &= ~(AT91C_RSTC_URSTIEN| + 253 .loc 1 112 0 + 254 01e8 F71212E5 ldr r1, [r2, #-759] + 255 01ec 01C8C1E3 bic ip, r1, #65536 + 256 01f0 1000CCE3 bic r0, ip, #16 + 257 .LVL29: + 258 01f4 F70202E5 str r0, [r2, #-759] + 259 01f8 A8FFFFEA b .L10 + 260 .LVL30: + 261 .L3: + 50:src/os/system_irq.c **** *AT91C_DBGU_IDR = *AT91C_DBGU_IMR; + 262 .loc 1 50 0 + 263 01fc EF0D12E5 ldr r0, [r2, #-3567] + 264 .LVL31: + 265 0200 F30D02E5 str r0, [r2, #-3571] + 266 0204 86FFFFEA b .L2 + 267 .LVL32: + 268 .L5: + 65:src/os/system_irq.c **** *AT91C_PITC_PIMR &= ~AT91C_PITC_PITIEN; + 269 .loc 1 65 0 + 270 0208 CF0212E5 ldr r0, [r2, #-719] + 271 .LVL33: + 272 020c 02C4C0E3 bic ip, r0, #33554432 + 273 0210 CFC202E5 str ip, [r2, #-719] + 274 0214 89FFFFEA b .L4 + 275 .LVL34: + 276 .L15: + 130:src/os/system_irq.c **** *AT91C_MC_FMR &= ~(AT91C_MC_LOCKE | + 277 .loc 1 130 0 + 278 0218 0030E0E3 mvn r3, #0 + 279 021c 9FC013E5 ldr ip, [r3, #-159] + 280 0220 0C00CCE3 bic r0, ip, #12 + 281 .LVL35: + 282 0224 9F0003E5 str r0, [r3, #-159] + 283 0228 ACFFFFEA b .L12 + 284 .L24: + 285 .align 2 + 286 .L23: + 287 022c 10000100 .word 65552 + 288 0230 00000000 .word .LANCHOR0 + 289 .cfi_endproc + 290 .LFE273: + 292 .align 2 + 293 .global sysirq_register + 295 sysirq_register: + 296 .LFB274: + 156:src/os/system_irq.c **** + 157:src/os/system_irq.c **** void sysirq_register(enum sysirqs irq, sysirq_hdlr *hdlr) + 158:src/os/system_irq.c **** { + 297 .loc 1 158 0 + 298 .cfi_startproc + 299 @ Function supports interworking. + 300 @ args = 0, pretend = 0, frame = 0 + 301 @ frame_needed = 0, uses_anonymous_args = 0 + 302 @ link register save eliminated. + 303 .LVL36: + 159:src/os/system_irq.c **** if (irq >= AT91SAM7_SYSIRQ_COUNT) + 304 .loc 1 159 0 + 305 0234 060050E3 cmp r0, #6 + 160:src/os/system_irq.c **** return; + 161:src/os/system_irq.c **** + 162:src/os/system_irq.c **** sysirq_hdlrs[irq] = hdlr; + 306 .loc 1 162 0 + 307 0238 04309F95 ldrls r3, .L27 + 308 023c 00118397 strls r1, [r3, r0, asl #2] + 309 0240 1EFF2FE1 bx lr + 310 .L28: + 311 .align 2 + 312 .L27: + 313 0244 00000000 .word .LANCHOR0 + 314 .cfi_endproc + 315 .LFE274: + 317 .align 2 + 318 .global sysirq_init + 320 sysirq_init: + 321 .LFB275: + 163:src/os/system_irq.c **** } + 164:src/os/system_irq.c **** + 165:src/os/system_irq.c **** void sysirq_init(void) + 166:src/os/system_irq.c **** { + 322 .loc 1 166 0 + 323 .cfi_startproc + 324 @ Function supports interworking. + 325 @ args = 0, pretend = 0, frame = 0 + 326 @ frame_needed = 0, uses_anonymous_args = 0 + 327 0248 04E02DE5 str lr, [sp, #-4]! + 328 .LCFI1: + 329 .cfi_def_cfa_offset 4 + 167:src/os/system_irq.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, + 330 .loc 1 167 0 + 331 024c 30C09FE5 ldr ip, .L30 + 166:src/os/system_irq.c **** { + 332 .loc 1 166 0 + 333 0250 0CD04DE2 sub sp, sp, #12 + 334 .LCFI2: + 335 .cfi_def_cfa_offset 16 + 336 .loc 1 167 0 + 337 0254 0520A0E3 mov r2, #5 + 338 0258 0030A0E3 mov r3, #0 + 339 025c 24009FE5 ldr r0, .L30+4 + 340 0260 0110A0E3 mov r1, #1 + 341 0264 00C08DE5 str ip, [sp, #0] + 342 .cfi_offset 14, -4 + 343 0268 FEFFFFEB bl AT91F_AIC_ConfigureIt + 344 .LVL37: + 345 .LBB8: + 346 .LBB9: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 347 .loc 2 70 0 + 348 026c 0220A0E3 mov r2, #2 + 349 0270 0F3CE0E3 mvn r3, #3840 + 350 0274 212083E5 str r2, [r3, #33] + 351 .LBE9: + 352 .LBE8: + 168:src/os/system_irq.c **** OPENPCD_IRQ_PRIO_SYS, + 169:src/os/system_irq.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, + 170:src/os/system_irq.c **** &sys_irq); + 171:src/os/system_irq.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS); + 172:src/os/system_irq.c **** } + 353 .loc 1 172 0 + 354 0278 0CD08DE2 add sp, sp, #12 + 355 027c 04E09DE4 ldr lr, [sp], #4 + 356 0280 1EFF2FE1 bx lr + 357 .L31: + 358 .align 2 + 359 .L30: + 360 0284 00000000 .word sys_irq + 361 0288 00F0FFFF .word -4096 + 362 .cfi_endproc + 363 .LFE275: + 365 .bss + 366 .align 2 + 367 .set .LANCHOR0,. + 0 + 370 sysirq_hdlrs: + 371 0000 00000000 .space 28 + 371 00000000 + 371 00000000 + 371 00000000 + 371 00000000 + 372 .text + 373 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 system_irq.c +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:23 .text:00000000 sys_irq +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:287 .text:0000022c $d +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:292 .text:00000234 $a +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:295 .text:00000234 sysirq_register +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:313 .text:00000244 $d +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:317 .text:00000248 $a +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:320 .text:00000248 sysirq_init +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:360 .text:00000284 $d +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:366 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccE368gN.s:370 .bss:00000000 sysirq_hdlrs + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +AT91F_AIC_ConfigureIt diff --git a/firmware/src/os/tc_cdiv.c b/firmware/src/os/tc_cdiv.c new file mode 100644 index 0000000..6f06ba5 --- /dev/null +++ b/firmware/src/os/tc_cdiv.c @@ -0,0 +1,107 @@ +/* OpenPC TC (Timer / Clock) support code + * (C) 2006 by Harald Welte + * + * 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 + * + * This idea of this code is to feed the 13.56MHz carrier clock of RC632 + * into TCLK1, which is routed to XC1. Then configure TC0 to divide this + * clock by a configurable divider. + * + */ + +#include +#include +#include + +#include "../openpcd.h" +#include + +static AT91PS_TCB tcb = AT91C_BASE_TCB; + +/* set carrier divider to a specific */ +void tc_cdiv_set_divider(u_int16_t div) +{ + tcb->TCB_TC0.TC_RC = div; + + /* set to 50% duty cycle */ + tcb->TCB_TC0.TC_RA = 1; + tcb->TCB_TC0.TC_RB = 1 + (div >> 1); +} + +void tc_cdiv_phase_add(int16_t inc) +{ + tcb->TCB_TC0.TC_RA = (tcb->TCB_TC0.TC_RA + inc) % tcb->TCB_TC0.TC_RC; + tcb->TCB_TC0.TC_RB = (tcb->TCB_TC0.TC_RB + inc) % tcb->TCB_TC0.TC_RC; + + /* FIXME: can this be done more elegantly? */ + if (tcb->TCB_TC0.TC_RA == 0) { + tcb->TCB_TC0.TC_RA += 1; + tcb->TCB_TC0.TC_RB += 1; + } +} + +void tc_cdiv_init(void) +{ + /* Cfg PA28(TCLK1), PA0(TIOA0), PA1(TIOB0), PA20(TCLK2) as Periph B */ + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, + OPENPCD_PIO_CARRIER_IN | + OPENPCD_PIO_CARRIER_DIV_OUT | + OPENPCD_PIO_CDIV_HELP_OUT | + OPENPCD_PIO_CDIV_HELP_IN); + + AT91F_PMC_EnablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_TC0)); + + /* Enable Clock for TC0 */ + tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKEN; + + /* Connect TCLK1 to XC1, TCLK2 to XC2 */ + tcb->TCB_BMR &= ~(AT91C_TCB_TC1XC1S | AT91C_TCB_TC2XC2S); + tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2); + + /* Clock XC1, Wave mode, Reset on RC comp + * TIOA0 on RA comp = set, * TIOA0 on RC comp = clear, + * TIOB0 on EEVT = set, TIOB0 on RB comp = clear, + * EEVT = XC2 (TIOA0) */ + tcb->TCB_TC0.TC_CMR = AT91C_TC_CLKS_XC1 | AT91C_TC_WAVE | + AT91C_TC_WAVESEL_UP_AUTO | + AT91C_TC_ACPA_SET | AT91C_TC_ACPC_CLEAR | + AT91C_TC_BEEVT_SET | AT91C_TC_BCPB_CLEAR | + AT91C_TC_EEVT_XC2 | AT91C_TC_ETRGEDG_RISING | + AT91C_TC_BSWTRG_CLEAR | AT91C_TC_ASWTRG_CLEAR; + + tc_cdiv_set_divider(128); + + /* Reset to start timers */ + tcb->TCB_BCR = 1; +} + +void tc_cdiv_print(void) +{ + DEBUGP("TCB_BMR=0x%08x ", tcb->TCB_BMR); + DEBUGP("TC0_CV=0x%08x ", tcb->TCB_TC0.TC_CV); + DEBUGP("TC0_CMR=0x%08x ", tcb->TCB_TC0.TC_CMR); + DEBUGPCR("TC0_SR=0x%08x", tcb->TCB_TC0.TC_SR); + + DEBUGPCR("TC0_RA=0x%04x, TC0_RB=0x%04x, TC0_RC=0x%04x", + tcb->TCB_TC0.TC_RA, tcb->TCB_TC0.TC_RB, tcb->TCB_TC0.TC_RC); +} + +void tc_cdiv_fini(void) +{ + tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKDIS; + AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_TC0)); +} diff --git a/firmware/src/os/tc_cdiv.h b/firmware/src/os/tc_cdiv.h new file mode 100644 index 0000000..4f2bc02 --- /dev/null +++ b/firmware/src/os/tc_cdiv.h @@ -0,0 +1,26 @@ +#ifndef _TC_CDIV_H +#define _TC_CDIV_H + +#include +#include + +static AT91PS_TCB tcb; + +extern void tc_cdiv_phase_add(int16_t inc); +extern void tc_cdiv_set_divider(u_int16_t div); + +static inline void tc_cdiv_phase_inc(void) +{ + tc_cdiv_phase_add(1); +} + +static inline void tc_cdiv_phase_dec(void) +{ + tc_cdiv_phase_add(-1); +} + +extern void tc_cdiv_print(void); +extern void tc_cdiv_init(void); +extern void tc_cdiv_fini(void); + +#endif diff --git a/firmware/src/os/tc_cdiv.lst b/firmware/src/os/tc_cdiv.lst new file mode 100644 index 0000000..baba5c1 --- /dev/null +++ b/firmware/src/os/tc_cdiv.lst @@ -0,0 +1,1403 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "tc_cdiv.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global tc_cdiv_set_divider + 24 tc_cdiv_set_divider: + 25 .LFB275: + 26 .file 1 "src/os/tc_cdiv.c" + 1:src/os/tc_cdiv.c **** /* OpenPC TC (Timer / Clock) support code + 2:src/os/tc_cdiv.c **** * (C) 2006 by Harald Welte + 3:src/os/tc_cdiv.c **** * + 4:src/os/tc_cdiv.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/tc_cdiv.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/tc_cdiv.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/tc_cdiv.c **** * (at your option) any later version. + 8:src/os/tc_cdiv.c **** * + 9:src/os/tc_cdiv.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/tc_cdiv.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/tc_cdiv.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/tc_cdiv.c **** * GNU General Public License for more details. + 13:src/os/tc_cdiv.c **** * + 14:src/os/tc_cdiv.c **** * You should have received a copy of the GNU General Public License + 15:src/os/tc_cdiv.c **** * along with this program; if not, write to the Free Software + 16:src/os/tc_cdiv.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/tc_cdiv.c **** * + 18:src/os/tc_cdiv.c **** * This idea of this code is to feed the 13.56MHz carrier clock of RC632 + 19:src/os/tc_cdiv.c **** * into TCLK1, which is routed to XC1. Then configure TC0 to divide this + 20:src/os/tc_cdiv.c **** * clock by a configurable divider. + 21:src/os/tc_cdiv.c **** * + 22:src/os/tc_cdiv.c **** */ + 23:src/os/tc_cdiv.c **** + 24:src/os/tc_cdiv.c **** #include + 25:src/os/tc_cdiv.c **** #include + 26:src/os/tc_cdiv.c **** #include + 27:src/os/tc_cdiv.c **** + 28:src/os/tc_cdiv.c **** #include "../openpcd.h" + 29:src/os/tc_cdiv.c **** #include + 30:src/os/tc_cdiv.c **** + 31:src/os/tc_cdiv.c **** static AT91PS_TCB tcb = AT91C_BASE_TCB; + 32:src/os/tc_cdiv.c **** + 33:src/os/tc_cdiv.c **** /* set carrier divider to a specific */ + 34:src/os/tc_cdiv.c **** void tc_cdiv_set_divider(u_int16_t div) + 35:src/os/tc_cdiv.c **** { + 27 .loc 1 35 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 36:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RC = div; + 34 .loc 1 36 0 + 35 0000 18309FE5 ldr r3, .L2 + 37:src/os/tc_cdiv.c **** + 38:src/os/tc_cdiv.c **** /* set to 50% duty cycle */ + 39:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA = 1; + 40:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 36 .loc 1 40 0 + 37 0004 A0C0A0E1 mov ip, r0, lsr #1 + 38 0008 01208CE2 add r2, ip, #1 + 39:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA = 1; + 39 .loc 1 39 0 + 40 000c 0110A0E3 mov r1, #1 + 36:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RC = div; + 41 .loc 1 36 0 + 42 0010 E30003E5 str r0, [r3, #-227] + 39:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA = 1; + 43 .loc 1 39 0 + 44 0014 EB1003E5 str r1, [r3, #-235] + 45 .loc 1 40 0 + 46 0018 E72003E5 str r2, [r3, #-231] + 41:src/os/tc_cdiv.c **** } + 47 .loc 1 41 0 + 48 001c 1EFF2FE1 bx lr + 49 .L3: + 50 .align 2 + 51 .L2: + 52 0020 FF00FAFF .word -392961 + 53 .cfi_endproc + 54 .LFE275: + 56 .global __aeabi_uidivmod + 57 .align 2 + 58 .global tc_cdiv_phase_add + 60 tc_cdiv_phase_add: + 61 .LFB276: + 42:src/os/tc_cdiv.c **** + 43:src/os/tc_cdiv.c **** void tc_cdiv_phase_add(int16_t inc) + 44:src/os/tc_cdiv.c **** { + 62 .loc 1 44 0 + 63 .cfi_startproc + 64 @ Function supports interworking. + 65 @ args = 0, pretend = 0, frame = 0 + 66 @ frame_needed = 0, uses_anonymous_args = 0 + 67 .LVL1: + 68 0024 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 69 .LCFI0: + 70 .cfi_def_cfa_offset 16 + 45:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA = (tcb->TCB_TC0.TC_RA + inc) % tcb->TCB_TC0.TC_RC; + 71 .loc 1 45 0 + 72 0028 54409FE5 ldr r4, .L7 + 73 .cfi_offset 14, -4 + 74 .cfi_offset 5, -8 + 75 .cfi_offset 4, -12 + 76 .cfi_offset 3, -16 + 77 002c EB2014E5 ldr r2, [r4, #-235] + 44:src/os/tc_cdiv.c **** { + 78 .loc 1 44 0 + 79 0030 0050A0E1 mov r5, r0 + 80 .loc 1 45 0 + 81 0034 E31014E5 ldr r1, [r4, #-227] + 82 0038 020080E0 add r0, r0, r2 + 83 .LVL2: + 84 003c FEFFFFEB bl __aeabi_uidivmod + 85 0040 EB1004E5 str r1, [r4, #-235] + 46:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RB = (tcb->TCB_TC0.TC_RB + inc) % tcb->TCB_TC0.TC_RC; + 86 .loc 1 46 0 + 87 0044 E70014E5 ldr r0, [r4, #-231] + 88 0048 E31014E5 ldr r1, [r4, #-227] + 89 004c 000085E0 add r0, r5, r0 + 90 0050 FEFFFFEB bl __aeabi_uidivmod + 91 0054 E71004E5 str r1, [r4, #-231] + 47:src/os/tc_cdiv.c **** + 48:src/os/tc_cdiv.c **** /* FIXME: can this be done more elegantly? */ + 49:src/os/tc_cdiv.c **** if (tcb->TCB_TC0.TC_RA == 0) { + 92 .loc 1 49 0 + 93 0058 EB3014E5 ldr r3, [r4, #-235] + 94 005c 000053E3 cmp r3, #0 + 95 0060 0500001A bne .L4 + 50:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA += 1; + 96 .loc 1 50 0 + 97 0064 EB3014E5 ldr r3, [r4, #-235] + 98 0068 01E083E2 add lr, r3, #1 + 99 006c EBE004E5 str lr, [r4, #-235] + 51:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RB += 1; + 100 .loc 1 51 0 + 101 0070 E7C014E5 ldr ip, [r4, #-231] + 102 0074 01108CE2 add r1, ip, #1 + 103 0078 E71004E5 str r1, [r4, #-231] + 104 .L4: + 52:src/os/tc_cdiv.c **** } + 53:src/os/tc_cdiv.c **** } + 105 .loc 1 53 0 + 106 007c 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 107 0080 1EFF2FE1 bx lr + 108 .L8: + 109 .align 2 + 110 .L7: + 111 0084 FF00FAFF .word -392961 + 112 .cfi_endproc + 113 .LFE276: + 115 .align 2 + 116 .global tc_cdiv_init + 118 tc_cdiv_init: + 119 .LFB277: + 54:src/os/tc_cdiv.c **** + 55:src/os/tc_cdiv.c **** void tc_cdiv_init(void) + 56:src/os/tc_cdiv.c **** { + 120 .loc 1 56 0 + 121 .cfi_startproc + 122 @ Function supports interworking. + 123 @ args = 0, pretend = 0, frame = 0 + 124 @ frame_needed = 0, uses_anonymous_args = 0 + 125 @ link register save eliminated. + 126 .LVL3: + 57:src/os/tc_cdiv.c **** /* Cfg PA28(TCLK1), PA0(TIOA0), PA1(TIOB0), PA20(TCLK2) as Periph B */ + 58:src/os/tc_cdiv.c **** AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, + 59:src/os/tc_cdiv.c **** OPENPCD_PIO_CARRIER_IN | + 60:src/os/tc_cdiv.c **** OPENPCD_PIO_CARRIER_DIV_OUT | + 61:src/os/tc_cdiv.c **** OPENPCD_PIO_CDIV_HELP_OUT | + 62:src/os/tc_cdiv.c **** OPENPCD_PIO_CDIV_HELP_IN); + 63:src/os/tc_cdiv.c **** + 64:src/os/tc_cdiv.c **** AT91F_PMC_EnablePeriphClock(AT91C_BASE_PMC, + 65:src/os/tc_cdiv.c **** ((unsigned int) 1 << AT91C_ID_TC0)); + 66:src/os/tc_cdiv.c **** + 67:src/os/tc_cdiv.c **** /* Enable Clock for TC0 */ + 68:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKEN; + 127 .loc 1 68 0 + 128 0088 60309FE5 ldr r3, .L10 + 129 .LBB10: + 130 .LBB11: + 131 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 132 .loc 2 391 0 + 133 008c 0B1CE0E3 mvn r1, #2816 + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 134 .loc 2 392 0 + 135 0090 3302A0E3 mov r0, #805306371 + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 136 .loc 2 391 0 + 137 0094 00C0A0E3 mov ip, #0 + 138 0098 8FC001E5 str ip, [r1, #-143] + 139 .LBE11: + 140 .LBE10: + 141 .loc 1 68 0 + 142 009c 0120A0E3 mov r2, #1 + 143 .LBB13: + 144 .LBB12: + 145 .loc 2 392 0 + 146 00a0 8B0001E5 str r0, [r1, #-139] + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 147 .loc 2 393 0 + 148 00a4 FB0001E5 str r0, [r1, #-251] + 149 .LVL4: + 150 .LBE12: + 151 .LBE13: + 152 .LBB14: + 153 .LBB15: + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 154 .loc 2 940 0 + 155 00a8 010AA0E3 mov r0, #4096 + 156 00ac 031CE0E3 mvn r1, #768 + 157 00b0 EF0001E5 str r0, [r1, #-239] + 158 .LBE15: + 159 .LBE14: + 160 .loc 1 68 0 + 161 00b4 FF2003E5 str r2, [r3, #-255] + 69:src/os/tc_cdiv.c **** + 70:src/os/tc_cdiv.c **** /* Connect TCLK1 to XC1, TCLK2 to XC2 */ + 71:src/os/tc_cdiv.c **** tcb->TCB_BMR &= ~(AT91C_TCB_TC1XC1S | AT91C_TCB_TC2XC2S); + 162 .loc 1 71 0 + 163 00b8 3BC013E5 ldr ip, [r3, #-59] + 164 00bc 3C00CCE3 bic r0, ip, #60 + 165 00c0 3B0003E5 str r0, [r3, #-59] + 72:src/os/tc_cdiv.c **** tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2); + 166 .loc 1 72 0 + 167 00c4 3B1013E5 ldr r1, [r3, #-59] + 73:src/os/tc_cdiv.c **** + 74:src/os/tc_cdiv.c **** /* Clock XC1, Wave mode, Reset on RC comp + 75:src/os/tc_cdiv.c **** * TIOA0 on RA comp = set, * TIOA0 on RC comp = clear, + 76:src/os/tc_cdiv.c **** * TIOB0 on EEVT = set, TIOB0 on RB comp = clear, + 77:src/os/tc_cdiv.c **** * EEVT = XC2 (TIOA0) */ + 78:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_CMR = AT91C_TC_CLKS_XC1 | AT91C_TC_WAVE | + 168 .loc 1 78 0 + 169 00c8 24C09FE5 ldr ip, .L10+4 + 72:src/os/tc_cdiv.c **** tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2); + 170 .loc 1 72 0 + 171 00cc 3B1003E5 str r1, [r3, #-59] + 172 .LBB16: + 173 .LBB17: + 36:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RC = div; + 174 .loc 1 36 0 + 175 00d0 8000A0E3 mov r0, #128 + 40:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 176 .loc 1 40 0 + 177 00d4 4110A0E3 mov r1, #65 + 178 .LBE17: + 179 .LBE16: + 180 .loc 1 78 0 + 181 00d8 FBC003E5 str ip, [r3, #-251] + 182 .LVL5: + 183 .LBB19: + 184 .LBB18: + 36:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RC = div; + 185 .loc 1 36 0 + 186 00dc E30003E5 str r0, [r3, #-227] + 39:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA = 1; + 187 .loc 1 39 0 + 188 00e0 EB2003E5 str r2, [r3, #-235] + 40:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RB = 1 + (div >> 1); + 189 .loc 1 40 0 + 190 00e4 E71003E5 str r1, [r3, #-231] + 191 .LBE18: + 192 .LBE19: + 79:src/os/tc_cdiv.c **** AT91C_TC_WAVESEL_UP_AUTO | + 80:src/os/tc_cdiv.c **** AT91C_TC_ACPA_SET | AT91C_TC_ACPC_CLEAR | + 81:src/os/tc_cdiv.c **** AT91C_TC_BEEVT_SET | AT91C_TC_BCPB_CLEAR | + 82:src/os/tc_cdiv.c **** AT91C_TC_EEVT_XC2 | AT91C_TC_ETRGEDG_RISING | + 83:src/os/tc_cdiv.c **** AT91C_TC_BSWTRG_CLEAR | AT91C_TC_ASWTRG_CLEAR; + 84:src/os/tc_cdiv.c **** + 85:src/os/tc_cdiv.c **** tc_cdiv_set_divider(128); + 86:src/os/tc_cdiv.c **** + 87:src/os/tc_cdiv.c **** /* Reset to start timers */ + 88:src/os/tc_cdiv.c **** tcb->TCB_BCR = 1; + 193 .loc 1 88 0 + 194 00e8 3F2003E5 str r2, [r3, #-63] + 89:src/os/tc_cdiv.c **** } + 195 .loc 1 89 0 + 196 00ec 1EFF2FE1 bx lr + 197 .L11: + 198 .align 2 + 199 .L10: + 200 00f0 FF00FAFF .word -392961 + 201 00f4 06CD8992 .word -1836462842 + 202 .cfi_endproc + 203 .LFE277: + 205 .align 2 + 206 .global tc_cdiv_print + 208 tc_cdiv_print: + 209 .LFB278: + 90:src/os/tc_cdiv.c **** + 91:src/os/tc_cdiv.c **** void tc_cdiv_print(void) + 92:src/os/tc_cdiv.c **** { + 210 .loc 1 92 0 + 211 .cfi_startproc + 212 @ Function supports interworking. + 213 @ args = 0, pretend = 0, frame = 0 + 214 @ frame_needed = 0, uses_anonymous_args = 0 + 215 00f8 10402DE9 stmfd sp!, {r4, lr} + 216 .LCFI1: + 217 .cfi_def_cfa_offset 8 + 93:src/os/tc_cdiv.c **** DEBUGP("TCB_BMR=0x%08x ", tcb->TCB_BMR); + 218 .loc 1 93 0 + 219 00fc 48409FE5 ldr r4, .L13 + 220 .cfi_offset 14, -4 + 221 .cfi_offset 4, -8 + 222 0100 48009FE5 ldr r0, .L13+4 + 223 0104 3B1014E5 ldr r1, [r4, #-59] + 224 0108 FEFFFFEB bl debugp + 94:src/os/tc_cdiv.c **** DEBUGP("TC0_CV=0x%08x ", tcb->TCB_TC0.TC_CV); + 225 .loc 1 94 0 + 226 010c EF1014E5 ldr r1, [r4, #-239] + 227 0110 3C009FE5 ldr r0, .L13+8 + 228 0114 FEFFFFEB bl debugp + 95:src/os/tc_cdiv.c **** DEBUGP("TC0_CMR=0x%08x ", tcb->TCB_TC0.TC_CMR); + 229 .loc 1 95 0 + 230 0118 FB1014E5 ldr r1, [r4, #-251] + 231 011c 34009FE5 ldr r0, .L13+12 + 232 0120 FEFFFFEB bl debugp + 96:src/os/tc_cdiv.c **** DEBUGPCR("TC0_SR=0x%08x", tcb->TCB_TC0.TC_SR); + 233 .loc 1 96 0 + 234 0124 DF1014E5 ldr r1, [r4, #-223] + 235 0128 2C009FE5 ldr r0, .L13+16 + 236 012c FEFFFFEB bl debugp + 97:src/os/tc_cdiv.c **** + 98:src/os/tc_cdiv.c **** DEBUGPCR("TC0_RA=0x%04x, TC0_RB=0x%04x, TC0_RC=0x%04x", + 237 .loc 1 98 0 + 238 0130 EB1014E5 ldr r1, [r4, #-235] + 239 0134 24009FE5 ldr r0, .L13+20 + 240 0138 E72014E5 ldr r2, [r4, #-231] + 241 013c E33014E5 ldr r3, [r4, #-227] + 242 0140 FEFFFFEB bl debugp + 99:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_RA, tcb->TCB_TC0.TC_RB, tcb->TCB_TC0.TC_RC); + 100:src/os/tc_cdiv.c **** } + 243 .loc 1 100 0 + 244 0144 1040BDE8 ldmfd sp!, {r4, lr} + 245 0148 1EFF2FE1 bx lr + 246 .L14: + 247 .align 2 + 248 .L13: + 249 014c FF00FAFF .word -392961 + 250 0150 00000000 .word .LC0 + 251 0154 10000000 .word .LC1 + 252 0158 20000000 .word .LC2 + 253 015c 30000000 .word .LC3 + 254 0160 40000000 .word .LC4 + 255 .cfi_endproc + 256 .LFE278: + 258 .align 2 + 259 .global tc_cdiv_fini + 261 tc_cdiv_fini: + 262 .LFB279: + 101:src/os/tc_cdiv.c **** + 102:src/os/tc_cdiv.c **** void tc_cdiv_fini(void) + 103:src/os/tc_cdiv.c **** { + 263 .loc 1 103 0 + 264 .cfi_startproc + 265 @ Function supports interworking. + 266 @ args = 0, pretend = 0, frame = 0 + 267 @ frame_needed = 0, uses_anonymous_args = 0 + 268 @ link register save eliminated. + 104:src/os/tc_cdiv.c **** tcb->TCB_TC0.TC_CCR = AT91C_TC_CLKDIS; + 269 .loc 1 104 0 + 270 0164 14109FE5 ldr r1, .L16 + 271 0168 0200A0E3 mov r0, #2 + 272 .LBB20: + 273 .LBB21: + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 274 .loc 2 951 0 + 275 016c 012AA0E3 mov r2, #4096 + 276 0170 033CE0E3 mvn r3, #768 + 277 .LBE21: + 278 .LBE20: + 279 .loc 1 104 0 + 280 0174 FF0001E5 str r0, [r1, #-255] + 281 .LVL6: + 282 .LBB23: + 283 .LBB22: + 284 .loc 2 951 0 + 285 0178 EB2003E5 str r2, [r3, #-235] + 286 .LBE22: + 287 .LBE23: + 105:src/os/tc_cdiv.c **** AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, + 106:src/os/tc_cdiv.c **** ((unsigned int) 1 << AT91C_ID_TC0)); + 107:src/os/tc_cdiv.c **** } + 288 .loc 1 107 0 + 289 017c 1EFF2FE1 bx lr + 290 .L17: + 291 .align 2 + 292 .L16: + 293 0180 FF00FAFF .word -392961 + 294 .cfi_endproc + 295 .LFE279: + 297 .section .rodata.str1.4,"aMS",%progbits,1 + 298 .align 2 + 299 .LC0: + 300 0000 5443425F .ascii "TCB_BMR=0x%08x \000" + 300 424D523D + 300 30782530 + 300 38782000 + 301 .LC1: + 302 0010 5443305F .ascii "TC0_CV=0x%08x \000" + 302 43563D30 + 302 78253038 + 302 782000 + 303 001f 00 .space 1 + 304 .LC2: + 305 0020 5443305F .ascii "TC0_CMR=0x%08x \000" + 305 434D523D + 305 30782530 + 305 38782000 + 306 .LC3: + 307 0030 5443305F .ascii "TC0_SR=0x%08x\015\012\000" + 307 53523D30 + 307 78253038 + 307 780D0A00 + 308 .LC4: + 309 0040 5443305F .ascii "TC0_RA=0x%04x, TC0_RB=0x%04x, TC0_RC=0x%04x\015\012" + 309 52413D30 + 309 78253034 + 309 782C2054 + 309 43305F52 + 310 006d 00 .ascii "\000" + 311 006e 0000 .text + 312 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 tc_cdiv.c +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:24 .text:00000000 tc_cdiv_set_divider +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:52 .text:00000020 $d +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:57 .text:00000024 $a +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:60 .text:00000024 tc_cdiv_phase_add +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:111 .text:00000084 $d +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:115 .text:00000088 $a +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:118 .text:00000088 tc_cdiv_init +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:200 .text:000000f0 $d +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:205 .text:000000f8 $a +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:208 .text:000000f8 tc_cdiv_print +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:249 .text:0000014c $d +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:258 .text:00000164 $a +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:261 .text:00000164 tc_cdiv_fini +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:293 .text:00000180 $d +C:\Users\netz\AppData\Local\Temp\cc27XN4q.s:298 .rodata.str1.4:00000000 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +__aeabi_uidivmod +debugp diff --git a/firmware/src/os/trigger.c b/firmware/src/os/trigger.c new file mode 100644 index 0000000..7220e85 --- /dev/null +++ b/firmware/src/os/trigger.c @@ -0,0 +1,36 @@ +/* AT91SAM7 Trigger output routines for OpenPCD / OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include "../openpcd.h" + +void trigger_init(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); +} + +void trigger_pulse(void) +{ + volatile int i; + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + for (i=0; i < 0xff; i++) + { } + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); +} diff --git a/firmware/src/os/trigger.h b/firmware/src/os/trigger.h new file mode 100644 index 0000000..597704b --- /dev/null +++ b/firmware/src/os/trigger.h @@ -0,0 +1,7 @@ +#ifndef _TRIGGER_H +#define _TRIGGER_H + +extern void trigger_init(void); +extern void trigger_pulse(void); + +#endif diff --git a/firmware/src/os/trigger.lst b/firmware/src/os/trigger.lst new file mode 100644 index 0000000..42df6fb --- /dev/null +++ b/firmware/src/os/trigger.lst @@ -0,0 +1,661 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "trigger.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global trigger_init + 24 trigger_init: + 25 .LFB273: + 26 .file 1 "src/os/trigger.c" + 1:src/os/trigger.c **** /* AT91SAM7 Trigger output routines for OpenPCD / OpenPICC + 2:src/os/trigger.c **** * (C) 2006 by Harald Welte + 3:src/os/trigger.c **** * + 4:src/os/trigger.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/trigger.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/trigger.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/trigger.c **** * (at your option) any later version. + 8:src/os/trigger.c **** * + 9:src/os/trigger.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/trigger.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/trigger.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/trigger.c **** * GNU General Public License for more details. + 13:src/os/trigger.c **** * + 14:src/os/trigger.c **** * You should have received a copy of the GNU General Public License + 15:src/os/trigger.c **** * along with this program; if not, write to the Free Software + 16:src/os/trigger.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/trigger.c **** * + 18:src/os/trigger.c **** */ + 19:src/os/trigger.c **** + 20:src/os/trigger.c **** #include + 21:src/os/trigger.c **** #include + 22:src/os/trigger.c **** #include "../openpcd.h" + 23:src/os/trigger.c **** + 24:src/os/trigger.c **** void trigger_init(void) + 25:src/os/trigger.c **** { + 27 .loc 1 25 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 34 .LBB8: + 35 .LBB9: + 36 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 37 .loc 2 404 0 + 38 0000 0B3CE0E3 mvn r3, #2816 + 39 0004 0221A0E3 mov r2, #-2147483648 + 40 0008 FF2003E5 str r2, [r3, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 41 .loc 2 405 0 + 42 000c EF2003E5 str r2, [r3, #-239] + 43 .LBE9: + 44 .LBE8: + 26:src/os/trigger.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + 27:src/os/trigger.c **** } + 45 .loc 1 27 0 + 46 0010 1EFF2FE1 bx lr + 47 .cfi_endproc + 48 .LFE273: + 50 .align 2 + 51 .global trigger_pulse + 53 trigger_pulse: + 54 .LFB274: + 28:src/os/trigger.c **** + 29:src/os/trigger.c **** void trigger_pulse(void) + 30:src/os/trigger.c **** { + 55 .loc 1 30 0 + 56 .cfi_startproc + 57 @ Function supports interworking. + 58 @ args = 0, pretend = 0, frame = 8 + 59 @ frame_needed = 0, uses_anonymous_args = 0 + 60 @ link register save eliminated. + 61 .LVL1: + 62 0014 08D04DE2 sub sp, sp, #8 + 63 .LCFI0: + 64 .cfi_def_cfa_offset 8 + 65 .LBB10: + 66 .LBB11: + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 67 .loc 2 505 0 + 68 0018 0221A0E3 mov r2, #-2147483648 + 69 001c 0B1CE0E3 mvn r1, #2816 + 70 .LBE11: + 71 .LBE10: + 31:src/os/trigger.c **** volatile int i; + 32:src/os/trigger.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + 33:src/os/trigger.c **** for (i=0; i < 0xff; i++) + 72 .loc 1 33 0 + 73 0020 0000A0E3 mov r0, #0 + 74 .LBB13: + 75 .LBB12: + 76 .loc 2 505 0 + 77 0024 CF2001E5 str r2, [r1, #-207] + 78 .LBE12: + 79 .LBE13: + 80 .loc 1 33 0 + 81 0028 04008DE5 str r0, [sp, #4] + 82 .LVL2: + 83 002c 04309DE5 ldr r3, [sp, #4] + 84 0030 FE0053E3 cmp r3, #254 + 85 0034 050000CA bgt .L3 + 86 .L5: + 87 .loc 1 33 0 is_stmt 0 discriminator 2 + 88 0038 04009DE5 ldr r0, [sp, #4] + 89 003c 013080E2 add r3, r0, #1 + 90 .LVL3: + 91 0040 04308DE5 str r3, [sp, #4] + 92 .LVL4: + 93 0044 04C09DE5 ldr ip, [sp, #4] + 94 0048 FE005CE3 cmp ip, #254 + 95 004c F9FFFFDA ble .L5 + 96 .L3: + 97 .LVL5: + 98 .LBB14: + 99 .LBB15: + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 100 .loc 2 516 0 is_stmt 1 + 101 0050 0221A0E3 mov r2, #-2147483648 + 102 0054 0B1CE0E3 mvn r1, #2816 + 103 0058 CB2001E5 str r2, [r1, #-203] + 104 .LBE15: + 105 .LBE14: + 34:src/os/trigger.c **** { } + 35:src/os/trigger.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + 36:src/os/trigger.c **** } + 106 .loc 1 36 0 + 107 005c 08D08DE2 add sp, sp, #8 + 108 0060 1EFF2FE1 bx lr + 109 .cfi_endproc + 110 .LFE274: + 112 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 trigger.c +C:\Users\netz\AppData\Local\Temp\ccyjuDL3.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccyjuDL3.s:24 .text:00000000 trigger_init +C:\Users\netz\AppData\Local\Temp\ccyjuDL3.s:53 .text:00000014 trigger_pulse + .debug_frame:00000010 $d + +NO UNDEFINED SYMBOLS diff --git a/firmware/src/os/usb_benchmark.c b/firmware/src/os/usb_benchmark.c new file mode 100644 index 0000000..2802d90 --- /dev/null +++ b/firmware/src/os/usb_benchmark.c @@ -0,0 +1,75 @@ +/* AT91SAM7 USB benchmark routines for OpenPCD / OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "../openpcd.h" + +static struct req_ctx dummy_rctx; +static struct req_ctx empty_rctx; + +static int usbtest_rx(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + struct req_ctx *rctx_new; + int i; + + switch (poh->cmd) { + case OPENPCD_CMD_USBTEST_IN: + DEBUGP("USBTEST_IN "); + /* test bulk in pipe */ + if (poh->val > RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE) + poh->val = RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE; + rctx_new = req_ctx_find_get(1, RCTX_STATE_FREE, + RCTX_STATE_MAIN_PROCESSING); + if (!rctx_new) { + DEBUGP("NO RCTX "); + return USB_ERR(0); + } + + rctx_new->tot_len = poh->val * AT91C_EP_OUT_SIZE; + req_ctx_set_state(rctx_new, RCTX_STATE_UDP_EP2_PENDING); + led_toggle(2); + break; + case OPENPCD_CMD_USBTEST_OUT: + DEBUGP("USBTEST_IN "); + /* test bulk out pipe */ + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + break; + } + + req_ctx_put(rctx); + return 1; +} + +void usbtest_init(void) +{ + dummy_rctx.tot_len = 64; + memset(dummy_rctx.data, 0x23, 64); + + empty_rctx.tot_len = 0; + + usb_hdlr_register(&usbtest_rx, OPENPCD_CMD_CLS_USBTEST); +} diff --git a/firmware/src/os/usb_benchmark.lst b/firmware/src/os/usb_benchmark.lst new file mode 100644 index 0000000..41532b3 --- /dev/null +++ b/firmware/src/os/usb_benchmark.lst @@ -0,0 +1,294 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "usb_benchmark.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 usbtest_rx: + 24 .LFB278: + 25 .file 1 "src/os/usb_benchmark.c" + 1:src/os/usb_benchmark.c **** /* AT91SAM7 USB benchmark routines for OpenPCD / OpenPICC + 2:src/os/usb_benchmark.c **** * (C) 2006 by Harald Welte + 3:src/os/usb_benchmark.c **** * + 4:src/os/usb_benchmark.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/usb_benchmark.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/usb_benchmark.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/usb_benchmark.c **** * (at your option) any later version. + 8:src/os/usb_benchmark.c **** * + 9:src/os/usb_benchmark.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/usb_benchmark.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/usb_benchmark.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/usb_benchmark.c **** * GNU General Public License for more details. + 13:src/os/usb_benchmark.c **** * + 14:src/os/usb_benchmark.c **** * You should have received a copy of the GNU General Public License + 15:src/os/usb_benchmark.c **** * along with this program; if not, write to the Free Software + 16:src/os/usb_benchmark.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/usb_benchmark.c **** * + 18:src/os/usb_benchmark.c **** */ + 19:src/os/usb_benchmark.c **** + 20:src/os/usb_benchmark.c **** #include + 21:src/os/usb_benchmark.c **** #include + 22:src/os/usb_benchmark.c **** #include + 23:src/os/usb_benchmark.c **** #include + 24:src/os/usb_benchmark.c **** #include + 25:src/os/usb_benchmark.c **** #include + 26:src/os/usb_benchmark.c **** #include + 27:src/os/usb_benchmark.c **** #include + 28:src/os/usb_benchmark.c **** #include "../openpcd.h" + 29:src/os/usb_benchmark.c **** + 30:src/os/usb_benchmark.c **** static struct req_ctx dummy_rctx; + 31:src/os/usb_benchmark.c **** static struct req_ctx empty_rctx; + 32:src/os/usb_benchmark.c **** + 33:src/os/usb_benchmark.c **** static int usbtest_rx(struct req_ctx *rctx) + 34:src/os/usb_benchmark.c **** { + 26 .loc 1 34 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 .LVL0: + 32 0000 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 16 + 35:src/os/usb_benchmark.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 35 .loc 1 35 0 + 36 0004 084090E5 ldr r4, [r0, #8] + 37 .cfi_offset 14, -4 + 38 .cfi_offset 5, -8 + 39 .cfi_offset 4, -12 + 40 .cfi_offset 3, -16 + 41 .LVL1: + 36:src/os/usb_benchmark.c **** struct req_ctx *rctx_new; + 37:src/os/usb_benchmark.c **** int i; + 38:src/os/usb_benchmark.c **** + 39:src/os/usb_benchmark.c **** switch (poh->cmd) { + 42 .loc 1 39 0 + 43 0008 0030D4E5 ldrb r3, [r4, #0] @ zero_extendqisi2 + 44 000c F10053E3 cmp r3, #241 + 34:src/os/usb_benchmark.c **** { + 45 .loc 1 34 0 + 46 0010 0050A0E1 mov r5, r0 + 47 .loc 1 39 0 + 48 0014 0600000A beq .L3 + 49 .LVL2: + 50 0018 F20053E3 cmp r3, #242 + 51 001c 1A00000A beq .L9 + 52 .LVL3: + 53 .L2: + 40:src/os/usb_benchmark.c **** case OPENPCD_CMD_USBTEST_IN: + 41:src/os/usb_benchmark.c **** DEBUGP("USBTEST_IN "); + 42:src/os/usb_benchmark.c **** /* test bulk in pipe */ + 43:src/os/usb_benchmark.c **** if (poh->val > RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE) + 44:src/os/usb_benchmark.c **** poh->val = RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE; + 45:src/os/usb_benchmark.c **** rctx_new = req_ctx_find_get(1, RCTX_STATE_FREE, + 46:src/os/usb_benchmark.c **** RCTX_STATE_MAIN_PROCESSING); + 47:src/os/usb_benchmark.c **** if (!rctx_new) { + 48:src/os/usb_benchmark.c **** DEBUGP("NO RCTX "); + 49:src/os/usb_benchmark.c **** return USB_ERR(0); + 50:src/os/usb_benchmark.c **** } + 51:src/os/usb_benchmark.c **** + 52:src/os/usb_benchmark.c **** rctx_new->tot_len = poh->val * AT91C_EP_OUT_SIZE; + 53:src/os/usb_benchmark.c **** req_ctx_set_state(rctx_new, RCTX_STATE_UDP_EP2_PENDING); + 54:src/os/usb_benchmark.c **** led_toggle(2); + 55:src/os/usb_benchmark.c **** break; + 56:src/os/usb_benchmark.c **** case OPENPCD_CMD_USBTEST_OUT: + 57:src/os/usb_benchmark.c **** DEBUGP("USBTEST_IN "); + 58:src/os/usb_benchmark.c **** /* test bulk out pipe */ + 59:src/os/usb_benchmark.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 60:src/os/usb_benchmark.c **** break; + 61:src/os/usb_benchmark.c **** } + 62:src/os/usb_benchmark.c **** + 63:src/os/usb_benchmark.c **** req_ctx_put(rctx); + 54 .loc 1 63 0 + 55 0020 0500A0E1 mov r0, r5 + 56 0024 FEFFFFEB bl req_ctx_put + 64:src/os/usb_benchmark.c **** return 1; + 57 .loc 1 64 0 + 58 0028 0100A0E3 mov r0, #1 + 59 .L7: + 65:src/os/usb_benchmark.c **** } + 60 .loc 1 65 0 + 61 002c 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 62 0030 1EFF2FE1 bx lr + 63 .L3: + 41:src/os/usb_benchmark.c **** DEBUGP("USBTEST_IN "); + 64 .loc 1 41 0 + 65 0034 70009FE5 ldr r0, .L11 + 66 0038 FEFFFFEB bl debugp + 43:src/os/usb_benchmark.c **** if (poh->val > RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE) + 67 .loc 1 43 0 + 68 003c 0300D4E5 ldrb r0, [r4, #3] @ zero_extendqisi2 + 69 0040 200050E3 cmp r0, #32 + 44:src/os/usb_benchmark.c **** poh->val = RCTX_SIZE_LARGE/AT91C_EP_OUT_SIZE; + 70 .loc 1 44 0 + 71 0044 2000A083 movhi r0, #32 + 72 0048 0300C485 strhib r0, [r4, #3] + 45:src/os/usb_benchmark.c **** rctx_new = req_ctx_find_get(1, RCTX_STATE_FREE, + 73 .loc 1 45 0 + 74 004c 5C309FE5 ldr r3, .L11+4 + 75 0050 0100A0E3 mov r0, #1 + 76 0054 FE10A0E3 mov r1, #254 + 77 0058 0320A0E3 mov r2, #3 + 78 005c 0FE0A0E1 mov lr, pc + 79 0060 13FF2FE1 bx r3 + 80 .LVL4: + 47:src/os/usb_benchmark.c **** if (!rctx_new) { + 81 .loc 1 47 0 + 82 0064 003050E2 subs r3, r0, #0 + 83 0068 0B00000A beq .L10 + 52:src/os/usb_benchmark.c **** rctx_new->tot_len = poh->val * AT91C_EP_OUT_SIZE; + 84 .loc 1 52 0 + 85 006c 0310D4E5 ldrb r1, [r4, #3] @ zero_extendqisi2 + 86 0070 0123A0E1 mov r2, r1, asl #6 + 87 0074 B620C3E1 strh r2, [r3, #6] @ movhi + 53:src/os/usb_benchmark.c **** req_ctx_set_state(rctx_new, RCTX_STATE_UDP_EP2_PENDING); + 88 .loc 1 53 0 + 89 0078 1010A0E3 mov r1, #16 + 90 007c FEFFFFEB bl req_ctx_set_state + 91 .LVL5: + 54:src/os/usb_benchmark.c **** led_toggle(2); + 92 .loc 1 54 0 + 93 0080 0200A0E3 mov r0, #2 + 94 0084 FEFFFFEB bl led_toggle + 55:src/os/usb_benchmark.c **** break; + 95 .loc 1 55 0 + 96 0088 E4FFFFEA b .L2 + 97 .L9: + 57:src/os/usb_benchmark.c **** DEBUGP("USBTEST_IN "); + 98 .loc 1 57 0 + 99 008c 18009FE5 ldr r0, .L11 + 100 0090 FEFFFFEB bl debugp + 59:src/os/usb_benchmark.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 101 .loc 1 59 0 + 102 0094 18009FE5 ldr r0, .L11+8 + 103 0098 E3FFFFEA b .L7 + 104 .LVL6: + 105 .L10: + 48:src/os/usb_benchmark.c **** DEBUGP("NO RCTX "); + 106 .loc 1 48 0 + 107 009c 14009FE5 ldr r0, .L11+12 + 108 .LVL7: + 109 00a0 FEFFFFEB bl debugp + 110 .LVL8: + 49:src/os/usb_benchmark.c **** return USB_ERR(0); + 111 .loc 1 49 0 + 112 00a4 030CA0E3 mov r0, #768 + 113 00a8 DFFFFFEA b .L7 + 114 .L12: + 115 .align 2 + 116 .L11: + 117 00ac 00000000 .word .LC0 + 118 00b0 00000000 .word req_ctx_find_get + 119 00b4 02030000 .word 770 + 120 00b8 0C000000 .word .LC1 + 121 .cfi_endproc + 122 .LFE278: + 124 .align 2 + 125 .global usbtest_init + 127 usbtest_init: + 128 .LFB279: + 66:src/os/usb_benchmark.c **** + 67:src/os/usb_benchmark.c **** void usbtest_init(void) + 68:src/os/usb_benchmark.c **** { + 129 .loc 1 68 0 + 130 .cfi_startproc + 131 @ Function supports interworking. + 132 @ args = 0, pretend = 0, frame = 0 + 133 @ frame_needed = 0, uses_anonymous_args = 0 + 134 00bc 10402DE9 stmfd sp!, {r4, lr} + 135 .LCFI1: + 136 .cfi_def_cfa_offset 8 + 69:src/os/usb_benchmark.c **** dummy_rctx.tot_len = 64; + 137 .loc 1 69 0 + 138 00c0 30409FE5 ldr r4, .L14 + 139 .cfi_offset 14, -4 + 140 .cfi_offset 4, -8 + 141 00c4 40C0A0E3 mov ip, #64 + 70:src/os/usb_benchmark.c **** memset(dummy_rctx.data, 0x23, 64); + 142 .loc 1 70 0 + 143 00c8 2310A0E3 mov r1, #35 + 144 00cc 080094E5 ldr r0, [r4, #8] + 145 00d0 0C20A0E1 mov r2, ip + 69:src/os/usb_benchmark.c **** dummy_rctx.tot_len = 64; + 146 .loc 1 69 0 + 147 00d4 B6C0C4E1 strh ip, [r4, #6] @ movhi + 148 .loc 1 70 0 + 149 00d8 FEFFFFEB bl memset + 71:src/os/usb_benchmark.c **** + 72:src/os/usb_benchmark.c **** empty_rctx.tot_len = 0; + 150 .loc 1 72 0 + 151 00dc 0030A0E3 mov r3, #0 @ movhi + 73:src/os/usb_benchmark.c **** + 74:src/os/usb_benchmark.c **** usb_hdlr_register(&usbtest_rx, OPENPCD_CMD_CLS_USBTEST); + 152 .loc 1 74 0 + 153 00e0 0F10A0E3 mov r1, #15 + 154 00e4 10009FE5 ldr r0, .L14+4 + 72:src/os/usb_benchmark.c **** empty_rctx.tot_len = 0; + 155 .loc 1 72 0 + 156 00e8 B231C4E1 strh r3, [r4, #18] @ movhi + 157 .loc 1 74 0 + 158 00ec FEFFFFEB bl usb_hdlr_register + 75:src/os/usb_benchmark.c **** } + 159 .loc 1 75 0 + 160 00f0 1040BDE8 ldmfd sp!, {r4, lr} + 161 00f4 1EFF2FE1 bx lr + 162 .L15: + 163 .align 2 + 164 .L14: + 165 00f8 00000000 .word .LANCHOR0 + 166 00fc 00000000 .word usbtest_rx + 167 .cfi_endproc + 168 .LFE279: + 170 .section .rodata.str1.4,"aMS",%progbits,1 + 171 .align 2 + 172 .LC0: + 173 0000 55534254 .ascii "USBTEST_IN \000" + 173 4553545F + 173 494E2000 + 174 .LC1: + 175 000c 4E4F2052 .ascii "NO RCTX \000" + 175 43545820 + 175 00 + 176 0015 000000 .bss + 177 .align 2 + 178 .set .LANCHOR0,. + 0 + 181 dummy_rctx: + 182 0000 00000000 .space 12 + 182 00000000 + 182 00000000 + 185 empty_rctx: + 186 000c 00000000 .space 12 + 186 00000000 + 186 00000000 + 187 .text + 188 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 usb_benchmark.c +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:23 .text:00000000 usbtest_rx +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:117 .text:000000ac $d +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:124 .text:000000bc $a +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:127 .text:000000bc usbtest_init +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:165 .text:000000f8 $d +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:171 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:177 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:181 .bss:00000000 dummy_rctx +C:\Users\netz\AppData\Local\Temp\ccZWX5cp.s:185 .bss:0000000c empty_rctx + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +req_ctx_put +debugp +req_ctx_set_state +led_toggle +req_ctx_find_get +memset +usb_hdlr_register diff --git a/firmware/src/os/usb_descriptors_hid.h b/firmware/src/os/usb_descriptors_hid.h new file mode 100644 index 0000000..9399692 --- /dev/null +++ b/firmware/src/os/usb_descriptors_hid.h @@ -0,0 +1,112 @@ +#ifndef _USB_DESCRIPTORS_H +#define _USB_DESCRIPTORS_H + +#include +#include +#include +#include +#include + +#include "../config.h" + +/* The USB descriptor set for emulating a HID device */ + +const struct usb_device_descriptor dev_descriptor = { + .bLength = USB_DT_DEVICE_SIZE, + .bDescriptorType = USB_DT_DEVICE, + .bcdUSB = 0x0100, + .bDeviceClass = 0x00, + .bDeviceSubClass = 0x00, + .bDeviceProtocol = 0x00, + .bMaxPacketSize0 = 0x08, + .idVendor = USB_VENDOR_ID, + .idProduct = USB_PRODUCT_ID, + .bcdDevice = 0x0030, /* Version 0.3 */ +#ifdef CONFIG_USB_STRING + .iManufacturer = 3, + .iProduct = 4, + .iSerialNumber = 0, +#else + .iManufacturer = 0, + .iProduct = 0, + .iSerialNumber = 0, +#endif + .bNumConfigurations = 0x01, +}; + +struct _desc { + struct usb_config_descriptor ucfg; + struct usb_interface_descriptor uif; + struct usb_hid_descriptor hid; + struct usb_endpoint_descriptor ep[1]; +#ifdef CONFIG_DFU + struct usb_interface_descriptor uif_dfu[2]; +#endif +}; + +const struct _desc cfg_descriptor = { + .ucfg = { + .bLength = USB_DT_CONFIG_SIZE, + .bDescriptorType = USB_DT_CONFIG, + .wTotalLength = USB_DT_CONFIG_SIZE + +#ifdef CONFIG_DFU + 3 * USB_DT_INTERFACE_SIZE + + 1 * USB_DT_ENDPOINT_SIZE, + .bNumInterfaces = 3, +#else + 1 * USB_DT_INTERFACE_SIZE + + 1 * USB_DT_ENDPOINT_SIZE, + .bNumInterfaces = 1, +#endif + .bConfigurationValue = 1, +#ifdef CONFIG_USB_STRING + .iConfiguration = 5, +#else + .iConfiguration = 0, +#endif + .bmAttributes = USB_CONFIG_ATT_ONE, + .bMaxPower = 250, /* 500mA */ + }, + .uif = { + .bLength = USB_DT_INTERFACE_SIZE, + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = 0, + .bAlternateSetting = 0, + .bNumEndpoints = 1, + .bInterfaceClass = USB_CLASS_HID, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0x01, +#ifdef CONFIG_USB_STRING + .iInterface = 6, +#else + .iInterface = 0, +#endif + }, + .hid = { + .bLength = 0x09, + .bDescriptorType = HID_DT_HID, + .bcdHID = 0x0111, + .bCountryCode = 0, + .bNumDescriptors = 1, + .desc[0] = { + .bDescriptorType = HID_DT_REPORT, + .bLength = FIXME, + }, + }, + .ep = { + { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = OPENPCD_IRQ_EP, + .bmAttributes = USB_ENDPOINT_XFER_INT, + .wMaxPacketSize = AT91C_EP_IN_SIZE, + .bInterval = 0x0a, /* FIXME */ + }, + }, + +#ifdef CONFIG_DFU + .uif_dfu = DFU_RT_IF_DESC, +#endif +}; + +#endif /* _USB_DESCRIPTORS_H */ diff --git a/firmware/src/os/usb_descriptors_openpcd.h b/firmware/src/os/usb_descriptors_openpcd.h new file mode 100644 index 0000000..ceb7ff6 --- /dev/null +++ b/firmware/src/os/usb_descriptors_openpcd.h @@ -0,0 +1,110 @@ +#ifndef _USB_DESCRIPTORS_H +#define _USB_DESCRIPTORS_H + +#include +#include +#include +#include + +#include "../config.h" + +const struct usb_device_descriptor dev_descriptor = { + .bLength = USB_DT_DEVICE_SIZE, + .bDescriptorType = USB_DT_DEVICE, + .bcdUSB = 0x0100, + .bDeviceClass = USB_CLASS_VENDOR_SPEC, + .bDeviceSubClass = 0xff, + .bDeviceProtocol = 0xff, + .bMaxPacketSize0 = 0x08, + .idVendor = USB_VENDOR_ID, + .idProduct = USB_PRODUCT_ID, + .bcdDevice = 0x0030, /* Version 0.3 */ +#ifdef CONFIG_USB_STRING + .iManufacturer = 3, + .iProduct = 4, + .iSerialNumber = 0, +#else + .iManufacturer = 0, + .iProduct = 0, + .iSerialNumber = 0, +#endif + .bNumConfigurations = 0x01, +}; + +struct _desc { + struct usb_config_descriptor ucfg; + struct usb_interface_descriptor uif; + struct usb_endpoint_descriptor ep[3]; +#ifdef CONFIG_DFU + struct usb_interface_descriptor uif_dfu[2]; +#endif +}; + +const struct _desc cfg_descriptor = { + .ucfg = { + .bLength = USB_DT_CONFIG_SIZE, + .bDescriptorType = USB_DT_CONFIG, + .wTotalLength = USB_DT_CONFIG_SIZE + +#ifdef CONFIG_DFU + 3 * USB_DT_INTERFACE_SIZE + + 3 * USB_DT_ENDPOINT_SIZE, + .bNumInterfaces = 3, +#else + 1 * USB_DT_INTERFACE_SIZE + + 3 * USB_DT_ENDPOINT_SIZE, + .bNumInterfaces = 1, +#endif + .bConfigurationValue = 1, +#ifdef CONFIG_USB_STRING + .iConfiguration = 5, +#else + .iConfiguration = 0, +#endif + .bmAttributes = USB_CONFIG_ATT_ONE, + .bMaxPower = 250, /* 500mA */ + }, + .uif = { + .bLength = USB_DT_INTERFACE_SIZE, + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = 0, + .bAlternateSetting = 0, + .bNumEndpoints = 3, + .bInterfaceClass = USB_CLASS_VENDOR_SPEC, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0xff, +#ifdef CONFIG_USB_STRING + .iInterface = 6, +#else + .iInterface = 0, +#endif + }, + .ep= { + { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = OPENPCD_OUT_EP, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = AT91C_EP_OUT_SIZE, + .bInterval = 0x00, + }, { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = OPENPCD_IN_EP, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = AT91C_EP_IN_SIZE, + .bInterval = 0x00, + }, { + .bLength = USB_DT_ENDPOINT_SIZE, + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = OPENPCD_IRQ_EP, + .bmAttributes = USB_ENDPOINT_XFER_INT, + .wMaxPacketSize = AT91C_EP_IN_SIZE, + .bInterval = 0xff, /* FIXME */ + }, + }, +#ifdef CONFIG_DFU + .uif_dfu = DFU_RT_IF_DESC, +#endif +}; + +#endif /* _USB_DESCRIPTORS_H */ diff --git a/firmware/src/os/usb_handler.c b/firmware/src/os/usb_handler.c new file mode 100644 index 0000000..029891a --- /dev/null +++ b/firmware/src/os/usb_handler.c @@ -0,0 +1,101 @@ +/* OpenPCD USB handler - handle incoming USB requests on OUT pipe + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "../openpcd.h" + +static usb_cmd_fn *cmd_hdlrs[16]; + +int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class) +{ + cmd_hdlrs[class] = hdlr; + return 0; +} + +void usb_hdlr_unregister(u_int8_t class) +{ + cmd_hdlrs[class] = NULL; +} + +static int usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + usb_cmd_fn *hdlr; + int ret; + +/* DEBUGP("usb_in(cls=%d) ", OPENPCD_CMD_CLS(poh->cmd));*/ + + if (rctx->tot_len < sizeof(*poh)) + return -EINVAL; + + hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + if (!hdlr) { + DEBUGPCR("no handler for this class "); + ret = USB_ERR(USB_ERR_CMD_UNKNOWN); + } else + ret = (hdlr)(rctx); + + if (ret & USB_RET_ERR) { + poh->val = ret & 0xff; + poh->flags = OPENPCD_FLAG_ERROR; + } + if (ret & USB_RET_RESPOND) { + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + udp_refill_ep(2); + } + +/* DEBUGPCR("");*/ + return (ret & USB_RET_ERR) ? 1 : 0; +} + +/* Process all pending request contexts that want to Tx on either + * IN or INTERRUPT endpoint */ +void usb_out_process(void) +{ + /* interrupts are likely to be more urgent than bulk */ + udp_refill_ep(3); + udp_refill_ep(2); +} + +/* process incoming USB packets (OUT pipe) that have already been + * put into request contexts by the UDP IRQ handler */ +void usb_in_process(void) +{ + struct req_ctx *rctx; + + while (rctx = req_ctx_find_get(0, RCTX_STATE_UDP_RCV_DONE, + RCTX_STATE_MAIN_PROCESSING)) { +/* DEBUGPCRF("found used ctx %u: len=%u", + req_ctx_num(rctx), rctx->tot_len);*/ + usb_in(rctx); + } + udp_unthrottle(); +} + diff --git a/firmware/src/os/usb_handler.h b/firmware/src/os/usb_handler.h new file mode 100644 index 0000000..9d5ad48 --- /dev/null +++ b/firmware/src/os/usb_handler.h @@ -0,0 +1,27 @@ +#ifndef _USB_HANDLER_H +#define _USB_HANDLER_H + +#include "openpcd.h" +#include + +#define MAX_PAYLOAD_LEN (64 - sizeof(struct openpcd_hdr)) + +#define USB_RET_RESPOND (1 << 8) +#define USB_RET_ERR (2 << 8) +#define USB_ERR(x) (USB_RET_RESPOND|USB_RET_ERR|(x & 0xff)) + +enum usbapi_err { + USB_ERR_NONE, + USB_ERR_CMD_UNKNOWN, + USB_ERR_CMD_NOT_IMPL, +}; + +typedef int usb_cmd_fn(struct req_ctx *rctx); + +extern int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class); +extern void usb_hdlr_unregister(u_int8_t class); + +extern void usb_in_process(void); +extern void usb_out_process(void); + +#endif diff --git a/firmware/src/os/usb_handler.lst b/firmware/src/os/usb_handler.lst new file mode 100644 index 0000000..63705d6 --- /dev/null +++ b/firmware/src/os/usb_handler.lst @@ -0,0 +1,374 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "usb_handler.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global usb_hdlr_register + 24 usb_hdlr_register: + 25 .LFB278: + 26 .file 1 "src/os/usb_handler.c" + 1:src/os/usb_handler.c **** /* OpenPCD USB handler - handle incoming USB requests on OUT pipe + 2:src/os/usb_handler.c **** * (C) 2006 by Harald Welte + 3:src/os/usb_handler.c **** * + 4:src/os/usb_handler.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/usb_handler.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/usb_handler.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/usb_handler.c **** * (at your option) any later version. + 8:src/os/usb_handler.c **** * + 9:src/os/usb_handler.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/usb_handler.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/usb_handler.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/usb_handler.c **** * GNU General Public License for more details. + 13:src/os/usb_handler.c **** * + 14:src/os/usb_handler.c **** * You should have received a copy of the GNU General Public License + 15:src/os/usb_handler.c **** * along with this program; if not, write to the Free Software + 16:src/os/usb_handler.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/usb_handler.c **** * + 18:src/os/usb_handler.c **** */ + 19:src/os/usb_handler.c **** + 20:src/os/usb_handler.c **** #include + 21:src/os/usb_handler.c **** #include + 22:src/os/usb_handler.c **** #include + 23:src/os/usb_handler.c **** + 24:src/os/usb_handler.c **** #include + 25:src/os/usb_handler.c **** + 26:src/os/usb_handler.c **** #include + 27:src/os/usb_handler.c **** #include + 28:src/os/usb_handler.c **** #include + 29:src/os/usb_handler.c **** #include + 30:src/os/usb_handler.c **** #include + 31:src/os/usb_handler.c **** + 32:src/os/usb_handler.c **** #include "../openpcd.h" + 33:src/os/usb_handler.c **** + 34:src/os/usb_handler.c **** static usb_cmd_fn *cmd_hdlrs[16]; + 35:src/os/usb_handler.c **** + 36:src/os/usb_handler.c **** int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class) + 37:src/os/usb_handler.c **** { + 27 .loc 1 37 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 .LVL0: + 38:src/os/usb_handler.c **** cmd_hdlrs[class] = hdlr; + 34 .loc 1 38 0 + 35 0000 08309FE5 ldr r3, .L2 + 36 0004 010183E7 str r0, [r3, r1, asl #2] + 39:src/os/usb_handler.c **** return 0; + 40:src/os/usb_handler.c **** } + 37 .loc 1 40 0 + 38 0008 0000A0E3 mov r0, #0 + 39 .LVL1: + 40 000c 1EFF2FE1 bx lr + 41 .L3: + 42 .align 2 + 43 .L2: + 44 0010 00000000 .word .LANCHOR0 + 45 .cfi_endproc + 46 .LFE278: + 48 .align 2 + 49 .global usb_hdlr_unregister + 51 usb_hdlr_unregister: + 52 .LFB279: + 41:src/os/usb_handler.c **** + 42:src/os/usb_handler.c **** void usb_hdlr_unregister(u_int8_t class) + 43:src/os/usb_handler.c **** { + 53 .loc 1 43 0 + 54 .cfi_startproc + 55 @ Function supports interworking. + 56 @ args = 0, pretend = 0, frame = 0 + 57 @ frame_needed = 0, uses_anonymous_args = 0 + 58 @ link register save eliminated. + 59 .LVL2: + 44:src/os/usb_handler.c **** cmd_hdlrs[class] = NULL; + 60 .loc 1 44 0 + 61 0014 08309FE5 ldr r3, .L5 + 62 0018 0020A0E3 mov r2, #0 + 63 001c 002183E7 str r2, [r3, r0, asl #2] + 45:src/os/usb_handler.c **** } + 64 .loc 1 45 0 + 65 0020 1EFF2FE1 bx lr + 66 .L6: + 67 .align 2 + 68 .L5: + 69 0024 00000000 .word .LANCHOR0 + 70 .cfi_endproc + 71 .LFE279: + 73 .align 2 + 74 .global usb_out_process + 76 usb_out_process: + 77 .LFB281: + 46:src/os/usb_handler.c **** + 47:src/os/usb_handler.c **** static int usb_in(struct req_ctx *rctx) + 48:src/os/usb_handler.c **** { + 49:src/os/usb_handler.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 50:src/os/usb_handler.c **** usb_cmd_fn *hdlr; + 51:src/os/usb_handler.c **** int ret; + 52:src/os/usb_handler.c **** + 53:src/os/usb_handler.c **** /* DEBUGP("usb_in(cls=%d) ", OPENPCD_CMD_CLS(poh->cmd));*/ + 54:src/os/usb_handler.c **** + 55:src/os/usb_handler.c **** if (rctx->tot_len < sizeof(*poh)) + 56:src/os/usb_handler.c **** return -EINVAL; + 57:src/os/usb_handler.c **** + 58:src/os/usb_handler.c **** hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + 59:src/os/usb_handler.c **** if (!hdlr) { + 60:src/os/usb_handler.c **** DEBUGPCR("no handler for this class "); + 61:src/os/usb_handler.c **** ret = USB_ERR(USB_ERR_CMD_UNKNOWN); + 62:src/os/usb_handler.c **** } else + 63:src/os/usb_handler.c **** ret = (hdlr)(rctx); + 64:src/os/usb_handler.c **** + 65:src/os/usb_handler.c **** if (ret & USB_RET_ERR) { + 66:src/os/usb_handler.c **** poh->val = ret & 0xff; + 67:src/os/usb_handler.c **** poh->flags = OPENPCD_FLAG_ERROR; + 68:src/os/usb_handler.c **** } + 69:src/os/usb_handler.c **** if (ret & USB_RET_RESPOND) { + 70:src/os/usb_handler.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 71:src/os/usb_handler.c **** udp_refill_ep(2); + 72:src/os/usb_handler.c **** } + 73:src/os/usb_handler.c **** + 74:src/os/usb_handler.c **** /* DEBUGPCR("");*/ + 75:src/os/usb_handler.c **** return (ret & USB_RET_ERR) ? 1 : 0; + 76:src/os/usb_handler.c **** } + 77:src/os/usb_handler.c **** + 78:src/os/usb_handler.c **** /* Process all pending request contexts that want to Tx on either + 79:src/os/usb_handler.c **** * IN or INTERRUPT endpoint */ + 80:src/os/usb_handler.c **** void usb_out_process(void) + 81:src/os/usb_handler.c **** { + 78 .loc 1 81 0 + 79 .cfi_startproc + 80 @ Function supports interworking. + 81 @ args = 0, pretend = 0, frame = 0 + 82 @ frame_needed = 0, uses_anonymous_args = 0 + 83 0028 08402DE9 stmfd sp!, {r3, lr} + 84 .LCFI0: + 85 .cfi_def_cfa_offset 8 + 82:src/os/usb_handler.c **** /* interrupts are likely to be more urgent than bulk */ + 83:src/os/usb_handler.c **** udp_refill_ep(3); + 86 .loc 1 83 0 + 87 002c 0300A0E3 mov r0, #3 + 88 .cfi_offset 14, -4 + 89 .cfi_offset 3, -8 + 90 0030 FEFFFFEB bl udp_refill_ep + 84:src/os/usb_handler.c **** udp_refill_ep(2); + 91 .loc 1 84 0 + 92 0034 0200A0E3 mov r0, #2 + 93 0038 FEFFFFEB bl udp_refill_ep + 85:src/os/usb_handler.c **** } + 94 .loc 1 85 0 + 95 003c 0840BDE8 ldmfd sp!, {r3, lr} + 96 0040 1EFF2FE1 bx lr + 97 .cfi_endproc + 98 .LFE281: + 100 .align 2 + 101 .global usb_in_process + 103 usb_in_process: + 104 .LFB282: + 86:src/os/usb_handler.c **** + 87:src/os/usb_handler.c **** /* process incoming USB packets (OUT pipe) that have already been + 88:src/os/usb_handler.c **** * put into request contexts by the UDP IRQ handler */ + 89:src/os/usb_handler.c **** void usb_in_process(void) + 90:src/os/usb_handler.c **** { + 105 .loc 1 90 0 + 106 .cfi_startproc + 107 @ Function supports interworking. + 108 @ args = 0, pretend = 0, frame = 0 + 109 @ frame_needed = 0, uses_anonymous_args = 0 + 110 0044 F0412DE9 stmfd sp!, {r4, r5, r6, r7, r8, lr} + 111 .LCFI1: + 112 .cfi_def_cfa_offset 24 + 113 0048 C0409FE5 ldr r4, .L24 + 114 .cfi_offset 14, -4 + 115 .cfi_offset 8, -8 + 116 .cfi_offset 7, -12 + 117 .cfi_offset 6, -16 + 118 .cfi_offset 5, -20 + 119 .cfi_offset 4, -24 + 120 .LBB4: + 121 .LBB6: + 58:src/os/usb_handler.c **** hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + 122 .loc 1 58 0 + 123 004c C0509FE5 ldr r5, .L24+4 + 67:src/os/usb_handler.c **** poh->flags = OPENPCD_FLAG_ERROR; + 124 .loc 1 67 0 + 125 0050 7F60E0E3 mvn r6, #127 + 126 .L19: + 127 .LBE6: + 128 .LBE4: + 91:src/os/usb_handler.c **** struct req_ctx *rctx; + 92:src/os/usb_handler.c **** + 93:src/os/usb_handler.c **** while (rctx = req_ctx_find_get(0, RCTX_STATE_UDP_RCV_DONE, + 129 .loc 1 93 0 discriminator 1 + 130 0054 0320A0E3 mov r2, #3 + 131 0058 0210A0E3 mov r1, #2 + 132 005c 0000A0E3 mov r0, #0 + 133 0060 0FE0A0E1 mov lr, pc + 134 0064 14FF2FE1 bx r4 + 135 .LVL3: + 136 0068 007050E2 subs r7, r0, #0 + 137 006c 1B00000A beq .L21 + 138 .L16: + 139 .LVL4: + 140 .LBB8: + 141 .LBB5: + 55:src/os/usb_handler.c **** if (rctx->tot_len < sizeof(*poh)) + 142 .loc 1 55 0 + 143 0070 B630D7E1 ldrh r3, [r7, #6] + 144 0074 030053E3 cmp r3, #3 + 49:src/os/usb_handler.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 145 .loc 1 49 0 + 146 0078 088097E5 ldr r8, [r7, #8] + 147 .LVL5: + 55:src/os/usb_handler.c **** if (rctx->tot_len < sizeof(*poh)) + 148 .loc 1 55 0 + 149 007c F4FFFF9A bls .L19 + 150 .LVL6: + 58:src/os/usb_handler.c **** hdlr = cmd_hdlrs[OPENPCD_CMD_CLS(poh->cmd)]; + 151 .loc 1 58 0 + 152 0080 0020D8E5 ldrb r2, [r8, #0] @ zero_extendqisi2 + 153 0084 2212A0E1 mov r1, r2, lsr #4 + 154 0088 013195E7 ldr r3, [r5, r1, asl #2] + 155 .LVL7: + 59:src/os/usb_handler.c **** if (!hdlr) { + 156 .loc 1 59 0 + 157 008c 000053E3 cmp r3, #0 + 158 0090 1900000A beq .L22 + 63:src/os/usb_handler.c **** ret = (hdlr)(rctx); + 159 .loc 1 63 0 + 160 0094 0FE0A0E1 mov lr, pc + 161 0098 13FF2FE1 bx r3 + 162 .LVL8: + 65:src/os/usb_handler.c **** if (ret & USB_RET_ERR) { + 163 .loc 1 65 0 + 164 009c 020C10E3 tst r0, #512 + 165 00a0 013C0002 andeq r3, r0, #256 + 166 00a4 1000001A bne .L23 + 167 .LVL9: + 168 .L14: + 69:src/os/usb_handler.c **** if (ret & USB_RET_RESPOND) { + 169 .loc 1 69 0 + 170 00a8 000053E3 cmp r3, #0 + 171 00ac E8FFFF0A beq .L19 + 70:src/os/usb_handler.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 172 .loc 1 70 0 + 173 00b0 0700A0E1 mov r0, r7 + 174 00b4 1010A0E3 mov r1, #16 + 175 00b8 FEFFFFEB bl req_ctx_set_state + 71:src/os/usb_handler.c **** udp_refill_ep(2); + 176 .loc 1 71 0 + 177 00bc 0200A0E3 mov r0, #2 + 178 00c0 FEFFFFEB bl udp_refill_ep + 179 .LBE5: + 180 .LBE8: + 181 .loc 1 93 0 + 182 00c4 0320A0E3 mov r2, #3 + 183 00c8 0210A0E3 mov r1, #2 + 184 00cc 0000A0E3 mov r0, #0 + 185 00d0 0FE0A0E1 mov lr, pc + 186 00d4 14FF2FE1 bx r4 + 187 .LVL10: + 188 00d8 007050E2 subs r7, r0, #0 + 189 .LVL11: + 190 00dc E3FFFF1A bne .L16 + 191 .LVL12: + 192 .L21: + 94:src/os/usb_handler.c **** RCTX_STATE_MAIN_PROCESSING)) { + 95:src/os/usb_handler.c **** /* DEBUGPCRF("found used ctx %u: len=%u", + 96:src/os/usb_handler.c **** req_ctx_num(rctx), rctx->tot_len);*/ + 97:src/os/usb_handler.c **** usb_in(rctx); + 98:src/os/usb_handler.c **** } + 99:src/os/usb_handler.c **** udp_unthrottle(); + 193 .loc 1 99 0 + 194 00e0 FEFFFFEB bl udp_unthrottle + 195 .LVL13: + 100:src/os/usb_handler.c **** } + 196 .loc 1 100 0 + 197 00e4 F041BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, lr} + 198 00e8 1EFF2FE1 bx lr + 199 .LVL14: + 200 .L23: + 201 .LBB9: + 202 .LBB7: + 65:src/os/usb_handler.c **** if (ret & USB_RET_ERR) { + 203 .loc 1 65 0 + 204 00ec 013C00E2 and r3, r0, #256 + 205 .LVL15: + 206 .L12: + 66:src/os/usb_handler.c **** poh->val = ret & 0xff; + 207 .loc 1 66 0 + 208 00f0 0300C8E5 strb r0, [r8, #3] + 67:src/os/usb_handler.c **** poh->flags = OPENPCD_FLAG_ERROR; + 209 .loc 1 67 0 + 210 00f4 0160C8E5 strb r6, [r8, #1] + 211 00f8 EAFFFFEA b .L14 + 212 .LVL16: + 213 .L22: + 60:src/os/usb_handler.c **** DEBUGPCR("no handler for this class "); + 214 .loc 1 60 0 + 215 00fc 14009FE5 ldr r0, .L24+8 + 216 0100 FEFFFFEB bl debugp + 217 .LVL17: + 218 0104 013CA0E3 mov r3, #256 + 219 0108 0100A0E3 mov r0, #1 + 220 010c F7FFFFEA b .L12 + 221 .L25: + 222 .align 2 + 223 .L24: + 224 0110 00000000 .word req_ctx_find_get + 225 0114 00000000 .word .LANCHOR0 + 226 0118 00000000 .word .LC0 + 227 .LBE7: + 228 .LBE9: + 229 .cfi_endproc + 230 .LFE282: + 232 .section .rodata.str1.4,"aMS",%progbits,1 + 233 .align 2 + 234 .LC0: + 235 0000 6E6F2068 .ascii "no handler for this class \015\012\000" + 235 616E646C + 235 65722066 + 235 6F722074 + 235 68697320 + 236 001d 000000 .bss + 237 .align 2 + 238 .set .LANCHOR0,. + 0 + 241 cmd_hdlrs: + 242 0000 00000000 .space 64 + 242 00000000 + 242 00000000 + 242 00000000 + 242 00000000 + 243 .text + 244 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 usb_handler.c +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:24 .text:00000000 usb_hdlr_register +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:44 .text:00000010 $d +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:48 .text:00000014 $a +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:51 .text:00000014 usb_hdlr_unregister +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:69 .text:00000024 $d +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:73 .text:00000028 $a +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:76 .text:00000028 usb_out_process +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:103 .text:00000044 usb_in_process +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:224 .text:00000110 $d +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:233 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:237 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\cc87KK8o.s:241 .bss:00000000 cmd_hdlrs + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +udp_refill_ep +req_ctx_set_state +udp_unthrottle +debugp +req_ctx_find_get diff --git a/firmware/src/os/usb_hid.c b/firmware/src/os/usb_hid.c new file mode 100644 index 0000000..57daeb5 --- /dev/null +++ b/firmware/src/os/usb_hid.c @@ -0,0 +1,34 @@ +/* OpenPCD USB HID - emulate a human inupt device + * (C) 2008 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "../openpcd.h" + + diff --git a/firmware/src/os/usbcmd_generic.c b/firmware/src/os/usbcmd_generic.c new file mode 100644 index 0000000..77b992f --- /dev/null +++ b/firmware/src/os/usbcmd_generic.c @@ -0,0 +1,144 @@ +/* Some generel USB API commands, common between OpenPCD and OpenPICC + * (C) 2006 by Harald Welte + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef PCD +#include +#endif/*PCD*/ + +#define OPENPCD_API_VERSION (0x01) +#define CONFIG_AREA_ADDR ((void*)(AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE)) +#define CONFIG_AREA_WORDS ( AT91C_IFLASH_PAGE_SIZE/sizeof(u_int32_t) ) + +volatile u_int32_t config_stack[ CONFIG_AREA_WORDS ]; + +static int gen_setenv(const void* buffer,int len) +{ + volatile unsigned int i; + u_int32_t *dst; + + if( len >= sizeof(config_stack) ) + len=sizeof(config_stack); + + memcpy(&config_stack,buffer,len); + + /* retrieve current content to allow partial flashing */ + + /* flash changes */ + dst=(u_int32_t*)CONFIG_AREA_ADDR; + for(i=0;i= sizeof(config_stack) ) + len=sizeof(config_stack); + + memcpy(buffer,&config_stack,len); + + return len; +} + +static int gen_usb_rx(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + struct openpcd_compile_version *ver = + (struct openpcd_compile_version *)poh->data; + u_int32_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + + case OPENPCD_CMD_GET_API_VERSION: + DEBUGP("CMD_GET_API_VERSION\n"); + poh->flags &= OPENPCD_FLAG_RESPOND; + poh->val = OPENPCD_API_VERSION; + break; + + case OPENPCD_CMD_GET_ENVIRONMENT: + poh->flags &= OPENPCD_FLAG_RESPOND; + poh->val = gen_getenv(&poh->data,poh->val); + rctx->tot_len += poh->val; + DEBUGP("CMD_GET_ENVIRONMENT(res_len=%u)\n", poh->val); + break; + + case OPENPCD_CMD_SET_ENVIRONMENT: + DEBUGP("CMD_SET_ENVIRONMENT (in_len=%u)\n", len); + gen_setenv(&poh->data,len); + break; + + case OPENPCD_CMD_RESET: + DEBUGP("CMD_RESET\n"); + AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + break; + + case OPENPCD_CMD_GET_VERSION: + DEBUGP("GET_VERSION\n"); + poh->flags |= OPENPCD_FLAG_RESPOND; + memcpy(ver, &opcd_version, sizeof(*ver)); + rctx->tot_len += sizeof(*ver); + break; + + case OPENPCD_CMD_SET_LED: + DEBUGP("SET LED(%u,%u)\n", poh->reg, poh->val); + led_switch(poh->reg, poh->val); + break; + + case OPENPCD_CMD_GET_SERIAL: + DEBUGP("GET SERIAL("); + poh->flags |= OPENPCD_FLAG_RESPOND; +#ifdef PCD + rctx->tot_len += 4; + if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + DEBUGP("ERROR) "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + } + + DEBUGP("%s)\n", hexdump(poh->data, 4)); +#else + /* FIXME: where to get serial in PICC case */ + return USB_ERR(USB_ERR_CMD_NOT_IMPL); +#endif + break; + + default: + DEBUGP("UNKNOWN\n"); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + break; + } + + if (poh->flags & OPENPCD_FLAG_RESPOND) + return USB_RET_RESPOND; + return 0; +} + +void usbcmd_gen_init(void) +{ + DEBUGP("Inititalizing usbcmd_gen_init\n"); + /* setup FLASH write support for environment storage */ + flash_init(); + + /* retrieve default data from flash */ + memcpy(&config_stack,CONFIG_AREA_ADDR,sizeof(config_stack)); + + usb_hdlr_register(&gen_usb_rx, OPENPCD_CMD_CLS_GENERIC); +} + diff --git a/firmware/src/os/usbcmd_generic.h b/firmware/src/os/usbcmd_generic.h new file mode 100644 index 0000000..4dd0456 --- /dev/null +++ b/firmware/src/os/usbcmd_generic.h @@ -0,0 +1,6 @@ +#ifndef _USBAPI_GENERIC_H +#define _USBAPI_GENERIC_H +extern void usbcmd_gen_init(void); +extern int gen_setenv(void* data,u_int32_t pos,u_int32_t length); +extern int gen_getenv(void* data,u_int32_t pos,u_int32_t length); +#endif diff --git a/firmware/src/os/usbcmd_generic.lst b/firmware/src/os/usbcmd_generic.lst new file mode 100644 index 0000000..78f59c5 --- /dev/null +++ b/firmware/src/os/usbcmd_generic.lst @@ -0,0 +1,1692 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "usbcmd_generic.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 gen_usb_rx: + 24 .LFB275: + 25 .file 1 "src/os/usbcmd_generic.c" + 1:src/os/usbcmd_generic.c **** /* Some generel USB API commands, common between OpenPCD and OpenPICC + 2:src/os/usbcmd_generic.c **** * (C) 2006 by Harald Welte + 3:src/os/usbcmd_generic.c **** */ + 4:src/os/usbcmd_generic.c **** + 5:src/os/usbcmd_generic.c **** #include + 6:src/os/usbcmd_generic.c **** #include + 7:src/os/usbcmd_generic.c **** #include + 8:src/os/usbcmd_generic.c **** #include + 9:src/os/usbcmd_generic.c **** #include + 10:src/os/usbcmd_generic.c **** #include + 11:src/os/usbcmd_generic.c **** #include + 12:src/os/usbcmd_generic.c **** #include + 13:src/os/usbcmd_generic.c **** #include + 14:src/os/usbcmd_generic.c **** #include + 15:src/os/usbcmd_generic.c **** #ifdef PCD + 16:src/os/usbcmd_generic.c **** #include + 17:src/os/usbcmd_generic.c **** #endif/*PCD*/ + 18:src/os/usbcmd_generic.c **** + 19:src/os/usbcmd_generic.c **** #define OPENPCD_API_VERSION (0x01) + 20:src/os/usbcmd_generic.c **** #define CONFIG_AREA_ADDR ((void*)(AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE)) + 21:src/os/usbcmd_generic.c **** #define CONFIG_AREA_WORDS ( AT91C_IFLASH_PAGE_SIZE/sizeof(u_int32_t) ) + 22:src/os/usbcmd_generic.c **** + 23:src/os/usbcmd_generic.c **** volatile u_int32_t config_stack[ CONFIG_AREA_WORDS ]; + 24:src/os/usbcmd_generic.c **** + 25:src/os/usbcmd_generic.c **** static int gen_setenv(const void* buffer,int len) + 26:src/os/usbcmd_generic.c **** { + 27:src/os/usbcmd_generic.c **** volatile unsigned int i; + 28:src/os/usbcmd_generic.c **** u_int32_t *dst; + 29:src/os/usbcmd_generic.c **** + 30:src/os/usbcmd_generic.c **** if( len >= sizeof(config_stack) ) + 31:src/os/usbcmd_generic.c **** len=sizeof(config_stack); + 32:src/os/usbcmd_generic.c **** + 33:src/os/usbcmd_generic.c **** memcpy(&config_stack,buffer,len); + 34:src/os/usbcmd_generic.c **** + 35:src/os/usbcmd_generic.c **** /* retrieve current content to allow partial flashing */ + 36:src/os/usbcmd_generic.c **** + 37:src/os/usbcmd_generic.c **** /* flash changes */ + 38:src/os/usbcmd_generic.c **** dst=(u_int32_t*)CONFIG_AREA_ADDR; + 39:src/os/usbcmd_generic.c **** for(i=0;i= sizeof(config_stack) ) + 50:src/os/usbcmd_generic.c **** len=sizeof(config_stack); + 51:src/os/usbcmd_generic.c **** + 52:src/os/usbcmd_generic.c **** memcpy(buffer,&config_stack,len); + 53:src/os/usbcmd_generic.c **** + 54:src/os/usbcmd_generic.c **** return len; + 55:src/os/usbcmd_generic.c **** } + 56:src/os/usbcmd_generic.c **** + 57:src/os/usbcmd_generic.c **** static int gen_usb_rx(struct req_ctx *rctx) + 58:src/os/usbcmd_generic.c **** { + 26 .loc 1 58 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 8 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 .LVL0: + 32 0000 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 16 + 59:src/os/usbcmd_generic.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 60:src/os/usbcmd_generic.c **** struct openpcd_compile_version *ver = + 61:src/os/usbcmd_generic.c **** (struct openpcd_compile_version *)poh->data; + 62:src/os/usbcmd_generic.c **** u_int32_t len = rctx->tot_len-sizeof(*poh); + 63:src/os/usbcmd_generic.c **** + 64:src/os/usbcmd_generic.c **** /* initialize transmit length to header length */ + 65:src/os/usbcmd_generic.c **** rctx->tot_len = sizeof(*poh); + 35 .loc 1 65 0 + 36 0004 04C0A0E3 mov ip, #4 @ movhi + 59:src/os/usbcmd_generic.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 37 .loc 1 59 0 + 38 0008 084090E5 ldr r4, [r0, #8] + 39 .cfi_offset 14, -4 + 40 .cfi_offset 6, -8 + 41 .cfi_offset 5, -12 + 42 .cfi_offset 4, -16 + 43 .LVL1: + 62:src/os/usbcmd_generic.c **** u_int32_t len = rctx->tot_len-sizeof(*poh); + 44 .loc 1 62 0 + 45 000c B620D0E1 ldrh r2, [r0, #6] + 46 .loc 1 65 0 + 47 0010 B6C0C0E1 strh ip, [r0, #6] @ movhi + 66:src/os/usbcmd_generic.c **** + 67:src/os/usbcmd_generic.c **** switch (poh->cmd) { + 48 .loc 1 67 0 + 49 0014 0010D4E5 ldrb r1, [r4, #0] @ zero_extendqisi2 + 50 0018 013041E2 sub r3, r1, #1 + 58:src/os/usbcmd_generic.c **** { + 51 .loc 1 58 0 + 52 001c 08D04DE2 sub sp, sp, #8 + 53 .LCFI1: + 54 .cfi_def_cfa_offset 24 + 58:src/os/usbcmd_generic.c **** { + 55 .loc 1 58 0 + 56 0020 0050A0E1 mov r5, r0 + 61:src/os/usbcmd_generic.c **** (struct openpcd_compile_version *)poh->data; + 57 .loc 1 61 0 + 58 0024 041084E2 add r1, r4, #4 + 59 .LVL2: + 60 .loc 1 67 0 + 61 0028 060053E3 cmp r3, #6 + 62 002c 03F19F97 ldrls pc, [pc, r3, asl #2] + 63 0030 0F0000EA b .L15 + 64 .L10: + 65 0034 7C000000 .word .L3 + 66 0038 AC000000 .word .L4 + 67 003c C0000000 .word .L5 + 68 0040 F4000000 .word .L6 + 69 0044 0C010000 .word .L7 + 70 0048 44010000 .word .L8 + 71 004c 50000000 .word .L9 + 72 .L9: + 73 .LVL3: + 74 .LBB8: + 75 .LBB9: + 76 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); + 77 .loc 2 1193 0 + 78 0050 50119FE5 ldr r1, .L21 + 79 .LVL4: + 80 0054 023CE0E3 mvn r3, #512 + 81 0058 FF1003E5 str r1, [r3, #-255] + 82 005c 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 83 .LVL5: + 84 .L11: + 85 .LBE9: + 86 .LBE8: + 68:src/os/usbcmd_generic.c **** + 69:src/os/usbcmd_generic.c **** case OPENPCD_CMD_GET_API_VERSION: + 70:src/os/usbcmd_generic.c **** DEBUGP("CMD_GET_API_VERSION\n"); + 71:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 72:src/os/usbcmd_generic.c **** poh->val = OPENPCD_API_VERSION; + 73:src/os/usbcmd_generic.c **** break; + 74:src/os/usbcmd_generic.c **** + 75:src/os/usbcmd_generic.c **** case OPENPCD_CMD_GET_ENVIRONMENT: + 76:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 77:src/os/usbcmd_generic.c **** poh->val = gen_getenv(&poh->data,poh->val); + 78:src/os/usbcmd_generic.c **** rctx->tot_len += poh->val; + 79:src/os/usbcmd_generic.c **** DEBUGP("CMD_GET_ENVIRONMENT(res_len=%u)\n", poh->val); + 80:src/os/usbcmd_generic.c **** break; + 81:src/os/usbcmd_generic.c **** + 82:src/os/usbcmd_generic.c **** case OPENPCD_CMD_SET_ENVIRONMENT: + 83:src/os/usbcmd_generic.c **** DEBUGP("CMD_SET_ENVIRONMENT (in_len=%u)\n", len); + 84:src/os/usbcmd_generic.c **** gen_setenv(&poh->data,len); + 85:src/os/usbcmd_generic.c **** break; + 86:src/os/usbcmd_generic.c **** + 87:src/os/usbcmd_generic.c **** case OPENPCD_CMD_RESET: + 88:src/os/usbcmd_generic.c **** DEBUGP("CMD_RESET\n"); + 89:src/os/usbcmd_generic.c **** AT91F_RSTSoftReset(AT91C_BASE_RSTC, AT91C_RSTC_PROCRST| + 90:src/os/usbcmd_generic.c **** AT91C_RSTC_PERRST|AT91C_RSTC_EXTRST); + 91:src/os/usbcmd_generic.c **** break; + 92:src/os/usbcmd_generic.c **** + 93:src/os/usbcmd_generic.c **** case OPENPCD_CMD_GET_VERSION: + 94:src/os/usbcmd_generic.c **** DEBUGP("GET_VERSION\n"); + 95:src/os/usbcmd_generic.c **** poh->flags |= OPENPCD_FLAG_RESPOND; + 96:src/os/usbcmd_generic.c **** memcpy(ver, &opcd_version, sizeof(*ver)); + 97:src/os/usbcmd_generic.c **** rctx->tot_len += sizeof(*ver); + 98:src/os/usbcmd_generic.c **** break; + 99:src/os/usbcmd_generic.c **** + 100:src/os/usbcmd_generic.c **** case OPENPCD_CMD_SET_LED: + 101:src/os/usbcmd_generic.c **** DEBUGP("SET LED(%u,%u)\n", poh->reg, poh->val); + 102:src/os/usbcmd_generic.c **** led_switch(poh->reg, poh->val); + 103:src/os/usbcmd_generic.c **** break; + 104:src/os/usbcmd_generic.c **** + 105:src/os/usbcmd_generic.c **** case OPENPCD_CMD_GET_SERIAL: + 106:src/os/usbcmd_generic.c **** DEBUGP("GET SERIAL("); + 107:src/os/usbcmd_generic.c **** poh->flags |= OPENPCD_FLAG_RESPOND; + 108:src/os/usbcmd_generic.c **** #ifdef PCD + 109:src/os/usbcmd_generic.c **** rctx->tot_len += 4; + 110:src/os/usbcmd_generic.c **** if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + 111:src/os/usbcmd_generic.c **** DEBUGP("ERROR) "); + 112:src/os/usbcmd_generic.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 113:src/os/usbcmd_generic.c **** } + 114:src/os/usbcmd_generic.c **** + 115:src/os/usbcmd_generic.c **** DEBUGP("%s)\n", hexdump(poh->data, 4)); + 116:src/os/usbcmd_generic.c **** #else + 117:src/os/usbcmd_generic.c **** /* FIXME: where to get serial in PICC case */ + 118:src/os/usbcmd_generic.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 119:src/os/usbcmd_generic.c **** #endif + 120:src/os/usbcmd_generic.c **** break; + 121:src/os/usbcmd_generic.c **** + 122:src/os/usbcmd_generic.c **** default: + 123:src/os/usbcmd_generic.c **** DEBUGP("UNKNOWN\n"); + 124:src/os/usbcmd_generic.c **** return USB_ERR(USB_ERR_CMD_UNKNOWN); + 125:src/os/usbcmd_generic.c **** break; + 126:src/os/usbcmd_generic.c **** } + 127:src/os/usbcmd_generic.c **** + 128:src/os/usbcmd_generic.c **** if (poh->flags & OPENPCD_FLAG_RESPOND) + 87 .loc 1 128 0 + 88 0060 010010E2 ands r0, r0, #1 + 129:src/os/usbcmd_generic.c **** return USB_RET_RESPOND; + 89 .loc 1 129 0 + 90 0064 010CA013 movne r0, #256 + 91 .L2: + 130:src/os/usbcmd_generic.c **** return 0; + 131:src/os/usbcmd_generic.c **** } + 92 .loc 1 131 0 + 93 0068 08D08DE2 add sp, sp, #8 + 94 006c 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 95 0070 1EFF2FE1 bx lr + 96 .LVL6: + 97 .L15: + 124:src/os/usbcmd_generic.c **** return USB_ERR(USB_ERR_CMD_UNKNOWN); + 98 .loc 1 124 0 + 99 0074 30019FE5 ldr r0, .L21+4 + 100 0078 FAFFFFEA b .L2 + 101 .L3: + 95:src/os/usbcmd_generic.c **** poh->flags |= OPENPCD_FLAG_RESPOND; + 102 .loc 1 95 0 + 103 007c 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 104 0080 01E080E3 orr lr, r0, #1 + 96:src/os/usbcmd_generic.c **** memcpy(ver, &opcd_version, sizeof(*ver)); + 105 .loc 1 96 0 + 106 0084 3020A0E3 mov r2, #48 + 107 .LVL7: + 108 0088 0100A0E1 mov r0, r1 + 95:src/os/usbcmd_generic.c **** poh->flags |= OPENPCD_FLAG_RESPOND; + 109 .loc 1 95 0 + 110 008c 01E0C4E5 strb lr, [r4, #1] + 96:src/os/usbcmd_generic.c **** memcpy(ver, &opcd_version, sizeof(*ver)); + 111 .loc 1 96 0 + 112 0090 18119FE5 ldr r1, .L21+8 + 113 .LVL8: + 114 0094 FEFFFFEB bl memcpy + 115 .LVL9: + 97:src/os/usbcmd_generic.c **** rctx->tot_len += sizeof(*ver); + 116 .loc 1 97 0 + 117 0098 B620D5E1 ldrh r2, [r5, #6] + 118 009c 30C082E2 add ip, r2, #48 + 119 00a0 B6C0C5E1 strh ip, [r5, #6] @ movhi + 120 00a4 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 98:src/os/usbcmd_generic.c **** break; + 121 .loc 1 98 0 + 122 00a8 ECFFFFEA b .L11 + 123 .LVL10: + 124 .L4: + 102:src/os/usbcmd_generic.c **** led_switch(poh->reg, poh->val); + 125 .loc 1 102 0 + 126 00ac 0200D4E5 ldrb r0, [r4, #2] @ zero_extendqisi2 + 127 00b0 0310D4E5 ldrb r1, [r4, #3] @ zero_extendqisi2 + 128 .LVL11: + 129 00b4 FEFFFFEB bl led_switch + 130 .LVL12: + 131 00b8 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 103:src/os/usbcmd_generic.c **** break; + 132 .loc 1 103 0 + 133 00bc E7FFFFEA b .L11 + 134 .LVL13: + 135 .L5: + 107:src/os/usbcmd_generic.c **** poh->flags |= OPENPCD_FLAG_RESPOND; + 136 .loc 1 107 0 + 137 00c0 01E0D4E5 ldrb lr, [r4, #1] @ zero_extendqisi2 + 138 00c4 01208EE3 orr r2, lr, #1 + 139 .LVL14: + 140 00c8 0120C4E5 strb r2, [r4, #1] + 109:src/os/usbcmd_generic.c **** rctx->tot_len += 4; + 141 .loc 1 109 0 + 142 00cc B6C0D0E1 ldrh ip, [r0, #6] + 143 00d0 04308CE2 add r3, ip, #4 + 144 00d4 B630C0E1 strh r3, [r0, #6] @ movhi + 110:src/os/usbcmd_generic.c **** if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + 145 .loc 1 110 0 + 146 00d8 0000A0E3 mov r0, #0 + 147 00dc FEFFFFEB bl rc632_get_serial + 148 .LVL15: + 149 00e0 000050E3 cmp r0, #0 + 112:src/os/usbcmd_generic.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 150 .loc 1 112 0 + 151 00e4 C8009FB5 ldrlt r0, .L21+12 + 110:src/os/usbcmd_generic.c **** if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + 152 .loc 1 110 0 + 153 00e8 DEFFFFBA blt .L2 + 154 00ec 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 155 00f0 DAFFFFEA b .L11 + 156 .LVL16: + 157 .L6: + 71:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 158 .loc 1 71 0 + 159 00f4 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 72:src/os/usbcmd_generic.c **** poh->val = OPENPCD_API_VERSION; + 160 .loc 1 72 0 + 161 00f8 0120A0E3 mov r2, #1 + 162 .LVL17: + 71:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 163 .loc 1 71 0 + 164 00fc 010000E2 and r0, r0, #1 + 165 0100 0100C4E5 strb r0, [r4, #1] + 72:src/os/usbcmd_generic.c **** poh->val = OPENPCD_API_VERSION; + 166 .loc 1 72 0 + 167 0104 0320C4E5 strb r2, [r4, #3] + 73:src/os/usbcmd_generic.c **** break; + 168 .loc 1 73 0 + 169 0108 D4FFFFEA b .L11 + 170 .LVL18: + 171 .L7: + 76:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 172 .loc 1 76 0 + 173 010c 01C0D4E5 ldrb ip, [r4, #1] @ zero_extendqisi2 + 77:src/os/usbcmd_generic.c **** poh->val = gen_getenv(&poh->data,poh->val); + 174 .loc 1 77 0 + 175 0110 0360D4E5 ldrb r6, [r4, #3] @ zero_extendqisi2 + 176 .LVL19: + 76:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 177 .loc 1 76 0 + 178 0114 01E00CE2 and lr, ip, #1 + 179 .LBB10: + 180 .LBB11: + 52:src/os/usbcmd_generic.c **** memcpy(buffer,&config_stack,len); + 181 .loc 1 52 0 + 182 0118 0100A0E1 mov r0, r1 + 183 011c 0620A0E1 mov r2, r6 + 184 .LVL20: + 185 .LBE11: + 186 .LBE10: + 76:src/os/usbcmd_generic.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 187 .loc 1 76 0 + 188 0120 01E0C4E5 strb lr, [r4, #1] + 189 .LBB13: + 190 .LBB12: + 52:src/os/usbcmd_generic.c **** memcpy(buffer,&config_stack,len); + 191 .loc 1 52 0 + 192 0124 8C109FE5 ldr r1, .L21+16 + 193 .LVL21: + 194 0128 FEFFFFEB bl memcpy + 195 .LVL22: + 196 .LBE12: + 197 .LBE13: + 77:src/os/usbcmd_generic.c **** poh->val = gen_getenv(&poh->data,poh->val); + 198 .loc 1 77 0 + 199 012c 0360C4E5 strb r6, [r4, #3] + 78:src/os/usbcmd_generic.c **** rctx->tot_len += poh->val; + 200 .loc 1 78 0 + 201 0130 B630D5E1 ldrh r3, [r5, #6] + 202 0134 036086E0 add r6, r6, r3 + 203 .LVL23: + 204 0138 B660C5E1 strh r6, [r5, #6] @ movhi + 205 013c 0100D4E5 ldrb r0, [r4, #1] @ zero_extendqisi2 + 80:src/os/usbcmd_generic.c **** break; + 206 .loc 1 80 0 + 207 0140 C6FFFFEA b .L11 + 208 .LVL24: + 209 .L8: + 62:src/os/usbcmd_generic.c **** u_int32_t len = rctx->tot_len-sizeof(*poh); + 210 .loc 1 62 0 + 211 0144 042042E2 sub r2, r2, #4 + 212 .LVL25: + 213 .LBB14: + 214 .LBB15: + 33:src/os/usbcmd_generic.c **** memcpy(&config_stack,buffer,len); + 215 .loc 1 33 0 + 216 0148 FF0052E3 cmp r2, #255 + 217 014c 012CA083 movhi r2, #256 + 218 .LVL26: + 219 0150 60009FE5 ldr r0, .L21+16 + 220 0154 FEFFFFEB bl memcpy + 221 .LVL27: + 39:src/os/usbcmd_generic.c **** for(i=0;i + * + * 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 + * + */ + +#include +#include + +#include +#include + +#ifdef WDT_DEBUG +#undef WDT_DEBUG +#endif/*WDT_DEBUG*/ + +static void wdt_irq(u_int32_t sr) +{ + DEBUGPCRF("================> WATCHDOG EXPIRED !!!!!"); +} + +void wdt_restart(void) +{ + AT91F_WDTRestart(AT91C_BASE_WDTC); +} + +void wdt_init(void) +{ + sysirq_register(AT91SAM7_SYSIRQ_WDT, &wdt_irq); +#ifdef WDT_DEBUG + AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xff << 16) | + AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT | + AT91C_WDTC_WDFIEN); +#else + AT91F_WDTSetMode(AT91C_BASE_WDTC, (0x80 << 16) | + AT91C_WDTC_WDRSTEN | 0x80); +#endif +} diff --git a/firmware/src/os/wdt.h b/firmware/src/os/wdt.h new file mode 100644 index 0000000..35ea721 --- /dev/null +++ b/firmware/src/os/wdt.h @@ -0,0 +1,5 @@ +#ifndef _WDT_H +extern void wdt_init(void); +extern void wdt_restart(void); + +#endif diff --git a/firmware/src/os/wdt.lst b/firmware/src/os/wdt.lst new file mode 100644 index 0000000..9f84505 --- /dev/null +++ b/firmware/src/os/wdt.lst @@ -0,0 +1,1658 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "wdt.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 wdt_irq: + 24 .LFB273: + 25 .file 1 "src/os/wdt.c" + 1:src/os/wdt.c **** /* AT91SAM7 Watch Dog Timer code for OpenPCD / OpenPICC + 2:src/os/wdt.c **** * (C) 2006 by Harald Welte + 3:src/os/wdt.c **** * + 4:src/os/wdt.c **** * This program is free software; you can redistribute it and/or modify + 5:src/os/wdt.c **** * it under the terms of the GNU General Public License as published by + 6:src/os/wdt.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/os/wdt.c **** * (at your option) any later version. + 8:src/os/wdt.c **** * + 9:src/os/wdt.c **** * This program is distributed in the hope that it will be useful, + 10:src/os/wdt.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/os/wdt.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/os/wdt.c **** * GNU General Public License for more details. + 13:src/os/wdt.c **** * + 14:src/os/wdt.c **** * You should have received a copy of the GNU General Public License + 15:src/os/wdt.c **** * along with this program; if not, write to the Free Software + 16:src/os/wdt.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/os/wdt.c **** * + 18:src/os/wdt.c **** */ + 19:src/os/wdt.c **** + 20:src/os/wdt.c **** #include + 21:src/os/wdt.c **** #include + 22:src/os/wdt.c **** + 23:src/os/wdt.c **** #include + 24:src/os/wdt.c **** #include + 25:src/os/wdt.c **** + 26:src/os/wdt.c **** #ifdef WDT_DEBUG + 27:src/os/wdt.c **** #undef WDT_DEBUG + 28:src/os/wdt.c **** #endif/*WDT_DEBUG*/ + 29:src/os/wdt.c **** + 30:src/os/wdt.c **** static void wdt_irq(u_int32_t sr) + 31:src/os/wdt.c **** { + 26 .loc 1 31 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 .LVL0: + 32 0000 08402DE9 stmfd sp!, {r3, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 8 + 32:src/os/wdt.c **** DEBUGPCRF("================> WATCHDOG EXPIRED !!!!!"); + 35 .loc 1 32 0 + 36 0004 10009FE5 ldr r0, .L2 + 37 .LVL1: + 38 0008 10109FE5 ldr r1, .L2+4 + 39 000c 2020A0E3 mov r2, #32 + 40 .cfi_offset 14, -4 + 41 .cfi_offset 3, -8 + 42 0010 FEFFFFEB bl debugp + 33:src/os/wdt.c **** } + 43 .loc 1 33 0 + 44 0014 0840BDE8 ldmfd sp!, {r3, lr} + 45 0018 1EFF2FE1 bx lr + 46 .L3: + 47 .align 2 + 48 .L2: + 49 001c 00000000 .word .LC0 + 50 0020 00000000 .word .LANCHOR0 + 51 .cfi_endproc + 52 .LFE273: + 54 .align 2 + 55 .global wdt_restart + 57 wdt_restart: + 58 .LFB274: + 34:src/os/wdt.c **** + 35:src/os/wdt.c **** void wdt_restart(void) + 36:src/os/wdt.c **** { + 59 .loc 1 36 0 + 60 .cfi_startproc + 61 @ Function supports interworking. + 62 @ args = 0, pretend = 0, frame = 0 + 63 @ frame_needed = 0, uses_anonymous_args = 0 + 64 @ link register save eliminated. + 65 .LVL2: + 66 .LBB6: + 67 .LBB7: + 68 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; + 69 .loc 2 1461 0 + 70 0024 08209FE5 ldr r2, .L5 + 71 0028 023CE0E3 mvn r3, #512 + 72 002c BF2003E5 str r2, [r3, #-191] + 73 .LBE7: + 74 .LBE6: + 37:src/os/wdt.c **** AT91F_WDTRestart(AT91C_BASE_WDTC); + 38:src/os/wdt.c **** } + 75 .loc 1 38 0 + 76 0030 1EFF2FE1 bx lr + 77 .L6: + 78 .align 2 + 79 .L5: + 80 0034 010000A5 .word -1526726655 + 81 .cfi_endproc + 82 .LFE274: + 84 .align 2 + 85 .global wdt_init + 87 wdt_init: + 88 .LFB275: + 39:src/os/wdt.c **** + 40:src/os/wdt.c **** void wdt_init(void) + 41:src/os/wdt.c **** { + 89 .loc 1 41 0 + 90 .cfi_startproc + 91 @ Function supports interworking. + 92 @ args = 0, pretend = 0, frame = 0 + 93 @ frame_needed = 0, uses_anonymous_args = 0 + 94 0038 08402DE9 stmfd sp!, {r3, lr} + 95 .LCFI1: + 96 .cfi_def_cfa_offset 8 + 42:src/os/wdt.c **** sysirq_register(AT91SAM7_SYSIRQ_WDT, &wdt_irq); + 97 .loc 1 42 0 + 98 003c 0300A0E3 mov r0, #3 + 99 0040 14109FE5 ldr r1, .L8 + 100 .cfi_offset 14, -4 + 101 .cfi_offset 3, -8 + 102 0044 FEFFFFEB bl sysirq_register + 103 .LVL3: + 104 .LBB8: + 105 .LBB9: +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; + 106 .loc 2 1451 0 + 107 0048 10209FE5 ldr r2, .L8+4 + 108 004c 023CE0E3 mvn r3, #512 + 109 0050 BB2003E5 str r2, [r3, #-187] + 110 .LBE9: + 111 .LBE8: + 43:src/os/wdt.c **** #ifdef WDT_DEBUG + 44:src/os/wdt.c **** AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xff << 16) | + 45:src/os/wdt.c **** AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT | + 46:src/os/wdt.c **** AT91C_WDTC_WDFIEN); + 47:src/os/wdt.c **** #else + 48:src/os/wdt.c **** AT91F_WDTSetMode(AT91C_BASE_WDTC, (0x80 << 16) | + 49:src/os/wdt.c **** AT91C_WDTC_WDRSTEN | 0x80); + 50:src/os/wdt.c **** #endif + 51:src/os/wdt.c **** } + 112 .loc 1 51 0 + 113 0054 0840BDE8 ldmfd sp!, {r3, lr} + 114 0058 1EFF2FE1 bx lr + 115 .L9: + 116 .align 2 + 117 .L8: + 118 005c 00000000 .word wdt_irq + 119 0060 80208000 .word 8396928 + 120 .cfi_endproc + 121 .LFE275: + 123 .section .rodata + 124 .align 2 + 125 .set .LANCHOR0,. + 0 + 128 __FUNCTION__.5603: + 129 0000 7764745F .ascii "wdt_irq\000" + 129 69727100 + 130 .section .rodata.str1.4,"aMS",%progbits,1 + 131 .align 2 + 132 .LC0: + 133 0000 25732825 .ascii "%s(%d): ================> WATCHDOG EXPIRED !!!!!\015" + 133 64293A20 + 133 3D3D3D3D + 133 3D3D3D3D + 133 3D3D3D3D + 134 0031 0A00 .ascii "\012\000" + 135 0033 00 .text + 136 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 wdt.c +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:23 .text:00000000 wdt_irq +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:49 .text:0000001c $d +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:54 .text:00000024 $a +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:57 .text:00000024 wdt_restart +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:80 .text:00000034 $d +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:84 .text:00000038 $a +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:87 .text:00000038 wdt_init +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:118 .text:0000005c $d +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:124 .rodata:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:128 .rodata:00000000 __FUNCTION__.5603 +C:\Users\netz\AppData\Local\Temp\ccibcThQ.s:131 .rodata.str1.4:00000000 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +debugp +sysirq_register diff --git a/firmware/src/pcd.h b/firmware/src/pcd.h new file mode 100644 index 0000000..77c99b2 --- /dev/null +++ b/firmware/src/pcd.h @@ -0,0 +1,35 @@ +#ifndef _OPENPCD_H +#define _OPENPCD_H +/* pcd.h - OpenPCD USB protocol definitions + * (C) 2006 Harald Welte + */ + +#include + +struct opcd_cmd_hdr { + u_int8_t cmd; + u_int8_t arg1; + u_int16_t arg2; +} __attribute__ ((packed)); + +enum opcd_cmd { + OPCD_CMD_REG_READ = 0x01, /* Transparent Read of RC632 REG */ + OPCD_CMD_REG_WRITE = 0x02, /* Transparent Write to RC632 REG */ + + OPCD_CMD_FIFO_READ = 0x03, /* Transparent Read fron RC632 FIFO */ + OPCD_CMD_FIFO_WRITE = 0x04, /* Transparent Write to RC632 FIFO */ + + OPCD_CMD_VFIFO_READ = 0x05, /* Read bytes from virtual FIFO */ + OPCD_CMD_VFIFO_WRITE = 0x06, /* Write bytes to virtual FIFO */ + OPCD_CMD_VFIFO_MODE = 0x07, /* Set Virtual FIFO mode */ + + OPCD_CMD_REG_SETBIT = 0x08, /* Set a bit in RC632 Register */ + OPCD_CMD_REG_CLRBIT = 0x09, /* Clear a bit in RC632 Register */ +}; + +struct opcd_status_hdr { + u_int8_t cause, /* interrupt cause register RC632 */ + u_int8_t prim_status, /* primary status register RC632 */ +} __attribute__ ((packed)); + +#endif /* _OPENPCD_H */ diff --git a/firmware/src/pcd/main_analog.c b/firmware/src/pcd/main_analog.c new file mode 100644 index 0000000..0f61693 --- /dev/null +++ b/firmware/src/pcd/main_analog.c @@ -0,0 +1,115 @@ +/* main_reqa - OpenPCD firmware for generating an endless loop of + * ISO 14443-A REQA packets. + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +/* If a response is received from the PICC, LED2 (green) will be switched + * on. If no valid response has been received within the timeout of the + * receiver, LED1 (Red) will be toggled. + * + */ + +#include +#include +#include +#include "rc632.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define RAH NULL + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; + +void _init_func(void) +{ + trigger_init(); + rc632_init(); + DEBUGPCRF("turning on RF"); + rc632_turn_on_rf(RAH); + /* FIXME: do we need this? */ + DEBUGPCRF("initializing 14443A operation"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A); + + /* Switch to 848kBps (1subcp / bit) */ + //opcd_rc632_clear_bits(RAH, RC632_REG_RX_CONTROL1, RC632_RXCTRL1_SUBCP_MASK); +} + +int _main_dbgu(char key) +{ + static char ana_out_sel; + int ret = -EINVAL; + + switch (key) { + case 'q': + ana_out_sel--; + ret = 1; + break; + case 'w': + ana_out_sel++; + ret = 1; + break; + case 'c': + rc632_turn_on_rf(RAH); + break; + case 'o': + rc632_turn_off_rf(RAH); + break; + } + + if (ana_out_sel >= 0xd) + ana_out_sel = 0; + + if (ret == 1) { + ana_out_sel &= 0x0f; + DEBUGPCR("switching to analog output mode 0x%x\n", ana_out_sel); + opcd_rc632_reg_write(RAH, RC632_REG_TEST_ANA_SELECT, ana_out_sel); + } + + return ret; +} + +void _main_func(void) +{ +#if 1 + struct iso14443a_atqa atqa; + + memset(&atqa, 0, sizeof(atqa)); + + trigger_pulse(); + + if (iso14443a_transceive_sf(l2h, ISO14443A_SF_CMD_WUPA, &atqa) < 0) { + DEBUGPCRF("error during transceive_sf"); + led_switch(1, 0); + } else { + DEBUGPCRF("received ATQA: %s\n", hexdump((char *)&atqa, sizeof(atqa))); + led_switch(1, 1); + } +#endif + led_toggle(2); +} diff --git a/firmware/src/pcd/main_dumbreader.c b/firmware/src/pcd/main_dumbreader.c new file mode 100644 index 0000000..62695f0 --- /dev/null +++ b/firmware/src/pcd/main_dumbreader.c @@ -0,0 +1,95 @@ +/* AT91SAM7 "dumb reader" firmware for OpenPCD + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include "rc632.h" +#include "rc632_highlevel.h" +#include +#include +#include +#include "../openpcd.h" +#include + +#define RAH NULL + +void _init_func(void) +{ + rc632_init(); +} + +int _main_dbgu(char key) +{ + unsigned char value; + + switch (key) { + case '4': + AT91F_DBGU_Printk("Testing RC632 : "); + if (rc632_test(RAH) == 0) + AT91F_DBGU_Printk("SUCCESS!\n\r"); + else + AT91F_DBGU_Printk("ERROR!\n\r"); + + break; + case '5': + opcd_rc632_reg_read(RAH, RC632_REG_RX_WAIT, &value); + DEBUGPCR("Reading RC632 Reg RxWait: 0x%02xr", value); + + break; + case '6': + DEBUGPCR("Writing RC632 Reg RxWait: 0x55"); + opcd_rc632_reg_write(RAH, RC632_REG_RX_WAIT, 0x55); + break; + case '7': + rc632_dump(); + break; + case 'P': + rc632_power(1); + rc632_init(); + break; + case 'p': + rc632_power(0); + break; + } + + return -EINVAL; +} + +void _main_func(void) +{ + static int i; + + if(i<4096) + i++; + else + { + led_toggle(1); + i=0; + } + + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + + rc632_unthrottle(); +} diff --git a/firmware/src/pcd/main_dumbreader.lst b/firmware/src/pcd/main_dumbreader.lst new file mode 100644 index 0000000..29d2957 --- /dev/null +++ b/firmware/src/pcd/main_dumbreader.lst @@ -0,0 +1,390 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "main_dumbreader.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global _init_func + 24 _init_func: + 25 .LFB278: + 26 .file 1 "src/pcd/main_dumbreader.c" + 1:src/pcd/main_dumbreader.c **** /* AT91SAM7 "dumb reader" firmware for OpenPCD + 2:src/pcd/main_dumbreader.c **** * (C) 2006 by Harald Welte + 3:src/pcd/main_dumbreader.c **** * + 4:src/pcd/main_dumbreader.c **** * This program is free software; you can redistribute it and/or modify + 5:src/pcd/main_dumbreader.c **** * it under the terms of the GNU General Public License as published by + 6:src/pcd/main_dumbreader.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/pcd/main_dumbreader.c **** * (at your option) any later version. + 8:src/pcd/main_dumbreader.c **** * + 9:src/pcd/main_dumbreader.c **** * This program is distributed in the hope that it will be useful, + 10:src/pcd/main_dumbreader.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/pcd/main_dumbreader.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/pcd/main_dumbreader.c **** * GNU General Public License for more details. + 13:src/pcd/main_dumbreader.c **** * + 14:src/pcd/main_dumbreader.c **** * You should have received a copy of the GNU General Public License + 15:src/pcd/main_dumbreader.c **** * along with this program; if not, write to the Free Software + 16:src/pcd/main_dumbreader.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/pcd/main_dumbreader.c **** * + 18:src/pcd/main_dumbreader.c **** */ + 19:src/pcd/main_dumbreader.c **** + 20:src/pcd/main_dumbreader.c **** #include + 21:src/pcd/main_dumbreader.c **** #include + 22:src/pcd/main_dumbreader.c **** #include + 23:src/pcd/main_dumbreader.c **** #include + 24:src/pcd/main_dumbreader.c **** #include "rc632.h" + 25:src/pcd/main_dumbreader.c **** #include "rc632_highlevel.h" + 26:src/pcd/main_dumbreader.c **** #include + 27:src/pcd/main_dumbreader.c **** #include + 28:src/pcd/main_dumbreader.c **** #include + 29:src/pcd/main_dumbreader.c **** #include "../openpcd.h" + 30:src/pcd/main_dumbreader.c **** #include + 31:src/pcd/main_dumbreader.c **** + 32:src/pcd/main_dumbreader.c **** #define RAH NULL + 33:src/pcd/main_dumbreader.c **** + 34:src/pcd/main_dumbreader.c **** void _init_func(void) + 35:src/pcd/main_dumbreader.c **** { + 27 .loc 1 35 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 0000 08402DE9 stmfd sp!, {r3, lr} + 33 .LCFI0: + 34 .cfi_def_cfa_offset 8 + 36:src/pcd/main_dumbreader.c **** rc632_init(); + 35 .loc 1 36 0 + 36 .cfi_offset 14, -4 + 37 .cfi_offset 3, -8 + 38 0004 FEFFFFEB bl rc632_init + 37:src/pcd/main_dumbreader.c **** } + 39 .loc 1 37 0 + 40 0008 0840BDE8 ldmfd sp!, {r3, lr} + 41 000c 1EFF2FE1 bx lr + 42 .cfi_endproc + 43 .LFE278: + 45 .align 2 + 46 .global _main_dbgu + 48 _main_dbgu: + 49 .LFB279: + 38:src/pcd/main_dumbreader.c **** + 39:src/pcd/main_dumbreader.c **** int _main_dbgu(char key) + 40:src/pcd/main_dumbreader.c **** { + 50 .loc 1 40 0 + 51 .cfi_startproc + 52 @ Function supports interworking. + 53 @ args = 0, pretend = 0, frame = 8 + 54 @ frame_needed = 0, uses_anonymous_args = 0 + 55 .LVL0: + 56 0010 04E02DE5 str lr, [sp, #-4]! + 57 .LCFI1: + 58 .cfi_def_cfa_offset 4 + 41:src/pcd/main_dumbreader.c **** unsigned char value; + 42:src/pcd/main_dumbreader.c **** + 43:src/pcd/main_dumbreader.c **** switch (key) { + 59 .loc 1 43 0 + 60 0014 340040E2 sub r0, r0, #52 + 61 .LVL1: + 40:src/pcd/main_dumbreader.c **** { + 62 .loc 1 40 0 + 63 0018 0CD04DE2 sub sp, sp, #12 + 64 .LCFI2: + 65 .cfi_def_cfa_offset 16 + 66 .loc 1 43 0 + 67 001c 3C0050E3 cmp r0, #60 + 68 0020 00F19F97 ldrls pc, [pc, r0, asl #2] + 69 0024 3F0000EA b .L3 + 70 .cfi_offset 14, -4 + 71 .L10: + 72 0028 44010000 .word .L4 + 73 002c 68010000 .word .L5 + 74 0030 7C010000 .word .L6 + 75 0034 90010000 .word .L7 + 76 0038 28010000 .word .L3 + 77 003c 28010000 .word .L3 + 78 0040 28010000 .word .L3 + 79 0044 28010000 .word .L3 + 80 0048 28010000 .word .L3 + 81 004c 28010000 .word .L3 + 82 0050 28010000 .word .L3 + 83 0054 28010000 .word .L3 + 84 0058 28010000 .word .L3 + 85 005c 28010000 .word .L3 + 86 0060 28010000 .word .L3 + 87 0064 28010000 .word .L3 + 88 0068 28010000 .word .L3 + 89 006c 28010000 .word .L3 + 90 0070 28010000 .word .L3 + 91 0074 28010000 .word .L3 + 92 0078 28010000 .word .L3 + 93 007c 28010000 .word .L3 + 94 0080 28010000 .word .L3 + 95 0084 28010000 .word .L3 + 96 0088 28010000 .word .L3 + 97 008c 28010000 .word .L3 + 98 0090 28010000 .word .L3 + 99 0094 28010000 .word .L3 + 100 0098 1C010000 .word .L8 + 101 009c 28010000 .word .L3 + 102 00a0 28010000 .word .L3 + 103 00a4 28010000 .word .L3 + 104 00a8 28010000 .word .L3 + 105 00ac 28010000 .word .L3 + 106 00b0 28010000 .word .L3 + 107 00b4 28010000 .word .L3 + 108 00b8 28010000 .word .L3 + 109 00bc 28010000 .word .L3 + 110 00c0 28010000 .word .L3 + 111 00c4 28010000 .word .L3 + 112 00c8 28010000 .word .L3 + 113 00cc 28010000 .word .L3 + 114 00d0 28010000 .word .L3 + 115 00d4 28010000 .word .L3 + 116 00d8 28010000 .word .L3 + 117 00dc 28010000 .word .L3 + 118 00e0 28010000 .word .L3 + 119 00e4 28010000 .word .L3 + 120 00e8 28010000 .word .L3 + 121 00ec 28010000 .word .L3 + 122 00f0 28010000 .word .L3 + 123 00f4 28010000 .word .L3 + 124 00f8 28010000 .word .L3 + 125 00fc 28010000 .word .L3 + 126 0100 28010000 .word .L3 + 127 0104 28010000 .word .L3 + 128 0108 28010000 .word .L3 + 129 010c 28010000 .word .L3 + 130 0110 28010000 .word .L3 + 131 0114 28010000 .word .L3 + 132 0118 38010000 .word .L9 + 133 .L8: + 44:src/pcd/main_dumbreader.c **** case '4': + 45:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("Testing RC632 : "); + 46:src/pcd/main_dumbreader.c **** if (rc632_test(RAH) == 0) + 47:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("SUCCESS!\n\r"); + 48:src/pcd/main_dumbreader.c **** else + 49:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("ERROR!\n\r"); + 50:src/pcd/main_dumbreader.c **** + 51:src/pcd/main_dumbreader.c **** break; + 52:src/pcd/main_dumbreader.c **** case '5': + 53:src/pcd/main_dumbreader.c **** opcd_rc632_reg_read(RAH, RC632_REG_RX_WAIT, &value); + 54:src/pcd/main_dumbreader.c **** DEBUGPCR("Reading RC632 Reg RxWait: 0x%02xr", value); + 55:src/pcd/main_dumbreader.c **** + 56:src/pcd/main_dumbreader.c **** break; + 57:src/pcd/main_dumbreader.c **** case '6': + 58:src/pcd/main_dumbreader.c **** DEBUGPCR("Writing RC632 Reg RxWait: 0x55"); + 59:src/pcd/main_dumbreader.c **** opcd_rc632_reg_write(RAH, RC632_REG_RX_WAIT, 0x55); + 60:src/pcd/main_dumbreader.c **** break; + 61:src/pcd/main_dumbreader.c **** case '7': + 62:src/pcd/main_dumbreader.c **** rc632_dump(); + 63:src/pcd/main_dumbreader.c **** break; + 64:src/pcd/main_dumbreader.c **** case 'P': + 65:src/pcd/main_dumbreader.c **** rc632_power(1); + 134 .loc 1 65 0 + 135 011c 0100A0E3 mov r0, #1 + 136 0120 FEFFFFEB bl rc632_power + 66:src/pcd/main_dumbreader.c **** rc632_init(); + 137 .loc 1 66 0 + 138 0124 FEFFFFEB bl rc632_init + 139 .L3: + 67:src/pcd/main_dumbreader.c **** break; + 68:src/pcd/main_dumbreader.c **** case 'p': + 69:src/pcd/main_dumbreader.c **** rc632_power(0); + 70:src/pcd/main_dumbreader.c **** break; + 71:src/pcd/main_dumbreader.c **** } + 72:src/pcd/main_dumbreader.c **** + 73:src/pcd/main_dumbreader.c **** return -EINVAL; + 74:src/pcd/main_dumbreader.c **** } + 140 .loc 1 74 0 + 141 0128 1500E0E3 mvn r0, #21 + 142 012c 0CD08DE2 add sp, sp, #12 + 143 0130 04E09DE4 ldr lr, [sp], #4 + 144 0134 1EFF2FE1 bx lr + 145 .L9: + 69:src/pcd/main_dumbreader.c **** rc632_power(0); + 146 .loc 1 69 0 + 147 0138 0000A0E3 mov r0, #0 + 148 013c FEFFFFEB bl rc632_power + 70:src/pcd/main_dumbreader.c **** break; + 149 .loc 1 70 0 + 150 0140 F8FFFFEA b .L3 + 151 .L4: + 45:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("Testing RC632 : "); + 152 .loc 1 45 0 + 153 0144 4C009FE5 ldr r0, .L13 + 154 0148 FEFFFFEB bl AT91F_DBGU_Printk + 46:src/pcd/main_dumbreader.c **** if (rc632_test(RAH) == 0) + 155 .loc 1 46 0 + 156 014c 0000A0E3 mov r0, #0 + 157 0150 FEFFFFEB bl rc632_test + 158 0154 000050E3 cmp r0, #0 + 47:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("SUCCESS!\n\r"); + 159 .loc 1 47 0 + 160 0158 3C009F05 ldreq r0, .L13+4 + 49:src/pcd/main_dumbreader.c **** AT91F_DBGU_Printk("ERROR!\n\r"); + 161 .loc 1 49 0 + 162 015c 3C009F15 ldrne r0, .L13+8 + 163 0160 FEFFFFEB bl AT91F_DBGU_Printk + 164 0164 EFFFFFEA b .L3 + 165 .L5: + 53:src/pcd/main_dumbreader.c **** opcd_rc632_reg_read(RAH, RC632_REG_RX_WAIT, &value); + 166 .loc 1 53 0 + 167 0168 2110A0E3 mov r1, #33 + 168 016c 07208DE2 add r2, sp, #7 + 169 0170 0000A0E3 mov r0, #0 + 170 0174 FEFFFFEB bl opcd_rc632_reg_read + 56:src/pcd/main_dumbreader.c **** break; + 171 .loc 1 56 0 + 172 0178 EAFFFFEA b .L3 + 173 .L6: + 59:src/pcd/main_dumbreader.c **** opcd_rc632_reg_write(RAH, RC632_REG_RX_WAIT, 0x55); + 174 .loc 1 59 0 + 175 017c 2110A0E3 mov r1, #33 + 176 0180 5520A0E3 mov r2, #85 + 177 0184 0000A0E3 mov r0, #0 + 178 0188 FEFFFFEB bl opcd_rc632_reg_write + 60:src/pcd/main_dumbreader.c **** break; + 179 .loc 1 60 0 + 180 018c E5FFFFEA b .L3 + 181 .L7: + 62:src/pcd/main_dumbreader.c **** rc632_dump(); + 182 .loc 1 62 0 + 183 0190 FEFFFFEB bl rc632_dump + 63:src/pcd/main_dumbreader.c **** break; + 184 .loc 1 63 0 + 185 0194 E3FFFFEA b .L3 + 186 .L14: + 187 .align 2 + 188 .L13: + 189 0198 00000000 .word .LC0 + 190 019c 14000000 .word .LC1 + 191 01a0 20000000 .word .LC2 + 192 .cfi_endproc + 193 .LFE279: + 195 .align 2 + 196 .global _main_func + 198 _main_func: + 199 .LFB280: + 75:src/pcd/main_dumbreader.c **** + 76:src/pcd/main_dumbreader.c **** void _main_func(void) + 77:src/pcd/main_dumbreader.c **** { + 200 .loc 1 77 0 + 201 .cfi_startproc + 202 @ Function supports interworking. + 203 @ args = 0, pretend = 0, frame = 0 + 204 @ frame_needed = 0, uses_anonymous_args = 0 + 205 01a4 10402DE9 stmfd sp!, {r4, lr} + 206 .LCFI3: + 207 .cfi_def_cfa_offset 8 + 78:src/pcd/main_dumbreader.c **** static int i; + 79:src/pcd/main_dumbreader.c **** + 80:src/pcd/main_dumbreader.c **** if(i<4096) + 208 .loc 1 80 0 + 209 01a8 34409FE5 ldr r4, .L18 + 210 .cfi_offset 14, -4 + 211 .cfi_offset 4, -8 + 212 01ac 003094E5 ldr r3, [r4, #0] + 213 01b0 010A53E3 cmp r3, #4096 + 81:src/pcd/main_dumbreader.c **** i++; + 214 .loc 1 81 0 + 215 01b4 013083B2 addlt r3, r3, #1 + 216 01b8 003084B5 strlt r3, [r4, #0] + 80:src/pcd/main_dumbreader.c **** if(i<4096) + 217 .loc 1 80 0 + 218 01bc 030000BA blt .L17 + 82:src/pcd/main_dumbreader.c **** else + 83:src/pcd/main_dumbreader.c **** { + 84:src/pcd/main_dumbreader.c **** led_toggle(1); + 219 .loc 1 84 0 + 220 01c0 0100A0E3 mov r0, #1 + 221 01c4 FEFFFFEB bl led_toggle + 85:src/pcd/main_dumbreader.c **** i=0; + 222 .loc 1 85 0 + 223 01c8 0000A0E3 mov r0, #0 + 224 01cc 000084E5 str r0, [r4, #0] + 225 .L17: + 86:src/pcd/main_dumbreader.c **** } + 87:src/pcd/main_dumbreader.c **** + 88:src/pcd/main_dumbreader.c **** /* first we try to get rid of pending to-be-sent stuff */ + 89:src/pcd/main_dumbreader.c **** usb_out_process(); + 226 .loc 1 89 0 + 227 01d0 FEFFFFEB bl usb_out_process + 90:src/pcd/main_dumbreader.c **** + 91:src/pcd/main_dumbreader.c **** /* next we deal with incoming reqyests from USB EP1 (OUT) */ + 92:src/pcd/main_dumbreader.c **** usb_in_process(); + 228 .loc 1 92 0 + 229 01d4 FEFFFFEB bl usb_in_process + 93:src/pcd/main_dumbreader.c **** + 94:src/pcd/main_dumbreader.c **** rc632_unthrottle(); + 230 .loc 1 94 0 + 231 01d8 FEFFFFEB bl rc632_unthrottle + 95:src/pcd/main_dumbreader.c **** } + 232 .loc 1 95 0 + 233 01dc 1040BDE8 ldmfd sp!, {r4, lr} + 234 01e0 1EFF2FE1 bx lr + 235 .L19: + 236 .align 2 + 237 .L18: + 238 01e4 00000000 .word .LANCHOR0 + 239 .cfi_endproc + 240 .LFE280: + 242 .section .rodata.str1.4,"aMS",%progbits,1 + 243 .align 2 + 244 .LC0: + 245 0000 54657374 .ascii "Testing RC632 : \000" + 245 696E6720 + 245 52433633 + 245 32203A20 + 245 00 + 246 0011 000000 .space 3 + 247 .LC1: + 248 0014 53554343 .ascii "SUCCESS!\012\015\000" + 248 45535321 + 248 0A0D00 + 249 001f 00 .space 1 + 250 .LC2: + 251 0020 4552524F .ascii "ERROR!\012\015\000" + 251 52210A0D + 251 00 + 252 0029 000000 .bss + 253 .align 2 + 254 .set .LANCHOR0,. + 0 + 257 i.7466: + 258 0000 00000000 .space 4 + 259 .text + 260 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 main_dumbreader.c +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:24 .text:00000000 _init_func +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:48 .text:00000010 _main_dbgu +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:72 .text:00000028 $d +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:135 .text:0000011c $a +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:189 .text:00000198 $d +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:195 .text:000001a4 $a +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:198 .text:000001a4 _main_func +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:238 .text:000001e4 $d +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:243 .rodata.str1.4:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:253 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccODQ1D8.s:257 .bss:00000000 i.7466 + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +rc632_init +rc632_power +AT91F_DBGU_Printk +rc632_test +opcd_rc632_reg_read +opcd_rc632_reg_write +rc632_dump +led_toggle +usb_out_process +usb_in_process +rc632_unthrottle diff --git a/firmware/src/pcd/main_hid.c b/firmware/src/pcd/main_hid.c new file mode 100644 index 0000000..9735c3d --- /dev/null +++ b/firmware/src/pcd/main_hid.c @@ -0,0 +1,59 @@ +/* main_hid - OpenPCD Human Input Device firmware + * + * (C) 2008 by Harald Welte + * + * 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 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static void help(void) +{ +} + +int _main_dbgu(char key) +{ + switch (key) { + default: + return -EINVAL; + } + + return 0; +} + +void _init_func(void) +{ + //usbtest_init(); +} + +void _main_func(void) +{ + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + + /* try unthrottling sources since we now are [more] likely to + * have empty request contexts */ + udp_unthrottle(); +} diff --git a/firmware/src/pcd/main_librfid.c b/firmware/src/pcd/main_librfid.c new file mode 100644 index 0000000..a5a488d --- /dev/null +++ b/firmware/src/pcd/main_librfid.c @@ -0,0 +1,216 @@ +/* main_librfid - OpenPCD firmware using in-firmware librfid + * + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +//#include "rc632.h" +#include +#include +#include +#include +#include + +#include "../openpcd.h" + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; +static struct rfid_protocol_handle *ph; + +void _init_func(void) +{ + trigger_init(); + rc632_init(); + rc632_test(); + DEBUGP("opening reader "); +#if 1 + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + DEBUGP("rh=%p ", rh); +#endif + led_switch(2, 1); +} + +int _main_dbgu(char key) +{ + int ret = -EINVAL; + return ret; +} + +struct openpcd_l2_connectinfo { + u_int32_t proto_supported; + + u_int8_t speed_rx; + u_int8_t speed_tx; + + u_int8_t uid_len; + u_int8_t uid[10]; +} __attribute__ ((packed)); + +struct openpcd_proto_connectinfo { +} __attribute__ ((packed)); + +struct openpcd_proto_tcl_connectinfo { + u_int8_t fsc; + u_int8_t fsd; + u_int8_t ta; + u_int8_t sfgt; + + u_int8_t flags; + u_int8_t cid; + u_int8_t nad; + + u_int8_t ats_tot_len; + u_int8_t ats_snippet[0]; +} __attribute__ ((packed)); + +static int init_proto(void) +{ + struct req_ctx *detect_rctx; + struct openpcd_hdr *opcdh; + struct openpcd_l2_connectinfo *l2c; + struct openpcd_proto_connectinfo *pc; + unsigned int size; + + l2h = rfid_layer2_scan(rh); + if (!l2h) + return 0; + + DEBUGP("l2='%s' ", rfid_layer2_name(l2h)); + + detect_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_LIBRFID_BUSY); + if (detect_rctx) { + unsigned int uid_len; + opcdh = (struct openpcd_hdr *) detect_rctx->data; + l2c = (struct openpcd_l2_connectinfo *) + (char *) opcdh + sizeof(opcdh); + l2c->uid_len = sizeof(l2c->uid); + opcdh->cmd = OPENPCD_CMD_LRFID_DETECT_IRQ; + opcdh->flags = 0x00; + opcdh->reg = 0x03; + opcdh->val = l2h->l2->id; + + detect_rctx->tot_len = sizeof(*opcdh) + sizeof(*l2c); +#if 0 + /* copy UID / PUPI into data section */ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, (void *)l2c->uid, + &uid_len); + l2c->uid_len = uid_len & 0xff; + + size = sizeof(l2c->proto_supported); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_PROTO_SUPP, + &l2c->proto_supported, &size); + + switch (l2h->l2->id) { + case RFID_LAYER2_ISO14443A: + break; + case RFID_LAYER2_ISO14443B: + break; + case RFID_LAYER2_ISO15693: + break; + } +#endif + req_ctx_set_state(detect_rctx, RCTX_STATE_UDP_EP3_PENDING); + } else + DEBUGPCRF("=>>>>>>>>>>>>>>no req_ctx for L2!"); + ph = rfid_protocol_scan(l2h); + if (!ph) + return 3; + + DEBUGP("p='%s' ", rfid_protocol_name(ph)); + detect_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_LIBRFID_BUSY); + if (detect_rctx) { + opcdh = (struct openpcd_hdr *) detect_rctx->data; + pc = (struct openpcd_proto_connectinfo *) + ((char *) opcdh + sizeof(*opcdh)); + detect_rctx->tot_len = sizeof(*opcdh) + sizeof(*pc); + opcdh->cmd = OPENPCD_CMD_LRFID_DETECT_IRQ; + opcdh->flags = 0x00; + opcdh->reg = 0x04; + opcdh->val = ph->proto->id; + /* copy L4 info into data section */ + +#if 0 + switch (ph->proto->id) { + case RFID_PROTOCOL_TCL: { + struct openpcd_proto_tcl_connectinfo *ptc + = (struct openpcd_proto_tcl_connectinfo *) + ((char *) ph + sizeof(*ph)); + unsigned int space; + detect_rctx->tot_len += sizeof(*ptc); + space = detect_rctx->size - sizeof(*opcdh)-sizeof(*pc); + size = space; + rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS, + &ptc->ats_snippet, &size); + if (size == space) { + /* we've only copied part of the ATS */ + size = sizeof(ptc->ats_tot_len); + rfid_protocol_getopt(ph, + RFID_OPT_P_TCL_ATS_LEN, + &ptc->ats_tot_len, &size); + } else { + ptc->ats_tot_len = size; + } + + } break; + } +#endif + req_ctx_set_state(detect_rctx, RCTX_STATE_UDP_EP3_PENDING); + } else + DEBUGPCRF("=>>>>>>>>>>>>>>no req_ctx for L2!"); + led_switch(1, 1); + + return 4; +} + +static int opcd_lrfid_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + return 0; +} + + +void _main_func(void) +{ + int ret; + + usb_out_process(); + usb_in_process(); + + ret = init_proto(); + + if (ret >= 4) + rfid_protocol_close(ph); + if (ret >= 3) + rfid_layer2_close(l2h); + + rc632_turn_off_rf(NULL); + { volatile int i; for (i = 0; i < 0xfffff; i++) ; } + rc632_turn_on_rf(NULL); + + led_switch(1, 0); + led_toggle(2); +} diff --git a/firmware/src/pcd/main_mifare.c b/firmware/src/pcd/main_mifare.c new file mode 100644 index 0000000..43729a5 --- /dev/null +++ b/firmware/src/pcd/main_mifare.c @@ -0,0 +1,279 @@ +/* main_mifare - OpenPCD firmware using in-firmware librfid + * + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +//#include "rc632.h" +#include +#include +#include +#include +#include +#include + +#include "../openpcd.h" + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; +static struct rfid_protocol_handle *ph; + +static u_int8_t sector = 0; + +void _init_func(void) +{ + trigger_init(); + rc632_init(); + rc632_test(NULL); + DEBUGP("opening reader "); +#if 1 + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + DEBUGP("rh=%p ", rh); +#endif + led_switch(2, 1); +} + +int _main_dbgu(char key) +{ + int ret = -EINVAL; + switch (key) { + case 'j': + ret = 0; + if (sector > 0); + sector--; + break; + case 'k': + ret = 0; + if (sector < 15) + sector++; + break; + } + return ret; +} + +struct openpcd_l2_connectinfo { + u_int32_t proto_supported; + + u_int8_t speed_rx; + u_int8_t speed_tx; + + u_int8_t uid_len; + u_int8_t uid[10]; +} __attribute__ ((packed)); + +struct openpcd_proto_connectinfo { +} __attribute__ ((packed)); + +struct openpcd_proto_tcl_connectinfo { + u_int8_t fsc; + u_int8_t fsd; + u_int8_t ta; + u_int8_t sfgt; + + u_int8_t flags; + u_int8_t cid; + u_int8_t nad; + + u_int8_t ats_tot_len; + u_int8_t ats_snippet[0]; +} __attribute__ ((packed)); + +/* mifare classic helper */ +static int +mifare_classic_read_sector(struct rfid_protocol_handle *ph, int sector) +{ + unsigned char buf[20]; + unsigned int len = sizeof(buf); + int ret; + int block; + + /* FIXME: make this work for sectors > 31 */ + DEBUGPCR("Reading sector %u", sector); + + for (block = sector*4; block < sector*4+4; block++) { + DEBUGP("Reading block %u: ", block); + ret = rfid_protocol_read(ph, block, buf, &len); + if(ret == -ETIMEDOUT) + DEBUGPCR("TIMEOUT"); + if (ret < 0) { + DEBUGPCR("Error %d reading", ret); + return ret; + } + + DEBUGPCR("Page 0x%x: %s", block, hexdump(buf, len)); + } + return 0; +} + +static int init_proto(void) +{ + struct req_ctx *detect_rctx; + struct openpcd_hdr *opcdh; + struct openpcd_l2_connectinfo *l2c; + struct openpcd_proto_connectinfo *pc; + unsigned int size; + + l2h = rfid_layer2_scan(rh); + if (!l2h) + return 0; + + DEBUGP("l2='%s' ", rfid_layer2_name(l2h)); + + detect_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_LIBRFID_BUSY); + if (detect_rctx) { + unsigned int uid_len; + opcdh = (struct openpcd_hdr *) detect_rctx->data; + l2c = (struct openpcd_l2_connectinfo *) + (char *) opcdh + sizeof(opcdh); + l2c->uid_len = sizeof(l2c->uid); + opcdh->cmd = OPENPCD_CMD_LRFID_DETECT_IRQ; + opcdh->flags = 0x00; + opcdh->reg = 0x03; + opcdh->val = l2h->l2->id; + + detect_rctx->tot_len = sizeof(*opcdh) + sizeof(*l2c); +#if 0 + /* copy UID / PUPI into data section */ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, (void *)l2c->uid, + &uid_len); + l2c->uid_len = uid_len & 0xff; + + size = sizeof(l2c->proto_supported); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_PROTO_SUPP, + &l2c->proto_supported, &size); + + switch (l2h->l2->id) { + case RFID_LAYER2_ISO14443A: + break; + case RFID_LAYER2_ISO14443B: + break; + case RFID_LAYER2_ISO15693: + break; + } +#endif + req_ctx_set_state(detect_rctx, RCTX_STATE_UDP_EP3_PENDING); + } else + DEBUGPCRF("=>>>>>>>>>>>>>>no req_ctx for L2!"); + ph = rfid_protocol_scan(l2h); + if (!ph) + return 3; + + DEBUGP("p='%s' ", rfid_protocol_name(ph)); + detect_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_LIBRFID_BUSY); + if (detect_rctx) { + opcdh = (struct openpcd_hdr *) detect_rctx->data; + pc = (struct openpcd_proto_connectinfo *) + ((char *) opcdh + sizeof(*opcdh)); + detect_rctx->tot_len = sizeof(*opcdh) + sizeof(*pc); + opcdh->cmd = OPENPCD_CMD_LRFID_DETECT_IRQ; + opcdh->flags = 0x00; + opcdh->reg = 0x04; + opcdh->val = ph->proto->id; + /* copy L4 info into data section */ + +#if 0 + switch (ph->proto->id) { + case RFID_PROTOCOL_TCL: { + struct openpcd_proto_tcl_connectinfo *ptc + = (struct openpcd_proto_tcl_connectinfo *) + ((char *) ph + sizeof(*ph)); + unsigned int space; + detect_rctx->tot_len += sizeof(*ptc); + space = detect_rctx->size - sizeof(*opcdh)-sizeof(*pc); + size = space; + rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS, + &ptc->ats_snippet, &size); + if (size == space) { + /* we've only copied part of the ATS */ + size = sizeof(ptc->ats_tot_len); + rfid_protocol_getopt(ph, + RFID_OPT_P_TCL_ATS_LEN, + &ptc->ats_tot_len, &size); + } else { + ptc->ats_tot_len = size; + } + + } break; + } +#endif + req_ctx_set_state(detect_rctx, RCTX_STATE_UDP_EP3_PENDING); + } else + DEBUGPCRF("=>>>>>>>>>>>>>>no req_ctx for L2!"); + led_switch(1, 1); + + if (ph->proto->id == RFID_PROTOCOL_MIFARE_CLASSIC) { + int rc; + + DEBUGPCR("Authenticating sector %u: ", sector); + rc = mfcl_set_key(ph, MIFARE_CL_KEYA_DEFAULT_INFINEON); + if (rc < 0) { + DEBUGPCR("key format error"); + return 4; + } + rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, sector*4); + if (rc < 0) { + DEBUGPCR("mifare auth error"); + return 4; + } else + DEBUGPCR("mifare auth succeeded!\n"); + + mifare_classic_read_sector(ph, sector); + + return 5; + } + + return 4; +} + +static int opcd_lrfid_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + return 0; +} + + +void _main_func(void) +{ + int ret; + + usb_out_process(); + usb_in_process(); + + ret = init_proto(); + + if (ret >= 4) + rfid_protocol_close(ph); + if (ret >= 3) + rfid_layer2_close(l2h); + + rc632_turn_off_rf(NULL); + { volatile int i; for (i = 0; i < 0xfffff; i++) ; } + rc632_turn_on_rf(NULL); + + led_switch(1, 0); + led_toggle(2); +} diff --git a/firmware/src/pcd/main_presence.c b/firmware/src/pcd/main_presence.c new file mode 100644 index 0000000..f61878f --- /dev/null +++ b/firmware/src/pcd/main_presence.c @@ -0,0 +1,163 @@ +/* AT91SAM7 "presence reader" firmware for OpenPCD + * + * (C) 2006 by Milosch Meriac + * + * 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 + * + */ + +#include +#include +#include +#include +#include "rc632.h" +#include +#include +#include +#include +#include + +#include +#include + +#include "../openpcd.h" +#include + +#define RAH NULL + +u_int32_t delay_scan,delay_blink,last_uid,last_polled_uid; +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; + +static int usb_presence_rx(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + + switch (poh->cmd) + { + case OPENPCD_CMD_PRESENCE_UID_GET: + DEBUGPCRF("get presence UID"); + + poh->flags |= OPENPCD_FLAG_RESPOND; + if(last_polled_uid) + { + rctx->tot_len += 4; + poh->data[0]=(u_int8_t)(last_polled_uid>>24); + poh->data[1]=(u_int8_t)(last_polled_uid>>16); + poh->data[2]=(u_int8_t)(last_polled_uid>> 8); + poh->data[3]=(u_int8_t)(last_polled_uid ); + last_polled_uid=0; + } + break; + default: + DEBUGP("UNKNOWN "); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + break; + } + + if (poh->flags & OPENPCD_FLAG_RESPOND) + return USB_RET_RESPOND; + + return 0; +} + +void _init_func(void) +{ + DEBUGPCRF("enabling RC632"); + rc632_init(); + + DEBUGPCRF("turning on RF"); + rc632_turn_on_rf(RAH); + + DEBUGPCRF("initializing 14443A operation"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A); + + DEBUGPCRF("registering USB handler"); + usb_hdlr_register(&usb_presence_rx, OPENPCD_CMD_CLS_PRESENCE); + + delay_scan=delay_blink=0; + last_uid=0; +} + +int _main_dbgu(char key) +{ + unsigned char value; + + switch (key) { + case '4': + AT91F_DBGU_Printk("Testing RC632 : "); + if (rc632_test(RAH) == 0) + AT91F_DBGU_Printk("SUCCESS!\n\r"); + else + AT91F_DBGU_Printk("ERROR!\n\r"); + + break; + case '5': + opcd_rc632_reg_read(RAH, RC632_REG_RX_WAIT, &value); + DEBUGPCR("Reading RC632 Reg RxWait: 0x%02xr", value); + + break; + case '6': + DEBUGPCR("Writing RC632 Reg RxWait: 0x55"); + opcd_rc632_reg_write(RAH, RC632_REG_RX_WAIT, 0x55); + break; + case '7': + rc632_dump(); + break; + } + + return -EINVAL; +} + +void _main_func(void) +{ + u_int32_t uid; + int status; + + status = rfid_layer2_open(l2h); + if (status >= 0 && l2h->uid_len==4) + { + uid=((u_int32_t)l2h->uid[0]) | + ((u_int32_t)l2h->uid[1])<< 8| + ((u_int32_t)l2h->uid[2])<<16| + ((u_int32_t)l2h->uid[3])<<24; + + delay_scan=100; + + if(uid!=last_uid) + { + last_uid=last_polled_uid=uid; + delay_blink=10; + + DEBUGPCR("UID:0x%08X", uid); + } + } + else + if(delay_scan) + delay_scan--; + else + last_uid=0; + + led_switch(1,(delay_blink==0)?1:0); + if(delay_blink) + delay_blink--; + + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + rc632_unthrottle(); +} diff --git a/firmware/src/pcd/main_pwm.c b/firmware/src/pcd/main_pwm.c new file mode 100644 index 0000000..7db6b72 --- /dev/null +++ b/firmware/src/pcd/main_pwm.c @@ -0,0 +1,276 @@ +/* main_pwm - OpenPCD firmware for generating a PWM-modulated 13.56MHz + * carrier + * + * To use this, you need to connect PIOA P0 with MFIN of the reader. + * + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include "../openpcd.h" +#include +#include +#include +#include +#include +#include +#include + +#ifdef SSC +#include +#endif + +#define RAH NULL + +static u_int8_t force_100ask = 1; +static u_int8_t mod_conductance = 0x3f; +static u_int8_t cw_conductance = 0x3f; +static u_int16_t duty_percent = 22; + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +static u_int32_t pwm_freq[] = { 105937, 211875, 423750, 847500 }; +static u_int8_t pwm_freq_idx = 0; + +static void rc632_modulate_mfin() +{ + opcd_rc632_reg_write(RAH, RC632_REG_TX_CONTROL, + RC632_TXCTRL_MOD_SRC_MFIN|RC632_TXCTRL_TX2_INV| + RC632_TXCTRL_TX1_RF_EN|RC632_TXCTRL_TX2_RF_EN); +} + +/* (77/40) ^ EXPcsCfgCW */ +/* 1, 1.925, 3.705625, 7.13332812 */ + +#define COND_MANT(x) (x & 0x0f) +#define COND_EXP(x) ((x & 0x30) >> 4) + +static const u_int16_t rsrel_expfact[] = { 1000, 1925, 3706, 7133 }; + +static u_int32_t calc_conduct_rel(u_int8_t inp) +{ + u_int32_t cond_rel; + + cond_rel = COND_MANT(inp) * rsrel_expfact[COND_EXP(inp)]; + cond_rel = cond_rel / 1000; + + return cond_rel; +} + +static const u_int8_t rsrel_table[] = { + 0, 16, 32, 48, 1, 17, 2, 3, 33, 18, 4, 5, 19, 6, 7, 49, 34, 20, + 8, 9, 21, 10, 11, 35, 22, 12, 13, 23, 14, 50, 36, 15, 24, 25, + 37, 26, 27, 51, 38, 28, 29, 39, 30, 52, 31, 40, 41, 53, 42, 43, + 54, 44, 45, 55, 46, 47, 56, 57, 58, 59, 60, 61, 62, 63 }; + + +static const u_int16_t cdivs[] = { 128, 64, 32, 16 }; +static int cdiv_idx = 0; + +static void help(void) +{ + DEBUGPCR("o: decrease duty p: increase duty\r\n" + "k: stop pwm l: start pwn\r\n" + "n: decrease freq m: incresae freq\r\n" + "v: decrease mod_cond b: increase mod_cond\r\n" + "g: decrease cw_cond h: increase cw_cond"); + DEBUGPCR("u: PA23 const 1 y: PA23 const 0\r\n" + "t: PA23 PWM0 f: toggle Force100ASK\r\n" + "{: decrease cdiv_idx }: increse cdiv idx"); +} + +void _init_func(void) +{ + DEBUGPCR("\r\n===> main_pwm <===\r\n"); + help(); + + rc632_init(); + DEBUGPCRF("turning on RF"); + rc632_turn_on_rf(RAH); + + /* switch PA17 (connected to MFIN on board) to input */ + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PIO_PA17); + + DEBUGPCRF("Initializing carrier divider"); + tc_cdiv_init(); + + DEBUGPCRF("Initializing PWM"); + pwm_init(); + pwm_freq_set(0, 105937); + pwm_start(0); + pwm_duty_set_percent(0, 22); /* 22% of 9.43uS = 2.07uS */ + rc632_modulate_mfin(); + +#ifdef SSC + DEBUGPCRF("Initializing SSC RX"); + ssc_rx_init(); +#endif +} + +int _main_dbgu(char key) +{ + switch (key) { + case 'o': + if (duty_percent >= 1) + duty_percent--; + pwm_duty_set_percent(0, duty_percent); + break; + case 'p': + if (duty_percent <= 99) + duty_percent++; + pwm_duty_set_percent(0, duty_percent); + break; + case 'k': + pwm_stop(0); + break; + case 'l': + pwm_start(0); + break; + case 'n': + if (pwm_freq_idx > 0) { + pwm_freq_idx--; + pwm_stop(0); + pwm_freq_set(0, pwm_freq[pwm_freq_idx]); + pwm_start(0); + pwm_duty_set_percent(0, 22); /* 22% of 9.43uS = 2.07uS */ + } + break; + case 'm': + if (pwm_freq_idx < ARRAY_SIZE(pwm_freq)-1) { + pwm_freq_idx++; + pwm_stop(0); + pwm_freq_set(0, pwm_freq[pwm_freq_idx]); + pwm_start(0); + pwm_duty_set_percent(0, 22); /* 22% of 9.43uS = 2.07uS */ + } + break; + case 'u': + DEBUGPCRF("PA23 output high"); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + break; + case 'y': + DEBUGPCRF("PA23 output low"); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + return 0; + break; + case 't': + DEBUGPCRF("PA23 PeriphA (PWM)"); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA23_PWM0); + return 0; + break; + case 'f': + DEBUGPCRF("%sabling Force100ASK", force_100ask ? "Dis":"En"); + if (force_100ask) { + force_100ask = 0; + opcd_rc632_clear_bits(RAH, RC632_REG_TX_CONTROL, + RC632_TXCTRL_FORCE_100_ASK); + } else { + force_100ask = 1; + opcd_rc632_set_bits(RAH, RC632_REG_TX_CONTROL, + RC632_TXCTRL_FORCE_100_ASK); + } + return 0; + break; + case 'v': + if (mod_conductance > 0) { + mod_conductance--; + opcd_rc632_reg_write(RAH, RC632_REG_MOD_CONDUCTANCE, + rsrel_table[mod_conductance]); + } + break; + case 'b': + if (mod_conductance < 0x3f) { + mod_conductance++; + opcd_rc632_reg_write(RAH, RC632_REG_MOD_CONDUCTANCE, + rsrel_table[mod_conductance]); + } + break; + case 'g': + if (cw_conductance > 0) { + cw_conductance--; + opcd_rc632_reg_write(RAH, RC632_REG_CW_CONDUCTANCE, + rsrel_table[cw_conductance]); + } + break; + case 'h': + if (cw_conductance < 0x3f) { + cw_conductance++; + opcd_rc632_reg_write(RAH, RC632_REG_CW_CONDUCTANCE, + rsrel_table[cw_conductance]); + } + break; + case '?': + help(); + return 0; + break; + case '<': + tc_cdiv_phase_inc(); + break; + case '>': + tc_cdiv_phase_dec(); + break; + case '{': + if (cdiv_idx > 0) + cdiv_idx--; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; + case '}': + if (cdiv_idx < ARRAY_SIZE(cdivs)-1) + cdiv_idx++; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; +#ifdef SSC + case 's': + ssc_rx_start(); + break; + case 'S': + ssc_rx_stop(); + break; +#endif + default: + return -EINVAL; + } + + DEBUGPCR("pwm_freq=%u, duty_percent=%u, mod_cond=%u, cw_cond=%u tc_cdiv=%u", + pwm_freq[pwm_freq_idx], duty_percent, mod_conductance, cw_conductance, + cdivs[cdiv_idx]); + + return 0; +} + + +void _main_func(void) +{ + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + + /* try unthrottling sources since we now are [more] likely to + * have empty request contexts */ + rc632_unthrottle(); +#ifdef SSC + ssc_rx_unthrottle(); +#endif + + led_toggle(2); +} diff --git a/firmware/src/pcd/main_reqa.c b/firmware/src/pcd/main_reqa.c new file mode 100644 index 0000000..717926a --- /dev/null +++ b/firmware/src/pcd/main_reqa.c @@ -0,0 +1,292 @@ +/* main_reqa - OpenPCD firmware for generating an endless loop of + * ISO 14443-A REQA packets. Alternatively we can send WUPA, or + * perform a full ISO14443A anti-collision loop. + * + * If a response is received from the PICC, LED1 (Red) will be switched + * on. If no valid response has been received within the timeout of the + * receiver, LED1 (Red) will be switched off. + * + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include "rc632.h" +#include +#include +#include +#include +#include + +#include +#include + +#include "../openpcd.h" + +#ifdef WITH_TC +#include "tc.h" +#endif + +#define RAH NULL + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; + +void _init_func(void) +{ + trigger_init(); + DEBUGPCRF("enabling RC632"); + rc632_init(); +#ifdef WITH_TC + DEBUGPCRF("enabling TC"); + tc_cdiv_init(); +#endif + DEBUGPCRF("turning on RF"); + rc632_turn_on_rf(RAH); + DEBUGPCRF("initializing 14443A operation"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A); +} + +#define MODE_REQA 0x01 +#define MODE_WUPA 0x02 +#define MODE_ANTICOL 0x03 +#define MODE_14443A 0x04 + +static volatile int mode = MODE_REQA; + +static const char frame_14443a[] = { + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, + 0x00, 0xff, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, +}; + +static void reg_inc(u_int8_t reg) +{ + u_int8_t val; + opcd_rc632_reg_read(RAH, reg, &val); + opcd_rc632_reg_write(RAH, reg, val++); + DEBUGPCRF("reg 0x%02x = 0x%02x", reg, val); +} + +static void reg_dec(u_int8_t reg) +{ + u_int8_t val; + opcd_rc632_reg_read(RAH, reg, &val); + opcd_rc632_reg_write(RAH, reg, val--); + DEBUGPCRF("reg 0x%02x = 0x%02x", reg, val); +} + +static u_int8_t ana_out_sel; +static u_int8_t mfout_sel; +static u_int8_t speed_idx; + +static void help(void) +{ + DEBUGPCR("r: REQA w: WUPA a: ANTICOL\r\n" + "A: 14443A +: inc speed -: dec speed\r\n" + "y: inc cw cond x: dec cond c: inc mod cond"); + DEBUGPCR("v: dec mod cond o: dec ana_out p: dec ana_out\r\n" + "h: trigger high l: trigger low u: dec MFOUT mode"); + DEBUGPCR("i: inc MFOUT md <: dec cdiv ph >: inc cdiv phase\r\n" + "{: dev cdiv }: inc cdiv"); +} + +static u_int16_t cdivs[] = { 128, 64, 32, 16 }; + +int _main_dbgu(char key) +{ + int ret = 0; + static int cdiv_idx = 2; + + switch (key) { + case '?': + help(); + break; + case 'r': + mode = MODE_REQA; + break; + case 'w': + mode = MODE_WUPA; + break; + case 'A': + mode = MODE_14443A; + break; + case 'a': + mode = MODE_ANTICOL; + break; + /* Those below don't work as long as + * iso14443a_init() is called before + * every cycle */ + case 'y': + reg_inc(RC632_REG_CW_CONDUCTANCE); + break; + case 'x': + reg_dec(RC632_REG_CW_CONDUCTANCE); + break; + case 'c': + reg_inc(RC632_REG_MOD_CONDUCTANCE); + break; + case 'v': + reg_dec(RC632_REG_MOD_CONDUCTANCE); + break; + case 'o': + if (ana_out_sel > 0) { + ana_out_sel--; + DEBUGPCR("switching to analog output mode 0x%x\n", ana_out_sel); + opcd_rc632_reg_write(RAH, RC632_REG_TEST_ANA_SELECT, + ana_out_sel); + } + ret = 1; + break; + case 'p': + if (ana_out_sel < 0xc) { + ana_out_sel++; + DEBUGPCR("switching to analog output mode 0x%x\n", ana_out_sel); + opcd_rc632_reg_write(RAH, RC632_REG_TEST_ANA_SELECT, + ana_out_sel); + } + ret = 1; + break; + case 'u': + if (mfout_sel > 0) { + mfout_sel--; + DEBUGPCR("switching to MFOUT mode 0x%x\n", mfout_sel); + opcd_rc632_reg_write(RAH, RC632_REG_MFOUT_SELECT, mfout_sel); + } + ret = 1; + break; + case 'i': + if (mfout_sel < 5) { + mfout_sel++; + DEBUGPCR("switching to MFOUT mode 0x%x\n", mfout_sel); + opcd_rc632_reg_write(RAH, RC632_REG_MFOUT_SELECT, mfout_sel); + } + ret = 1; + break; + case 'h': + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + break; + case 'l': + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPCD_PIO_TRIGGER); + break; +#ifdef WITH_TC + case '<': + tc_cdiv_phase_inc(); + break; + case '>': + tc_cdiv_phase_dec(); + break; + case '{': + if (cdiv_idx > 0) + cdiv_idx--; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; + case '}': + if (cdiv_idx < ARRAY_SIZE(cdivs)-1) + cdiv_idx++; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; +#endif + case '-': + if (speed_idx > 0) + speed_idx--; + break; + case '+': + if (speed_idx < 3) + speed_idx++; + break; + default: + return -EINVAL; + } + + return ret; +} + +void _main_func(void) +{ + int status; + struct iso14443a_atqa atqa; + volatile int i; + + /* FIXME: why does this only work every second attempt without reset or + * power-cycle? */ + //rc632_turn_off_rf(); + //rc632_reset(); + //rc632_turn_on_rf(); + + opcd_rc632_reg_write(RAH, RC632_REG_TEST_ANA_SELECT, ana_out_sel); + opcd_rc632_reg_write(RAH, RC632_REG_MFOUT_SELECT, mfout_sel); + for (i = 0; i < 0xfffff; i++) {} + //rc632_dump(); +#ifdef WITH_TC + tc_cdiv_print(); +#endif + + switch (mode) { + case MODE_REQA: + status = iso14443a_transceive_sf(l2h, ISO14443A_SF_CMD_REQA, &atqa); + if (status < 0) + DEBUGPCRF("error during transceive_sf REQA"); + else + DEBUGPCRF("received ATQA: %s", hexdump((char *)&atqa, sizeof(atqa))); + break; + case MODE_WUPA: + status = iso14443a_transceive_sf(l2h, ISO14443A_SF_CMD_WUPA, &atqa); + if (status < 0) + DEBUGPCRF("error during transceive_sf WUPA"); + else + DEBUGPCRF("received WUPA: %s", hexdump((char *)&atqa, sizeof(atqa))); + break; + case MODE_ANTICOL: + status = rfid_layer2_open(l2h); + if (status < 0) + DEBUGPCR("error during anticol"); + else + DEBUGPCR("Anticol OK"); + break; + case MODE_14443A: + { + char rx_buf[4]; + int rx_len = sizeof(rx_buf); + rfid_layer2_setopt(l2h, RFID_OPT_14443A_SPEED_RX, + &speed_idx, sizeof(speed_idx)); + rfid_layer2_setopt(l2h, RFID_OPT_14443A_SPEED_TX, + &speed_idx, sizeof(speed_idx)); + rfid_layer2_transceive(l2h, RFID_14443A_FRAME_REGULAR, + &frame_14443a, sizeof(frame_14443a), + &rx_buf, &rx_len, 1, 0); + } + break; + } + + if (status < 0) + led_switch(1, 0); + else + led_switch(1, 1); + + led_toggle(2); + +} diff --git a/firmware/src/pcd/main_usb.c b/firmware/src/pcd/main_usb.c new file mode 100644 index 0000000..fcd3306 --- /dev/null +++ b/firmware/src/pcd/main_usb.c @@ -0,0 +1,44 @@ +/* main_usb - OpenPCD test firmware for benchmarking USB performance + * (C) 2006 by Harald Welte + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static void help(void) +{ +} + +int _main_dbgu(char key) +{ + switch (key) { + default: + return -EINVAL; + } + + return 0; +} + +void _init_func(void) +{ + usbtest_init(); +} + +void _main_func(void) +{ + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + + /* try unthrottling sources since we now are [more] likely to + * have empty request contexts */ + udp_unthrottle(); +} diff --git a/firmware/src/pcd/rc632.c b/firmware/src/pcd/rc632.c new file mode 100644 index 0000000..731574c --- /dev/null +++ b/firmware/src/pcd/rc632.c @@ -0,0 +1,659 @@ +/* Philips CL RC632 driver (via SPI) for OpenPCD firmware + * (C) 2006 by Harald Welte + * + * This is heavily based on the librfid RC632 driver. All primitive access + * functions such as rc632_{reg,fifo}_{read,write}() are API compatible to + * librfid in order to be able to leverage higher-level code from librfid + * to this OpenPCD firmware. + * + * AT91SAM7 PWM routines for OpenPCD / OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include "../openpcd.h" +#include +#include +#include +#include +#include +#include "rc632.h" + +#include + +#define NOTHING do {} while(0) + +#if 0 +#define DEBUGPSPI DEBUGP +#define DEBUGPSPIIRQ DEBUGP +#else +#define DEBUGPSPI(x, args ...) NOTHING +#define DEBUGPSPIIRQ(x, args...) NOTHING +#endif + +#if 0 +#define DEBUG632 DEBUGPCRF +#else +#define DEBUG632(x, args ...) NOTHING +#endif + + +/* SPI driver */ + +#ifdef OLIMEX +#define SPI_DEBUG_LOOPBACK +#endif + +#define SPI_USES_DMA + +#define SPI_MAX_XFER_LEN 65 + +static const AT91PS_SPI pSPI = AT91C_BASE_SPI; + +/* SPI irq handler */ +static void spi_irq(void) +{ + u_int32_t status = pSPI->SPI_SR; + + DEBUGPSPIIRQ("spi_irq: 0x%08x ", status); + + if (status & AT91C_SPI_OVRES) + DEBUGPSPIIRQ("Overrun "); + if (status & AT91C_SPI_MODF) + DEBUGPSPIIRQ("ModeFault "); + if (status & AT91C_SPI_ENDRX) { + pSPI->SPI_IDR = AT91C_SPI_ENDRX; + DEBUGPSPIIRQ("ENDRX "); + } + if (status & AT91C_SPI_ENDTX) { + pSPI->SPI_IDR = AT91C_SPI_ENDTX; + DEBUGPSPIIRQ("ENDTX "); + } + + DEBUGPSPIIRQ("\r\n"); + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SPI); +} + +#ifdef SPI_USES_DMA +static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + u_int8_t *rx_data, u_int16_t *rx_len) +{ + DEBUGPSPI("DMA Xfer tx=%s\r\n", hexdump(tx_data, tx_len)); + if (*rx_len < tx_len) { + DEBUGPCRF("rx_len=%u smaller tx_len=%u\n", *rx_len, tx_len); + return -1; + } + + /* disable RC632 interrupt because it wants to do SPI transactions */ + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + AT91F_SPI_ReceiveFrame(pSPI, rx_data, tx_len, NULL, 0); + AT91F_SPI_SendFrame(pSPI, tx_data, tx_len, NULL, 0); + + AT91F_PDC_EnableRx(AT91C_BASE_PDC_SPI); + AT91F_PDC_EnableTx(AT91C_BASE_PDC_SPI); + + pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + + + while (! (pSPI->SPI_SR & AT91C_SPI_ENDRX)) ; + + /* Re-enable RC632 interrupts */ + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + DEBUGPSPI("DMA Xfer finished rx=%s\r\n", hexdump(rx_data, tx_len)); + + *rx_len = tx_len; + + return 0; +} +#else +/* stupid polling transceiver routine */ +static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + u_int8_t *rx_data, u_int16_t *rx_len) +{ + u_int16_t tx_cur = 0; + u_int16_t rx_len_max = 0; + u_int16_t rx_cnt = 0; + + /* disable RC632 interrupt because it wants to do SPI transactions */ + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + DEBUGPSPI("spi_transceive: enter(tx_len=%u) ", tx_len); + + if (rx_len) { + rx_len_max = *rx_len; + *rx_len = 0; + } + + //AT91F_SPI_Enable(pSPI); + while (1) { + u_int32_t sr = pSPI->SPI_SR; + u_int8_t tmp; + if (sr & AT91C_SPI_RDRF) { + tmp = pSPI->SPI_RDR; + rx_cnt++; + if (rx_len && *rx_len < rx_len_max) + rx_data[(*rx_len)++] = tmp; + } + if (sr & AT91C_SPI_TDRE) { + if (tx_len > tx_cur) + pSPI->SPI_TDR = tx_data[tx_cur++]; + } + if (tx_cur >= tx_len && rx_cnt >= tx_len) + break; + } + //AT91F_SPI_Disable(pSPI); + if (rx_data) + DEBUGPSPI("leave(%02x %02x)\r\n", rx_data[0], rx_data[1]); + else + DEBUGPSPI("leave()\r\n"); + + /* Re-enable RC632 interrupts */ + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + return 0; +} +#endif + +/* RC632 driver */ + +/* static buffers used by RC632 access primitives below. + * Since we only have one */ + +static u_int8_t spi_outbuf[SPI_MAX_XFER_LEN]; +static u_int8_t spi_inbuf[SPI_MAX_XFER_LEN]; + +#define FIFO_ADDR (RC632_REG_FIFO_DATA << 1) + +#define RC632_WRITE_ADDR(x) ((x << 1) & 0x7e) + +/* RC632 access primitives */ + +int opcd_rc632_reg_write(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t data) +{ + u_int16_t rx_len = 2; + + DEBUG632("[0x%02x] <= 0x%02x", addr, data); + + addr = RC632_WRITE_ADDR(addr); + + spi_outbuf[0] = addr; + spi_outbuf[1] = data; + + return spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); +} + +#define RC632_REGSET_START 0x10 +#define RC632_REGSET_END 0x3f +#define RC632_REGSET_MAXSIZE (RC632_REGSET_END-RC632_REGSET_START) +static u_int8_t regset_buf[RC632_REGSET_MAXSIZE * 2]; + +int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + u_int8_t *regs, int len) +{ + u_int8_t i, j = 0; + u_int16_t rx_len; + + if (len > RC632_REGSET_MAXSIZE) + return -E2BIG; + + for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + /* skip bank registers */ + if (i % 8 == 0) + continue; + regset_buf[j++] = RC632_WRITE_ADDR(i); + regset_buf[j++] = regs[i - RC632_REGSET_START]; + } + + rx_len = j; + return spi_transceive(regset_buf, j, spi_inbuf, &rx_len); +} + +int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags) +{ + u_int16_t rx_len = sizeof(spi_inbuf); + if (len > sizeof(spi_outbuf)-1) + len = sizeof(spi_outbuf)-1; + + spi_outbuf[0] = FIFO_ADDR; + memcpy(&spi_outbuf[1], data, len); + + DEBUG632("[FIFO] <= %s", hexdump(data, len)); + + return spi_transceive(spi_outbuf, len+1, spi_inbuf, &rx_len); +} + +int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t *val) +{ + u_int16_t rx_len = 2; + + addr = (addr << 1) & 0x7e; + + spi_outbuf[0] = addr | 0x80; + spi_outbuf[1] = 0x00; + + spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + *val = spi_inbuf[1]; + + DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + + return 0; +} + +int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + u_int8_t max_len, u_int8_t *data) +{ + int ret; + u_int8_t fifo_length; + u_int8_t i; + u_int16_t rx_len; + + ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + if (ret < 0) + return ret; + + rx_len = fifo_length+1; + + if (max_len < fifo_length) + fifo_length = max_len; + + for (i = 0; i < fifo_length; i++) + spi_outbuf[i] = FIFO_ADDR; + + spi_outbuf[0] |= 0x80; + spi_outbuf[fifo_length] = 0x00; + + spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + memcpy(data, spi_inbuf+1, rx_len-1); + + DEBUG632("[FIFO] => %s", hexdump(data, rx_len-1)); + + return rx_len-1; +} + +int opcd_rc632_set_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + if (ret < 0) + return ret; + + val |= bits; + + return opcd_rc632_reg_write(hdl, reg, val); +} + +int opcd_rc632_clear_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits) +{ + u_int8_t val; + int ret; + + ret = opcd_rc632_reg_read(hdl, reg, &val); + if (ret < 0) + return ret; + + val &= ~bits; + + return opcd_rc632_reg_write(hdl, reg, val); +} + +/* RC632 interrupt handling */ + +static void rc632_irq(void) +{ + struct req_ctx *irq_rctx; + struct openpcd_hdr *irq_opcdh; + u_int8_t cause; + + /* CL RC632 has interrupted us */ + opcd_rc632_reg_read(NULL, RC632_REG_INTERRUPT_RQ, &cause); + + /* ACK all interrupts */ + //rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, cause); + opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, RC632_INT_TIMER); + DEBUGP("rc632_irq: "); + + if (cause & RC632_INT_LOALERT) { + /* FIFO is getting low, refill from virtual FIFO */ + DEBUGP("FIFO_low "); + #if 0 + if (!fifo_available(&rc632.fifo)) + return; + #endif + /* FIXME */ + } + if (cause & RC632_INT_HIALERT) { + /* FIFO is getting full, empty into virtual FIFO */ + DEBUGP("FIFO_high "); + /* FIXME */ + } + /* All interrupts below can be reported directly to the host */ + if (cause & RC632_INT_TIMER) + DEBUGP("Timer "); + if (cause & RC632_INT_IDLE) + DEBUGP("Idle "); + if (cause & RC632_INT_RX) + DEBUGP("RxComplete "); + if (cause & RC632_INT_TX) + DEBUGP("TxComplete "); + + + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_RC632IRQ_BUSY); + if (!irq_rctx) { + DEBUGPCRF("NO RCTX!"); + /* disable rc632 interrupt until RCTX is free */ + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + return; + } + + irq_opcdh = (struct openpcd_hdr *) irq_rctx->data; + + /* initialize static part of openpcd_hdr for USB IRQ reporting */ + irq_opcdh->cmd = OPENPCD_CMD_IRQ; + irq_opcdh->flags = 0x00; + irq_opcdh->reg = 0x07; + irq_opcdh->val = cause; + + req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + DEBUGPCR(""); +} + +void rc632_unthrottle(void) +{ + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); +} + +void rc632_power(u_int8_t up) +{ + DEBUGPCRF("powering %s RC632", up ? "up" : "down"); + if (up) + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, + OPENPCD_PIO_RC632_RESET); + else + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, + OPENPCD_PIO_RC632_RESET); +} + +void rc632_reset(void) +{ + volatile int i; + + rc632_power(0); + for (i = 0; i < 0xffff; i++) + {} + rc632_power(1); + + /* wait for startup phase to finish */ + while (1) { + u_int8_t val; + opcd_rc632_reg_read(NULL, RC632_REG_COMMAND, &val); + if (val == 0x00) + break; + } + + /* turn off register paging */ + opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); +} + +static int rc632_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + u_int16_t len = rctx->tot_len-sizeof(*poh); + + /* initialize transmit length to header length */ + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + case OPENPCD_CMD_READ_REG: + opcd_rc632_reg_read(NULL, poh->reg, &poh->val); + DEBUGP("READ REG(0x%02x)=0x%02x ", poh->reg, poh->val); + /* register read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + break; + case OPENPCD_CMD_READ_FIFO: + /* FIFO read always has to provoke a response */ + poh->flags &= OPENPCD_FLAG_RESPOND; + { + u_int16_t req_len = poh->val, remain_len = req_len, pih_len; +#if 0 + if (req_len > MAX_PAYLOAD_LEN) { + pih_len = MAX_PAYLOAD_LEN; + remain_len -= pih_len; + opcd_rc632_fifo_read(NULL, pih_len, poh->data); + rctx->tot_len += pih_len; + DEBUGP("READ FIFO(len=%u)=%s ", req_len, + hexdump(poh->data, pih_len)); + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + udp_refill_ep(2); + + /* get and initialize second rctx */ + rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + RCTX_STATE_MAIN_PROCESSING); + if (!rctx) { + DEBUGPCRF("FATAL_NO_RCTX!!!\n"); + break; + } + poh = (struct openpcd_hdr *) rctx->data; + rctx->tot_len = sizeof(*poh); + + pih_len = remain_len; + opcd_rc632_fifo_read(NULL, pih_len, poh->data); + rctx->tot_len += pih_len; + DEBUGP("READ FIFO(len=%u)=%s ", pih_len, + hexdump(poh->data, pih_len)); + /* don't set state of second rctx, main function + * body will do this after switch statement */ + } else { +#endif + poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + rctx->tot_len += poh->val; + DEBUGP("READ FIFO(len=%u)=%s ", poh->val, + hexdump(poh->data, poh->val)); + //} + } + break; + case OPENPCD_CMD_WRITE_REG: + DEBUGP("WRITE_REG(0x%02x, 0x%02x) ", poh->reg, poh->val); + opcd_rc632_reg_write(NULL, poh->reg, poh->val); + break; + case OPENPCD_CMD_WRITE_REG_SET: + DEBUGP("WRITE_REG_SET(%s) ", hexdump(poh->data, len)); + opcd_rc632_reg_write_set(NULL, poh->data, len); + break; + case OPENPCD_CMD_WRITE_FIFO: + DEBUGP("WRITE FIFO(len=%u): %s ", len, + hexdump(poh->data, len)); + opcd_rc632_fifo_write(NULL, len, poh->data, 0); + break; + case OPENPCD_CMD_READ_VFIFO: + DEBUGP("READ VFIFO "); + goto not_impl; + break; + case OPENPCD_CMD_WRITE_VFIFO: + DEBUGP("WRITE VFIFO "); + goto not_impl; + break; + case OPENPCD_CMD_REG_BITS_CLEAR: + DEBUGP("CLEAR BITS "); + poh->val = opcd_rc632_clear_bits(NULL, poh->reg, poh->val); + break; + case OPENPCD_CMD_REG_BITS_SET: + DEBUGP("SET BITS "); + poh->val = opcd_rc632_set_bits(NULL, poh->reg, poh->val); + break; + case OPENPCD_CMD_DUMP_REGS: + DEBUGP("DUMP REGS "); + goto not_impl; + break; + default: + DEBUGP("UNKNOWN "); + return USB_ERR(USB_ERR_CMD_UNKNOWN); + } + + return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; +not_impl: + DEBUGP("NOT IMPLEMENTED YET "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); +} + +void rc632_init(void) +{ + //fifo_init(&rc632.fifo, 256, NULL, &rc632); + + DEBUGPCRF("entering"); + + AT91F_SPI_CfgPMC(); + + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + AT91C_PA11_NPCS0|AT91C_PA12_MISO| + AT91C_PA13_MOSI |AT91C_PA14_SPCK, 0); + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + OPENPCD_IRQ_PRIO_SPI, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &spi_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI); + + AT91F_SPI_EnableIt(pSPI, AT91C_SPI_MODF|AT91C_SPI_OVRES); +#ifdef SPI_USES_DMA + AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDRX|AT91C_SPI_ENDTX); +#endif + +#ifdef SPI_DEBUG_LOOPBACK + AT91F_SPI_CfgMode(pSPI, AT91C_SPI_MSTR|AT91C_SPI_PS_FIXED| + AT91C_SPI_MODFDIS|AT91C_SPI_LLB); +#else + AT91F_SPI_CfgMode(pSPI, AT91C_SPI_MSTR|AT91C_SPI_PS_FIXED| + AT91C_SPI_MODFDIS); +#endif + /* CPOL = 0, NCPHA = 1, CSAAT = 0, BITS = 0000, SCBR = 10 (4.8MHz), + * DLYBS = 0, DLYBCT = 0 */ +#ifdef SPI_USES_DMA + AT91F_SPI_CfgCs(pSPI, 0, AT91C_SPI_BITS_8|AT91C_SPI_NCPHA|(10<<8)); +#else + /* 320 kHz in case of I/O based SPI */ + AT91F_SPI_CfgCs(pSPI, 0, AT91C_SPI_BITS_8|AT91C_SPI_NCPHA|(0x7f<<8)); +#endif + AT91F_SPI_Enable(pSPI); + + /* Register rc632_irq */ + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632, + OPENPCD_IRQ_PRIO_RC632, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &rc632_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_RC632_RESET); + + rc632_reset(); + + /* configure IRQ pin */ + opcd_rc632_reg_write(NULL, RC632_REG_IRQ_PIN_CONFIG, + RC632_IRQCFG_CMOS|RC632_IRQCFG_INV); + /* enable interrupts */ + opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_EN, RC632_INT_TIMER); + + /* configure AUX to test signal four */ + opcd_rc632_reg_write(NULL, RC632_REG_TEST_ANA_SELECT, 0x04); + + usb_hdlr_register(&rc632_usb_in, OPENPCD_CMD_CLS_RC632); +}; + +#if 0 +void rc632_exit(void) +{ + usb_hdlr_unregister(OPENPCD_CMD_CLS_RC632); + AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + AT91F_AIC_DisableIt(AT91C_BASE_AIC, AT91C_ID_SPI); + AT91F_SPI_Disable(pSPI); +} +#endif + +#ifdef DEBUG +static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t val) +{ + u_int8_t tmp; + + opcd_rc632_reg_write(hdl, reg, val); + opcd_rc632_reg_read(hdl, reg, &tmp); + + DEBUGPCRF("reg=0x%02x, write=0x%02x, read=0x%02x ", reg, val, tmp); + + return (val == tmp); +} + +int rc632_dump(void) +{ + u_int8_t i; + u_int16_t rx_len = sizeof(spi_inbuf); + + for (i = 0; i <= 0x3f; i++) { + u_int8_t reg = i; + if (reg == RC632_REG_FIFO_DATA) + reg = 0x3e; + + spi_outbuf[i] = reg << 1; + spi_inbuf[i] = 0x00; + } + + /* MSB of first byte of read spi transfer is high */ + spi_outbuf[0] |= 0x80; + + /* last byte of read spi transfer is 0x00 */ + spi_outbuf[0x40] = 0x00; + spi_inbuf[0x40] = 0x00; + + spi_transceive(spi_outbuf, 0x41, spi_inbuf, &rx_len); + + for (i = 0; i < 0x3f; i++) { + if (i == RC632_REG_FIFO_DATA) + DEBUGPCR("REG 0x02 = NOT READ"); + else + DEBUGPCR("REG 0x%02x = 0x%02x", i, spi_inbuf[i+1]); + } + + return 0; +} + +int rc632_test(struct rfid_asic_handle *hdl) +{ + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + return -1; + + if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0xAA) != 1) + return -1; + + return 0; +} +#else /* DEBUG */ +int rc632_test(struct rfid_asic_handle *hdl) {} +int rc632_dump(void) {} +#endif /* DEBUG */ diff --git a/firmware/src/pcd/rc632.h b/firmware/src/pcd/rc632.h new file mode 100644 index 0000000..5081f42 --- /dev/null +++ b/firmware/src/pcd/rc632.h @@ -0,0 +1,32 @@ +#ifndef _RC623_API_H +#define _RC632_API_H + +#include +#include +#include +#include + +extern int opcd_rc632_reg_write(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t data); +extern int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + u_int8_t len, u_int8_t *data, u_int8_t flags); +extern int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + u_int8_t addr, u_int8_t *val); +extern int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + u_int8_t max_len, u_int8_t *data); +extern int opcd_rc632_clear_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits); +extern int opcd_rc632_set_bits(struct rfid_asic_handle *hdl, + u_int8_t reg, u_int8_t bits); + +extern void rc632_init(void); +extern void rc632_exit(void); + +extern void rc632_unthrottle(void); + +extern int rc632_test(struct rfid_asic_handle *hdl); +extern int rc632_dump(void); + +extern void rc632_power(u_int8_t up); + +#endif diff --git a/firmware/src/pcd/rc632.lst b/firmware/src/pcd/rc632.lst new file mode 100644 index 0000000..57cf761 --- /dev/null +++ b/firmware/src/pcd/rc632.lst @@ -0,0 +1,4274 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "rc632.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 23 spi_irq: + 24 .LFB278: + 25 .file 1 "src/pcd/rc632.c" + 1:src/pcd/rc632.c **** /* Philips CL RC632 driver (via SPI) for OpenPCD firmware + 2:src/pcd/rc632.c **** * (C) 2006 by Harald Welte + 3:src/pcd/rc632.c **** * + 4:src/pcd/rc632.c **** * This is heavily based on the librfid RC632 driver. All primitive access + 5:src/pcd/rc632.c **** * functions such as rc632_{reg,fifo}_{read,write}() are API compatible to + 6:src/pcd/rc632.c **** * librfid in order to be able to leverage higher-level code from librfid + 7:src/pcd/rc632.c **** * to this OpenPCD firmware. + 8:src/pcd/rc632.c **** * + 9:src/pcd/rc632.c **** * AT91SAM7 PWM routines for OpenPCD / OpenPICC + 10:src/pcd/rc632.c **** * (C) 2006 by Harald Welte + 11:src/pcd/rc632.c **** * + 12:src/pcd/rc632.c **** * This program is free software; you can redistribute it and/or modify + 13:src/pcd/rc632.c **** * it under the terms of the GNU General Public License as published by + 14:src/pcd/rc632.c **** * the Free Software Foundation; either version 2 of the License, or + 15:src/pcd/rc632.c **** * (at your option) any later version. + 16:src/pcd/rc632.c **** * + 17:src/pcd/rc632.c **** * This program is distributed in the hope that it will be useful, + 18:src/pcd/rc632.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 19:src/pcd/rc632.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 20:src/pcd/rc632.c **** * GNU General Public License for more details. + 21:src/pcd/rc632.c **** * + 22:src/pcd/rc632.c **** * You should have received a copy of the GNU General Public License + 23:src/pcd/rc632.c **** * along with this program; if not, write to the Free Software + 24:src/pcd/rc632.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 25:src/pcd/rc632.c **** * + 26:src/pcd/rc632.c **** */ + 27:src/pcd/rc632.c **** + 28:src/pcd/rc632.c **** #include + 29:src/pcd/rc632.c **** #include + 30:src/pcd/rc632.c **** #include + 31:src/pcd/rc632.c **** #include + 32:src/pcd/rc632.c **** #include + 33:src/pcd/rc632.c **** #include "../openpcd.h" + 34:src/pcd/rc632.c **** #include + 35:src/pcd/rc632.c **** #include + 36:src/pcd/rc632.c **** #include + 37:src/pcd/rc632.c **** #include + 38:src/pcd/rc632.c **** #include + 39:src/pcd/rc632.c **** #include "rc632.h" + 40:src/pcd/rc632.c **** + 41:src/pcd/rc632.c **** #include + 42:src/pcd/rc632.c **** + 43:src/pcd/rc632.c **** #define NOTHING do {} while(0) + 44:src/pcd/rc632.c **** + 45:src/pcd/rc632.c **** #if 0 + 46:src/pcd/rc632.c **** #define DEBUGPSPI DEBUGP + 47:src/pcd/rc632.c **** #define DEBUGPSPIIRQ DEBUGP + 48:src/pcd/rc632.c **** #else + 49:src/pcd/rc632.c **** #define DEBUGPSPI(x, args ...) NOTHING + 50:src/pcd/rc632.c **** #define DEBUGPSPIIRQ(x, args...) NOTHING + 51:src/pcd/rc632.c **** #endif + 52:src/pcd/rc632.c **** + 53:src/pcd/rc632.c **** #if 0 + 54:src/pcd/rc632.c **** #define DEBUG632 DEBUGPCRF + 55:src/pcd/rc632.c **** #else + 56:src/pcd/rc632.c **** #define DEBUG632(x, args ...) NOTHING + 57:src/pcd/rc632.c **** #endif + 58:src/pcd/rc632.c **** + 59:src/pcd/rc632.c **** + 60:src/pcd/rc632.c **** /* SPI driver */ + 61:src/pcd/rc632.c **** + 62:src/pcd/rc632.c **** #ifdef OLIMEX + 63:src/pcd/rc632.c **** #define SPI_DEBUG_LOOPBACK + 64:src/pcd/rc632.c **** #endif + 65:src/pcd/rc632.c **** + 66:src/pcd/rc632.c **** #define SPI_USES_DMA + 67:src/pcd/rc632.c **** + 68:src/pcd/rc632.c **** #define SPI_MAX_XFER_LEN 65 + 69:src/pcd/rc632.c **** + 70:src/pcd/rc632.c **** static const AT91PS_SPI pSPI = AT91C_BASE_SPI; + 71:src/pcd/rc632.c **** + 72:src/pcd/rc632.c **** /* SPI irq handler */ + 73:src/pcd/rc632.c **** static void spi_irq(void) + 74:src/pcd/rc632.c **** { + 26 .loc 1 74 0 + 27 .cfi_startproc + 28 @ Function supports interworking. + 29 @ args = 0, pretend = 0, frame = 0 + 30 @ frame_needed = 0, uses_anonymous_args = 0 + 31 @ link register save eliminated. + 75:src/pcd/rc632.c **** u_int32_t status = pSPI->SPI_SR; + 32 .loc 1 75 0 + 33 0000 2C009FE5 ldr r0, .L4 + 34 0004 EFC010E5 ldr ip, [r0, #-239] + 35 .LVL0: + 76:src/pcd/rc632.c **** + 77:src/pcd/rc632.c **** DEBUGPSPIIRQ("spi_irq: 0x%08x ", status); + 78:src/pcd/rc632.c **** + 79:src/pcd/rc632.c **** if (status & AT91C_SPI_OVRES) + 80:src/pcd/rc632.c **** DEBUGPSPIIRQ("Overrun "); + 81:src/pcd/rc632.c **** if (status & AT91C_SPI_MODF) + 82:src/pcd/rc632.c **** DEBUGPSPIIRQ("ModeFault "); + 83:src/pcd/rc632.c **** if (status & AT91C_SPI_ENDRX) { + 36 .loc 1 83 0 + 37 0008 10001CE3 tst ip, #16 + 84:src/pcd/rc632.c **** pSPI->SPI_IDR = AT91C_SPI_ENDRX; + 38 .loc 1 84 0 + 39 000c 1010A013 movne r1, #16 + 40 0010 E7100015 strne r1, [r0, #-231] + 85:src/pcd/rc632.c **** DEBUGPSPIIRQ("ENDRX "); + 86:src/pcd/rc632.c **** } + 87:src/pcd/rc632.c **** if (status & AT91C_SPI_ENDTX) { + 41 .loc 1 87 0 + 42 0014 20001CE3 tst ip, #32 + 88:src/pcd/rc632.c **** pSPI->SPI_IDR = AT91C_SPI_ENDTX; + 43 .loc 1 88 0 + 44 0018 14C09F15 ldrne ip, .L4 + 45 .LVL1: + 46 001c 2000A013 movne r0, #32 + 47 .LBB85: + 48 .LBB86: + 49 .file 2 "include/lib_AT91SAM7.h" + 1:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 2:include/lib_AT91SAM7.h **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 4:include/lib_AT91SAM7.h **** //* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + 5:include/lib_AT91SAM7.h **** //* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + 6:include/lib_AT91SAM7.h **** //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + 7:include/lib_AT91SAM7.h **** //* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + 8:include/lib_AT91SAM7.h **** //* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + 9:include/lib_AT91SAM7.h **** //* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + 10:include/lib_AT91SAM7.h **** //* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + 11:include/lib_AT91SAM7.h **** //* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + 12:include/lib_AT91SAM7.h **** //* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + 13:include/lib_AT91SAM7.h **** //* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 14:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 15:include/lib_AT91SAM7.h **** //* File Name : lib_AT91SAM7S64.h + 16:include/lib_AT91SAM7.h **** //* Object : AT91SAM7S64 inlined functions + 17:include/lib_AT91SAM7.h **** //* Generated : AT91 SW Application Group 08/30/2005 (15:52:59) + 18:include/lib_AT91SAM7.h **** //* + 19:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// + 20:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pmc_SAM7S.h/1.4/Tue Aug 30 13:00:43 2005// + 21:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// + 22:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// + 23:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// + 24:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// + 25:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// + 26:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// + 27:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// + 28:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// + 29:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// + 30:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// + 31:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// + 32:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// + 33:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// + 34:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_MC_SAM7S.h/1.1/Thu Mar 25 15:19:14 2004// + 35:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// + 36:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// + 37:include/lib_AT91SAM7.h **** //* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// + 38:include/lib_AT91SAM7.h **** //* ---------------------------------------------------------------------------- + 39:include/lib_AT91SAM7.h **** + 40:include/lib_AT91SAM7.h **** #ifndef lib_AT91SAM7S64_H + 41:include/lib_AT91SAM7.h **** #define lib_AT91SAM7S64_H + 42:include/lib_AT91SAM7.h **** + 43:include/lib_AT91SAM7.h **** #include + 44:include/lib_AT91SAM7.h **** + 45:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 46:include/lib_AT91SAM7.h **** SOFTWARE API FOR AIC + 47:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 48:include/lib_AT91SAM7.h **** #define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] + 49:include/lib_AT91SAM7.h **** + 50:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 51:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ConfigureIt + 52:include/lib_AT91SAM7.h **** //* \brief Interrupt Handler Initialization + 53:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 54:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_ConfigureIt ( + 55:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 56:include/lib_AT91SAM7.h **** unsigned int irq_id, // \arg interrupt number to initialize + 57:include/lib_AT91SAM7.h **** unsigned int priority, // \arg priority to give to the interrupt + 58:include/lib_AT91SAM7.h **** unsigned int src_type, // \arg activation and sense of activation + 59:include/lib_AT91SAM7.h **** void (*newHandler) () ); // \arg address of the interrupt handler + 60:include/lib_AT91SAM7.h **** + 61:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 62:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_EnableIt + 63:include/lib_AT91SAM7.h **** //* \brief Enable corresponding IT number + 64:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 65:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_EnableIt ( + 66:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 67:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 68:include/lib_AT91SAM7.h **** { + 69:include/lib_AT91SAM7.h **** //* Enable the interrupt on the interrupt controller + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 71:include/lib_AT91SAM7.h **** } + 72:include/lib_AT91SAM7.h **** + 73:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 74:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_DisableIt + 75:include/lib_AT91SAM7.h **** //* \brief Disable corresponding IT number + 76:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 77:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_DisableIt ( + 78:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 79:include/lib_AT91SAM7.h **** unsigned int irq_id ) // \arg interrupt number to initialize + 80:include/lib_AT91SAM7.h **** { + 81:include/lib_AT91SAM7.h **** unsigned int mask = 0x1 << irq_id; + 82:include/lib_AT91SAM7.h **** //* Disable the interrupt on the interrupt controller + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 84:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 86:include/lib_AT91SAM7.h **** } + 87:include/lib_AT91SAM7.h **** + 88:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 89:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_ClearIt + 90:include/lib_AT91SAM7.h **** //* \brief Clear corresponding IT number + 91:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 92:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_ClearIt ( + 93:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 94:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number to initialize + 95:include/lib_AT91SAM7.h **** { + 96:include/lib_AT91SAM7.h **** //* Clear the interrupt on the Interrupt Controller ( if one is pending ) + 97:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = (0x1 << irq_id); + 50 .loc 2 97 0 + 51 0020 2020A0E3 mov r2, #32 + 52 0024 0F3CE0E3 mvn r3, #3840 + 53 .LBE86: + 54 .LBE85: + 55 .loc 1 88 0 + 56 0028 E7000C15 strne r0, [ip, #-231] + 57 .LVL2: + 58 .LBB88: + 59 .LBB87: + 60 .loc 2 97 0 + 61 002c 292083E5 str r2, [r3, #41] + 62 .LBE87: + 63 .LBE88: + 89:src/pcd/rc632.c **** DEBUGPSPIIRQ("ENDTX "); + 90:src/pcd/rc632.c **** } + 91:src/pcd/rc632.c **** + 92:src/pcd/rc632.c **** DEBUGPSPIIRQ("\r\n"); + 93:src/pcd/rc632.c **** + 94:src/pcd/rc632.c **** AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SPI); + 95:src/pcd/rc632.c **** } + 64 .loc 1 95 0 + 65 0030 1EFF2FE1 bx lr + 66 .L5: + 67 .align 2 + 68 .L4: + 69 0034 FF00FEFF .word -130817 + 70 .cfi_endproc + 71 .LFE278: + 73 .align 2 + 75 spi_transceive.clone.1: + 76 .LFB296: + 96:src/pcd/rc632.c **** + 97:src/pcd/rc632.c **** #ifdef SPI_USES_DMA + 98:src/pcd/rc632.c **** static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 77 .loc 1 98 0 + 78 .cfi_startproc + 79 @ Function supports interworking. + 80 @ args = 0, pretend = 0, frame = 0 + 81 @ frame_needed = 0, uses_anonymous_args = 0 + 82 .LVL3: + 83 0038 F0402DE9 stmfd sp!, {r4, r5, r6, r7, lr} + 84 .LCFI0: + 85 .cfi_def_cfa_offset 20 + 99:src/pcd/rc632.c **** u_int8_t *rx_data, u_int16_t *rx_len) + 100:src/pcd/rc632.c **** { + 101:src/pcd/rc632.c **** DEBUGPSPI("DMA Xfer tx=%s\r\n", hexdump(tx_data, tx_len)); + 102:src/pcd/rc632.c **** if (*rx_len < tx_len) { + 86 .loc 1 102 0 + 87 003c B030D2E1 ldrh r3, [r2, #0] + 88 0040 010053E1 cmp r3, r1 + 98:src/pcd/rc632.c **** static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 89 .loc 1 98 0 + 90 0044 0070A0E1 mov r7, r0 + 91 .cfi_offset 14, -4 + 92 .cfi_offset 7, -8 + 93 .cfi_offset 6, -12 + 94 .cfi_offset 5, -16 + 95 .cfi_offset 4, -20 + 96 0048 0CD04DE2 sub sp, sp, #12 + 97 .LCFI1: + 98 .cfi_def_cfa_offset 32 + 98:src/pcd/rc632.c **** static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 99 .loc 1 98 0 + 100 004c 0250A0E1 mov r5, r2 + 101 0050 0140A0E1 mov r4, r1 + 103:src/pcd/rc632.c **** DEBUGPCRF("rx_len=%u smaller tx_len=%u\n", *rx_len, tx_len); + 104:src/pcd/rc632.c **** return -1; + 102 .loc 1 104 0 + 103 0054 0000E033 mvncc r0, #0 + 104 .LVL4: + 102:src/pcd/rc632.c **** if (*rx_len < tx_len) { + 105 .loc 1 102 0 + 106 0058 0200002A bcs .L12 + 107 .LVL5: + 108 .L7: + 105:src/pcd/rc632.c **** } + 106:src/pcd/rc632.c **** + 107:src/pcd/rc632.c **** /* disable RC632 interrupt because it wants to do SPI transactions */ + 108:src/pcd/rc632.c **** AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 109:src/pcd/rc632.c **** + 110:src/pcd/rc632.c **** AT91F_SPI_ReceiveFrame(pSPI, rx_data, tx_len, NULL, 0); + 111:src/pcd/rc632.c **** AT91F_SPI_SendFrame(pSPI, tx_data, tx_len, NULL, 0); + 112:src/pcd/rc632.c **** + 113:src/pcd/rc632.c **** AT91F_PDC_EnableRx(AT91C_BASE_PDC_SPI); + 114:src/pcd/rc632.c **** AT91F_PDC_EnableTx(AT91C_BASE_PDC_SPI); + 115:src/pcd/rc632.c **** + 116:src/pcd/rc632.c **** pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + 117:src/pcd/rc632.c **** + 118:src/pcd/rc632.c **** + 119:src/pcd/rc632.c **** while (! (pSPI->SPI_SR & AT91C_SPI_ENDRX)) ; + 120:src/pcd/rc632.c **** + 121:src/pcd/rc632.c **** /* Re-enable RC632 interrupts */ + 122:src/pcd/rc632.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 123:src/pcd/rc632.c **** + 124:src/pcd/rc632.c **** DEBUGPSPI("DMA Xfer finished rx=%s\r\n", hexdump(rx_data, tx_len)); + 125:src/pcd/rc632.c **** + 126:src/pcd/rc632.c **** *rx_len = tx_len; + 127:src/pcd/rc632.c **** + 128:src/pcd/rc632.c **** return 0; + 129:src/pcd/rc632.c **** } + 109 .loc 1 129 0 + 110 005c 0CD08DE2 add sp, sp, #12 + 111 0060 F040BDE8 ldmfd sp!, {r4, r5, r6, r7, lr} + 112 0064 1EFF2FE1 bx lr + 113 .LVL6: + 114 .L12: + 115 .LBB89: + 116 .LBB91: + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 117 .loc 2 83 0 + 118 0068 0FCCE0E3 mvn ip, #3840 + 119 .LBE91: + 120 .LBE89: + 121 .LBB93: + 122 .LBB95: + 98:include/lib_AT91SAM7.h **** } + 99:include/lib_AT91SAM7.h **** + 100:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 101:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_AcknowledgeIt + 102:include/lib_AT91SAM7.h **** //* \brief Acknowledge corresponding IT number + 103:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 104:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_AcknowledgeIt ( + 105:include/lib_AT91SAM7.h **** AT91PS_AIC pAic) // \arg pointer to the AIC registers + 106:include/lib_AT91SAM7.h **** { + 107:include/lib_AT91SAM7.h **** pAic->AIC_EOICR = pAic->AIC_EOICR; + 108:include/lib_AT91SAM7.h **** } + 109:include/lib_AT91SAM7.h **** + 110:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 111:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_SetExceptionVector + 112:include/lib_AT91SAM7.h **** //* \brief Configure vector handler + 113:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 114:include/lib_AT91SAM7.h **** extern unsigned int AT91F_AIC_SetExceptionVector ( + 115:include/lib_AT91SAM7.h **** unsigned int *pVector, // \arg pointer to the AIC registers + 116:include/lib_AT91SAM7.h **** void (*Handler) () ); // \arg Interrupt Handler + 117:include/lib_AT91SAM7.h **** + 118:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 119:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Trig + 120:include/lib_AT91SAM7.h **** //* \brief Trig an IT + 121:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 122:include/lib_AT91SAM7.h **** static inline void AT91F_AIC_Trig ( + 123:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 124:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg interrupt number + 125:include/lib_AT91SAM7.h **** { + 126:include/lib_AT91SAM7.h **** pAic->AIC_ISCR = (0x1 << irq_id) ; + 127:include/lib_AT91SAM7.h **** } + 128:include/lib_AT91SAM7.h **** + 129:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 130:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsActive + 131:include/lib_AT91SAM7.h **** //* \brief Test if an IT is active + 132:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 133:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsActive ( + 134:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 135:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 136:include/lib_AT91SAM7.h **** { + 137:include/lib_AT91SAM7.h **** return (pAic->AIC_ISR & (0x1 << irq_id)); + 138:include/lib_AT91SAM7.h **** } + 139:include/lib_AT91SAM7.h **** + 140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 141:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_IsPending + 142:include/lib_AT91SAM7.h **** //* \brief Test if an IT is pending + 143:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 144:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_AIC_IsPending ( + 145:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 146:include/lib_AT91SAM7.h **** unsigned int irq_id) // \arg Interrupt Number + 147:include/lib_AT91SAM7.h **** { + 148:include/lib_AT91SAM7.h **** return (pAic->AIC_IPR & (0x1 << irq_id)); + 149:include/lib_AT91SAM7.h **** } + 150:include/lib_AT91SAM7.h **** + 151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 152:include/lib_AT91SAM7.h **** //* \fn AT91F_AIC_Open + 153:include/lib_AT91SAM7.h **** //* \brief Set exception vectors and AIC registers to default values + 154:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 155:include/lib_AT91SAM7.h **** extern void AT91F_AIC_Open( + 156:include/lib_AT91SAM7.h **** AT91PS_AIC pAic, // \arg pointer to the AIC registers + 157:include/lib_AT91SAM7.h **** void (*IrqHandler) (), // \arg Default IRQ vector exception + 158:include/lib_AT91SAM7.h **** void (*FiqHandler) (), // \arg Default FIQ vector exception + 159:include/lib_AT91SAM7.h **** void (*DefaultHandler) (), // \arg Default Handler set in ISR + 160:include/lib_AT91SAM7.h **** void (*SpuriousHandler) (), // \arg Default Spurious Handler + 161:include/lib_AT91SAM7.h **** unsigned int protectMode); // \arg Debug Control Register + 162:include/lib_AT91SAM7.h **** + 163:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 164:include/lib_AT91SAM7.h **** SOFTWARE API FOR PDC + 165:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 166:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 167:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextRx + 168:include/lib_AT91SAM7.h **** //* \brief Set the next receive transfer descriptor + 169:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 170:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextRx ( + 171:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 172:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 173:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 174:include/lib_AT91SAM7.h **** { + 175:include/lib_AT91SAM7.h **** pPDC->PDC_RNPR = (unsigned int) address; + 176:include/lib_AT91SAM7.h **** pPDC->PDC_RNCR = bytes; + 177:include/lib_AT91SAM7.h **** } + 178:include/lib_AT91SAM7.h **** + 179:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 180:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetNextTx + 181:include/lib_AT91SAM7.h **** //* \brief Set the next transmit transfer descriptor + 182:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 183:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetNextTx ( + 184:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 185:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 186:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 187:include/lib_AT91SAM7.h **** { + 188:include/lib_AT91SAM7.h **** pPDC->PDC_TNPR = (unsigned int) address; + 189:include/lib_AT91SAM7.h **** pPDC->PDC_TNCR = bytes; + 190:include/lib_AT91SAM7.h **** } + 191:include/lib_AT91SAM7.h **** + 192:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 193:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetRx + 194:include/lib_AT91SAM7.h **** //* \brief Set the receive transfer descriptor + 195:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 196:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetRx ( + 197:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 198:include/lib_AT91SAM7.h **** unsigned char *address,// \arg address to the next bloc to be received + 199:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be received + 200:include/lib_AT91SAM7.h **** { + 201:include/lib_AT91SAM7.h **** pPDC->PDC_RPR = (unsigned int) address; + 202:include/lib_AT91SAM7.h **** pPDC->PDC_RCR = bytes; + 203:include/lib_AT91SAM7.h **** } + 204:include/lib_AT91SAM7.h **** + 205:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 206:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SetTx + 207:include/lib_AT91SAM7.h **** //* \brief Set the transmit transfer descriptor + 208:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 209:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_SetTx ( + 210:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, // \arg pointer to a PDC controller + 211:include/lib_AT91SAM7.h **** const unsigned char *address,// \arg address to the next bloc to be transmitted + 212:include/lib_AT91SAM7.h **** unsigned int bytes) // \arg number of bytes to be transmitted + 213:include/lib_AT91SAM7.h **** { + 214:include/lib_AT91SAM7.h **** pPDC->PDC_TPR = (unsigned int) address; + 215:include/lib_AT91SAM7.h **** pPDC->PDC_TCR = bytes; + 216:include/lib_AT91SAM7.h **** } + 217:include/lib_AT91SAM7.h **** + 218:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 219:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableTx + 220:include/lib_AT91SAM7.h **** //* \brief Enable transmit + 221:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 222:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableTx ( + 223:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 224:include/lib_AT91SAM7.h **** { + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 226:include/lib_AT91SAM7.h **** } + 227:include/lib_AT91SAM7.h **** + 228:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 229:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_EnableRx + 230:include/lib_AT91SAM7.h **** //* \brief Enable receive + 231:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 232:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_EnableRx ( + 233:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 234:include/lib_AT91SAM7.h **** { + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 236:include/lib_AT91SAM7.h **** } + 237:include/lib_AT91SAM7.h **** + 238:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 239:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableTx + 240:include/lib_AT91SAM7.h **** //* \brief Disable transmit + 241:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 242:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableTx ( + 243:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 244:include/lib_AT91SAM7.h **** { + 245:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; + 246:include/lib_AT91SAM7.h **** } + 247:include/lib_AT91SAM7.h **** + 248:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 249:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_DisableRx + 250:include/lib_AT91SAM7.h **** //* \brief Disable receive + 251:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 252:include/lib_AT91SAM7.h **** static inline void AT91F_PDC_DisableRx ( + 253:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 254:include/lib_AT91SAM7.h **** { + 255:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; + 256:include/lib_AT91SAM7.h **** } + 257:include/lib_AT91SAM7.h **** + 258:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 259:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsTxEmpty + 260:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been sent + 261:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 262:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete + 263:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 264:include/lib_AT91SAM7.h **** { + 265:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TCR); + 266:include/lib_AT91SAM7.h **** } + 267:include/lib_AT91SAM7.h **** + 268:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 269:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextTxEmpty + 270:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 271:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 272:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete + 273:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 274:include/lib_AT91SAM7.h **** { + 275:include/lib_AT91SAM7.h **** return !(pPDC->PDC_TNCR); + 276:include/lib_AT91SAM7.h **** } + 277:include/lib_AT91SAM7.h **** + 278:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 279:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsRxEmpty + 280:include/lib_AT91SAM7.h **** //* \brief Test if the current transfer descriptor has been filled + 281:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 282:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete + 283:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 284:include/lib_AT91SAM7.h **** { + 285:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RCR); + 286:include/lib_AT91SAM7.h **** } + 287:include/lib_AT91SAM7.h **** + 288:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 289:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_IsNextRxEmpty + 290:include/lib_AT91SAM7.h **** //* \brief Test if the next transfer descriptor has been moved to the current td + 291:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 292:include/lib_AT91SAM7.h **** static inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete + 293:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC ) // \arg pointer to a PDC controller + 294:include/lib_AT91SAM7.h **** { + 295:include/lib_AT91SAM7.h **** return !(pPDC->PDC_RNCR); + 296:include/lib_AT91SAM7.h **** } + 297:include/lib_AT91SAM7.h **** + 298:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 299:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Open + 300:include/lib_AT91SAM7.h **** //* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX + 301:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 302:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Open(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 303:include/lib_AT91SAM7.h **** + 304:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 305:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_Close + 306:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 307:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 308:include/lib_AT91SAM7.h **** extern void AT91F_PDC_Close(AT91PS_PDC pPDC); // \arg pointer to a PDC controller + 309:include/lib_AT91SAM7.h **** + 310:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 311:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_SendFrame + 312:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 313:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 314:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_SendFrame( + 315:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 316:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, + 317:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 318:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, + 319:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 320:include/lib_AT91SAM7.h **** + 321:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 322:include/lib_AT91SAM7.h **** //* \fn AT91F_PDC_ReceiveFrame + 323:include/lib_AT91SAM7.h **** //* \brief Close PDC: disable TX and RX reset transfer descriptors + 324:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 325:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PDC_ReceiveFrame ( + 326:include/lib_AT91SAM7.h **** AT91PS_PDC pPDC, + 327:include/lib_AT91SAM7.h **** unsigned char *pBuffer, + 328:include/lib_AT91SAM7.h **** unsigned int szBuffer, + 329:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, + 330:include/lib_AT91SAM7.h **** unsigned int szNextBuffer); + 331:include/lib_AT91SAM7.h **** + 332:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 333:include/lib_AT91SAM7.h **** SOFTWARE API FOR DBGU + 334:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 335:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 336:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptEnable + 337:include/lib_AT91SAM7.h **** //* \brief Enable DBGU Interrupt + 338:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 339:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptEnable( + 340:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 341:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be enabled + 342:include/lib_AT91SAM7.h **** { + 343:include/lib_AT91SAM7.h **** pDbgu->DBGU_IER = flag; + 344:include/lib_AT91SAM7.h **** } + 345:include/lib_AT91SAM7.h **** + 346:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 347:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_InterruptDisable + 348:include/lib_AT91SAM7.h **** //* \brief Disable DBGU Interrupt + 349:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 350:include/lib_AT91SAM7.h **** static inline void AT91F_DBGU_InterruptDisable( + 351:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 352:include/lib_AT91SAM7.h **** unsigned int flag) // \arg dbgu interrupt to be disabled + 353:include/lib_AT91SAM7.h **** { + 354:include/lib_AT91SAM7.h **** pDbgu->DBGU_IDR = flag; + 355:include/lib_AT91SAM7.h **** } + 356:include/lib_AT91SAM7.h **** + 357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 358:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_GetInterruptMaskStatus + 359:include/lib_AT91SAM7.h **** //* \brief Return DBGU Interrupt Mask Status + 360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 361:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status + 362:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller + 363:include/lib_AT91SAM7.h **** { + 364:include/lib_AT91SAM7.h **** return pDbgu->DBGU_IMR; + 365:include/lib_AT91SAM7.h **** } + 366:include/lib_AT91SAM7.h **** + 367:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 368:include/lib_AT91SAM7.h **** //* \fn AT91F_DBGU_IsInterruptMasked + 369:include/lib_AT91SAM7.h **** //* \brief Test if DBGU Interrupt is Masked + 370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 371:include/lib_AT91SAM7.h **** static inline int AT91F_DBGU_IsInterruptMasked( + 372:include/lib_AT91SAM7.h **** AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller + 373:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 374:include/lib_AT91SAM7.h **** { + 375:include/lib_AT91SAM7.h **** return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); + 376:include/lib_AT91SAM7.h **** } + 377:include/lib_AT91SAM7.h **** + 378:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 379:include/lib_AT91SAM7.h **** SOFTWARE API FOR PIO + 380:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 382:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPeriph + 383:include/lib_AT91SAM7.h **** //* \brief Enable pins to be drived by peripheral + 384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 385:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPeriph( + 386:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 387:include/lib_AT91SAM7.h **** unsigned int periphAEnable, // \arg PERIPH A to enable + 388:include/lib_AT91SAM7.h **** unsigned int periphBEnable) // \arg PERIPH B to enable + 389:include/lib_AT91SAM7.h **** + 390:include/lib_AT91SAM7.h **** { + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 394:include/lib_AT91SAM7.h **** } + 395:include/lib_AT91SAM7.h **** + 396:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 397:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOutput + 398:include/lib_AT91SAM7.h **** //* \brief Enable PIO in output mode + 399:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 400:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOutput( + 401:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 402:include/lib_AT91SAM7.h **** unsigned int pioEnable) // \arg PIO to be enabled + 403:include/lib_AT91SAM7.h **** { + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 406:include/lib_AT91SAM7.h **** } + 407:include/lib_AT91SAM7.h **** + 408:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 409:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInput + 410:include/lib_AT91SAM7.h **** //* \brief Enable PIO in input mode + 411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 412:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInput( + 413:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 414:include/lib_AT91SAM7.h **** unsigned int inputEnable) // \arg PIO to be enabled + 415:include/lib_AT91SAM7.h **** { + 416:include/lib_AT91SAM7.h **** // Disable output + 417:include/lib_AT91SAM7.h **** pPio->PIO_ODR = inputEnable; + 418:include/lib_AT91SAM7.h **** pPio->PIO_PER = inputEnable; + 419:include/lib_AT91SAM7.h **** } + 420:include/lib_AT91SAM7.h **** + 421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 422:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgOpendrain + 423:include/lib_AT91SAM7.h **** //* \brief Configure PIO in open drain + 424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 425:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgOpendrain( + 426:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 427:include/lib_AT91SAM7.h **** unsigned int multiDrvEnable) // \arg pio to be configured in open drain + 428:include/lib_AT91SAM7.h **** { + 429:include/lib_AT91SAM7.h **** // Configure the multi-drive option + 430:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = ~multiDrvEnable; + 431:include/lib_AT91SAM7.h **** pPio->PIO_MDER = multiDrvEnable; + 432:include/lib_AT91SAM7.h **** } + 433:include/lib_AT91SAM7.h **** + 434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 435:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgPullup + 436:include/lib_AT91SAM7.h **** //* \brief Enable pullup on PIO + 437:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 438:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgPullup( + 439:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 440:include/lib_AT91SAM7.h **** unsigned int pullupEnable) // \arg enable pullup on PIO + 441:include/lib_AT91SAM7.h **** { + 442:include/lib_AT91SAM7.h **** // Connect or not Pullup + 443:include/lib_AT91SAM7.h **** pPio->PIO_PPUDR = ~pullupEnable; + 444:include/lib_AT91SAM7.h **** pPio->PIO_PPUER = pullupEnable; + 445:include/lib_AT91SAM7.h **** } + 446:include/lib_AT91SAM7.h **** + 447:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 448:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgDirectDrive + 449:include/lib_AT91SAM7.h **** //* \brief Enable direct drive on PIO + 450:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 451:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgDirectDrive( + 452:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 453:include/lib_AT91SAM7.h **** unsigned int directDrive) // \arg PIO to be configured with direct drive + 454:include/lib_AT91SAM7.h **** + 455:include/lib_AT91SAM7.h **** { + 456:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 457:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = ~directDrive; + 458:include/lib_AT91SAM7.h **** pPio->PIO_OWER = directDrive; + 459:include/lib_AT91SAM7.h **** } + 460:include/lib_AT91SAM7.h **** + 461:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 462:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_CfgInputFilter + 463:include/lib_AT91SAM7.h **** //* \brief Enable input filter on input PIO + 464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 465:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_CfgInputFilter( + 466:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 467:include/lib_AT91SAM7.h **** unsigned int inputFilter) // \arg PIO to be configured with input filter + 468:include/lib_AT91SAM7.h **** + 469:include/lib_AT91SAM7.h **** { + 470:include/lib_AT91SAM7.h **** // Configure the Direct Drive + 471:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = ~inputFilter; + 472:include/lib_AT91SAM7.h **** pPio->PIO_IFER = inputFilter; + 473:include/lib_AT91SAM7.h **** } + 474:include/lib_AT91SAM7.h **** + 475:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 476:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInput + 477:include/lib_AT91SAM7.h **** //* \brief Return PIO input value + 478:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 479:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInput( // \return PIO input + 480:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 481:include/lib_AT91SAM7.h **** { + 482:include/lib_AT91SAM7.h **** return pPio->PIO_PDSR; + 483:include/lib_AT91SAM7.h **** } + 484:include/lib_AT91SAM7.h **** + 485:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 486:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputSet + 487:include/lib_AT91SAM7.h **** //* \brief Test if PIO is input flag is active + 488:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 489:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputSet( + 490:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 491:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 492:include/lib_AT91SAM7.h **** { + 493:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInput(pPio) & flag); + 494:include/lib_AT91SAM7.h **** } + 495:include/lib_AT91SAM7.h **** + 496:include/lib_AT91SAM7.h **** + 497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 498:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_SetOutput + 499:include/lib_AT91SAM7.h **** //* \brief Set to 1 output PIO + 500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 501:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_SetOutput( + 502:include/lib_AT91SAM7.h **** const AT91PS_PIO pPio, // \arg pointer to a PIO controller + 503:include/lib_AT91SAM7.h **** const unsigned int flag) // \arg output to be set + 504:include/lib_AT91SAM7.h **** { + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 506:include/lib_AT91SAM7.h **** } + 507:include/lib_AT91SAM7.h **** + 508:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 509:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ClearOutput + 510:include/lib_AT91SAM7.h **** //* \brief Set to 0 output PIO + 511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 512:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ClearOutput( + 513:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 514:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be cleared + 515:include/lib_AT91SAM7.h **** { + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 517:include/lib_AT91SAM7.h **** } + 518:include/lib_AT91SAM7.h **** + 519:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 520:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_ForceOutput + 521:include/lib_AT91SAM7.h **** //* \brief Force output when Direct drive option is enabled + 522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 523:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_ForceOutput( + 524:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 525:include/lib_AT91SAM7.h **** unsigned int flag) // \arg output to be forced + 526:include/lib_AT91SAM7.h **** { + 527:include/lib_AT91SAM7.h **** pPio->PIO_ODSR = flag; + 528:include/lib_AT91SAM7.h **** } + 529:include/lib_AT91SAM7.h **** + 530:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 531:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Enable + 532:include/lib_AT91SAM7.h **** //* \brief Enable PIO + 533:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 534:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Enable( + 535:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 536:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 537:include/lib_AT91SAM7.h **** { + 538:include/lib_AT91SAM7.h **** pPio->PIO_PER = flag; + 539:include/lib_AT91SAM7.h **** } + 540:include/lib_AT91SAM7.h **** + 541:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 542:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Disable + 543:include/lib_AT91SAM7.h **** //* \brief Disable PIO + 544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 545:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_Disable( + 546:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 547:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 548:include/lib_AT91SAM7.h **** { + 549:include/lib_AT91SAM7.h **** pPio->PIO_PDR = flag; + 550:include/lib_AT91SAM7.h **** } + 551:include/lib_AT91SAM7.h **** + 552:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 553:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetStatus + 554:include/lib_AT91SAM7.h **** //* \brief Return PIO Status + 555:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 556:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status + 557:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 558:include/lib_AT91SAM7.h **** { + 559:include/lib_AT91SAM7.h **** return pPio->PIO_PSR; + 560:include/lib_AT91SAM7.h **** } + 561:include/lib_AT91SAM7.h **** + 562:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 563:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsSet + 564:include/lib_AT91SAM7.h **** //* \brief Test if PIO is Set + 565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 566:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsSet( + 567:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 568:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 569:include/lib_AT91SAM7.h **** { + 570:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetStatus(pPio) & flag); + 571:include/lib_AT91SAM7.h **** } + 572:include/lib_AT91SAM7.h **** + 573:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 574:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputEnable + 575:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 576:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 577:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputEnable( + 578:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 579:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be enabled + 580:include/lib_AT91SAM7.h **** { + 581:include/lib_AT91SAM7.h **** pPio->PIO_OER = flag; + 582:include/lib_AT91SAM7.h **** } + 583:include/lib_AT91SAM7.h **** + 584:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 585:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputDisable + 586:include/lib_AT91SAM7.h **** //* \brief Output Enable PIO + 587:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 588:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputDisable( + 589:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 590:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output to be disabled + 591:include/lib_AT91SAM7.h **** { + 592:include/lib_AT91SAM7.h **** pPio->PIO_ODR = flag; + 593:include/lib_AT91SAM7.h **** } + 594:include/lib_AT91SAM7.h **** + 595:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 596:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputStatus + 597:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Status + 598:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 599:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status + 600:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 601:include/lib_AT91SAM7.h **** { + 602:include/lib_AT91SAM7.h **** return pPio->PIO_OSR; + 603:include/lib_AT91SAM7.h **** } + 604:include/lib_AT91SAM7.h **** + 605:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 606:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOuputSet + 607:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output is Set + 608:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 609:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputSet( + 610:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 611:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 612:include/lib_AT91SAM7.h **** { + 613:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputStatus(pPio) & flag); + 614:include/lib_AT91SAM7.h **** } + 615:include/lib_AT91SAM7.h **** + 616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 617:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterEnable + 618:include/lib_AT91SAM7.h **** //* \brief Input Filter Enable PIO + 619:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 620:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterEnable( + 621:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 622:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be enabled + 623:include/lib_AT91SAM7.h **** { + 624:include/lib_AT91SAM7.h **** pPio->PIO_IFER = flag; + 625:include/lib_AT91SAM7.h **** } + 626:include/lib_AT91SAM7.h **** + 627:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 628:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InputFilterDisable + 629:include/lib_AT91SAM7.h **** //* \brief Input Filter Disable PIO + 630:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 631:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InputFilterDisable( + 632:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 633:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio input filter to be disabled + 634:include/lib_AT91SAM7.h **** { + 635:include/lib_AT91SAM7.h **** pPio->PIO_IFDR = flag; + 636:include/lib_AT91SAM7.h **** } + 637:include/lib_AT91SAM7.h **** + 638:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 639:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInputFilterStatus + 640:include/lib_AT91SAM7.h **** //* \brief Return PIO Input Filter Status + 641:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 642:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status + 643:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 644:include/lib_AT91SAM7.h **** { + 645:include/lib_AT91SAM7.h **** return pPio->PIO_IFSR; + 646:include/lib_AT91SAM7.h **** } + 647:include/lib_AT91SAM7.h **** + 648:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 649:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInputFilterSet + 650:include/lib_AT91SAM7.h **** //* \brief Test if PIO Input filter is Set + 651:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 652:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInputFilterSet( + 653:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 654:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 655:include/lib_AT91SAM7.h **** { + 656:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); + 657:include/lib_AT91SAM7.h **** } + 658:include/lib_AT91SAM7.h **** + 659:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 660:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputDataStatus + 661:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Data Status + 662:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 663:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status + 664:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 665:include/lib_AT91SAM7.h **** { + 666:include/lib_AT91SAM7.h **** return pPio->PIO_ODSR; + 667:include/lib_AT91SAM7.h **** } + 668:include/lib_AT91SAM7.h **** + 669:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 670:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptEnable + 671:include/lib_AT91SAM7.h **** //* \brief Enable PIO Interrupt + 672:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 673:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptEnable( + 674:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 675:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be enabled + 676:include/lib_AT91SAM7.h **** { + 677:include/lib_AT91SAM7.h **** pPio->PIO_IER = flag; + 678:include/lib_AT91SAM7.h **** } + 679:include/lib_AT91SAM7.h **** + 680:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 681:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_InterruptDisable + 682:include/lib_AT91SAM7.h **** //* \brief Disable PIO Interrupt + 683:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 684:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_InterruptDisable( + 685:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 686:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio interrupt to be disabled + 687:include/lib_AT91SAM7.h **** { + 688:include/lib_AT91SAM7.h **** pPio->PIO_IDR = flag; + 689:include/lib_AT91SAM7.h **** } + 690:include/lib_AT91SAM7.h **** + 691:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 692:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptMaskStatus + 693:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Mask Status + 694:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 695:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status + 696:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 697:include/lib_AT91SAM7.h **** { + 698:include/lib_AT91SAM7.h **** return pPio->PIO_IMR; + 699:include/lib_AT91SAM7.h **** } + 700:include/lib_AT91SAM7.h **** + 701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 702:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetInterruptStatus + 703:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 704:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 705:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status + 706:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 707:include/lib_AT91SAM7.h **** { + 708:include/lib_AT91SAM7.h **** return pPio->PIO_ISR; + 709:include/lib_AT91SAM7.h **** } + 710:include/lib_AT91SAM7.h **** + 711:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 712:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptMasked + 713:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Masked + 714:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 715:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptMasked( + 716:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 717:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 718:include/lib_AT91SAM7.h **** { + 719:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); + 720:include/lib_AT91SAM7.h **** } + 721:include/lib_AT91SAM7.h **** + 722:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 723:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsInterruptSet + 724:include/lib_AT91SAM7.h **** //* \brief Test if PIO Interrupt is Set + 725:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 726:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsInterruptSet( + 727:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 728:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 729:include/lib_AT91SAM7.h **** { + 730:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetInterruptStatus(pPio) & flag); + 731:include/lib_AT91SAM7.h **** } + 732:include/lib_AT91SAM7.h **** + 733:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 734:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverEnable + 735:include/lib_AT91SAM7.h **** //* \brief Multi Driver Enable PIO + 736:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 737:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverEnable( + 738:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 739:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be enabled + 740:include/lib_AT91SAM7.h **** { + 741:include/lib_AT91SAM7.h **** pPio->PIO_MDER = flag; + 742:include/lib_AT91SAM7.h **** } + 743:include/lib_AT91SAM7.h **** + 744:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 745:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_MultiDriverDisable + 746:include/lib_AT91SAM7.h **** //* \brief Multi Driver Disable PIO + 747:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 748:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_MultiDriverDisable( + 749:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 750:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio to be disabled + 751:include/lib_AT91SAM7.h **** { + 752:include/lib_AT91SAM7.h **** pPio->PIO_MDDR = flag; + 753:include/lib_AT91SAM7.h **** } + 754:include/lib_AT91SAM7.h **** + 755:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 756:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetMultiDriverStatus + 757:include/lib_AT91SAM7.h **** //* \brief Return PIO Multi Driver Status + 758:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 759:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status + 760:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 761:include/lib_AT91SAM7.h **** { + 762:include/lib_AT91SAM7.h **** return pPio->PIO_MDSR; + 763:include/lib_AT91SAM7.h **** } + 764:include/lib_AT91SAM7.h **** + 765:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 766:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsMultiDriverSet + 767:include/lib_AT91SAM7.h **** //* \brief Test if PIO MultiDriver is Set + 768:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 769:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsMultiDriverSet( + 770:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 771:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 772:include/lib_AT91SAM7.h **** { + 773:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); + 774:include/lib_AT91SAM7.h **** } + 775:include/lib_AT91SAM7.h **** + 776:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 777:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_A_RegisterSelection + 778:include/lib_AT91SAM7.h **** //* \brief PIO A Register Selection + 779:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 780:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_A_RegisterSelection( + 781:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 782:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio A register selection + 783:include/lib_AT91SAM7.h **** { + 784:include/lib_AT91SAM7.h **** pPio->PIO_ASR = flag; + 785:include/lib_AT91SAM7.h **** } + 786:include/lib_AT91SAM7.h **** + 787:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 788:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_B_RegisterSelection + 789:include/lib_AT91SAM7.h **** //* \brief PIO B Register Selection + 790:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 791:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_B_RegisterSelection( + 792:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 793:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio B register selection + 794:include/lib_AT91SAM7.h **** { + 795:include/lib_AT91SAM7.h **** pPio->PIO_BSR = flag; + 796:include/lib_AT91SAM7.h **** } + 797:include/lib_AT91SAM7.h **** + 798:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 799:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_Get_AB_RegisterStatus + 800:include/lib_AT91SAM7.h **** //* \brief Return PIO Interrupt Status + 801:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 802:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status + 803:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 804:include/lib_AT91SAM7.h **** { + 805:include/lib_AT91SAM7.h **** return pPio->PIO_ABSR; + 806:include/lib_AT91SAM7.h **** } + 807:include/lib_AT91SAM7.h **** + 808:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 809:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsAB_RegisterSet + 810:include/lib_AT91SAM7.h **** //* \brief Test if PIO AB Register is Set + 811:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 812:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsAB_RegisterSet( + 813:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 814:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 815:include/lib_AT91SAM7.h **** { + 816:include/lib_AT91SAM7.h **** return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); + 817:include/lib_AT91SAM7.h **** } + 818:include/lib_AT91SAM7.h **** + 819:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 820:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteEnable + 821:include/lib_AT91SAM7.h **** //* \brief Output Write Enable PIO + 822:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 823:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteEnable( + 824:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 825:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be enabled + 826:include/lib_AT91SAM7.h **** { + 827:include/lib_AT91SAM7.h **** pPio->PIO_OWER = flag; + 828:include/lib_AT91SAM7.h **** } + 829:include/lib_AT91SAM7.h **** + 830:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 831:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_OutputWriteDisable + 832:include/lib_AT91SAM7.h **** //* \brief Output Write Disable PIO + 833:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 834:include/lib_AT91SAM7.h **** static inline void AT91F_PIO_OutputWriteDisable( + 835:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 836:include/lib_AT91SAM7.h **** unsigned int flag) // \arg pio output write to be disabled + 837:include/lib_AT91SAM7.h **** { + 838:include/lib_AT91SAM7.h **** pPio->PIO_OWDR = flag; + 839:include/lib_AT91SAM7.h **** } + 840:include/lib_AT91SAM7.h **** + 841:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 842:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetOutputWriteStatus + 843:include/lib_AT91SAM7.h **** //* \brief Return PIO Output Write Status + 844:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 845:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status + 846:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 847:include/lib_AT91SAM7.h **** { + 848:include/lib_AT91SAM7.h **** return pPio->PIO_OWSR; + 849:include/lib_AT91SAM7.h **** } + 850:include/lib_AT91SAM7.h **** + 851:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 852:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputWriteSet + 853:include/lib_AT91SAM7.h **** //* \brief Test if PIO OutputWrite is Set + 854:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 855:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputWriteSet( + 856:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 857:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 858:include/lib_AT91SAM7.h **** { + 859:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); + 860:include/lib_AT91SAM7.h **** } + 861:include/lib_AT91SAM7.h **** + 862:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 863:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_GetCfgPullup + 864:include/lib_AT91SAM7.h **** //* \brief Return PIO Configuration Pullup + 865:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 866:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup + 867:include/lib_AT91SAM7.h **** AT91PS_PIO pPio) // \arg pointer to a PIO controller + 868:include/lib_AT91SAM7.h **** { + 869:include/lib_AT91SAM7.h **** return pPio->PIO_PPUSR; + 870:include/lib_AT91SAM7.h **** } + 871:include/lib_AT91SAM7.h **** + 872:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 873:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsOutputDataStatusSet + 874:include/lib_AT91SAM7.h **** //* \brief Test if PIO Output Data Status is Set + 875:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 876:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsOutputDataStatusSet( + 877:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 878:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 879:include/lib_AT91SAM7.h **** { + 880:include/lib_AT91SAM7.h **** return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); + 881:include/lib_AT91SAM7.h **** } + 882:include/lib_AT91SAM7.h **** + 883:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 884:include/lib_AT91SAM7.h **** //* \fn AT91F_PIO_IsCfgPullupStatusSet + 885:include/lib_AT91SAM7.h **** //* \brief Test if PIO Configuration Pullup Status is Set + 886:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 887:include/lib_AT91SAM7.h **** static inline int AT91F_PIO_IsCfgPullupStatusSet( + 888:include/lib_AT91SAM7.h **** AT91PS_PIO pPio, // \arg pointer to a PIO controller + 889:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested + 890:include/lib_AT91SAM7.h **** { + 891:include/lib_AT91SAM7.h **** return (~AT91F_PIO_GetCfgPullup(pPio) & flag); + 892:include/lib_AT91SAM7.h **** } + 893:include/lib_AT91SAM7.h **** + 894:include/lib_AT91SAM7.h **** /* ***************************************************************************** + 895:include/lib_AT91SAM7.h **** SOFTWARE API FOR PMC + 896:include/lib_AT91SAM7.h **** ***************************************************************************** */ + 897:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 898:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkEnableReg + 899:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Enable Register of the PMC controller + 900:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 901:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkEnableReg ( + 902:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 903:include/lib_AT91SAM7.h **** unsigned int mode) + 904:include/lib_AT91SAM7.h **** { + 905:include/lib_AT91SAM7.h **** //* Write to the SCER register + 906:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = mode; + 907:include/lib_AT91SAM7.h **** } + 908:include/lib_AT91SAM7.h **** + 909:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 910:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgSysClkDisableReg + 911:include/lib_AT91SAM7.h **** //* \brief Configure the System Clock Disable Register of the PMC controller + 912:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 913:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgSysClkDisableReg ( + 914:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 915:include/lib_AT91SAM7.h **** unsigned int mode) + 916:include/lib_AT91SAM7.h **** { + 917:include/lib_AT91SAM7.h **** //* Write to the SCDR register + 918:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = mode; + 919:include/lib_AT91SAM7.h **** } + 920:include/lib_AT91SAM7.h **** + 921:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 922:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetSysClkStatusReg + 923:include/lib_AT91SAM7.h **** //* \brief Return the System Clock Status Register of the PMC controller + 924:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 925:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetSysClkStatusReg ( + 926:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC // pointer to a CAN controller + 927:include/lib_AT91SAM7.h **** ) + 928:include/lib_AT91SAM7.h **** { + 929:include/lib_AT91SAM7.h **** return pPMC->PMC_SCSR; + 930:include/lib_AT91SAM7.h **** } + 931:include/lib_AT91SAM7.h **** + 932:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 933:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePeriphClock + 934:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock + 935:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 936:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePeriphClock ( + 937:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 938:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 939:include/lib_AT91SAM7.h **** { + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 941:include/lib_AT91SAM7.h **** } + 942:include/lib_AT91SAM7.h **** + 943:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 944:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePeriphClock + 945:include/lib_AT91SAM7.h **** //* \brief Disable peripheral clock + 946:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 947:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePeriphClock ( + 948:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller + 949:include/lib_AT91SAM7.h **** unsigned int periphIds) // \arg IDs of peripherals to enable + 950:include/lib_AT91SAM7.h **** { + 951:include/lib_AT91SAM7.h **** pPMC->PMC_PCDR = periphIds; + 952:include/lib_AT91SAM7.h **** } + 953:include/lib_AT91SAM7.h **** + 954:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 955:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetPeriphClock + 956:include/lib_AT91SAM7.h **** //* \brief Get peripheral clock status + 957:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 958:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetPeriphClock ( + 959:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller + 960:include/lib_AT91SAM7.h **** { + 961:include/lib_AT91SAM7.h **** return pPMC->PMC_PCSR; + 962:include/lib_AT91SAM7.h **** } + 963:include/lib_AT91SAM7.h **** + 964:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 965:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscillatorReg + 966:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 967:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 968:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscillatorReg ( + 969:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller + 970:include/lib_AT91SAM7.h **** unsigned int mode) + 971:include/lib_AT91SAM7.h **** { + 972:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR = mode; + 973:include/lib_AT91SAM7.h **** } + 974:include/lib_AT91SAM7.h **** + 975:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 976:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainOscillatorReg + 977:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator + 978:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 979:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( + 980:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 981:include/lib_AT91SAM7.h **** { + 982:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MOR; + 983:include/lib_AT91SAM7.h **** } + 984:include/lib_AT91SAM7.h **** + 985:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 986:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_EnableMainOscillator + 987:include/lib_AT91SAM7.h **** //* \brief Enable the main oscillator + 988:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 989:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_EnableMainOscillator( + 990:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller + 991:include/lib_AT91SAM7.h **** { + 992:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; + 993:include/lib_AT91SAM7.h **** } + 994:include/lib_AT91SAM7.h **** + 995:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 996:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_DisableMainOscillator + 997:include/lib_AT91SAM7.h **** //* \brief Disable the main oscillator + 998:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- + 999:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_DisableMainOscillator ( +1000:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1001:include/lib_AT91SAM7.h **** { +1002:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +1003:include/lib_AT91SAM7.h **** } +1004:include/lib_AT91SAM7.h **** +1005:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1006:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_CfgMainOscStartUpTime +1007:include/lib_AT91SAM7.h **** //* \brief Cfg MOR Register according to the main osc startup time +1008:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1009:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgMainOscStartUpTime ( +1010:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1011:include/lib_AT91SAM7.h **** unsigned int startup_time, // \arg main osc startup time in microsecond (us) +1012:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1013:include/lib_AT91SAM7.h **** { +1014:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +1015:include/lib_AT91SAM7.h **** pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +1016:include/lib_AT91SAM7.h **** } +1017:include/lib_AT91SAM7.h **** +1018:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1019:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClockFreqReg +1020:include/lib_AT91SAM7.h **** //* \brief Cfg the main oscillator +1021:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1022:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +1023:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1024:include/lib_AT91SAM7.h **** { +1025:include/lib_AT91SAM7.h **** return pCKGR->CKGR_MCFR; +1026:include/lib_AT91SAM7.h **** } +1027:include/lib_AT91SAM7.h **** +1028:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1029:include/lib_AT91SAM7.h **** //* \fn AT91F_CKGR_GetMainClock +1030:include/lib_AT91SAM7.h **** //* \brief Return Main clock in Hz +1031:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1032:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetMainClock ( +1033:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1034:include/lib_AT91SAM7.h **** unsigned int slowClock) // \arg slowClock in Hz +1035:include/lib_AT91SAM7.h **** { +1036:include/lib_AT91SAM7.h **** return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +1037:include/lib_AT91SAM7.h **** } +1038:include/lib_AT91SAM7.h **** +1039:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1040:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_CfgMCKReg +1041:include/lib_AT91SAM7.h **** //* \brief Cfg Master Clock Register +1042:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1043:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_CfgMCKReg ( +1044:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1045:include/lib_AT91SAM7.h **** unsigned int mode) +1046:include/lib_AT91SAM7.h **** { +1047:include/lib_AT91SAM7.h **** pPMC->PMC_MCKR = mode; +1048:include/lib_AT91SAM7.h **** } +1049:include/lib_AT91SAM7.h **** +1050:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1051:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMCKReg +1052:include/lib_AT91SAM7.h **** //* \brief Return Master Clock Register +1053:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1054:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetMCKReg( +1055:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // \arg pointer to PMC controller +1056:include/lib_AT91SAM7.h **** { +1057:include/lib_AT91SAM7.h **** return pPMC->PMC_MCKR; +1058:include/lib_AT91SAM7.h **** } +1059:include/lib_AT91SAM7.h **** +1060:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1061:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetMasterClock +1062:include/lib_AT91SAM7.h **** //* \brief Return master clock in Hz which correponds to processor clock for ARM7 +1063:include/lib_AT91SAM7.h **** //*------------------------------------------------------------------------------ +1064:include/lib_AT91SAM7.h **** extern unsigned int AT91F_PMC_GetMasterClock ( +1065:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1066:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1067:include/lib_AT91SAM7.h **** unsigned int slowClock); // \arg slowClock in Hz +1068:include/lib_AT91SAM7.h **** +1069:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1070:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnablePCK +1071:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1072:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1073:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnablePCK ( +1074:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1075:include/lib_AT91SAM7.h **** unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +1076:include/lib_AT91SAM7.h **** unsigned int mode) +1077:include/lib_AT91SAM7.h **** { +1078:include/lib_AT91SAM7.h **** pPMC->PMC_PCKR[pck] = mode; +1079:include/lib_AT91SAM7.h **** pPMC->PMC_SCER = (1 << pck) << 8; +1080:include/lib_AT91SAM7.h **** } +1081:include/lib_AT91SAM7.h **** +1082:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1083:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisablePCK +1084:include/lib_AT91SAM7.h **** //* \brief Enable peripheral clock +1085:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1086:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisablePCK ( +1087:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to PMC controller +1088:include/lib_AT91SAM7.h **** unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +1089:include/lib_AT91SAM7.h **** { +1090:include/lib_AT91SAM7.h **** pPMC->PMC_SCDR = (1 << pck) << 8; +1091:include/lib_AT91SAM7.h **** } +1092:include/lib_AT91SAM7.h **** +1093:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1094:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_EnableIt +1095:include/lib_AT91SAM7.h **** //* \brief Enable PMC interrupt +1096:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1097:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_EnableIt ( +1098:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1099:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1100:include/lib_AT91SAM7.h **** { +1101:include/lib_AT91SAM7.h **** //* Write to the IER register +1102:include/lib_AT91SAM7.h **** pPMC->PMC_IER = flag; +1103:include/lib_AT91SAM7.h **** } +1104:include/lib_AT91SAM7.h **** +1105:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1106:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_DisableIt +1107:include/lib_AT91SAM7.h **** //* \brief Disable PMC interrupt +1108:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1109:include/lib_AT91SAM7.h **** static inline void AT91F_PMC_DisableIt ( +1110:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // pointer to a PMC controller +1111:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1112:include/lib_AT91SAM7.h **** { +1113:include/lib_AT91SAM7.h **** //* Write to the IDR register +1114:include/lib_AT91SAM7.h **** pPMC->PMC_IDR = flag; +1115:include/lib_AT91SAM7.h **** } +1116:include/lib_AT91SAM7.h **** +1117:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1118:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetStatus +1119:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Status +1120:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1121:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +1122:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1123:include/lib_AT91SAM7.h **** { +1124:include/lib_AT91SAM7.h **** return pPMC->PMC_SR; +1125:include/lib_AT91SAM7.h **** } +1126:include/lib_AT91SAM7.h **** +1127:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1128:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_GetInterruptMaskStatus +1129:include/lib_AT91SAM7.h **** //* \brief Return PMC Interrupt Mask Status +1130:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1131:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +1132:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC) // pointer to a PMC controller +1133:include/lib_AT91SAM7.h **** { +1134:include/lib_AT91SAM7.h **** return pPMC->PMC_IMR; +1135:include/lib_AT91SAM7.h **** } +1136:include/lib_AT91SAM7.h **** +1137:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1138:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsInterruptMasked +1139:include/lib_AT91SAM7.h **** //* \brief Test if PMC Interrupt is Masked +1140:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1141:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsInterruptMasked( +1142:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1143:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1144:include/lib_AT91SAM7.h **** { +1145:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +1146:include/lib_AT91SAM7.h **** } +1147:include/lib_AT91SAM7.h **** +1148:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1149:include/lib_AT91SAM7.h **** //* \fn AT91F_PMC_IsStatusSet +1150:include/lib_AT91SAM7.h **** //* \brief Test if PMC Status is Set +1151:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1152:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PMC_IsStatusSet( +1153:include/lib_AT91SAM7.h **** AT91PS_PMC pPMC, // \arg pointer to a PMC controller +1154:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1155:include/lib_AT91SAM7.h **** { +1156:include/lib_AT91SAM7.h **** return (AT91F_PMC_GetStatus(pPMC) & flag); +1157:include/lib_AT91SAM7.h **** } +1158:include/lib_AT91SAM7.h **** +1159:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1160:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_CfgPLLReg +1161:include/lib_AT91SAM7.h **** // \brief Cfg the PLL Register +1162:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1163:include/lib_AT91SAM7.h **** static inline void AT91F_CKGR_CfgPLLReg ( +1164:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +1165:include/lib_AT91SAM7.h **** unsigned int mode) +1166:include/lib_AT91SAM7.h **** { +1167:include/lib_AT91SAM7.h **** pCKGR->CKGR_PLLR = mode; +1168:include/lib_AT91SAM7.h **** } +1169:include/lib_AT91SAM7.h **** +1170:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1171:include/lib_AT91SAM7.h **** // \fn AT91F_CKGR_GetPLLReg +1172:include/lib_AT91SAM7.h **** // \brief Get the PLL Register +1173:include/lib_AT91SAM7.h **** // ---------------------------------------------------------------------------- +1174:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_CKGR_GetPLLReg ( +1175:include/lib_AT91SAM7.h **** AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +1176:include/lib_AT91SAM7.h **** { +1177:include/lib_AT91SAM7.h **** return pCKGR->CKGR_PLLR; +1178:include/lib_AT91SAM7.h **** } +1179:include/lib_AT91SAM7.h **** +1180:include/lib_AT91SAM7.h **** +1181:include/lib_AT91SAM7.h **** +1182:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1183:include/lib_AT91SAM7.h **** SOFTWARE API FOR RSTC +1184:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1185:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1186:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSoftReset +1187:include/lib_AT91SAM7.h **** //* \brief Start Software Reset +1188:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1189:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSoftReset( +1190:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1191:include/lib_AT91SAM7.h **** unsigned int reset) +1192:include/lib_AT91SAM7.h **** { +1193:include/lib_AT91SAM7.h **** pRSTC->RSTC_RCR = (0xA5000000 | reset); +1194:include/lib_AT91SAM7.h **** } +1195:include/lib_AT91SAM7.h **** +1196:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1197:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTSetMode +1198:include/lib_AT91SAM7.h **** //* \brief Set Reset Mode +1199:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1200:include/lib_AT91SAM7.h **** static inline void AT91F_RSTSetMode( +1201:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC, +1202:include/lib_AT91SAM7.h **** unsigned int mode) +1203:include/lib_AT91SAM7.h **** { +1204:include/lib_AT91SAM7.h **** pRSTC->RSTC_RMR = (0xA5000000 | mode); +1205:include/lib_AT91SAM7.h **** } +1206:include/lib_AT91SAM7.h **** +1207:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1208:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetMode +1209:include/lib_AT91SAM7.h **** //* \brief Get Reset Mode +1210:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1211:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetMode( +1212:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1213:include/lib_AT91SAM7.h **** { +1214:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RMR); +1215:include/lib_AT91SAM7.h **** } +1216:include/lib_AT91SAM7.h **** +1217:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1218:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTGetStatus +1219:include/lib_AT91SAM7.h **** //* \brief Get Reset Status +1220:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1221:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTGetStatus( +1222:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1223:include/lib_AT91SAM7.h **** { +1224:include/lib_AT91SAM7.h **** return (pRSTC->RSTC_RSR); +1225:include/lib_AT91SAM7.h **** } +1226:include/lib_AT91SAM7.h **** +1227:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1228:include/lib_AT91SAM7.h **** //* \fn AT91F_RSTIsSoftRstActive +1229:include/lib_AT91SAM7.h **** //* \brief Return !=0 if software reset is still not completed +1230:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1231:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RSTIsSoftRstActive( +1232:include/lib_AT91SAM7.h **** AT91PS_RSTC pRSTC) +1233:include/lib_AT91SAM7.h **** { +1234:include/lib_AT91SAM7.h **** return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +1235:include/lib_AT91SAM7.h **** } +1236:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1237:include/lib_AT91SAM7.h **** SOFTWARE API FOR RTTC +1238:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1239:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1240:include/lib_AT91SAM7.h **** //* \fn AT91F_SetRTT_TimeBase() +1241:include/lib_AT91SAM7.h **** //* \brief Set the RTT prescaler according to the TimeBase in ms +1242:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1243:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetTimeBase( +1244:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1245:include/lib_AT91SAM7.h **** unsigned int ms) +1246:include/lib_AT91SAM7.h **** { +1247:include/lib_AT91SAM7.h **** if (ms > 2000) +1248:include/lib_AT91SAM7.h **** return 1; // AT91C_TIME_OUT_OF_RANGE +1249:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1250:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +1251:include/lib_AT91SAM7.h **** return 0; +1252:include/lib_AT91SAM7.h **** } +1253:include/lib_AT91SAM7.h **** +1254:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1255:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTSetPrescaler() +1256:include/lib_AT91SAM7.h **** //* \brief Set the new prescaler value +1257:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1258:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTSetPrescaler( +1259:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, +1260:include/lib_AT91SAM7.h **** unsigned int rtpres) +1261:include/lib_AT91SAM7.h **** { +1262:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~0xFFFF; +1263:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +1264:include/lib_AT91SAM7.h **** return (pRTTC->RTTC_RTMR); +1265:include/lib_AT91SAM7.h **** } +1266:include/lib_AT91SAM7.h **** +1267:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1268:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTRestart() +1269:include/lib_AT91SAM7.h **** //* \brief Restart the RTT prescaler +1270:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1271:include/lib_AT91SAM7.h **** static inline void AT91F_RTTRestart( +1272:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1273:include/lib_AT91SAM7.h **** { +1274:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +1275:include/lib_AT91SAM7.h **** } +1276:include/lib_AT91SAM7.h **** +1277:include/lib_AT91SAM7.h **** +1278:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1279:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmINT() +1280:include/lib_AT91SAM7.h **** //* \brief Enable RTT Alarm Interrupt +1281:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1282:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmINT( +1283:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1284:include/lib_AT91SAM7.h **** { +1285:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +1286:include/lib_AT91SAM7.h **** } +1287:include/lib_AT91SAM7.h **** +1288:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1289:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearAlarmINT() +1290:include/lib_AT91SAM7.h **** //* \brief Disable RTT Alarm Interrupt +1291:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1292:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearAlarmINT( +1293:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1294:include/lib_AT91SAM7.h **** { +1295:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +1296:include/lib_AT91SAM7.h **** } +1297:include/lib_AT91SAM7.h **** +1298:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1299:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetRttIncINT() +1300:include/lib_AT91SAM7.h **** //* \brief Enable RTT INC Interrupt +1301:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1302:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetRttIncINT( +1303:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1304:include/lib_AT91SAM7.h **** { +1305:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +1306:include/lib_AT91SAM7.h **** } +1307:include/lib_AT91SAM7.h **** +1308:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1309:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ClearRttIncINT() +1310:include/lib_AT91SAM7.h **** //* \brief Disable RTT INC Interrupt +1311:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1312:include/lib_AT91SAM7.h **** static inline void AT91F_RTTClearRttIncINT( +1313:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1314:include/lib_AT91SAM7.h **** { +1315:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +1316:include/lib_AT91SAM7.h **** } +1317:include/lib_AT91SAM7.h **** +1318:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1319:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_SetAlarmValue() +1320:include/lib_AT91SAM7.h **** //* \brief Set RTT Alarm Value +1321:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1322:include/lib_AT91SAM7.h **** static inline void AT91F_RTTSetAlarmValue( +1323:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC, unsigned int _alarm) +1324:include/lib_AT91SAM7.h **** { +1325:include/lib_AT91SAM7.h **** pRTTC->RTTC_RTAR = _alarm; +1326:include/lib_AT91SAM7.h **** } +1327:include/lib_AT91SAM7.h **** +1328:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1329:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_GetAlarmValue() +1330:include/lib_AT91SAM7.h **** //* \brief Get RTT Alarm Value +1331:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1332:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetAlarmValue( +1333:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1334:include/lib_AT91SAM7.h **** { +1335:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTAR); +1336:include/lib_AT91SAM7.h **** } +1337:include/lib_AT91SAM7.h **** +1338:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1339:include/lib_AT91SAM7.h **** //* \fn AT91F_RTTGetStatus() +1340:include/lib_AT91SAM7.h **** //* \brief Read the RTT status +1341:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1342:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_RTTGetStatus( +1343:include/lib_AT91SAM7.h **** AT91PS_RTTC pRTTC) +1344:include/lib_AT91SAM7.h **** { +1345:include/lib_AT91SAM7.h **** return(pRTTC->RTTC_RTSR); +1346:include/lib_AT91SAM7.h **** } +1347:include/lib_AT91SAM7.h **** +1348:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1349:include/lib_AT91SAM7.h **** //* \fn AT91F_RTT_ReadValue() +1350:include/lib_AT91SAM7.h **** //* \brief Read the RTT value +1351:include/lib_AT91SAM7.h **** //*-------------------------------------------------------------------------------------- +1352:include/lib_AT91SAM7.h **** extern unsigned int AT91F_RTTReadValue(AT91PS_RTTC pRTTC); +1353:include/lib_AT91SAM7.h **** +1354:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1355:include/lib_AT91SAM7.h **** SOFTWARE API FOR PITC +1356:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1357:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1358:include/lib_AT91SAM7.h **** //* \fn AT91F_PITInit +1359:include/lib_AT91SAM7.h **** //* \brief System timer init : period in ‘second, system clock freq in MHz +1360:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1361:include/lib_AT91SAM7.h **** static inline void AT91F_PITInit( +1362:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1363:include/lib_AT91SAM7.h **** unsigned int period, +1364:include/lib_AT91SAM7.h **** unsigned int pit_frequency) +1365:include/lib_AT91SAM7.h **** { +1366:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +1367:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +1368:include/lib_AT91SAM7.h **** } +1369:include/lib_AT91SAM7.h **** +1370:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1371:include/lib_AT91SAM7.h **** //* \fn AT91F_PITSetPIV +1372:include/lib_AT91SAM7.h **** //* \brief Set the PIT Periodic Interval Value +1373:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1374:include/lib_AT91SAM7.h **** static inline void AT91F_PITSetPIV( +1375:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC, +1376:include/lib_AT91SAM7.h **** unsigned int piv) +1377:include/lib_AT91SAM7.h **** { +1378:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +1379:include/lib_AT91SAM7.h **** } +1380:include/lib_AT91SAM7.h **** +1381:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1382:include/lib_AT91SAM7.h **** //* \fn AT91F_PITEnableInt +1383:include/lib_AT91SAM7.h **** //* \brief Enable PIT periodic interrupt +1384:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1385:include/lib_AT91SAM7.h **** static inline void AT91F_PITEnableInt( +1386:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1387:include/lib_AT91SAM7.h **** { +1388:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +1389:include/lib_AT91SAM7.h **** } +1390:include/lib_AT91SAM7.h **** +1391:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1392:include/lib_AT91SAM7.h **** //* \fn AT91F_PITDisableInt +1393:include/lib_AT91SAM7.h **** //* \brief Disable PIT periodic interrupt +1394:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1395:include/lib_AT91SAM7.h **** static inline void AT91F_PITDisableInt( +1396:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1397:include/lib_AT91SAM7.h **** { +1398:include/lib_AT91SAM7.h **** pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +1399:include/lib_AT91SAM7.h **** } +1400:include/lib_AT91SAM7.h **** +1401:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1402:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetMode +1403:include/lib_AT91SAM7.h **** //* \brief Read PIT mode register +1404:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1405:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetMode( +1406:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1407:include/lib_AT91SAM7.h **** { +1408:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIMR); +1409:include/lib_AT91SAM7.h **** } +1410:include/lib_AT91SAM7.h **** +1411:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1412:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetStatus +1413:include/lib_AT91SAM7.h **** //* \brief Read PIT status register +1414:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1415:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetStatus( +1416:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1417:include/lib_AT91SAM7.h **** { +1418:include/lib_AT91SAM7.h **** return(pPITC->PITC_PISR); +1419:include/lib_AT91SAM7.h **** } +1420:include/lib_AT91SAM7.h **** +1421:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1422:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIIR +1423:include/lib_AT91SAM7.h **** //* \brief Read PIT CPIV and PICNT without ressetting the counters +1424:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1425:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIIR( +1426:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1427:include/lib_AT91SAM7.h **** { +1428:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIIR); +1429:include/lib_AT91SAM7.h **** } +1430:include/lib_AT91SAM7.h **** +1431:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1432:include/lib_AT91SAM7.h **** //* \fn AT91F_PITGetPIVR +1433:include/lib_AT91SAM7.h **** //* \brief Read System timer CPIV and PICNT without ressetting the counters +1434:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1435:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_PITGetPIVR( +1436:include/lib_AT91SAM7.h **** AT91PS_PITC pPITC) +1437:include/lib_AT91SAM7.h **** { +1438:include/lib_AT91SAM7.h **** return(pPITC->PITC_PIVR); +1439:include/lib_AT91SAM7.h **** } +1440:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1441:include/lib_AT91SAM7.h **** SOFTWARE API FOR WDTC +1442:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1443:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1444:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSetMode +1445:include/lib_AT91SAM7.h **** //* \brief Set Watchdog Mode Register +1446:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1447:include/lib_AT91SAM7.h **** static inline void AT91F_WDTSetMode( +1448:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC, +1449:include/lib_AT91SAM7.h **** unsigned int Mode) +1450:include/lib_AT91SAM7.h **** { +1451:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDMR = Mode; +1452:include/lib_AT91SAM7.h **** } +1453:include/lib_AT91SAM7.h **** +1454:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1455:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTRestart +1456:include/lib_AT91SAM7.h **** //* \brief Restart Watchdog +1457:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1458:include/lib_AT91SAM7.h **** static inline void AT91F_WDTRestart( +1459:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1460:include/lib_AT91SAM7.h **** { +1461:include/lib_AT91SAM7.h **** pWDTC->WDTC_WDCR = 0xA5000001; +1462:include/lib_AT91SAM7.h **** } +1463:include/lib_AT91SAM7.h **** +1464:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1465:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTSGettatus +1466:include/lib_AT91SAM7.h **** //* \brief Get Watchdog Status +1467:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1468:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTSGettatus( +1469:include/lib_AT91SAM7.h **** AT91PS_WDTC pWDTC) +1470:include/lib_AT91SAM7.h **** { +1471:include/lib_AT91SAM7.h **** return(pWDTC->WDTC_WDSR & 0x3); +1472:include/lib_AT91SAM7.h **** } +1473:include/lib_AT91SAM7.h **** +1474:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1475:include/lib_AT91SAM7.h **** //* \fn AT91F_WDTGetPeriod +1476:include/lib_AT91SAM7.h **** //* \brief Translate ms into Watchdog Compatible value +1477:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1478:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +1479:include/lib_AT91SAM7.h **** { +1480:include/lib_AT91SAM7.h **** if ((ms < 4) || (ms > 16000)) +1481:include/lib_AT91SAM7.h **** return 0; +1482:include/lib_AT91SAM7.h **** return((ms << 8) / 1000); +1483:include/lib_AT91SAM7.h **** } +1484:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1485:include/lib_AT91SAM7.h **** SOFTWARE API FOR VREG +1486:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1487:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1488:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Enable_LowPowerMode +1489:include/lib_AT91SAM7.h **** //* \brief Enable VREG Low Power Mode +1490:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1491:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Enable_LowPowerMode( +1492:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1493:include/lib_AT91SAM7.h **** { +1494:include/lib_AT91SAM7.h **** pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +1495:include/lib_AT91SAM7.h **** } +1496:include/lib_AT91SAM7.h **** +1497:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1498:include/lib_AT91SAM7.h **** //* \fn AT91F_VREG_Disable_LowPowerMode +1499:include/lib_AT91SAM7.h **** //* \brief Disable VREG Low Power Mode +1500:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1501:include/lib_AT91SAM7.h **** static inline void AT91F_VREG_Disable_LowPowerMode( +1502:include/lib_AT91SAM7.h **** AT91PS_VREG pVREG) +1503:include/lib_AT91SAM7.h **** { +1504:include/lib_AT91SAM7.h **** pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +1505:include/lib_AT91SAM7.h **** }/* ***************************************************************************** +1506:include/lib_AT91SAM7.h **** SOFTWARE API FOR MC +1507:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1508:include/lib_AT91SAM7.h **** +1509:include/lib_AT91SAM7.h **** #define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +1510:include/lib_AT91SAM7.h **** +1511:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1512:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_Remap +1513:include/lib_AT91SAM7.h **** //* \brief Make Remap +1514:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1515:include/lib_AT91SAM7.h **** static inline void AT91F_MC_Remap (void) // +1516:include/lib_AT91SAM7.h **** { +1517:include/lib_AT91SAM7.h **** AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +1518:include/lib_AT91SAM7.h **** +1519:include/lib_AT91SAM7.h **** pMC->MC_RCR = AT91C_MC_RCB; +1520:include/lib_AT91SAM7.h **** } +1521:include/lib_AT91SAM7.h **** +1522:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1523:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_CfgModeReg +1524:include/lib_AT91SAM7.h **** //* \brief Configure the EFC Mode Register of the MC controller +1525:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1526:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_CfgModeReg ( +1527:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1528:include/lib_AT91SAM7.h **** unsigned int mode) // mode register +1529:include/lib_AT91SAM7.h **** { +1530:include/lib_AT91SAM7.h **** // Write to the FMR register +1531:include/lib_AT91SAM7.h **** pMC->MC_FMR = mode; +1532:include/lib_AT91SAM7.h **** } +1533:include/lib_AT91SAM7.h **** +1534:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1535:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetModeReg +1536:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1537:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1538:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetModeReg( +1539:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1540:include/lib_AT91SAM7.h **** { +1541:include/lib_AT91SAM7.h **** return pMC->MC_FMR; +1542:include/lib_AT91SAM7.h **** } +1543:include/lib_AT91SAM7.h **** +1544:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1545:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_ComputeFMCN +1546:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Mode Regsiter +1547:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1548:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_ComputeFMCN( +1549:include/lib_AT91SAM7.h **** int master_clock) // master clock in Hz +1550:include/lib_AT91SAM7.h **** { +1551:include/lib_AT91SAM7.h **** return (master_clock/1000000 +2); +1552:include/lib_AT91SAM7.h **** } +1553:include/lib_AT91SAM7.h **** +1554:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1555:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_PerformCmd +1556:include/lib_AT91SAM7.h **** //* \brief Perform EFC Command +1557:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1558:include/lib_AT91SAM7.h **** static inline void AT91F_MC_EFC_PerformCmd ( +1559:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // pointer to a MC controller +1560:include/lib_AT91SAM7.h **** unsigned int transfer_cmd) +1561:include/lib_AT91SAM7.h **** { +1562:include/lib_AT91SAM7.h **** pMC->MC_FCR = transfer_cmd; +1563:include/lib_AT91SAM7.h **** } +1564:include/lib_AT91SAM7.h **** +1565:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1566:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_GetStatus +1567:include/lib_AT91SAM7.h **** //* \brief Return MC EFC Status +1568:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1569:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_GetStatus( +1570:include/lib_AT91SAM7.h **** AT91PS_MC pMC) // pointer to a MC controller +1571:include/lib_AT91SAM7.h **** { +1572:include/lib_AT91SAM7.h **** return pMC->MC_FSR; +1573:include/lib_AT91SAM7.h **** } +1574:include/lib_AT91SAM7.h **** +1575:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1576:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptMasked +1577:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Masked +1578:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1579:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +1580:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1581:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1582:include/lib_AT91SAM7.h **** { +1583:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +1584:include/lib_AT91SAM7.h **** } +1585:include/lib_AT91SAM7.h **** +1586:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1587:include/lib_AT91SAM7.h **** //* \fn AT91F_MC_EFC_IsInterruptSet +1588:include/lib_AT91SAM7.h **** //* \brief Test if EFC MC Interrupt is Set +1589:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1590:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_MC_EFC_IsInterruptSet( +1591:include/lib_AT91SAM7.h **** AT91PS_MC pMC, // \arg pointer to a MC controller +1592:include/lib_AT91SAM7.h **** unsigned int flag) // \arg flag to be tested +1593:include/lib_AT91SAM7.h **** { +1594:include/lib_AT91SAM7.h **** return (AT91F_MC_EFC_GetStatus(pMC) & flag); +1595:include/lib_AT91SAM7.h **** } +1596:include/lib_AT91SAM7.h **** +1597:include/lib_AT91SAM7.h **** /* ***************************************************************************** +1598:include/lib_AT91SAM7.h **** SOFTWARE API FOR SPI +1599:include/lib_AT91SAM7.h **** ***************************************************************************** */ +1600:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1601:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgCs +1602:include/lib_AT91SAM7.h **** //* \brief Configure SPI chip select register +1603:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1604:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgCs ( +1605:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1606:include/lib_AT91SAM7.h **** int cs, // SPI cs number (0 to 3) +1607:include/lib_AT91SAM7.h **** int val) // chip select register +1608:include/lib_AT91SAM7.h **** { +1609:include/lib_AT91SAM7.h **** //* Write to the CSR register +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; +1611:include/lib_AT91SAM7.h **** } +1612:include/lib_AT91SAM7.h **** +1613:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1614:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_EnableIt +1615:include/lib_AT91SAM7.h **** //* \brief Enable SPI interrupt +1616:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1617:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_EnableIt ( +1618:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1619:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be enabled +1620:include/lib_AT91SAM7.h **** { +1621:include/lib_AT91SAM7.h **** //* Write to the IER register +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; +1623:include/lib_AT91SAM7.h **** } +1624:include/lib_AT91SAM7.h **** +1625:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1626:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_DisableIt +1627:include/lib_AT91SAM7.h **** //* \brief Disable SPI interrupt +1628:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1629:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_DisableIt ( +1630:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1631:include/lib_AT91SAM7.h **** unsigned int flag) // IT to be disabled +1632:include/lib_AT91SAM7.h **** { +1633:include/lib_AT91SAM7.h **** //* Write to the IDR register +1634:include/lib_AT91SAM7.h **** pSPI->SPI_IDR = flag; +1635:include/lib_AT91SAM7.h **** } +1636:include/lib_AT91SAM7.h **** +1637:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1638:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Reset +1639:include/lib_AT91SAM7.h **** //* \brief Reset the SPI controller +1640:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1641:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Reset ( +1642:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1643:include/lib_AT91SAM7.h **** ) +1644:include/lib_AT91SAM7.h **** { +1645:include/lib_AT91SAM7.h **** //* Write to the CR register +1646:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SWRST; +1647:include/lib_AT91SAM7.h **** } +1648:include/lib_AT91SAM7.h **** +1649:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1650:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Enable +1651:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1652:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1653:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Enable ( +1654:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1655:include/lib_AT91SAM7.h **** ) +1656:include/lib_AT91SAM7.h **** { +1657:include/lib_AT91SAM7.h **** //* Write to the CR register +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; +1659:include/lib_AT91SAM7.h **** } +1660:include/lib_AT91SAM7.h **** +1661:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1662:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_Disable +1663:include/lib_AT91SAM7.h **** //* \brief Disable the SPI controller +1664:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1665:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_Disable ( +1666:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI // pointer to a SPI controller +1667:include/lib_AT91SAM7.h **** ) +1668:include/lib_AT91SAM7.h **** { +1669:include/lib_AT91SAM7.h **** //* Write to the CR register +1670:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIDIS; +1671:include/lib_AT91SAM7.h **** } +1672:include/lib_AT91SAM7.h **** +1673:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1674:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgMode +1675:include/lib_AT91SAM7.h **** //* \brief Enable the SPI controller +1676:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1677:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgMode ( +1678:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1679:include/lib_AT91SAM7.h **** int mode) // mode register +1680:include/lib_AT91SAM7.h **** { +1681:include/lib_AT91SAM7.h **** //* Write to the MR register +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; +1683:include/lib_AT91SAM7.h **** } +1684:include/lib_AT91SAM7.h **** +1685:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1686:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_CfgPCS +1687:include/lib_AT91SAM7.h **** //* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +1688:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1689:include/lib_AT91SAM7.h **** static inline void AT91F_SPI_CfgPCS ( +1690:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, // pointer to a SPI controller +1691:include/lib_AT91SAM7.h **** char PCS_Device) // PCS of the Device +1692:include/lib_AT91SAM7.h **** { +1693:include/lib_AT91SAM7.h **** //* Write to the MR register +1694:include/lib_AT91SAM7.h **** pSPI->SPI_MR &= 0xFFF0FFFF; +1695:include/lib_AT91SAM7.h **** pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +1696:include/lib_AT91SAM7.h **** } +1697:include/lib_AT91SAM7.h **** +1698:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1699:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_ReceiveFrame +1700:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1701:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1702:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_ReceiveFrame ( +1703:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1704:include/lib_AT91SAM7.h **** unsigned char *pBuffer, +1705:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1706:include/lib_AT91SAM7.h **** unsigned char *pNextBuffer, +1707:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1708:include/lib_AT91SAM7.h **** { +1709:include/lib_AT91SAM7.h **** return AT91F_PDC_ReceiveFrame( + 123 .loc 2 1709 0 + 124 006c 0060A0E3 mov r6, #0 + 125 .LBE95: + 126 .LBE93: + 127 .LBB97: + 128 .LBB90: + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 129 .loc 2 83 0 + 130 0070 02E1A0E3 mov lr, #-2147483648 + 131 0074 25E08CE5 str lr, [ip, #37] + 132 .LBE90: + 133 .LBE97: + 134 .LBB98: + 135 .LBB94: + 136 .loc 2 1709 0 + 137 0078 70109FE5 ldr r1, .L13 + 138 .LVL7: + 139 .LBE94: + 140 .LBE98: + 141 .LBB99: + 142 .LBB92: + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 143 .loc 2 85 0 + 144 007c 29E08CE5 str lr, [ip, #41] + 145 .LVL8: + 146 .LBE92: + 147 .LBE99: + 148 .LBB100: + 149 .LBB96: + 150 .loc 2 1709 0 + 151 0080 0420A0E1 mov r2, r4 + 152 0084 0630A0E1 mov r3, r6 + 153 0088 64009FE5 ldr r0, .L13+4 + 154 008c 00608DE5 str r6, [sp, #0] + 155 0090 FEFFFFEB bl AT91F_PDC_ReceiveFrame + 156 .LVL9: + 157 .LBE96: + 158 .LBE100: + 159 .LBB101: + 160 .LBB102: +1710:include/lib_AT91SAM7.h **** (AT91PS_PDC) &(pSPI->SPI_RPR), +1711:include/lib_AT91SAM7.h **** pBuffer, +1712:include/lib_AT91SAM7.h **** szBuffer, +1713:include/lib_AT91SAM7.h **** pNextBuffer, +1714:include/lib_AT91SAM7.h **** szNextBuffer); +1715:include/lib_AT91SAM7.h **** } +1716:include/lib_AT91SAM7.h **** +1717:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1718:include/lib_AT91SAM7.h **** //* \fn AT91F_SPI_SendFrame +1719:include/lib_AT91SAM7.h **** //* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been init +1720:include/lib_AT91SAM7.h **** //*---------------------------------------------------------------------------- +1721:include/lib_AT91SAM7.h **** static inline unsigned int AT91F_SPI_SendFrame( +1722:include/lib_AT91SAM7.h **** AT91PS_SPI pSPI, +1723:include/lib_AT91SAM7.h **** const unsigned char *pBuffer, +1724:include/lib_AT91SAM7.h **** unsigned int szBuffer, +1725:include/lib_AT91SAM7.h **** const unsigned char *pNextBuffer, +1726:include/lib_AT91SAM7.h **** unsigned int szNextBuffer ) +1727:include/lib_AT91SAM7.h **** { +1728:include/lib_AT91SAM7.h **** return AT91F_PDC_SendFrame( + 161 .loc 2 1728 0 + 162 0094 0710A0E1 mov r1, r7 + 163 0098 0420A0E1 mov r2, r4 + 164 009c 0630A0E1 mov r3, r6 + 165 00a0 4C009FE5 ldr r0, .L13+4 + 166 00a4 00608DE5 str r6, [sp, #0] + 167 00a8 FEFFFFEB bl AT91F_PDC_SendFrame + 168 .LVL10: + 169 .LBE102: + 170 .LBE101: + 171 .LBB103: + 172 .LBB105: + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 173 .loc 2 235 0 + 174 00ac 44C09FE5 ldr ip, .L13+8 + 175 .LBE105: + 176 .LBE103: + 116:src/pcd/rc632.c **** pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + 177 .loc 1 116 0 + 178 00b0 44209FE5 ldr r2, .L13+12 + 179 .LBB107: + 180 .LBB104: + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 181 .loc 2 235 0 + 182 00b4 0130A0E3 mov r3, #1 + 183 .LBE104: + 184 .LBE107: + 185 .LBB108: + 186 .LBB109: + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 187 .loc 2 225 0 + 188 00b8 011CA0E3 mov r1, #256 + 189 .LBE109: + 190 .LBE108: + 116:src/pcd/rc632.c **** pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + 191 .loc 1 116 0 + 192 00bc 3000A0E3 mov r0, #48 + 193 .LBB111: + 194 .LBB106: + 235:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_RXTEN; + 195 .loc 2 235 0 + 196 00c0 DF300CE5 str r3, [ip, #-223] + 197 .LVL11: + 198 .LBE106: + 199 .LBE111: + 200 .LBB112: + 201 .LBB110: + 225:include/lib_AT91SAM7.h **** pPDC->PDC_PTCR = AT91C_PDC_TXTEN; + 202 .loc 2 225 0 + 203 00c4 DF100CE5 str r1, [ip, #-223] + 204 .LBE110: + 205 .LBE112: + 116:src/pcd/rc632.c **** pSPI->SPI_IER = AT91C_SPI_ENDTX|AT91C_SPI_ENDRX; + 206 .loc 1 116 0 + 207 00c8 EB0002E5 str r0, [r2, #-235] + 208 .L8: + 119:src/pcd/rc632.c **** while (! (pSPI->SPI_SR & AT91C_SPI_ENDRX)) ; + 209 .loc 1 119 0 + 210 00cc EF0012E5 ldr r0, [r2, #-239] + 211 00d0 100010E3 tst r0, #16 + 212 00d4 FCFFFF0A beq .L8 + 213 .LVL12: + 214 .LBB113: + 215 .LBB114: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 216 .loc 2 70 0 + 217 00d8 0221A0E3 mov r2, #-2147483648 + 218 00dc 0F1CE0E3 mvn r1, #3840 + 219 00e0 212081E5 str r2, [r1, #33] + 220 .LBE114: + 221 .LBE113: + 128:src/pcd/rc632.c **** return 0; + 222 .loc 1 128 0 + 223 00e4 0000A0E3 mov r0, #0 + 126:src/pcd/rc632.c **** *rx_len = tx_len; + 224 .loc 1 126 0 + 225 00e8 B040C5E1 strh r4, [r5, #0] @ movhi + 226 00ec DAFFFFEA b .L7 + 227 .L14: + 228 .align 2 + 229 .L13: + 230 00f0 00000000 .word .LANCHOR0 + 231 00f4 0001FEFF .word -130816 + 232 00f8 FF01FEFF .word -130561 + 233 00fc FF00FEFF .word -130817 + 234 .cfi_endproc + 235 .LFE296: + 237 .align 2 + 238 .global opcd_rc632_reg_write + 240 opcd_rc632_reg_write: + 241 .LFB280: + 130:src/pcd/rc632.c **** #else + 131:src/pcd/rc632.c **** /* stupid polling transceiver routine */ + 132:src/pcd/rc632.c **** static int spi_transceive(const u_int8_t *tx_data, u_int16_t tx_len, + 133:src/pcd/rc632.c **** u_int8_t *rx_data, u_int16_t *rx_len) + 134:src/pcd/rc632.c **** { + 135:src/pcd/rc632.c **** u_int16_t tx_cur = 0; + 136:src/pcd/rc632.c **** u_int16_t rx_len_max = 0; + 137:src/pcd/rc632.c **** u_int16_t rx_cnt = 0; + 138:src/pcd/rc632.c **** + 139:src/pcd/rc632.c **** /* disable RC632 interrupt because it wants to do SPI transactions */ + 140:src/pcd/rc632.c **** AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 141:src/pcd/rc632.c **** + 142:src/pcd/rc632.c **** DEBUGPSPI("spi_transceive: enter(tx_len=%u) ", tx_len); + 143:src/pcd/rc632.c **** + 144:src/pcd/rc632.c **** if (rx_len) { + 145:src/pcd/rc632.c **** rx_len_max = *rx_len; + 146:src/pcd/rc632.c **** *rx_len = 0; + 147:src/pcd/rc632.c **** } + 148:src/pcd/rc632.c **** + 149:src/pcd/rc632.c **** //AT91F_SPI_Enable(pSPI); + 150:src/pcd/rc632.c **** while (1) { + 151:src/pcd/rc632.c **** u_int32_t sr = pSPI->SPI_SR; + 152:src/pcd/rc632.c **** u_int8_t tmp; + 153:src/pcd/rc632.c **** if (sr & AT91C_SPI_RDRF) { + 154:src/pcd/rc632.c **** tmp = pSPI->SPI_RDR; + 155:src/pcd/rc632.c **** rx_cnt++; + 156:src/pcd/rc632.c **** if (rx_len && *rx_len < rx_len_max) + 157:src/pcd/rc632.c **** rx_data[(*rx_len)++] = tmp; + 158:src/pcd/rc632.c **** } + 159:src/pcd/rc632.c **** if (sr & AT91C_SPI_TDRE) { + 160:src/pcd/rc632.c **** if (tx_len > tx_cur) + 161:src/pcd/rc632.c **** pSPI->SPI_TDR = tx_data[tx_cur++]; + 162:src/pcd/rc632.c **** } + 163:src/pcd/rc632.c **** if (tx_cur >= tx_len && rx_cnt >= tx_len) + 164:src/pcd/rc632.c **** break; + 165:src/pcd/rc632.c **** } + 166:src/pcd/rc632.c **** //AT91F_SPI_Disable(pSPI); + 167:src/pcd/rc632.c **** if (rx_data) + 168:src/pcd/rc632.c **** DEBUGPSPI("leave(%02x %02x)\r\n", rx_data[0], rx_data[1]); + 169:src/pcd/rc632.c **** else + 170:src/pcd/rc632.c **** DEBUGPSPI("leave()\r\n"); + 171:src/pcd/rc632.c **** + 172:src/pcd/rc632.c **** /* Re-enable RC632 interrupts */ + 173:src/pcd/rc632.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 174:src/pcd/rc632.c **** + 175:src/pcd/rc632.c **** return 0; + 176:src/pcd/rc632.c **** } + 177:src/pcd/rc632.c **** #endif + 178:src/pcd/rc632.c **** + 179:src/pcd/rc632.c **** /* RC632 driver */ + 180:src/pcd/rc632.c **** + 181:src/pcd/rc632.c **** /* static buffers used by RC632 access primitives below. + 182:src/pcd/rc632.c **** * Since we only have one */ + 183:src/pcd/rc632.c **** + 184:src/pcd/rc632.c **** static u_int8_t spi_outbuf[SPI_MAX_XFER_LEN]; + 185:src/pcd/rc632.c **** static u_int8_t spi_inbuf[SPI_MAX_XFER_LEN]; + 186:src/pcd/rc632.c **** + 187:src/pcd/rc632.c **** #define FIFO_ADDR (RC632_REG_FIFO_DATA << 1) + 188:src/pcd/rc632.c **** + 189:src/pcd/rc632.c **** #define RC632_WRITE_ADDR(x) ((x << 1) & 0x7e) + 190:src/pcd/rc632.c **** + 191:src/pcd/rc632.c **** /* RC632 access primitives */ + 192:src/pcd/rc632.c **** + 193:src/pcd/rc632.c **** int opcd_rc632_reg_write(struct rfid_asic_handle *hdl, + 194:src/pcd/rc632.c **** u_int8_t addr, u_int8_t data) + 195:src/pcd/rc632.c **** { + 242 .loc 1 195 0 + 243 .cfi_startproc + 244 @ Function supports interworking. + 245 @ args = 0, pretend = 0, frame = 8 + 246 @ frame_needed = 0, uses_anonymous_args = 0 + 247 .LVL13: + 248 0100 10402DE9 stmfd sp!, {r4, lr} + 249 .LCFI2: + 250 .cfi_def_cfa_offset 8 + 251 0104 08D04DE2 sub sp, sp, #8 + 252 .LCFI3: + 253 .cfi_def_cfa_offset 16 + 196:src/pcd/rc632.c **** u_int16_t rx_len = 2; + 254 .loc 1 196 0 + 255 0108 02E0A0E3 mov lr, #2 + 256 .cfi_offset 14, -4 + 257 .cfi_offset 4, -8 + 258 010c 08C08DE2 add ip, sp, #8 + 197:src/pcd/rc632.c **** + 198:src/pcd/rc632.c **** DEBUG632("[0x%02x] <= 0x%02x", addr, data); + 199:src/pcd/rc632.c **** + 200:src/pcd/rc632.c **** addr = RC632_WRITE_ADDR(addr); + 201:src/pcd/rc632.c **** + 202:src/pcd/rc632.c **** spi_outbuf[0] = addr; + 259 .loc 1 202 0 + 260 0110 2C309FE5 ldr r3, .L16 + 196:src/pcd/rc632.c **** u_int16_t rx_len = 2; + 261 .loc 1 196 0 + 262 0114 B2E06CE1 strh lr, [ip, #-2]! @ movhi + 263 .LVL14: + 200:src/pcd/rc632.c **** addr = RC632_WRITE_ADDR(addr); + 264 .loc 1 200 0 + 265 0118 8110A0E1 mov r1, r1, asl #1 + 266 .LVL15: + 267 011c 7E4001E2 and r4, r1, #126 + 203:src/pcd/rc632.c **** spi_outbuf[1] = data; + 268 .loc 1 203 0 + 269 0120 4520C3E5 strb r2, [r3, #69] + 204:src/pcd/rc632.c **** + 205:src/pcd/rc632.c **** return spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 270 .loc 1 205 0 + 271 0124 440083E2 add r0, r3, #68 + 272 .LVL16: + 273 0128 0E10A0E1 mov r1, lr + 274 012c 0C20A0E1 mov r2, ip + 275 .LVL17: + 202:src/pcd/rc632.c **** spi_outbuf[0] = addr; + 276 .loc 1 202 0 + 277 0130 4440C3E5 strb r4, [r3, #68] + 278 .loc 1 205 0 + 279 0134 BFFFFFEB bl spi_transceive.clone.1 + 280 .LVL18: + 206:src/pcd/rc632.c **** } + 281 .loc 1 206 0 + 282 0138 08D08DE2 add sp, sp, #8 + 283 013c 1040BDE8 ldmfd sp!, {r4, lr} + 284 0140 1EFF2FE1 bx lr + 285 .L17: + 286 .align 2 + 287 .L16: + 288 0144 00000000 .word .LANCHOR0 + 289 .cfi_endproc + 290 .LFE280: + 292 .align 2 + 293 .global opcd_rc632_reg_write_set + 295 opcd_rc632_reg_write_set: + 296 .LFB281: + 207:src/pcd/rc632.c **** + 208:src/pcd/rc632.c **** #define RC632_REGSET_START 0x10 + 209:src/pcd/rc632.c **** #define RC632_REGSET_END 0x3f + 210:src/pcd/rc632.c **** #define RC632_REGSET_MAXSIZE (RC632_REGSET_END-RC632_REGSET_START) + 211:src/pcd/rc632.c **** static u_int8_t regset_buf[RC632_REGSET_MAXSIZE * 2]; + 212:src/pcd/rc632.c **** + 213:src/pcd/rc632.c **** int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + 214:src/pcd/rc632.c **** u_int8_t *regs, int len) + 215:src/pcd/rc632.c **** { + 297 .loc 1 215 0 + 298 .cfi_startproc + 299 @ Function supports interworking. + 300 @ args = 0, pretend = 0, frame = 8 + 301 @ frame_needed = 0, uses_anonymous_args = 0 + 302 .LVL19: + 303 0148 10402DE9 stmfd sp!, {r4, lr} + 304 .LCFI4: + 305 .cfi_def_cfa_offset 8 + 216:src/pcd/rc632.c **** u_int8_t i, j = 0; + 217:src/pcd/rc632.c **** u_int16_t rx_len; + 218:src/pcd/rc632.c **** + 219:src/pcd/rc632.c **** if (len > RC632_REGSET_MAXSIZE) + 306 .loc 1 219 0 + 307 014c 2F0052E3 cmp r2, #47 + 215:src/pcd/rc632.c **** { + 308 .loc 1 215 0 + 309 0150 08D04DE2 sub sp, sp, #8 + 310 .LCFI5: + 311 .cfi_def_cfa_offset 16 + 220:src/pcd/rc632.c **** return -E2BIG; + 312 .loc 1 220 0 + 313 0154 0600E0C3 mvngt r0, #6 + 314 .LVL20: + 219:src/pcd/rc632.c **** if (len > RC632_REGSET_MAXSIZE) + 315 .loc 1 219 0 + 316 0158 1D0000CA bgt .L19 + 317 .cfi_offset 14, -4 + 318 .cfi_offset 4, -8 + 319 015c 0000A0E3 mov r0, #0 + 320 0160 01C0A0E1 mov ip, r1 + 321 0164 1030A0E3 mov r3, #16 + 322 0168 0010A0E1 mov r1, r0 + 323 .LVL21: + 221:src/pcd/rc632.c **** + 222:src/pcd/rc632.c **** for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + 223:src/pcd/rc632.c **** /* skip bank registers */ + 224:src/pcd/rc632.c **** if (i % 8 == 0) + 225:src/pcd/rc632.c **** continue; + 226:src/pcd/rc632.c **** regset_buf[j++] = RC632_WRITE_ADDR(i); + 324 .loc 1 226 0 + 325 016c 6CE09FE5 ldr lr, .L24 + 326 0170 0F0000EA b .L20 + 327 .LVL22: + 328 .L22: + 224:src/pcd/rc632.c **** if (i % 8 == 0) + 329 .loc 1 224 0 + 330 0174 070012E3 tst r2, #7 + 331 0178 0B00000A beq .L21 + 213:src/pcd/rc632.c **** int opcd_rc632_reg_write_set(struct rfid_asic_handle *hdl, + 332 .loc 1 213 0 + 333 017c 112080E2 add r2, r0, #17 + 334 .loc 1 226 0 + 335 0180 8240A0E1 mov r4, r2, asl #1 + 336 0184 7E4004E2 and r4, r4, #126 + 337 0188 01208EE0 add r2, lr, r1 + 338 018c 8840C2E5 strb r4, [r2, #136] + 339 0190 014081E2 add r4, r1, #1 + 340 0194 FF1004E2 and r1, r4, #255 + 341 .LVL23: + 227:src/pcd/rc632.c **** regset_buf[j++] = regs[i - RC632_REGSET_START]; + 342 .loc 1 227 0 + 343 0198 0140DCE5 ldrb r4, [ip, #1] @ zero_extendqisi2 + 344 019c 01208EE0 add r2, lr, r1 + 345 01a0 8840C2E5 strb r4, [r2, #136] + 346 01a4 011081E2 add r1, r1, #1 + 347 .LVL24: + 348 01a8 FF1001E2 and r1, r1, #255 + 349 .LVL25: + 350 .L21: + 351 01ac 010080E2 add r0, r0, #1 + 352 01b0 01C08CE2 add ip, ip, #1 + 353 .LVL26: + 354 .L20: + 222:src/pcd/rc632.c **** for (i = RC632_REGSET_START; i <= RC632_REGSET_END; i++) { + 355 .loc 1 222 0 + 356 01b4 012083E2 add r2, r3, #1 + 357 01b8 FF3002E2 and r3, r2, #255 + 358 .LVL27: + 359 01bc 400053E3 cmp r3, #64 + 360 01c0 EBFFFF1A bne .L22 + 228:src/pcd/rc632.c **** } + 229:src/pcd/rc632.c **** + 230:src/pcd/rc632.c **** rx_len = j; + 361 .loc 1 230 0 + 362 01c4 08208DE2 add r2, sp, #8 + 363 01c8 B21062E1 strh r1, [r2, #-2]! @ movhi + 364 .LVL28: + 231:src/pcd/rc632.c **** return spi_transceive(regset_buf, j, spi_inbuf, &rx_len); + 365 .loc 1 231 0 + 366 01cc 10009FE5 ldr r0, .L24+4 + 367 01d0 98FFFFEB bl spi_transceive.clone.1 + 368 .LVL29: + 369 .L19: + 232:src/pcd/rc632.c **** } + 370 .loc 1 232 0 + 371 01d4 08D08DE2 add sp, sp, #8 + 372 01d8 1040BDE8 ldmfd sp!, {r4, lr} + 373 01dc 1EFF2FE1 bx lr + 374 .L25: + 375 .align 2 + 376 .L24: + 377 01e0 00000000 .word .LANCHOR0 + 378 01e4 88000000 .word .LANCHOR0+136 + 379 .cfi_endproc + 380 .LFE281: + 382 .align 2 + 383 .global opcd_rc632_fifo_write + 385 opcd_rc632_fifo_write: + 386 .LFB282: + 233:src/pcd/rc632.c **** + 234:src/pcd/rc632.c **** int opcd_rc632_fifo_write(struct rfid_asic_handle *hdl, + 235:src/pcd/rc632.c **** u_int8_t len, u_int8_t *data, u_int8_t flags) + 236:src/pcd/rc632.c **** { + 387 .loc 1 236 0 + 388 .cfi_startproc + 389 @ Function supports interworking. + 390 @ args = 0, pretend = 0, frame = 8 + 391 @ frame_needed = 0, uses_anonymous_args = 0 + 392 .LVL30: + 393 01e8 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 394 .LCFI6: + 395 .cfi_def_cfa_offset 16 + 237:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 238:src/pcd/rc632.c **** if (len > sizeof(spi_outbuf)-1) + 239:src/pcd/rc632.c **** len = sizeof(spi_outbuf)-1; + 240:src/pcd/rc632.c **** + 241:src/pcd/rc632.c **** spi_outbuf[0] = FIFO_ADDR; + 396 .loc 1 241 0 + 397 01ec 50009FE5 ldr r0, .L27 + 398 .LVL31: + 236:src/pcd/rc632.c **** { + 399 .loc 1 236 0 + 400 01f0 08D04DE2 sub sp, sp, #8 + 401 .LCFI7: + 402 .cfi_def_cfa_offset 24 + 237:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 403 .loc 1 237 0 + 404 01f4 400051E3 cmp r1, #64 + 405 01f8 0160A031 movcc r6, r1 + 406 01fc 4060A023 movcs r6, #64 + 407 .cfi_offset 14, -4 + 408 .cfi_offset 6, -8 + 409 .cfi_offset 5, -12 + 410 .cfi_offset 4, -16 + 411 .LVL32: + 412 .loc 1 241 0 + 413 0200 0050A0E1 mov r5, r0 + 237:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 414 .loc 1 237 0 + 415 0204 08408DE2 add r4, sp, #8 + 242:src/pcd/rc632.c **** memcpy(&spi_outbuf[1], data, len); + 416 .loc 1 242 0 + 417 0208 0210A0E1 mov r1, r2 + 241:src/pcd/rc632.c **** spi_outbuf[0] = FIFO_ADDR; + 418 .loc 1 241 0 + 419 020c 0430A0E3 mov r3, #4 + 420 .LVL33: + 237:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 421 .loc 1 237 0 + 422 0210 4120A0E3 mov r2, #65 @ movhi + 423 .LVL34: + 424 0214 B22064E1 strh r2, [r4, #-2]! @ movhi + 425 .LVL35: + 241:src/pcd/rc632.c **** spi_outbuf[0] = FIFO_ADDR; + 426 .loc 1 241 0 + 427 0218 4430E5E5 strb r3, [r5, #68]! + 428 .loc 1 242 0 + 429 021c 0620A0E1 mov r2, r6 + 430 0220 450080E2 add r0, r0, #69 + 431 0224 FEFFFFEB bl memcpy + 432 .LVL36: + 243:src/pcd/rc632.c **** + 244:src/pcd/rc632.c **** DEBUG632("[FIFO] <= %s", hexdump(data, len)); + 245:src/pcd/rc632.c **** + 246:src/pcd/rc632.c **** return spi_transceive(spi_outbuf, len+1, spi_inbuf, &rx_len); + 433 .loc 1 246 0 + 434 0228 0500A0E1 mov r0, r5 + 435 022c 011086E2 add r1, r6, #1 + 436 0230 0420A0E1 mov r2, r4 + 437 0234 7FFFFFEB bl spi_transceive.clone.1 + 247:src/pcd/rc632.c **** } + 438 .loc 1 247 0 + 439 0238 08D08DE2 add sp, sp, #8 + 440 023c 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 441 0240 1EFF2FE1 bx lr + 442 .L28: + 443 .align 2 + 444 .L27: + 445 0244 00000000 .word .LANCHOR0 + 446 .cfi_endproc + 447 .LFE282: + 449 .align 2 + 450 .global opcd_rc632_reg_read + 452 opcd_rc632_reg_read: + 453 .LFB283: + 248:src/pcd/rc632.c **** + 249:src/pcd/rc632.c **** int opcd_rc632_reg_read(struct rfid_asic_handle *hdl, + 250:src/pcd/rc632.c **** u_int8_t addr, u_int8_t *val) + 251:src/pcd/rc632.c **** { + 454 .loc 1 251 0 + 455 .cfi_startproc + 456 @ Function supports interworking. + 457 @ args = 0, pretend = 0, frame = 8 + 458 @ frame_needed = 0, uses_anonymous_args = 0 + 459 .LVL37: + 460 0248 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 461 .LCFI8: + 462 .cfi_def_cfa_offset 16 + 463 024c 08D04DE2 sub sp, sp, #8 + 464 .LCFI9: + 465 .cfi_def_cfa_offset 24 + 252:src/pcd/rc632.c **** u_int16_t rx_len = 2; + 466 .loc 1 252 0 + 467 0250 02E0A0E3 mov lr, #2 + 468 .cfi_offset 14, -4 + 469 .cfi_offset 6, -8 + 470 .cfi_offset 5, -12 + 471 .cfi_offset 4, -16 + 472 0254 08C08DE2 add ip, sp, #8 + 253:src/pcd/rc632.c **** + 254:src/pcd/rc632.c **** addr = (addr << 1) & 0x7e; + 473 .loc 1 254 0 + 474 0258 8150A0E1 mov r5, r1, asl #1 + 475 .LVL38: + 255:src/pcd/rc632.c **** + 256:src/pcd/rc632.c **** spi_outbuf[0] = addr | 0x80; + 476 .loc 1 256 0 + 477 025c 44409FE5 ldr r4, .L30 + 252:src/pcd/rc632.c **** u_int16_t rx_len = 2; + 478 .loc 1 252 0 + 479 0260 B2E06CE1 strh lr, [ip, #-2]! @ movhi + 480 .LVL39: + 254:src/pcd/rc632.c **** addr = (addr << 1) & 0x7e; + 481 .loc 1 254 0 + 482 0264 7E1005E2 and r1, r5, #126 + 483 .loc 1 256 0 + 484 0268 810CE0E1 mvn r0, r1, asl #25 + 485 .LVL40: + 486 026c A03CE0E1 mvn r3, r0, lsr #25 + 251:src/pcd/rc632.c **** { + 487 .loc 1 251 0 + 488 0270 0260A0E1 mov r6, r2 + 257:src/pcd/rc632.c **** spi_outbuf[1] = 0x00; + 489 .loc 1 257 0 + 490 0274 0050A0E3 mov r5, #0 + 258:src/pcd/rc632.c **** + 259:src/pcd/rc632.c **** spi_transceive(spi_outbuf, 2, spi_inbuf, &rx_len); + 491 .loc 1 259 0 + 492 0278 440084E2 add r0, r4, #68 + 493 027c 0E10A0E1 mov r1, lr + 494 0280 0C20A0E1 mov r2, ip + 495 .LVL41: + 256:src/pcd/rc632.c **** spi_outbuf[0] = addr | 0x80; + 496 .loc 1 256 0 + 497 0284 4430C4E5 strb r3, [r4, #68] + 257:src/pcd/rc632.c **** spi_outbuf[1] = 0x00; + 498 .loc 1 257 0 + 499 0288 4550C4E5 strb r5, [r4, #69] + 500 .loc 1 259 0 + 501 028c 69FFFFEB bl spi_transceive.clone.1 + 260:src/pcd/rc632.c **** *val = spi_inbuf[1]; + 502 .loc 1 260 0 + 503 0290 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 261:src/pcd/rc632.c **** + 262:src/pcd/rc632.c **** DEBUG632("[0x%02x] => 0x%02x", addr>>1, *val); + 263:src/pcd/rc632.c **** + 264:src/pcd/rc632.c **** return 0; + 265:src/pcd/rc632.c **** } + 504 .loc 1 265 0 + 505 0294 0500A0E1 mov r0, r5 + 260:src/pcd/rc632.c **** *val = spi_inbuf[1]; + 506 .loc 1 260 0 + 507 0298 0030C6E5 strb r3, [r6, #0] + 508 .loc 1 265 0 + 509 029c 08D08DE2 add sp, sp, #8 + 510 02a0 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 511 02a4 1EFF2FE1 bx lr + 512 .L31: + 513 .align 2 + 514 .L30: + 515 02a8 00000000 .word .LANCHOR0 + 516 .cfi_endproc + 517 .LFE283: + 519 .align 2 + 521 rc632_irq: + 522 .LFB287: + 266:src/pcd/rc632.c **** + 267:src/pcd/rc632.c **** int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 268:src/pcd/rc632.c **** u_int8_t max_len, u_int8_t *data) + 269:src/pcd/rc632.c **** { + 270:src/pcd/rc632.c **** int ret; + 271:src/pcd/rc632.c **** u_int8_t fifo_length; + 272:src/pcd/rc632.c **** u_int8_t i; + 273:src/pcd/rc632.c **** u_int16_t rx_len; + 274:src/pcd/rc632.c **** + 275:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + 276:src/pcd/rc632.c **** if (ret < 0) + 277:src/pcd/rc632.c **** return ret; + 278:src/pcd/rc632.c **** + 279:src/pcd/rc632.c **** rx_len = fifo_length+1; + 280:src/pcd/rc632.c **** + 281:src/pcd/rc632.c **** if (max_len < fifo_length) + 282:src/pcd/rc632.c **** fifo_length = max_len; + 283:src/pcd/rc632.c **** + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 286:src/pcd/rc632.c **** + 287:src/pcd/rc632.c **** spi_outbuf[0] |= 0x80; + 288:src/pcd/rc632.c **** spi_outbuf[fifo_length] = 0x00; + 289:src/pcd/rc632.c **** + 290:src/pcd/rc632.c **** spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 291:src/pcd/rc632.c **** memcpy(data, spi_inbuf+1, rx_len-1); + 292:src/pcd/rc632.c **** + 293:src/pcd/rc632.c **** DEBUG632("[FIFO] => %s", hexdump(data, rx_len-1)); + 294:src/pcd/rc632.c **** + 295:src/pcd/rc632.c **** return rx_len-1; + 296:src/pcd/rc632.c **** } + 297:src/pcd/rc632.c **** + 298:src/pcd/rc632.c **** int opcd_rc632_set_bits(struct rfid_asic_handle *hdl, + 299:src/pcd/rc632.c **** u_int8_t reg, u_int8_t bits) + 300:src/pcd/rc632.c **** { + 301:src/pcd/rc632.c **** u_int8_t val; + 302:src/pcd/rc632.c **** int ret; + 303:src/pcd/rc632.c **** + 304:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 305:src/pcd/rc632.c **** if (ret < 0) + 306:src/pcd/rc632.c **** return ret; + 307:src/pcd/rc632.c **** + 308:src/pcd/rc632.c **** val |= bits; + 309:src/pcd/rc632.c **** + 310:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 311:src/pcd/rc632.c **** } + 312:src/pcd/rc632.c **** + 313:src/pcd/rc632.c **** int opcd_rc632_clear_bits(struct rfid_asic_handle *hdl, + 314:src/pcd/rc632.c **** u_int8_t reg, u_int8_t bits) + 315:src/pcd/rc632.c **** { + 316:src/pcd/rc632.c **** u_int8_t val; + 317:src/pcd/rc632.c **** int ret; + 318:src/pcd/rc632.c **** + 319:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 320:src/pcd/rc632.c **** if (ret < 0) + 321:src/pcd/rc632.c **** return ret; + 322:src/pcd/rc632.c **** + 323:src/pcd/rc632.c **** val &= ~bits; + 324:src/pcd/rc632.c **** + 325:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 326:src/pcd/rc632.c **** } + 327:src/pcd/rc632.c **** + 328:src/pcd/rc632.c **** /* RC632 interrupt handling */ + 329:src/pcd/rc632.c **** + 330:src/pcd/rc632.c **** static void rc632_irq(void) + 331:src/pcd/rc632.c **** { + 523 .loc 1 331 0 + 524 .cfi_startproc + 525 @ Function supports interworking. + 526 @ args = 0, pretend = 0, frame = 8 + 527 @ frame_needed = 0, uses_anonymous_args = 0 + 528 02ac 04E02DE5 str lr, [sp, #-4]! + 529 .LCFI10: + 530 .cfi_def_cfa_offset 4 + 332:src/pcd/rc632.c **** struct req_ctx *irq_rctx; + 333:src/pcd/rc632.c **** struct openpcd_hdr *irq_opcdh; + 334:src/pcd/rc632.c **** u_int8_t cause; + 335:src/pcd/rc632.c **** + 336:src/pcd/rc632.c **** /* CL RC632 has interrupted us */ + 337:src/pcd/rc632.c **** opcd_rc632_reg_read(NULL, RC632_REG_INTERRUPT_RQ, &cause); + 531 .loc 1 337 0 + 532 02b0 0710A0E3 mov r1, #7 + 331:src/pcd/rc632.c **** { + 533 .loc 1 331 0 + 534 02b4 0CD04DE2 sub sp, sp, #12 + 535 .LCFI11: + 536 .cfi_def_cfa_offset 16 + 537 .loc 1 337 0 + 538 02b8 01208DE0 add r2, sp, r1 + 539 02bc 0000A0E3 mov r0, #0 + 540 .cfi_offset 14, -4 + 541 02c0 FEFFFFEB bl opcd_rc632_reg_read + 338:src/pcd/rc632.c **** + 339:src/pcd/rc632.c **** /* ACK all interrupts */ + 340:src/pcd/rc632.c **** //rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, cause); + 341:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_RQ, RC632_INT_TIMER); + 542 .loc 1 341 0 + 543 02c4 0710A0E3 mov r1, #7 + 544 02c8 2020A0E3 mov r2, #32 + 545 02cc 0000A0E3 mov r0, #0 + 546 02d0 FEFFFFEB bl opcd_rc632_reg_write + 342:src/pcd/rc632.c **** DEBUGP("rc632_irq: "); + 343:src/pcd/rc632.c **** + 344:src/pcd/rc632.c **** if (cause & RC632_INT_LOALERT) { + 345:src/pcd/rc632.c **** /* FIFO is getting low, refill from virtual FIFO */ + 346:src/pcd/rc632.c **** DEBUGP("FIFO_low "); + 347:src/pcd/rc632.c **** #if 0 + 348:src/pcd/rc632.c **** if (!fifo_available(&rc632.fifo)) + 349:src/pcd/rc632.c **** return; + 350:src/pcd/rc632.c **** #endif + 351:src/pcd/rc632.c **** /* FIXME */ + 352:src/pcd/rc632.c **** } + 353:src/pcd/rc632.c **** if (cause & RC632_INT_HIALERT) { + 354:src/pcd/rc632.c **** /* FIFO is getting full, empty into virtual FIFO */ + 355:src/pcd/rc632.c **** DEBUGP("FIFO_high "); + 356:src/pcd/rc632.c **** /* FIXME */ + 357:src/pcd/rc632.c **** } + 358:src/pcd/rc632.c **** /* All interrupts below can be reported directly to the host */ + 359:src/pcd/rc632.c **** if (cause & RC632_INT_TIMER) + 360:src/pcd/rc632.c **** DEBUGP("Timer "); + 361:src/pcd/rc632.c **** if (cause & RC632_INT_IDLE) + 362:src/pcd/rc632.c **** DEBUGP("Idle "); + 363:src/pcd/rc632.c **** if (cause & RC632_INT_RX) + 364:src/pcd/rc632.c **** DEBUGP("RxComplete "); + 365:src/pcd/rc632.c **** if (cause & RC632_INT_TX) + 366:src/pcd/rc632.c **** DEBUGP("TxComplete "); + 367:src/pcd/rc632.c **** + 368:src/pcd/rc632.c **** + 369:src/pcd/rc632.c **** irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 547 .loc 1 369 0 + 548 02d4 64309FE5 ldr r3, .L36 + 549 02d8 0000A0E3 mov r0, #0 + 550 02dc FE10A0E3 mov r1, #254 + 551 02e0 0420A0E3 mov r2, #4 + 552 02e4 0FE0A0E1 mov lr, pc + 553 02e8 13FF2FE1 bx r3 + 554 .LVL42: + 370:src/pcd/rc632.c **** RCTX_STATE_RC632IRQ_BUSY); + 371:src/pcd/rc632.c **** if (!irq_rctx) { + 555 .loc 1 371 0 + 556 02ec 003050E2 subs r3, r0, #0 + 557 02f0 0D00000A beq .L35 + 372:src/pcd/rc632.c **** DEBUGPCRF("NO RCTX!"); + 373:src/pcd/rc632.c **** /* disable rc632 interrupt until RCTX is free */ + 374:src/pcd/rc632.c **** AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 375:src/pcd/rc632.c **** return; + 376:src/pcd/rc632.c **** } + 377:src/pcd/rc632.c **** + 378:src/pcd/rc632.c **** irq_opcdh = (struct openpcd_hdr *) irq_rctx->data; + 558 .loc 1 378 0 + 559 02f4 08E093E5 ldr lr, [r3, #8] + 560 .LVL43: + 379:src/pcd/rc632.c **** + 380:src/pcd/rc632.c **** /* initialize static part of openpcd_hdr for USB IRQ reporting */ + 381:src/pcd/rc632.c **** irq_opcdh->cmd = OPENPCD_CMD_IRQ; + 382:src/pcd/rc632.c **** irq_opcdh->flags = 0x00; + 383:src/pcd/rc632.c **** irq_opcdh->reg = 0x07; + 561 .loc 1 383 0 + 562 02f8 0710A0E3 mov r1, #7 + 381:src/pcd/rc632.c **** irq_opcdh->cmd = OPENPCD_CMD_IRQ; + 563 .loc 1 381 0 + 564 02fc 1A20A0E3 mov r2, #26 + 382:src/pcd/rc632.c **** irq_opcdh->flags = 0x00; + 565 .loc 1 382 0 + 566 0300 0030A0E3 mov r3, #0 + 567 .loc 1 383 0 + 568 0304 0210CEE5 strb r1, [lr, #2] + 381:src/pcd/rc632.c **** irq_opcdh->cmd = OPENPCD_CMD_IRQ; + 569 .loc 1 381 0 + 570 0308 0020CEE5 strb r2, [lr, #0] + 382:src/pcd/rc632.c **** irq_opcdh->flags = 0x00; + 571 .loc 1 382 0 + 572 030c 0130CEE5 strb r3, [lr, #1] + 573 .LVL44: + 384:src/pcd/rc632.c **** irq_opcdh->val = cause; + 574 .loc 1 384 0 + 575 0310 07C0DDE5 ldrb ip, [sp, #7] @ zero_extendqisi2 + 576 .LVL45: + 385:src/pcd/rc632.c **** + 386:src/pcd/rc632.c **** req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); + 577 .loc 1 386 0 + 578 0314 1210A0E3 mov r1, #18 + 579 .LVL46: + 384:src/pcd/rc632.c **** irq_opcdh->val = cause; + 580 .loc 1 384 0 + 581 0318 03C0CEE5 strb ip, [lr, #3] + 582 .loc 1 386 0 + 583 031c FEFFFFEB bl req_ctx_set_state + 584 .LVL47: + 585 .L32: + 387:src/pcd/rc632.c **** DEBUGPCR(""); + 388:src/pcd/rc632.c **** } + 586 .loc 1 388 0 + 587 0320 0CD08DE2 add sp, sp, #12 + 588 0324 04E09DE4 ldr lr, [sp], #4 + 589 0328 1EFF2FE1 bx lr + 590 .LVL48: + 591 .L35: + 592 .LBB115: + 593 .LBB116: + 83:include/lib_AT91SAM7.h **** pAic->AIC_IDCR = mask ; + 594 .loc 2 83 0 + 595 032c 0F0CE0E3 mvn r0, #3840 + 596 .LVL49: + 597 0330 0221A0E3 mov r2, #-2147483648 + 598 0334 252080E5 str r2, [r0, #37] + 85:include/lib_AT91SAM7.h **** pAic->AIC_ICCR = mask ; + 599 .loc 2 85 0 + 600 0338 292080E5 str r2, [r0, #41] + 601 .LBE116: + 602 .LBE115: + 375:src/pcd/rc632.c **** return; + 603 .loc 1 375 0 + 604 033c F7FFFFEA b .L32 + 605 .L37: + 606 .align 2 + 607 .L36: + 608 0340 00000000 .word req_ctx_find_get + 609 .cfi_endproc + 610 .LFE287: + 612 .align 2 + 614 rc632_reg_write_verify.clone.0: + 615 .LFB297: + 389:src/pcd/rc632.c **** + 390:src/pcd/rc632.c **** void rc632_unthrottle(void) + 391:src/pcd/rc632.c **** { + 392:src/pcd/rc632.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 393:src/pcd/rc632.c **** } + 394:src/pcd/rc632.c **** + 395:src/pcd/rc632.c **** void rc632_power(u_int8_t up) + 396:src/pcd/rc632.c **** { + 397:src/pcd/rc632.c **** DEBUGPCRF("powering %s RC632", up ? "up" : "down"); + 398:src/pcd/rc632.c **** if (up) + 399:src/pcd/rc632.c **** AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, + 400:src/pcd/rc632.c **** OPENPCD_PIO_RC632_RESET); + 401:src/pcd/rc632.c **** else + 402:src/pcd/rc632.c **** AT91F_PIO_SetOutput(AT91C_BASE_PIOA, + 403:src/pcd/rc632.c **** OPENPCD_PIO_RC632_RESET); + 404:src/pcd/rc632.c **** } + 405:src/pcd/rc632.c **** + 406:src/pcd/rc632.c **** void rc632_reset(void) + 407:src/pcd/rc632.c **** { + 408:src/pcd/rc632.c **** volatile int i; + 409:src/pcd/rc632.c **** + 410:src/pcd/rc632.c **** rc632_power(0); + 411:src/pcd/rc632.c **** for (i = 0; i < 0xffff; i++) + 412:src/pcd/rc632.c **** {} + 413:src/pcd/rc632.c **** rc632_power(1); + 414:src/pcd/rc632.c **** + 415:src/pcd/rc632.c **** /* wait for startup phase to finish */ + 416:src/pcd/rc632.c **** while (1) { + 417:src/pcd/rc632.c **** u_int8_t val; + 418:src/pcd/rc632.c **** opcd_rc632_reg_read(NULL, RC632_REG_COMMAND, &val); + 419:src/pcd/rc632.c **** if (val == 0x00) + 420:src/pcd/rc632.c **** break; + 421:src/pcd/rc632.c **** } + 422:src/pcd/rc632.c **** + 423:src/pcd/rc632.c **** /* turn off register paging */ + 424:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); + 425:src/pcd/rc632.c **** } + 426:src/pcd/rc632.c **** + 427:src/pcd/rc632.c **** static int rc632_usb_in(struct req_ctx *rctx) + 428:src/pcd/rc632.c **** { + 429:src/pcd/rc632.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 430:src/pcd/rc632.c **** u_int16_t len = rctx->tot_len-sizeof(*poh); + 431:src/pcd/rc632.c **** + 432:src/pcd/rc632.c **** /* initialize transmit length to header length */ + 433:src/pcd/rc632.c **** rctx->tot_len = sizeof(*poh); + 434:src/pcd/rc632.c **** + 435:src/pcd/rc632.c **** switch (poh->cmd) { + 436:src/pcd/rc632.c **** case OPENPCD_CMD_READ_REG: + 437:src/pcd/rc632.c **** opcd_rc632_reg_read(NULL, poh->reg, &poh->val); + 438:src/pcd/rc632.c **** DEBUGP("READ REG(0x%02x)=0x%02x ", poh->reg, poh->val); + 439:src/pcd/rc632.c **** /* register read always has to provoke a response */ + 440:src/pcd/rc632.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 441:src/pcd/rc632.c **** break; + 442:src/pcd/rc632.c **** case OPENPCD_CMD_READ_FIFO: + 443:src/pcd/rc632.c **** /* FIFO read always has to provoke a response */ + 444:src/pcd/rc632.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 445:src/pcd/rc632.c **** { + 446:src/pcd/rc632.c **** u_int16_t req_len = poh->val, remain_len = req_len, pih_len; + 447:src/pcd/rc632.c **** #if 0 + 448:src/pcd/rc632.c **** if (req_len > MAX_PAYLOAD_LEN) { + 449:src/pcd/rc632.c **** pih_len = MAX_PAYLOAD_LEN; + 450:src/pcd/rc632.c **** remain_len -= pih_len; + 451:src/pcd/rc632.c **** opcd_rc632_fifo_read(NULL, pih_len, poh->data); + 452:src/pcd/rc632.c **** rctx->tot_len += pih_len; + 453:src/pcd/rc632.c **** DEBUGP("READ FIFO(len=%u)=%s ", req_len, + 454:src/pcd/rc632.c **** hexdump(poh->data, pih_len)); + 455:src/pcd/rc632.c **** req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + 456:src/pcd/rc632.c **** udp_refill_ep(2); + 457:src/pcd/rc632.c **** + 458:src/pcd/rc632.c **** /* get and initialize second rctx */ + 459:src/pcd/rc632.c **** rctx = req_ctx_find_get(0, RCTX_STATE_FREE, + 460:src/pcd/rc632.c **** RCTX_STATE_MAIN_PROCESSING); + 461:src/pcd/rc632.c **** if (!rctx) { + 462:src/pcd/rc632.c **** DEBUGPCRF("FATAL_NO_RCTX!!!\n"); + 463:src/pcd/rc632.c **** break; + 464:src/pcd/rc632.c **** } + 465:src/pcd/rc632.c **** poh = (struct openpcd_hdr *) rctx->data; + 466:src/pcd/rc632.c **** rctx->tot_len = sizeof(*poh); + 467:src/pcd/rc632.c **** + 468:src/pcd/rc632.c **** pih_len = remain_len; + 469:src/pcd/rc632.c **** opcd_rc632_fifo_read(NULL, pih_len, poh->data); + 470:src/pcd/rc632.c **** rctx->tot_len += pih_len; + 471:src/pcd/rc632.c **** DEBUGP("READ FIFO(len=%u)=%s ", pih_len, + 472:src/pcd/rc632.c **** hexdump(poh->data, pih_len)); + 473:src/pcd/rc632.c **** /* don't set state of second rctx, main function + 474:src/pcd/rc632.c **** * body will do this after switch statement */ + 475:src/pcd/rc632.c **** } else { + 476:src/pcd/rc632.c **** #endif + 477:src/pcd/rc632.c **** poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + 478:src/pcd/rc632.c **** rctx->tot_len += poh->val; + 479:src/pcd/rc632.c **** DEBUGP("READ FIFO(len=%u)=%s ", poh->val, + 480:src/pcd/rc632.c **** hexdump(poh->data, poh->val)); + 481:src/pcd/rc632.c **** //} + 482:src/pcd/rc632.c **** } + 483:src/pcd/rc632.c **** break; + 484:src/pcd/rc632.c **** case OPENPCD_CMD_WRITE_REG: + 485:src/pcd/rc632.c **** DEBUGP("WRITE_REG(0x%02x, 0x%02x) ", poh->reg, poh->val); + 486:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, poh->reg, poh->val); + 487:src/pcd/rc632.c **** break; + 488:src/pcd/rc632.c **** case OPENPCD_CMD_WRITE_REG_SET: + 489:src/pcd/rc632.c **** DEBUGP("WRITE_REG_SET(%s) ", hexdump(poh->data, len)); + 490:src/pcd/rc632.c **** opcd_rc632_reg_write_set(NULL, poh->data, len); + 491:src/pcd/rc632.c **** break; + 492:src/pcd/rc632.c **** case OPENPCD_CMD_WRITE_FIFO: + 493:src/pcd/rc632.c **** DEBUGP("WRITE FIFO(len=%u): %s ", len, + 494:src/pcd/rc632.c **** hexdump(poh->data, len)); + 495:src/pcd/rc632.c **** opcd_rc632_fifo_write(NULL, len, poh->data, 0); + 496:src/pcd/rc632.c **** break; + 497:src/pcd/rc632.c **** case OPENPCD_CMD_READ_VFIFO: + 498:src/pcd/rc632.c **** DEBUGP("READ VFIFO "); + 499:src/pcd/rc632.c **** goto not_impl; + 500:src/pcd/rc632.c **** break; + 501:src/pcd/rc632.c **** case OPENPCD_CMD_WRITE_VFIFO: + 502:src/pcd/rc632.c **** DEBUGP("WRITE VFIFO "); + 503:src/pcd/rc632.c **** goto not_impl; + 504:src/pcd/rc632.c **** break; + 505:src/pcd/rc632.c **** case OPENPCD_CMD_REG_BITS_CLEAR: + 506:src/pcd/rc632.c **** DEBUGP("CLEAR BITS "); + 507:src/pcd/rc632.c **** poh->val = opcd_rc632_clear_bits(NULL, poh->reg, poh->val); + 508:src/pcd/rc632.c **** break; + 509:src/pcd/rc632.c **** case OPENPCD_CMD_REG_BITS_SET: + 510:src/pcd/rc632.c **** DEBUGP("SET BITS "); + 511:src/pcd/rc632.c **** poh->val = opcd_rc632_set_bits(NULL, poh->reg, poh->val); + 512:src/pcd/rc632.c **** break; + 513:src/pcd/rc632.c **** case OPENPCD_CMD_DUMP_REGS: + 514:src/pcd/rc632.c **** DEBUGP("DUMP REGS "); + 515:src/pcd/rc632.c **** goto not_impl; + 516:src/pcd/rc632.c **** break; + 517:src/pcd/rc632.c **** default: + 518:src/pcd/rc632.c **** DEBUGP("UNKNOWN "); + 519:src/pcd/rc632.c **** return USB_ERR(USB_ERR_CMD_UNKNOWN); + 520:src/pcd/rc632.c **** } + 521:src/pcd/rc632.c **** + 522:src/pcd/rc632.c **** return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; + 523:src/pcd/rc632.c **** not_impl: + 524:src/pcd/rc632.c **** DEBUGP("NOT IMPLEMENTED YET "); + 525:src/pcd/rc632.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 526:src/pcd/rc632.c **** } + 527:src/pcd/rc632.c **** + 528:src/pcd/rc632.c **** void rc632_init(void) + 529:src/pcd/rc632.c **** { + 530:src/pcd/rc632.c **** //fifo_init(&rc632.fifo, 256, NULL, &rc632); + 531:src/pcd/rc632.c **** + 532:src/pcd/rc632.c **** DEBUGPCRF("entering"); + 533:src/pcd/rc632.c **** + 534:src/pcd/rc632.c **** AT91F_SPI_CfgPMC(); + 535:src/pcd/rc632.c **** + 536:src/pcd/rc632.c **** AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + 537:src/pcd/rc632.c **** AT91C_PA11_NPCS0|AT91C_PA12_MISO| + 538:src/pcd/rc632.c **** AT91C_PA13_MOSI |AT91C_PA14_SPCK, 0); + 539:src/pcd/rc632.c **** + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 541:src/pcd/rc632.c **** OPENPCD_IRQ_PRIO_SPI, + 542:src/pcd/rc632.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &spi_irq); + 543:src/pcd/rc632.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI); + 544:src/pcd/rc632.c **** + 545:src/pcd/rc632.c **** AT91F_SPI_EnableIt(pSPI, AT91C_SPI_MODF|AT91C_SPI_OVRES); + 546:src/pcd/rc632.c **** #ifdef SPI_USES_DMA + 547:src/pcd/rc632.c **** AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDRX|AT91C_SPI_ENDTX); + 548:src/pcd/rc632.c **** #endif + 549:src/pcd/rc632.c **** + 550:src/pcd/rc632.c **** #ifdef SPI_DEBUG_LOOPBACK + 551:src/pcd/rc632.c **** AT91F_SPI_CfgMode(pSPI, AT91C_SPI_MSTR|AT91C_SPI_PS_FIXED| + 552:src/pcd/rc632.c **** AT91C_SPI_MODFDIS|AT91C_SPI_LLB); + 553:src/pcd/rc632.c **** #else + 554:src/pcd/rc632.c **** AT91F_SPI_CfgMode(pSPI, AT91C_SPI_MSTR|AT91C_SPI_PS_FIXED| + 555:src/pcd/rc632.c **** AT91C_SPI_MODFDIS); + 556:src/pcd/rc632.c **** #endif + 557:src/pcd/rc632.c **** /* CPOL = 0, NCPHA = 1, CSAAT = 0, BITS = 0000, SCBR = 10 (4.8MHz), + 558:src/pcd/rc632.c **** * DLYBS = 0, DLYBCT = 0 */ + 559:src/pcd/rc632.c **** #ifdef SPI_USES_DMA + 560:src/pcd/rc632.c **** AT91F_SPI_CfgCs(pSPI, 0, AT91C_SPI_BITS_8|AT91C_SPI_NCPHA|(10<<8)); + 561:src/pcd/rc632.c **** #else + 562:src/pcd/rc632.c **** /* 320 kHz in case of I/O based SPI */ + 563:src/pcd/rc632.c **** AT91F_SPI_CfgCs(pSPI, 0, AT91C_SPI_BITS_8|AT91C_SPI_NCPHA|(0x7f<<8)); + 564:src/pcd/rc632.c **** #endif + 565:src/pcd/rc632.c **** AT91F_SPI_Enable(pSPI); + 566:src/pcd/rc632.c **** + 567:src/pcd/rc632.c **** /* Register rc632_irq */ + 568:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632, + 569:src/pcd/rc632.c **** OPENPCD_IRQ_PRIO_RC632, + 570:src/pcd/rc632.c **** AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &rc632_irq); + 571:src/pcd/rc632.c **** AT91F_AIC_EnableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 572:src/pcd/rc632.c **** + 573:src/pcd/rc632.c **** AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_RC632_RESET); + 574:src/pcd/rc632.c **** + 575:src/pcd/rc632.c **** rc632_reset(); + 576:src/pcd/rc632.c **** + 577:src/pcd/rc632.c **** /* configure IRQ pin */ + 578:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_IRQ_PIN_CONFIG, + 579:src/pcd/rc632.c **** RC632_IRQCFG_CMOS|RC632_IRQCFG_INV); + 580:src/pcd/rc632.c **** /* enable interrupts */ + 581:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_EN, RC632_INT_TIMER); + 582:src/pcd/rc632.c **** + 583:src/pcd/rc632.c **** /* configure AUX to test signal four */ + 584:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_TEST_ANA_SELECT, 0x04); + 585:src/pcd/rc632.c **** + 586:src/pcd/rc632.c **** usb_hdlr_register(&rc632_usb_in, OPENPCD_CMD_CLS_RC632); + 587:src/pcd/rc632.c **** }; + 588:src/pcd/rc632.c **** + 589:src/pcd/rc632.c **** #if 0 + 590:src/pcd/rc632.c **** void rc632_exit(void) + 591:src/pcd/rc632.c **** { + 592:src/pcd/rc632.c **** usb_hdlr_unregister(OPENPCD_CMD_CLS_RC632); + 593:src/pcd/rc632.c **** AT91F_AIC_DisableIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632); + 594:src/pcd/rc632.c **** AT91F_AIC_DisableIt(AT91C_BASE_AIC, AT91C_ID_SPI); + 595:src/pcd/rc632.c **** AT91F_SPI_Disable(pSPI); + 596:src/pcd/rc632.c **** } + 597:src/pcd/rc632.c **** #endif + 598:src/pcd/rc632.c **** + 599:src/pcd/rc632.c **** #ifdef DEBUG + 600:src/pcd/rc632.c **** static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + 616 .loc 1 600 0 + 617 .cfi_startproc + 618 @ Function supports interworking. + 619 @ args = 0, pretend = 0, frame = 8 + 620 @ frame_needed = 0, uses_anonymous_args = 0 + 621 .LVL50: + 622 0344 30402DE9 stmfd sp!, {r4, r5, lr} + 623 .LCFI12: + 624 .cfi_def_cfa_offset 12 + 601:src/pcd/rc632.c **** u_int8_t reg, u_int8_t val) + 602:src/pcd/rc632.c **** { + 603:src/pcd/rc632.c **** u_int8_t tmp; + 604:src/pcd/rc632.c **** + 605:src/pcd/rc632.c **** opcd_rc632_reg_write(hdl, reg, val); + 625 .loc 1 605 0 + 626 0348 0120A0E1 mov r2, r1 + 600:src/pcd/rc632.c **** static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + 627 .loc 1 600 0 + 628 034c 0CD04DE2 sub sp, sp, #12 + 629 .LCFI13: + 630 .cfi_def_cfa_offset 24 + 600:src/pcd/rc632.c **** static int rc632_reg_write_verify(struct rfid_asic_handle *hdl, + 631 .loc 1 600 0 + 632 0350 0140A0E1 mov r4, r1 + 633 .cfi_offset 14, -4 + 634 .cfi_offset 5, -8 + 635 .cfi_offset 4, -12 + 636 0354 0050A0E1 mov r5, r0 + 637 .loc 1 605 0 + 638 0358 2110A0E3 mov r1, #33 + 639 .LVL51: + 640 035c FEFFFFEB bl opcd_rc632_reg_write + 641 .LVL52: + 606:src/pcd/rc632.c **** opcd_rc632_reg_read(hdl, reg, &tmp); + 642 .loc 1 606 0 + 643 0360 0500A0E1 mov r0, r5 + 644 0364 2110A0E3 mov r1, #33 + 645 0368 07208DE2 add r2, sp, #7 + 646 036c FEFFFFEB bl opcd_rc632_reg_read + 647 .LVL53: + 607:src/pcd/rc632.c **** + 608:src/pcd/rc632.c **** DEBUGPCRF("reg=0x%02x, write=0x%02x, read=0x%02x ", reg, val, tmp); + 609:src/pcd/rc632.c **** + 610:src/pcd/rc632.c **** return (val == tmp); + 648 .loc 1 610 0 + 649 0370 0710DDE5 ldrb r1, [sp, #7] @ zero_extendqisi2 + 650 .LVL54: + 611:src/pcd/rc632.c **** } + 651 .loc 1 611 0 + 652 0374 013064E0 rsb r3, r4, r1 + 653 .LVL55: + 654 0378 000073E2 rsbs r0, r3, #0 + 655 037c 0300A0E0 adc r0, r0, r3 + 656 0380 0CD08DE2 add sp, sp, #12 + 657 0384 3040BDE8 ldmfd sp!, {r4, r5, lr} + 658 0388 1EFF2FE1 bx lr + 659 .cfi_endproc + 660 .LFE297: + 662 .align 2 + 663 .global opcd_rc632_fifo_read + 665 opcd_rc632_fifo_read: + 666 .LFB284: + 269:src/pcd/rc632.c **** { + 667 .loc 1 269 0 + 668 .cfi_startproc + 669 @ Function supports interworking. + 670 @ args = 0, pretend = 0, frame = 8 + 671 @ frame_needed = 0, uses_anonymous_args = 0 + 672 .LVL56: + 673 038c 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 674 .LCFI14: + 675 .cfi_def_cfa_offset 16 + 676 0390 08D04DE2 sub sp, sp, #8 + 677 .LCFI15: + 678 .cfi_def_cfa_offset 24 + 269:src/pcd/rc632.c **** { + 679 .loc 1 269 0 + 680 0394 0140A0E1 mov r4, r1 + 681 .cfi_offset 14, -4 + 682 .cfi_offset 6, -8 + 683 .cfi_offset 5, -12 + 684 .cfi_offset 4, -16 + 685 0398 0260A0E1 mov r6, r2 + 275:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, RC632_REG_FIFO_LENGTH, &fifo_length); + 686 .loc 1 275 0 + 687 039c 0410A0E3 mov r1, #4 + 688 .LVL57: + 689 03a0 07208DE2 add r2, sp, #7 + 690 .LVL58: + 691 03a4 FEFFFFEB bl opcd_rc632_reg_read + 692 .LVL59: + 276:src/pcd/rc632.c **** if (ret < 0) + 693 .loc 1 276 0 + 694 03a8 005050E2 subs r5, r0, #0 + 695 03ac 2E0000BA blt .L40 + 696 .LVL60: + 279:src/pcd/rc632.c **** rx_len = fifo_length+1; + 697 .loc 1 279 0 + 698 03b0 07C0DDE5 ldrb ip, [sp, #7] @ zero_extendqisi2 + 281:src/pcd/rc632.c **** if (max_len < fifo_length) + 699 .loc 1 281 0 + 700 03b4 04005CE1 cmp ip, r4 + 279:src/pcd/rc632.c **** rx_len = fifo_length+1; + 701 .loc 1 279 0 + 702 03b8 01108CE2 add r1, ip, #1 + 282:src/pcd/rc632.c **** fifo_length = max_len; + 703 .loc 1 282 0 + 704 03bc 04C0A081 movhi ip, r4 + 279:src/pcd/rc632.c **** rx_len = fifo_length+1; + 705 .loc 1 279 0 + 706 03c0 B410CDE1 strh r1, [sp, #4] @ movhi + 707 .LVL61: + 282:src/pcd/rc632.c **** fifo_length = max_len; + 708 .loc 1 282 0 + 709 03c4 0740CD85 strhib r4, [sp, #7] + 710 03c8 01108482 addhi r1, r4, #1 + 711 .LVL62: + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 712 .loc 1 284 0 + 713 03cc 00005CE3 cmp ip, #0 + 714 03d0 1400000A beq .L42 + 715 03d4 A0E09FE5 ldr lr, .L50 + 267:src/pcd/rc632.c **** int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 716 .loc 1 267 0 + 717 03d8 01004CE2 sub r0, ip, #1 + 718 .LVL63: + 719 03dc FF2000E2 and r2, r0, #255 + 720 03e0 0E30A0E1 mov r3, lr + 721 03e4 0EE082E0 add lr, r2, lr + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 722 .loc 1 285 0 + 723 03e8 0400A0E3 mov r0, #4 + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 724 .loc 1 284 0 + 725 03ec 0E0053E1 cmp r3, lr + 726 03f0 012002E2 and r2, r2, #1 + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 727 .loc 1 285 0 + 728 03f4 0000C3E5 strb r0, [r3, #0] + 729 .LVL64: + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 730 .loc 1 284 0 + 731 03f8 0A00000A beq .L42 + 732 03fc 000052E3 cmp r2, #0 + 733 0400 0200000A beq .L43 + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 734 .loc 1 285 0 + 735 0404 0100E3E5 strb r0, [r3, #1]! + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 736 .loc 1 284 0 + 737 0408 0E0053E1 cmp r3, lr + 738 040c 0500000A beq .L42 + 739 .L43: + 267:src/pcd/rc632.c **** int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 740 .loc 1 267 0 discriminator 2 + 741 0410 014083E2 add r4, r3, #1 + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 742 .loc 1 285 0 discriminator 2 + 743 0414 0100C3E5 strb r0, [r3, #1] + 267:src/pcd/rc632.c **** int opcd_rc632_fifo_read(struct rfid_asic_handle *hdl, + 744 .loc 1 267 0 discriminator 2 + 745 0418 023083E2 add r3, r3, #2 + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 746 .loc 1 284 0 discriminator 2 + 747 041c 0E0053E1 cmp r3, lr + 285:src/pcd/rc632.c **** spi_outbuf[i] = FIFO_ADDR; + 748 .loc 1 285 0 discriminator 2 + 749 0420 0100C4E5 strb r0, [r4, #1] + 284:src/pcd/rc632.c **** for (i = 0; i < fifo_length; i++) + 750 .loc 1 284 0 discriminator 2 + 751 0424 F9FFFF1A bne .L43 + 752 .L42: + 287:src/pcd/rc632.c **** spi_outbuf[0] |= 0x80; + 753 .loc 1 287 0 + 754 0428 50409FE5 ldr r4, .L50+4 + 755 042c 4400D4E5 ldrb r0, [r4, #68] @ zero_extendqisi2 + 756 0430 802CE0E1 mvn r2, r0, asl #25 + 757 0434 A2ECE0E1 mvn lr, r2, lsr #25 + 288:src/pcd/rc632.c **** spi_outbuf[fifo_length] = 0x00; + 758 .loc 1 288 0 + 759 0438 0CC084E0 add ip, r4, ip + 760 043c 0030A0E3 mov r3, #0 + 290:src/pcd/rc632.c **** spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 761 .loc 1 290 0 + 762 0440 04208DE2 add r2, sp, #4 + 287:src/pcd/rc632.c **** spi_outbuf[0] |= 0x80; + 763 .loc 1 287 0 + 764 0444 44E0C4E5 strb lr, [r4, #68] + 290:src/pcd/rc632.c **** spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 765 .loc 1 290 0 + 766 0448 440084E2 add r0, r4, #68 + 288:src/pcd/rc632.c **** spi_outbuf[fifo_length] = 0x00; + 767 .loc 1 288 0 + 768 044c 4430CCE5 strb r3, [ip, #68] + 290:src/pcd/rc632.c **** spi_transceive(spi_outbuf, fifo_length+1, spi_inbuf, &rx_len); + 769 .loc 1 290 0 + 770 0450 F8FEFFEB bl spi_transceive.clone.1 + 291:src/pcd/rc632.c **** memcpy(data, spi_inbuf+1, rx_len-1); + 771 .loc 1 291 0 + 772 0454 B450DDE1 ldrh r5, [sp, #4] + 773 .LVL65: + 774 0458 015045E2 sub r5, r5, #1 + 775 .LVL66: + 776 045c 0600A0E1 mov r0, r6 + 777 0460 011084E2 add r1, r4, #1 + 778 0464 0520A0E1 mov r2, r5 + 779 0468 FEFFFFEB bl memcpy + 780 .L40: + 296:src/pcd/rc632.c **** } + 781 .loc 1 296 0 + 782 046c 0500A0E1 mov r0, r5 + 783 0470 08D08DE2 add sp, sp, #8 + 784 0474 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 785 0478 1EFF2FE1 bx lr + 786 .L51: + 787 .align 2 + 788 .L50: + 789 047c 44000000 .word .LANCHOR0+68 + 790 0480 00000000 .word .LANCHOR0 + 791 .cfi_endproc + 792 .LFE284: + 794 .align 2 + 795 .global opcd_rc632_set_bits + 797 opcd_rc632_set_bits: + 798 .LFB285: + 300:src/pcd/rc632.c **** { + 799 .loc 1 300 0 + 800 .cfi_startproc + 801 @ Function supports interworking. + 802 @ args = 0, pretend = 0, frame = 8 + 803 @ frame_needed = 0, uses_anonymous_args = 0 + 804 .LVL67: + 805 0484 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 806 .LCFI16: + 807 .cfi_def_cfa_offset 16 + 808 0488 08D04DE2 sub sp, sp, #8 + 809 .LCFI17: + 810 .cfi_def_cfa_offset 24 + 300:src/pcd/rc632.c **** { + 811 .loc 1 300 0 + 812 048c 0260A0E1 mov r6, r2 + 813 .cfi_offset 14, -4 + 814 .cfi_offset 6, -8 + 815 .cfi_offset 5, -12 + 816 .cfi_offset 4, -16 + 304:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 817 .loc 1 304 0 + 818 0490 07208DE2 add r2, sp, #7 + 819 .LVL68: + 300:src/pcd/rc632.c **** { + 820 .loc 1 300 0 + 821 0494 0050A0E1 mov r5, r0 + 822 0498 0140A0E1 mov r4, r1 + 304:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 823 .loc 1 304 0 + 824 049c FEFFFFEB bl opcd_rc632_reg_read + 825 .LVL69: + 305:src/pcd/rc632.c **** if (ret < 0) + 826 .loc 1 305 0 + 827 04a0 000050E3 cmp r0, #0 + 828 04a4 060000BA blt .L53 + 829 .LVL70: + 308:src/pcd/rc632.c **** val |= bits; + 830 .loc 1 308 0 + 831 04a8 0730DDE5 ldrb r3, [sp, #7] @ zero_extendqisi2 + 832 .LVL71: + 833 04ac 036086E1 orr r6, r6, r3 + 834 .LVL72: + 310:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 835 .loc 1 310 0 + 836 04b0 0500A0E1 mov r0, r5 + 837 .LVL73: + 838 04b4 0410A0E1 mov r1, r4 + 839 04b8 0620A0E1 mov r2, r6 + 840 .LVL74: + 308:src/pcd/rc632.c **** val |= bits; + 841 .loc 1 308 0 + 842 04bc 0760CDE5 strb r6, [sp, #7] + 310:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 843 .loc 1 310 0 + 844 04c0 FEFFFFEB bl opcd_rc632_reg_write + 845 .L53: + 311:src/pcd/rc632.c **** } + 846 .loc 1 311 0 + 847 04c4 08D08DE2 add sp, sp, #8 + 848 04c8 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 849 04cc 1EFF2FE1 bx lr + 850 .cfi_endproc + 851 .LFE285: + 853 .align 2 + 854 .global opcd_rc632_clear_bits + 856 opcd_rc632_clear_bits: + 857 .LFB286: + 315:src/pcd/rc632.c **** { + 858 .loc 1 315 0 + 859 .cfi_startproc + 860 @ Function supports interworking. + 861 @ args = 0, pretend = 0, frame = 8 + 862 @ frame_needed = 0, uses_anonymous_args = 0 + 863 .LVL75: + 864 04d0 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 865 .LCFI18: + 866 .cfi_def_cfa_offset 16 + 867 04d4 08D04DE2 sub sp, sp, #8 + 868 .LCFI19: + 869 .cfi_def_cfa_offset 24 + 315:src/pcd/rc632.c **** { + 870 .loc 1 315 0 + 871 04d8 0260A0E1 mov r6, r2 + 872 .cfi_offset 14, -4 + 873 .cfi_offset 6, -8 + 874 .cfi_offset 5, -12 + 875 .cfi_offset 4, -16 + 319:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 876 .loc 1 319 0 + 877 04dc 07208DE2 add r2, sp, #7 + 878 .LVL76: + 315:src/pcd/rc632.c **** { + 879 .loc 1 315 0 + 880 04e0 0050A0E1 mov r5, r0 + 881 04e4 0140A0E1 mov r4, r1 + 319:src/pcd/rc632.c **** ret = opcd_rc632_reg_read(hdl, reg, &val); + 882 .loc 1 319 0 + 883 04e8 FEFFFFEB bl opcd_rc632_reg_read + 884 .LVL77: + 320:src/pcd/rc632.c **** if (ret < 0) + 885 .loc 1 320 0 + 886 04ec 000050E3 cmp r0, #0 + 887 04f0 060000BA blt .L55 + 888 .LVL78: + 323:src/pcd/rc632.c **** val &= ~bits; + 889 .loc 1 323 0 + 890 04f4 0730DDE5 ldrb r3, [sp, #7] @ zero_extendqisi2 + 891 .LVL79: + 892 04f8 0660C3E1 bic r6, r3, r6 + 893 .LVL80: + 325:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 894 .loc 1 325 0 + 895 04fc 0500A0E1 mov r0, r5 + 896 .LVL81: + 897 0500 0410A0E1 mov r1, r4 + 898 0504 0620A0E1 mov r2, r6 + 899 .LVL82: + 323:src/pcd/rc632.c **** val &= ~bits; + 900 .loc 1 323 0 + 901 0508 0760CDE5 strb r6, [sp, #7] + 325:src/pcd/rc632.c **** return opcd_rc632_reg_write(hdl, reg, val); + 902 .loc 1 325 0 + 903 050c FEFFFFEB bl opcd_rc632_reg_write + 904 .L55: + 326:src/pcd/rc632.c **** } + 905 .loc 1 326 0 + 906 0510 08D08DE2 add sp, sp, #8 + 907 0514 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 908 0518 1EFF2FE1 bx lr + 909 .cfi_endproc + 910 .LFE286: + 912 .align 2 + 914 rc632_usb_in: + 915 .LFB291: + 428:src/pcd/rc632.c **** { + 916 .loc 1 428 0 + 917 .cfi_startproc + 918 @ Function supports interworking. + 919 @ args = 0, pretend = 0, frame = 0 + 920 @ frame_needed = 0, uses_anonymous_args = 0 + 921 .LVL83: + 922 051c 38402DE9 stmfd sp!, {r3, r4, r5, lr} + 923 .LCFI20: + 924 .cfi_def_cfa_offset 16 + 433:src/pcd/rc632.c **** rctx->tot_len = sizeof(*poh); + 925 .loc 1 433 0 + 926 0520 0430A0E3 mov r3, #4 @ movhi + 927 .cfi_offset 14, -4 + 928 .cfi_offset 5, -8 + 929 .cfi_offset 4, -12 + 930 .cfi_offset 3, -16 + 430:src/pcd/rc632.c **** u_int16_t len = rctx->tot_len-sizeof(*poh); + 931 .loc 1 430 0 + 932 0524 B6C0D0E1 ldrh ip, [r0, #6] + 429:src/pcd/rc632.c **** struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + 933 .loc 1 429 0 + 934 0528 084090E5 ldr r4, [r0, #8] + 935 .LVL84: + 433:src/pcd/rc632.c **** rctx->tot_len = sizeof(*poh); + 936 .loc 1 433 0 + 937 052c B630C0E1 strh r3, [r0, #6] @ movhi + 428:src/pcd/rc632.c **** { + 938 .loc 1 428 0 + 939 0530 0050A0E1 mov r5, r0 + 435:src/pcd/rc632.c **** switch (poh->cmd) { + 940 .loc 1 435 0 + 941 0534 0000D4E5 ldrb r0, [r4, #0] @ zero_extendqisi2 + 942 .LVL85: + 430:src/pcd/rc632.c **** u_int16_t len = rctx->tot_len-sizeof(*poh); + 943 .loc 1 430 0 + 944 0538 04104CE2 sub r1, ip, #4 + 945 053c 0128A0E1 mov r2, r1, asl #16 + 435:src/pcd/rc632.c **** switch (poh->cmd) { + 946 .loc 1 435 0 + 947 0540 113040E2 sub r3, r0, #17 + 430:src/pcd/rc632.c **** u_int16_t len = rctx->tot_len-sizeof(*poh); + 948 .loc 1 430 0 + 949 0544 2228A0E1 mov r2, r2, lsr #16 + 950 .LVL86: + 435:src/pcd/rc632.c **** switch (poh->cmd) { + 951 .loc 1 435 0 + 952 0548 0A0053E3 cmp r3, #10 + 953 054c 03F19F97 ldrls pc, [pc, r3, asl #2] + 954 0550 0D0000EA b .L57 + 955 .L66: + 956 0554 94050000 .word .L58 + 957 0558 B8050000 .word .L59 + 958 055c 80050000 .word .L68 + 959 0560 E8050000 .word .L61 + 960 0564 04060000 .word .L62 + 961 0568 20060000 .word .L63 + 962 056c 40060000 .word .L64 + 963 0570 80050000 .word .L68 + 964 0574 80050000 .word .L68 + 965 0578 8C050000 .word .L57 + 966 057c D4050000 .word .L65 + 967 .L68: + 525:src/pcd/rc632.c **** return USB_ERR(USB_ERR_CMD_NOT_IMPL); + 968 .loc 1 525 0 + 969 0580 F0009FE5 ldr r0, .L70 + 970 .LVL87: + 971 .L60: + 526:src/pcd/rc632.c **** } + 972 .loc 1 526 0 + 973 0584 3840BDE8 ldmfd sp!, {r3, r4, r5, lr} + 974 0588 1EFF2FE1 bx lr + 975 .LVL88: + 976 .L57: + 519:src/pcd/rc632.c **** return USB_ERR(USB_ERR_CMD_UNKNOWN); + 977 .loc 1 519 0 + 978 058c E8009FE5 ldr r0, .L70+4 + 979 0590 FBFFFFEA b .L60 + 980 .L58: + 486:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, poh->reg, poh->val); + 981 .loc 1 486 0 + 982 0594 0000A0E3 mov r0, #0 + 983 0598 0210D4E5 ldrb r1, [r4, #2] @ zero_extendqisi2 + 984 059c 0320D4E5 ldrb r2, [r4, #3] @ zero_extendqisi2 + 985 .LVL89: + 986 05a0 FEFFFFEB bl opcd_rc632_reg_write + 987 05a4 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 988 .L67: + 522:src/pcd/rc632.c **** return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; + 989 .loc 1 522 0 + 990 05a8 012013E2 ands r2, r3, #1 + 991 05ac 0200A001 moveq r0, r2 + 992 05b0 010CA013 movne r0, #256 + 993 05b4 F2FFFFEA b .L60 + 994 .LVL90: + 995 .L59: + 495:src/pcd/rc632.c **** opcd_rc632_fifo_write(NULL, len, poh->data, 0); + 996 .loc 1 495 0 + 997 05b8 0000A0E3 mov r0, #0 + 998 05bc FF1002E2 and r1, r2, #255 + 999 05c0 0030A0E1 mov r3, r0 + 1000 05c4 042084E2 add r2, r4, #4 + 1001 .LVL91: + 1002 05c8 FEFFFFEB bl opcd_rc632_fifo_write + 1003 05cc 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 496:src/pcd/rc632.c **** break; + 1004 .loc 1 496 0 + 1005 05d0 F4FFFFEA b .L67 + 1006 .LVL92: + 1007 .L65: + 490:src/pcd/rc632.c **** opcd_rc632_reg_write_set(NULL, poh->data, len); + 1008 .loc 1 490 0 + 1009 05d4 0000A0E3 mov r0, #0 + 1010 05d8 041084E2 add r1, r4, #4 + 1011 05dc FEFFFFEB bl opcd_rc632_reg_write_set + 1012 .LVL93: + 1013 05e0 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 491:src/pcd/rc632.c **** break; + 1014 .loc 1 491 0 + 1015 05e4 EFFFFFEA b .L67 + 1016 .LVL94: + 1017 .L61: + 507:src/pcd/rc632.c **** poh->val = opcd_rc632_clear_bits(NULL, poh->reg, poh->val); + 1018 .loc 1 507 0 + 1019 05e8 0000A0E3 mov r0, #0 + 1020 05ec 0210D4E5 ldrb r1, [r4, #2] @ zero_extendqisi2 + 1021 05f0 0320D4E5 ldrb r2, [r4, #3] @ zero_extendqisi2 + 1022 .LVL95: + 1023 05f4 FEFFFFEB bl opcd_rc632_clear_bits + 1024 05f8 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 1025 05fc 0300C4E5 strb r0, [r4, #3] + 508:src/pcd/rc632.c **** break; + 1026 .loc 1 508 0 + 1027 0600 E8FFFFEA b .L67 + 1028 .LVL96: + 1029 .L62: + 511:src/pcd/rc632.c **** poh->val = opcd_rc632_set_bits(NULL, poh->reg, poh->val); + 1030 .loc 1 511 0 + 1031 0604 0000A0E3 mov r0, #0 + 1032 0608 0210D4E5 ldrb r1, [r4, #2] @ zero_extendqisi2 + 1033 060c 0320D4E5 ldrb r2, [r4, #3] @ zero_extendqisi2 + 1034 .LVL97: + 1035 0610 FEFFFFEB bl opcd_rc632_set_bits + 1036 0614 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 1037 0618 0300C4E5 strb r0, [r4, #3] + 512:src/pcd/rc632.c **** break; + 1038 .loc 1 512 0 + 1039 061c E1FFFFEA b .L67 + 1040 .LVL98: + 1041 .L63: + 437:src/pcd/rc632.c **** opcd_rc632_reg_read(NULL, poh->reg, &poh->val); + 1042 .loc 1 437 0 + 1043 0620 032084E2 add r2, r4, #3 + 1044 .LVL99: + 1045 0624 0000A0E3 mov r0, #0 + 1046 0628 0210D4E5 ldrb r1, [r4, #2] @ zero_extendqisi2 + 1047 062c FEFFFFEB bl opcd_rc632_reg_read + 440:src/pcd/rc632.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 1048 .loc 1 440 0 + 1049 0630 0120D4E5 ldrb r2, [r4, #1] @ zero_extendqisi2 + 1050 0634 013002E2 and r3, r2, #1 + 1051 0638 0130C4E5 strb r3, [r4, #1] + 441:src/pcd/rc632.c **** break; + 1052 .loc 1 441 0 + 1053 063c D9FFFFEA b .L67 + 1054 .LVL100: + 1055 .L64: + 444:src/pcd/rc632.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 1056 .loc 1 444 0 + 1057 0640 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 1058 0644 01E003E2 and lr, r3, #1 + 1059 .LBB117: + 477:src/pcd/rc632.c **** poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + 1060 .loc 1 477 0 + 1061 0648 0310D4E5 ldrb r1, [r4, #3] @ zero_extendqisi2 + 1062 .LBE117: + 444:src/pcd/rc632.c **** poh->flags &= OPENPCD_FLAG_RESPOND; + 1063 .loc 1 444 0 + 1064 064c 01E0C4E5 strb lr, [r4, #1] + 1065 .LVL101: + 1066 .LBB118: + 477:src/pcd/rc632.c **** poh->val = opcd_rc632_fifo_read(NULL, req_len, poh->data); + 1067 .loc 1 477 0 + 1068 0650 0000A0E3 mov r0, #0 + 1069 0654 042084E2 add r2, r4, #4 + 1070 .LVL102: + 1071 0658 FEFFFFEB bl opcd_rc632_fifo_read + 1072 .LVL103: + 1073 065c FF1000E2 and r1, r0, #255 + 1074 0660 0310C4E5 strb r1, [r4, #3] + 478:src/pcd/rc632.c **** rctx->tot_len += poh->val; + 1075 .loc 1 478 0 + 1076 0664 B6C0D5E1 ldrh ip, [r5, #6] + 1077 0668 0C0081E0 add r0, r1, ip + 1078 066c B600C5E1 strh r0, [r5, #6] @ movhi + 1079 0670 0130D4E5 ldrb r3, [r4, #1] @ zero_extendqisi2 + 1080 .LBE118: + 483:src/pcd/rc632.c **** break; + 1081 .loc 1 483 0 + 1082 0674 CBFFFFEA b .L67 + 1083 .L71: + 1084 .align 2 + 1085 .L70: + 1086 0678 02030000 .word 770 + 1087 067c 01030000 .word 769 + 1088 .cfi_endproc + 1089 .LFE291: + 1091 .align 2 + 1092 .global rc632_unthrottle + 1094 rc632_unthrottle: + 1095 .LFB288: + 391:src/pcd/rc632.c **** { + 1096 .loc 1 391 0 + 1097 .cfi_startproc + 1098 @ Function supports interworking. + 1099 @ args = 0, pretend = 0, frame = 0 + 1100 @ frame_needed = 0, uses_anonymous_args = 0 + 1101 @ link register save eliminated. + 1102 .LVL104: + 1103 .LBB119: + 1104 .LBB120: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 1105 .loc 2 70 0 + 1106 0680 0221A0E3 mov r2, #-2147483648 + 1107 0684 0F3CE0E3 mvn r3, #3840 + 1108 0688 212083E5 str r2, [r3, #33] + 1109 .LBE120: + 1110 .LBE119: + 393:src/pcd/rc632.c **** } + 1111 .loc 1 393 0 + 1112 068c 1EFF2FE1 bx lr + 1113 .cfi_endproc + 1114 .LFE288: + 1116 .align 2 + 1117 .global rc632_power + 1119 rc632_power: + 1120 .LFB289: + 396:src/pcd/rc632.c **** { + 1121 .loc 1 396 0 + 1122 .cfi_startproc + 1123 @ Function supports interworking. + 1124 @ args = 0, pretend = 0, frame = 0 + 1125 @ frame_needed = 0, uses_anonymous_args = 0 + 1126 @ link register save eliminated. + 1127 .LVL105: + 398:src/pcd/rc632.c **** if (up) + 1128 .loc 1 398 0 + 1129 0690 000050E3 cmp r0, #0 + 1130 .LVL106: + 1131 .LBB121: + 1132 .LBB122: + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 1133 .loc 2 516 0 + 1134 0694 2020A0E3 mov r2, #32 + 1135 0698 0B3CE0E3 mvn r3, #2816 + 1136 069c CB200315 strne r2, [r3, #-203] + 1137 .LVL107: + 1138 .LBE122: + 1139 .LBE121: + 1140 .LBB123: + 1141 .LBB124: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1142 .loc 2 505 0 + 1143 06a0 CF200305 streq r2, [r3, #-207] + 1144 06a4 1EFF2FE1 bx lr + 1145 .LBE124: + 1146 .LBE123: + 1147 .cfi_endproc + 1148 .LFE289: + 1150 .align 2 + 1151 .global rc632_reset + 1153 rc632_reset: + 1154 .LFB290: + 407:src/pcd/rc632.c **** { + 1155 .loc 1 407 0 + 1156 .cfi_startproc + 1157 @ Function supports interworking. + 1158 @ args = 0, pretend = 0, frame = 8 + 1159 @ frame_needed = 0, uses_anonymous_args = 0 + 1160 .LVL108: + 1161 06a8 04E02DE5 str lr, [sp, #-4]! + 1162 .LCFI21: + 1163 .cfi_def_cfa_offset 4 + 1164 .LBB125: + 1165 .LBB127: + 1166 .LBB129: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1167 .loc 2 505 0 + 1168 06ac 2020A0E3 mov r2, #32 + 1169 .LBE129: + 1170 .LBE127: + 1171 .LBE125: + 407:src/pcd/rc632.c **** { + 1172 .loc 1 407 0 + 1173 06b0 0CD04DE2 sub sp, sp, #12 + 1174 .LCFI22: + 1175 .cfi_def_cfa_offset 16 + 1176 .LBB132: + 1177 .LBB126: + 1178 .LBB128: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1179 .loc 2 505 0 + 1180 06b4 0B1CE0E3 mvn r1, #2816 + 1181 .LBE128: + 1182 .LBE126: + 1183 .LBE132: + 411:src/pcd/rc632.c **** for (i = 0; i < 0xffff; i++) + 1184 .loc 1 411 0 + 1185 06b8 0000A0E3 mov r0, #0 + 1186 .LBB133: + 1187 .LBB131: + 1188 .LBB130: + 505:include/lib_AT91SAM7.h **** pPio->PIO_SODR = flag; + 1189 .loc 2 505 0 + 1190 06bc CF2001E5 str r2, [r1, #-207] + 1191 .LBE130: + 1192 .LBE131: + 1193 .LBE133: + 411:src/pcd/rc632.c **** for (i = 0; i < 0xffff; i++) + 1194 .loc 1 411 0 + 1195 06c0 00008DE5 str r0, [sp, #0] + 1196 .LVL109: + 1197 06c4 00309DE5 ldr r3, [sp, #0] + 1198 06c8 5C209FE5 ldr r2, .L83 + 1199 06cc 020053E1 cmp r3, r2 + 1200 06d0 050000CA bgt .L77 + 1201 .cfi_offset 14, -4 + 1202 .L80: + 411:src/pcd/rc632.c **** for (i = 0; i < 0xffff; i++) + 1203 .loc 1 411 0 is_stmt 0 discriminator 2 + 1204 06d4 00309DE5 ldr r3, [sp, #0] + 1205 06d8 01E083E2 add lr, r3, #1 + 1206 .LVL110: + 1207 06dc 00E08DE5 str lr, [sp, #0] + 1208 .LVL111: + 1209 06e0 00C09DE5 ldr ip, [sp, #0] + 1210 06e4 02005CE1 cmp ip, r2 + 1211 06e8 F9FFFFDA ble .L80 + 1212 .L77: + 1213 .LVL112: + 1214 .LBB134: + 1215 .LBB135: + 1216 .LBB136: + 516:include/lib_AT91SAM7.h **** pPio->PIO_CODR = flag; + 1217 .loc 2 516 0 is_stmt 1 + 1218 06ec 2000A0E3 mov r0, #32 + 1219 06f0 0B2CE0E3 mvn r2, #2816 + 1220 06f4 CB0002E5 str r0, [r2, #-203] + 1221 .LVL113: + 1222 .L79: + 1223 .LBE136: + 1224 .LBE135: + 1225 .LBE134: + 1226 .LBB137: + 418:src/pcd/rc632.c **** opcd_rc632_reg_read(NULL, RC632_REG_COMMAND, &val); + 1227 .loc 1 418 0 + 1228 06f8 0000A0E3 mov r0, #0 + 1229 .LVL114: + 1230 06fc 0110A0E3 mov r1, #1 + 1231 0700 07208DE2 add r2, sp, #7 + 1232 0704 FEFFFFEB bl opcd_rc632_reg_read + 1233 .LVL115: + 419:src/pcd/rc632.c **** if (val == 0x00) + 1234 .loc 1 419 0 + 1235 0708 0700DDE5 ldrb r0, [sp, #7] @ zero_extendqisi2 + 1236 .LVL116: + 1237 070c 000050E3 cmp r0, #0 + 1238 .LVL117: + 1239 0710 F8FFFF1A bne .L79 + 1240 .LBE137: + 424:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_PAGE0, 0x00); + 1241 .loc 1 424 0 + 1242 0714 0010A0E1 mov r1, r0 + 1243 .LVL118: + 1244 0718 0020A0E1 mov r2, r0 + 1245 071c FEFFFFEB bl opcd_rc632_reg_write + 425:src/pcd/rc632.c **** } + 1246 .loc 1 425 0 + 1247 0720 0CD08DE2 add sp, sp, #12 + 1248 0724 04E09DE4 ldr lr, [sp], #4 + 1249 0728 1EFF2FE1 bx lr + 1250 .L84: + 1251 .align 2 + 1252 .L83: + 1253 072c FEFF0000 .word 65534 + 1254 .cfi_endproc + 1255 .LFE290: + 1257 .align 2 + 1258 .global rc632_init + 1260 rc632_init: + 1261 .LFB292: + 529:src/pcd/rc632.c **** { + 1262 .loc 1 529 0 + 1263 .cfi_startproc + 1264 @ Function supports interworking. + 1265 @ args = 0, pretend = 0, frame = 0 + 1266 @ frame_needed = 0, uses_anonymous_args = 0 + 1267 .LVL119: + 1268 0730 F0452DE9 stmfd sp!, {r4, r5, r6, r7, r8, sl, lr} + 1269 .LCFI23: + 1270 .cfi_def_cfa_offset 28 + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1271 .loc 1 540 0 + 1272 0734 EC709FE5 ldr r7, .L86 + 1273 .cfi_offset 14, -4 + 1274 .cfi_offset 10, -8 + 1275 .cfi_offset 8, -12 + 1276 .cfi_offset 7, -16 + 1277 .cfi_offset 6, -20 + 1278 .cfi_offset 5, -24 + 1279 .cfi_offset 4, -28 + 1280 .LBB138: + 1281 .LBB141: + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 1282 .loc 2 392 0 + 1283 0738 0040A0E3 mov r4, #0 + 1284 .LBE141: + 1285 .LBE138: + 1286 .LBB144: + 1287 .LBB146: + 1288 .LBB148: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 1289 .loc 2 940 0 + 1290 073c 2050A0E3 mov r5, #32 + 1291 .LBE148: + 1292 .LBE146: + 1293 .LBE144: + 1294 .LBB151: + 1295 .LBB140: + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 1296 .loc 2 391 0 + 1297 0740 0B6CE0E3 mvn r6, #2816 + 1298 0744 1EABA0E3 mov sl, #30720 + 1299 .LBE140: + 1300 .LBE151: + 1301 .LBB152: + 1302 .LBB145: + 1303 .LBB147: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 1304 .loc 2 940 0 + 1305 0748 03CCE0E3 mvn ip, #768 + 1306 .LBE147: + 1307 .LBE145: + 1308 .LBE152: + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1309 .loc 1 540 0 + 1310 074c D8809FE5 ldr r8, .L86+4 + 529:src/pcd/rc632.c **** { + 1311 .loc 1 529 0 + 1312 0750 0CD04DE2 sub sp, sp, #12 + 1313 .LCFI24: + 1314 .cfi_def_cfa_offset 40 + 1315 .LBB153: + 1316 .LBB150: + 1317 .LBB149: + 940:include/lib_AT91SAM7.h **** pPMC->PMC_PCER = periphIds; + 1318 .loc 2 940 0 + 1319 0754 EF500CE5 str r5, [ip, #-239] + 1320 .LVL120: + 1321 .LBE149: + 1322 .LBE150: + 1323 .LBE153: + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1324 .loc 1 540 0 + 1325 0758 0430A0E1 mov r3, r4 + 1326 .LBB154: + 1327 .LBB142: + 391:include/lib_AT91SAM7.h **** pPio->PIO_ASR = periphAEnable; + 1328 .loc 2 391 0 + 1329 075c 8FA006E5 str sl, [r6, #-143] + 1330 .LBE142: + 1331 .LBE154: + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1332 .loc 1 540 0 + 1333 0760 0510A0E3 mov r1, #5 + 1334 .LBB155: + 1335 .LBB139: + 392:include/lib_AT91SAM7.h **** pPio->PIO_BSR = periphBEnable; + 1336 .loc 2 392 0 + 1337 0764 8B4006E5 str r4, [r6, #-139] + 1338 .LBE139: + 1339 .LBE155: + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1340 .loc 1 540 0 + 1341 0768 0720A0E3 mov r2, #7 + 1342 .LBB156: + 1343 .LBB143: + 393:include/lib_AT91SAM7.h **** pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode + 1344 .loc 2 393 0 + 1345 076c FBA006E5 str sl, [r6, #-251] + 1346 .LBE143: + 1347 .LBE156: + 540:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + 1348 .loc 1 540 0 + 1349 0770 0700A0E1 mov r0, r7 + 1350 0774 00808DE5 str r8, [sp, #0] + 1351 0778 FEFFFFEB bl AT91F_AIC_ConfigureIt + 1352 .LVL121: + 1353 .LBB157: + 1354 .LBB159: +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; + 1355 .loc 2 1622 0 + 1356 077c ACC09FE5 ldr ip, .L86+8 + 1357 .LBE159: + 1358 .LBE157: + 1359 .LBB161: + 1360 .LBB162: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 1361 .loc 2 70 0 + 1362 0780 0F8CE0E3 mvn r8, #3840 + 1363 .LBE162: + 1364 .LBE161: + 1365 .LBB164: + 1366 .LBB158: +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; + 1367 .loc 2 1622 0 + 1368 0784 0CE0A0E3 mov lr, #12 + 1369 .LBE158: + 1370 .LBE164: + 1371 .LBB165: + 1372 .LBB163: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 1373 .loc 2 70 0 + 1374 0788 215088E5 str r5, [r8, #33] + 1375 .LVL122: + 1376 .LBE163: + 1377 .LBE165: + 1378 .LBB166: + 1379 .LBB160: +1622:include/lib_AT91SAM7.h **** pSPI->SPI_IER = flag; + 1380 .loc 2 1622 0 + 1381 078c EBE00CE5 str lr, [ip, #-235] + 1382 .LVL123: + 1383 .LBE160: + 1384 .LBE166: + 1385 .LBB167: + 1386 .LBB168: + 1387 0790 30E0A0E3 mov lr, #48 + 1388 0794 EBE00CE5 str lr, [ip, #-235] + 1389 .LVL124: + 1390 .LBE168: + 1391 .LBE167: + 1392 .LBB169: + 1393 .LBB170: +1682:include/lib_AT91SAM7.h **** pSPI->SPI_MR = mode; + 1394 .loc 2 1682 0 + 1395 0798 11E0A0E3 mov lr, #17 + 1396 079c FBE00CE5 str lr, [ip, #-251] + 1397 .LVL125: + 1398 .LBE170: + 1399 .LBE169: + 1400 .LBB171: + 1401 .LBB172: +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; + 1402 .loc 2 1610 0 + 1403 07a0 8CE09FE5 ldr lr, .L86+12 + 1404 .LBE172: + 1405 .LBE171: + 1406 .LBB174: + 1407 .LBB175: +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; + 1408 .loc 2 1658 0 + 1409 07a4 01A0A0E3 mov sl, #1 + 1410 .LBE175: + 1411 .LBE174: + 1412 .LBB177: + 1413 .LBB173: +1610:include/lib_AT91SAM7.h **** *(pSPI->SPI_CSR + cs) = val; + 1414 .loc 2 1610 0 + 1415 07a8 CFE00CE5 str lr, [ip, #-207] + 1416 .LVL126: + 1417 .LBE173: + 1418 .LBE177: + 1419 .LBB178: + 1420 .LBB176: +1658:include/lib_AT91SAM7.h **** pSPI->SPI_CR = AT91C_SPI_SPIEN; + 1421 .loc 2 1658 0 + 1422 07ac FFA00CE5 str sl, [ip, #-255] + 1423 .LBE176: + 1424 .LBE178: + 568:src/pcd/rc632.c **** AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, OPENPCD_IRQ_RC632, + 1425 .loc 1 568 0 + 1426 07b0 80C09FE5 ldr ip, .L86+16 + 1427 07b4 0420A0E1 mov r2, r4 + 1428 07b8 0430A0E1 mov r3, r4 + 1429 07bc 1F10A0E3 mov r1, #31 + 1430 07c0 0700A0E1 mov r0, r7 + 1431 07c4 00C08DE5 str ip, [sp, #0] + 1432 07c8 FEFFFFEB bl AT91F_AIC_ConfigureIt + 1433 .LVL127: + 1434 .LBB179: + 1435 .LBB180: + 70:include/lib_AT91SAM7.h **** pAic->AIC_IECR = 0x1 << irq_id ; + 1436 .loc 2 70 0 + 1437 07cc 0231A0E3 mov r3, #-2147483648 + 1438 07d0 213088E5 str r3, [r8, #33] + 1439 .LVL128: + 1440 .LBE180: + 1441 .LBE179: + 1442 .LBB181: + 1443 .LBB182: + 404:include/lib_AT91SAM7.h **** pPio->PIO_PER = pioEnable; // Set in PIO mode + 1444 .loc 2 404 0 + 1445 07d4 FF5006E5 str r5, [r6, #-255] + 405:include/lib_AT91SAM7.h **** pPio->PIO_OER = pioEnable; // Configure in Output + 1446 .loc 2 405 0 + 1447 07d8 EF5006E5 str r5, [r6, #-239] + 1448 .LBE182: + 1449 .LBE181: + 575:src/pcd/rc632.c **** rc632_reset(); + 1450 .loc 1 575 0 + 1451 07dc FEFFFFEB bl rc632_reset + 578:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_IRQ_PIN_CONFIG, + 1452 .loc 1 578 0 + 1453 07e0 0400A0E1 mov r0, r4 + 1454 07e4 2D10A0E3 mov r1, #45 + 1455 07e8 0320A0E3 mov r2, #3 + 1456 07ec FEFFFFEB bl opcd_rc632_reg_write + 581:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_INTERRUPT_EN, RC632_INT_TIMER); + 1457 .loc 1 581 0 + 1458 07f0 0520A0E1 mov r2, r5 + 1459 07f4 0400A0E1 mov r0, r4 + 1460 07f8 0610A0E3 mov r1, #6 + 1461 07fc FEFFFFEB bl opcd_rc632_reg_write + 584:src/pcd/rc632.c **** opcd_rc632_reg_write(NULL, RC632_REG_TEST_ANA_SELECT, 0x04); + 1462 .loc 1 584 0 + 1463 0800 0400A0E1 mov r0, r4 + 1464 0804 3A10A0E3 mov r1, #58 + 1465 0808 0420A0E3 mov r2, #4 + 1466 080c FEFFFFEB bl opcd_rc632_reg_write + 586:src/pcd/rc632.c **** usb_hdlr_register(&rc632_usb_in, OPENPCD_CMD_CLS_RC632); + 1467 .loc 1 586 0 + 1468 0810 0A10A0E1 mov r1, sl + 1469 0814 20009FE5 ldr r0, .L86+20 + 1470 0818 FEFFFFEB bl usb_hdlr_register + 587:src/pcd/rc632.c **** }; + 1471 .loc 1 587 0 + 1472 081c 0CD08DE2 add sp, sp, #12 + 1473 0820 F045BDE8 ldmfd sp!, {r4, r5, r6, r7, r8, sl, lr} + 1474 0824 1EFF2FE1 bx lr + 1475 .L87: + 1476 .align 2 + 1477 .L86: + 1478 0828 00F0FFFF .word -4096 + 1479 082c 00000000 .word spi_irq + 1480 0830 FF00FEFF .word -130817 + 1481 0834 020A0000 .word 2562 + 1482 0838 00000000 .word rc632_irq + 1483 083c 00000000 .word rc632_usb_in + 1484 .cfi_endproc + 1485 .LFE292: + 1487 .align 2 + 1488 .global rc632_dump + 1490 rc632_dump: + 1491 .LFB294: + 612:src/pcd/rc632.c **** + 613:src/pcd/rc632.c **** int rc632_dump(void) + 614:src/pcd/rc632.c **** { + 1492 .loc 1 614 0 + 1493 .cfi_startproc + 1494 @ Function supports interworking. + 1495 @ args = 0, pretend = 0, frame = 8 + 1496 @ frame_needed = 0, uses_anonymous_args = 0 + 1497 0840 F0402DE9 stmfd sp!, {r4, r5, r6, r7, lr} + 1498 .LCFI25: + 1499 .cfi_def_cfa_offset 20 + 1500 0844 9CC09FE5 ldr ip, .L94 + 1501 0848 0CD04DE2 sub sp, sp, #12 + 1502 .LCFI26: + 1503 .cfi_def_cfa_offset 32 + 615:src/pcd/rc632.c **** u_int8_t i; + 616:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 1504 .loc 1 616 0 + 1505 084c 0010A0E3 mov r1, #0 + 1506 0850 4130A0E3 mov r3, #65 @ movhi + 1507 0854 B630CDE1 strh r3, [sp, #6] @ movhi + 1508 .LVL129: + 1509 0858 0100A0E3 mov r0, #1 + 1510 .LBB183: + 617:src/pcd/rc632.c **** + 618:src/pcd/rc632.c **** for (i = 0; i <= 0x3f; i++) { + 619:src/pcd/rc632.c **** u_int8_t reg = i; + 620:src/pcd/rc632.c **** if (reg == RC632_REG_FIFO_DATA) + 621:src/pcd/rc632.c **** reg = 0x3e; + 622:src/pcd/rc632.c **** + 623:src/pcd/rc632.c **** spi_outbuf[i] = reg << 1; + 1511 .loc 1 623 0 + 1512 085c 46708CE2 add r7, ip, #70 + 1513 .cfi_offset 14, -4 + 1514 .cfi_offset 7, -8 + 1515 .cfi_offset 6, -12 + 1516 .cfi_offset 5, -16 + 1517 .cfi_offset 4, -20 + 1518 0860 7C60A0E3 mov r6, #124 + 624:src/pcd/rc632.c **** spi_inbuf[i] = 0x00; + 1519 .loc 1 624 0 + 1520 0864 0150A0E1 mov r5, r1 + 1521 0868 080000EA b .L89 + 1522 .LVL130: + 1523 .L93: + 1524 .LBE183: + 618:src/pcd/rc632.c **** for (i = 0; i <= 0x3f; i++) { + 1525 .loc 1 618 0 + 1526 086c 3F0050E3 cmp r0, #63 + 1527 .LBB184: + 623:src/pcd/rc632.c **** spi_outbuf[i] = reg << 1; + 1528 .loc 1 623 0 + 1529 0870 4440CEE5 strb r4, [lr, #68] + 1530 0874 6C309FE5 ldr r3, .L94 + 1531 .loc 1 624 0 + 1532 0878 0040A0E3 mov r4, #0 + 1533 087c 0250CCE7 strb r5, [ip, r2] + 1534 .LVL131: + 1535 .LBE184: + 618:src/pcd/rc632.c **** for (i = 0; i <= 0x3f; i++) { + 1536 .loc 1 618 0 + 1537 0880 0A00008A bhi .L92 + 1538 .LVL132: + 1539 .L91: + 616:src/pcd/rc632.c **** u_int16_t rx_len = sizeof(spi_inbuf); + 1540 .loc 1 616 0 + 1541 0884 010080E2 add r0, r0, #1 + 1542 0888 011081E2 add r1, r1, #1 + 1543 088c FF0000E2 and r0, r0, #255 + 1544 .L89: + 1545 0890 FF2001E2 and r2, r1, #255 + 1546 .LVL133: + 1547 .LBB185: + 620:src/pcd/rc632.c **** if (reg == RC632_REG_FIFO_DATA) + 1548 .loc 1 620 0 + 1549 0894 020052E3 cmp r2, #2 + 623:src/pcd/rc632.c **** spi_outbuf[i] = reg << 1; + 1550 .loc 1 623 0 + 1551 0898 02E08CE0 add lr, ip, r2 + 1552 089c 8240A0E1 mov r4, r2, asl #1 + 620:src/pcd/rc632.c **** if (reg == RC632_REG_FIFO_DATA) + 1553 .loc 1 620 0 + 1554 08a0 F1FFFF1A bne .L93 + 1555 .LVL134: + 623:src/pcd/rc632.c **** spi_outbuf[i] = reg << 1; + 1556 .loc 1 623 0 + 1557 08a4 0060C7E5 strb r6, [r7, #0] + 1558 .loc 1 624 0 + 1559 08a8 0250CCE7 strb r5, [ip, r2] + 1560 .LVL135: + 1561 08ac F4FFFFEA b .L91 + 1562 .LVL136: + 1563 .L92: + 1564 .LBE185: + 625:src/pcd/rc632.c **** } + 626:src/pcd/rc632.c **** + 627:src/pcd/rc632.c **** /* MSB of first byte of read spi transfer is high */ + 628:src/pcd/rc632.c **** spi_outbuf[0] |= 0x80; + 1565 .loc 1 628 0 + 1566 08b0 4420D3E5 ldrb r2, [r3, #68] @ zero_extendqisi2 + 1567 .LVL137: + 1568 08b4 821CE0E1 mvn r1, r2, asl #25 + 1569 08b8 A1CCE0E1 mvn ip, r1, lsr #25 + 629:src/pcd/rc632.c **** + 630:src/pcd/rc632.c **** /* last byte of read spi transfer is 0x00 */ + 631:src/pcd/rc632.c **** spi_outbuf[0x40] = 0x00; + 632:src/pcd/rc632.c **** spi_inbuf[0x40] = 0x00; + 633:src/pcd/rc632.c **** + 634:src/pcd/rc632.c **** spi_transceive(spi_outbuf, 0x41, spi_inbuf, &rx_len); + 1570 .loc 1 634 0 + 1571 08bc 440083E2 add r0, r3, #68 + 1572 .LVL138: + 1573 08c0 4110A0E3 mov r1, #65 + 1574 08c4 06208DE2 add r2, sp, #6 + 628:src/pcd/rc632.c **** spi_outbuf[0] |= 0x80; + 1575 .loc 1 628 0 + 1576 08c8 44C0C3E5 strb ip, [r3, #68] + 631:src/pcd/rc632.c **** spi_outbuf[0x40] = 0x00; + 1577 .loc 1 631 0 + 1578 08cc 8440C3E5 strb r4, [r3, #132] + 632:src/pcd/rc632.c **** spi_inbuf[0x40] = 0x00; + 1579 .loc 1 632 0 + 1580 08d0 4040C3E5 strb r4, [r3, #64] + 1581 .loc 1 634 0 + 1582 08d4 D7FDFFEB bl spi_transceive.clone.1 + 1583 .LVL139: + 635:src/pcd/rc632.c **** + 636:src/pcd/rc632.c **** for (i = 0; i < 0x3f; i++) { + 637:src/pcd/rc632.c **** if (i == RC632_REG_FIFO_DATA) + 638:src/pcd/rc632.c **** DEBUGPCR("REG 0x02 = NOT READ"); + 639:src/pcd/rc632.c **** else + 640:src/pcd/rc632.c **** DEBUGPCR("REG 0x%02x = 0x%02x", i, spi_inbuf[i+1]); + 641:src/pcd/rc632.c **** } + 642:src/pcd/rc632.c **** + 643:src/pcd/rc632.c **** return 0; + 644:src/pcd/rc632.c **** } + 1584 .loc 1 644 0 + 1585 08d8 0400A0E1 mov r0, r4 + 1586 08dc 0CD08DE2 add sp, sp, #12 + 1587 08e0 F040BDE8 ldmfd sp!, {r4, r5, r6, r7, lr} + 1588 08e4 1EFF2FE1 bx lr + 1589 .L95: + 1590 .align 2 + 1591 .L94: + 1592 08e8 00000000 .word .LANCHOR0 + 1593 .cfi_endproc + 1594 .LFE294: + 1596 .align 2 + 1597 .global rc632_test + 1599 rc632_test: + 1600 .LFB295: + 645:src/pcd/rc632.c **** + 646:src/pcd/rc632.c **** int rc632_test(struct rfid_asic_handle *hdl) + 647:src/pcd/rc632.c **** { + 1601 .loc 1 647 0 + 1602 .cfi_startproc + 1603 @ Function supports interworking. + 1604 @ args = 0, pretend = 0, frame = 0 + 1605 @ frame_needed = 0, uses_anonymous_args = 0 + 1606 .LVL140: + 1607 08ec 10402DE9 stmfd sp!, {r4, lr} + 1608 .LCFI27: + 1609 .cfi_def_cfa_offset 8 + 648:src/pcd/rc632.c **** if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + 1610 .loc 1 648 0 + 1611 08f0 5510A0E3 mov r1, #85 + 647:src/pcd/rc632.c **** { + 1612 .loc 1 647 0 + 1613 08f4 0040A0E1 mov r4, r0 + 1614 .cfi_offset 14, -4 + 1615 .cfi_offset 4, -8 + 1616 .loc 1 648 0 + 1617 08f8 91FEFFEB bl rc632_reg_write_verify.clone.0 + 1618 .LVL141: + 1619 08fc 010050E3 cmp r0, #1 + 649:src/pcd/rc632.c **** return -1; + 1620 .loc 1 649 0 + 1621 0900 0000E013 mvnne r0, #0 + 648:src/pcd/rc632.c **** if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0x55) != 1) + 1622 .loc 1 648 0 + 1623 0904 0100000A beq .L100 + 1624 .L97: + 650:src/pcd/rc632.c **** + 651:src/pcd/rc632.c **** if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0xAA) != 1) + 652:src/pcd/rc632.c **** return -1; + 653:src/pcd/rc632.c **** + 654:src/pcd/rc632.c **** return 0; + 655:src/pcd/rc632.c **** } + 1625 .loc 1 655 0 + 1626 0908 1040BDE8 ldmfd sp!, {r4, lr} + 1627 090c 1EFF2FE1 bx lr + 1628 .L100: + 651:src/pcd/rc632.c **** if (rc632_reg_write_verify(hdl, RC632_REG_RX_WAIT, 0xAA) != 1) + 1629 .loc 1 651 0 + 1630 0910 0400A0E1 mov r0, r4 + 1631 0914 AA10A0E3 mov r1, #170 + 1632 0918 89FEFFEB bl rc632_reg_write_verify.clone.0 + 1633 091c 010050E3 cmp r0, #1 + 652:src/pcd/rc632.c **** return -1; + 1634 .loc 1 652 0 + 1635 0920 0000A003 moveq r0, #0 + 1636 0924 0000E013 mvnne r0, #0 + 1637 0928 F6FFFFEA b .L97 + 1638 .cfi_endproc + 1639 .LFE295: + 1641 .bss + 1642 .align 2 + 1643 .set .LANCHOR0,. + 0 + 1646 spi_inbuf: + 1647 0000 00000000 .space 65 + 1647 00000000 + 1647 00000000 + 1647 00000000 + 1647 00000000 + 1648 0041 000000 .space 3 + 1651 spi_outbuf: + 1652 0044 00000000 .space 65 + 1652 00000000 + 1652 00000000 + 1652 00000000 + 1652 00000000 + 1653 0085 000000 .space 3 + 1656 regset_buf: + 1657 0088 00000000 .space 94 + 1657 00000000 + 1657 00000000 + 1657 00000000 + 1657 00000000 + 1658 00e6 0000 .text + 1659 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 rc632.c +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:23 .text:00000000 spi_irq +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:69 .text:00000034 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:73 .text:00000038 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:75 .text:00000038 spi_transceive.clone.1 +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:230 .text:000000f0 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:237 .text:00000100 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:240 .text:00000100 opcd_rc632_reg_write +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:288 .text:00000144 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:292 .text:00000148 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:295 .text:00000148 opcd_rc632_reg_write_set +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:377 .text:000001e0 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:382 .text:000001e8 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:385 .text:000001e8 opcd_rc632_fifo_write +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:445 .text:00000244 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:449 .text:00000248 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:452 .text:00000248 opcd_rc632_reg_read +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:515 .text:000002a8 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:519 .text:000002ac $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:521 .text:000002ac rc632_irq +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:608 .text:00000340 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:612 .text:00000344 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:614 .text:00000344 rc632_reg_write_verify.clone.0 +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:665 .text:0000038c opcd_rc632_fifo_read +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:789 .text:0000047c $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:794 .text:00000484 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:797 .text:00000484 opcd_rc632_set_bits +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:856 .text:000004d0 opcd_rc632_clear_bits +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:914 .text:0000051c rc632_usb_in +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:956 .text:00000554 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:969 .text:00000580 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1086 .text:00000678 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1091 .text:00000680 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1094 .text:00000680 rc632_unthrottle +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1119 .text:00000690 rc632_power +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1153 .text:000006a8 rc632_reset +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1253 .text:0000072c $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1257 .text:00000730 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1260 .text:00000730 rc632_init +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1478 .text:00000828 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1487 .text:00000840 $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1490 .text:00000840 rc632_dump +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1592 .text:000008e8 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1596 .text:000008ec $a +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1599 .text:000008ec rc632_test +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1642 .bss:00000000 $d +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1646 .bss:00000000 spi_inbuf +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1651 .bss:00000044 spi_outbuf +C:\Users\netz\AppData\Local\Temp\ccedl1N8.s:1656 .bss:00000088 regset_buf + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +AT91F_PDC_ReceiveFrame +AT91F_PDC_SendFrame +memcpy +req_ctx_set_state +req_ctx_find_get +AT91F_AIC_ConfigureIt +usb_hdlr_register diff --git a/firmware/src/pcd/rc632_highlevel.c b/firmware/src/pcd/rc632_highlevel.c new file mode 100644 index 0000000..14a2a2a --- /dev/null +++ b/firmware/src/pcd/rc632_highlevel.c @@ -0,0 +1,194 @@ +/* Generic Philips CL RC632 Routines + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#ifdef DEBUG +#undef DEBUG +#endif + +#include +#include +#include +#include +#include "rc632.h" +#include +#include +#include + +/* initially we use the same values as cm5121 */ +#define OPENPCD_CW_CONDUCTANCE 0x3f +#define OPENPCD_MOD_CONDUCTANCE 0x3f +#define OPENPCD_14443A_BITPHASE 0xa9 +#define OPENPCD_14443A_THRESHOLD 0xff +#define OPENPCD_14443B_BITPHASE 0xad +#define OPENPCD_14443B_THRESHOLD 0xff + +#define RC632_TMO_AUTH1 14000 + +#define RC632_TIMEOUT_FUZZ_FACTOR 10 + +#define USE_IRQ + +#define ENTER() DEBUGPCRF("entering") +struct rfid_asic rc632; + +static int +rc632_set_bit_mask(struct rfid_asic_handle *handle, + u_int8_t reg, u_int8_t mask, u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = opcd_rc632_reg_read(handle, reg, &tmp); + if (ret < 0) + return ret; + + /* if bits are already like we want them, abort */ + if ((tmp & mask) == val) + return 0; + + return opcd_rc632_reg_write(handle, reg, (tmp & ~mask)|(val & mask)); +} + +int +rc632_turn_on_rf(struct rfid_asic_handle *handle) +{ + ENTER(); + return opcd_rc632_set_bits(handle, RC632_REG_TX_CONTROL, 0x03); +} + +int +rc632_turn_off_rf(struct rfid_asic_handle *handle) +{ + ENTER(); + return opcd_rc632_clear_bits(handle, RC632_REG_TX_CONTROL, 0x03); +} + +static int +rc632_power_up(struct rfid_asic_handle *handle) +{ + ENTER(); + return opcd_rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); +} + +static int +rc632_power_down(struct rfid_asic_handle *handle) +{ + return opcd_rc632_set_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); +} + +#define MAX_WRITE_LEN 16 /* see Sec. 18.6.1.2 of RC632 Spec Rev. 3.2. */ + +int +rc632_write_eeprom(struct rfid_asic_handle *handle, + u_int16_t addr, u_int8_t len, u_int8_t *data) +{ + u_int8_t sndbuf[MAX_WRITE_LEN + 2]; + u_int8_t reg; + int ret; + + if (len > MAX_WRITE_LEN) + return -EINVAL; + if (addr < 0x10) + return -EPERM; + if (addr > 0x1ff) + return -EINVAL; + + sndbuf[0] = addr & 0x00ff; /* LSB */ + sndbuf[1] = addr >> 8; /* MSB */ + memcpy(&sndbuf[2], data, len); + + ret = opcd_rc632_fifo_write(handle, len + 2, sndbuf, 0x03); + if (ret < 0) + return ret; + + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_WRITE_E2); + if (ret < 0) + return ret; + + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_ACCESS_ERR) + return -EPERM; + + while (1) { + ret = opcd_rc632_reg_read(handle, RC632_REG_SECONDARY_STATUS, ®); + if (ret < 0) + return ret; + + if (reg & RC632_SEC_ST_E2_READY) { + /* the E2Write command must be terminated, See sec. 18.6.1.3 */ + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + break; + } + } + + return ret; +} + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf) +{ + u_int8_t sndbuf[3]; + u_int8_t err; + int ret; + + sndbuf[0] = (addr & 0xff); + sndbuf[1] = addr >> 8; + sndbuf[2] = len; + + ret = opcd_rc632_fifo_write(handle, 3, sndbuf, 0x03); + if (ret < 0) + return ret; + + ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_READ_E2); + if (ret < 0) + return ret; + + /* usleep(20000); */ + + ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + if (err & RC632_ERR_FLAG_ACCESS_ERR) + return -EPERM; + + ret = opcd_rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &err); + if (err < len) + len = err; + + ret = opcd_rc632_fifo_read(handle, len, recvbuf); + if (ret < 0) + return ret; + + return len; +} + +#define RC632_E2_PRODUCT_TYPE 0 +#define RC632_E2_PRODUCT_SERIAL 8 +#define RC632_E2_RS_MAX_P 14 + +int rc632_get_serial(struct rfid_asic_handle *handle, + u_int32_t *serial) +{ + return rc632_read_eeprom(handle, RC632_E2_PRODUCT_SERIAL, + 4, (u_int8_t *)serial); +} diff --git a/firmware/src/pcd/rc632_highlevel.h b/firmware/src/pcd/rc632_highlevel.h new file mode 100644 index 0000000..40e80e0 --- /dev/null +++ b/firmware/src/pcd/rc632_highlevel.h @@ -0,0 +1,19 @@ +#ifndef _RC632_HIGHLEVEL_H +#define _RC632_HIGHLEVEL_H + +#include +#include + +int +rc632_turn_on_rf(struct rfid_asic_handle *handle); + +int +rc632_turn_off_rf(struct rfid_asic_handle *handle); + +int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + u_int8_t *recvbuf); + +int rc632_get_serial(struct rfid_asic_handle *handle, + u_int32_t *serial); +#endif /* _RC632_HIGHLEVEL_H */ diff --git a/firmware/src/pcd/rc632_highlevel.lst b/firmware/src/pcd/rc632_highlevel.lst new file mode 100644 index 0000000..30f1ab7 --- /dev/null +++ b/firmware/src/pcd/rc632_highlevel.lst @@ -0,0 +1,576 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 2 + 10 .eabi_attribute 18, 4 + 11 .file "rc632_highlevel.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global rc632_turn_on_rf + 24 rc632_turn_on_rf: + 25 .LFB1: + 26 .file 1 "src/pcd/rc632_highlevel.c" + 1:src/pcd/rc632_highlevel.c **** /* Generic Philips CL RC632 Routines + 2:src/pcd/rc632_highlevel.c **** * (C) 2006 by Harald Welte + 3:src/pcd/rc632_highlevel.c **** * + 4:src/pcd/rc632_highlevel.c **** * This program is free software; you can redistribute it and/or modify + 5:src/pcd/rc632_highlevel.c **** * it under the terms of the GNU General Public License as published by + 6:src/pcd/rc632_highlevel.c **** * the Free Software Foundation; either version 2 of the License, or + 7:src/pcd/rc632_highlevel.c **** * (at your option) any later version. + 8:src/pcd/rc632_highlevel.c **** * + 9:src/pcd/rc632_highlevel.c **** * This program is distributed in the hope that it will be useful, + 10:src/pcd/rc632_highlevel.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11:src/pcd/rc632_highlevel.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12:src/pcd/rc632_highlevel.c **** * GNU General Public License for more details. + 13:src/pcd/rc632_highlevel.c **** * + 14:src/pcd/rc632_highlevel.c **** * You should have received a copy of the GNU General Public License + 15:src/pcd/rc632_highlevel.c **** * along with this program; if not, write to the Free Software + 16:src/pcd/rc632_highlevel.c **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17:src/pcd/rc632_highlevel.c **** * + 18:src/pcd/rc632_highlevel.c **** */ + 19:src/pcd/rc632_highlevel.c **** + 20:src/pcd/rc632_highlevel.c **** #ifdef DEBUG + 21:src/pcd/rc632_highlevel.c **** #undef DEBUG + 22:src/pcd/rc632_highlevel.c **** #endif + 23:src/pcd/rc632_highlevel.c **** + 24:src/pcd/rc632_highlevel.c **** #include + 25:src/pcd/rc632_highlevel.c **** #include + 26:src/pcd/rc632_highlevel.c **** #include + 27:src/pcd/rc632_highlevel.c **** #include + 28:src/pcd/rc632_highlevel.c **** #include "rc632.h" + 29:src/pcd/rc632_highlevel.c **** #include + 30:src/pcd/rc632_highlevel.c **** #include + 31:src/pcd/rc632_highlevel.c **** #include + 32:src/pcd/rc632_highlevel.c **** + 33:src/pcd/rc632_highlevel.c **** /* initially we use the same values as cm5121 */ + 34:src/pcd/rc632_highlevel.c **** #define OPENPCD_CW_CONDUCTANCE 0x3f + 35:src/pcd/rc632_highlevel.c **** #define OPENPCD_MOD_CONDUCTANCE 0x3f + 36:src/pcd/rc632_highlevel.c **** #define OPENPCD_14443A_BITPHASE 0xa9 + 37:src/pcd/rc632_highlevel.c **** #define OPENPCD_14443A_THRESHOLD 0xff + 38:src/pcd/rc632_highlevel.c **** #define OPENPCD_14443B_BITPHASE 0xad + 39:src/pcd/rc632_highlevel.c **** #define OPENPCD_14443B_THRESHOLD 0xff + 40:src/pcd/rc632_highlevel.c **** + 41:src/pcd/rc632_highlevel.c **** #define RC632_TMO_AUTH1 14000 + 42:src/pcd/rc632_highlevel.c **** + 43:src/pcd/rc632_highlevel.c **** #define RC632_TIMEOUT_FUZZ_FACTOR 10 + 44:src/pcd/rc632_highlevel.c **** + 45:src/pcd/rc632_highlevel.c **** #define USE_IRQ + 46:src/pcd/rc632_highlevel.c **** + 47:src/pcd/rc632_highlevel.c **** #define ENTER() DEBUGPCRF("entering") + 48:src/pcd/rc632_highlevel.c **** struct rfid_asic rc632; + 49:src/pcd/rc632_highlevel.c **** + 50:src/pcd/rc632_highlevel.c **** static int + 51:src/pcd/rc632_highlevel.c **** rc632_set_bit_mask(struct rfid_asic_handle *handle, + 52:src/pcd/rc632_highlevel.c **** u_int8_t reg, u_int8_t mask, u_int8_t val) + 53:src/pcd/rc632_highlevel.c **** { + 54:src/pcd/rc632_highlevel.c **** int ret; + 55:src/pcd/rc632_highlevel.c **** u_int8_t tmp; + 56:src/pcd/rc632_highlevel.c **** + 57:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, reg, &tmp); + 58:src/pcd/rc632_highlevel.c **** if (ret < 0) + 59:src/pcd/rc632_highlevel.c **** return ret; + 60:src/pcd/rc632_highlevel.c **** + 61:src/pcd/rc632_highlevel.c **** /* if bits are already like we want them, abort */ + 62:src/pcd/rc632_highlevel.c **** if ((tmp & mask) == val) + 63:src/pcd/rc632_highlevel.c **** return 0; + 64:src/pcd/rc632_highlevel.c **** + 65:src/pcd/rc632_highlevel.c **** return opcd_rc632_reg_write(handle, reg, (tmp & ~mask)|(val & mask)); + 66:src/pcd/rc632_highlevel.c **** } + 67:src/pcd/rc632_highlevel.c **** + 68:src/pcd/rc632_highlevel.c **** int + 69:src/pcd/rc632_highlevel.c **** rc632_turn_on_rf(struct rfid_asic_handle *handle) + 70:src/pcd/rc632_highlevel.c **** { + 27 .loc 1 70 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 0 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 .LVL0: + 33 0000 08402DE9 stmfd sp!, {r3, lr} + 34 .LCFI0: + 35 .cfi_def_cfa_offset 8 + 71:src/pcd/rc632_highlevel.c **** ENTER(); + 72:src/pcd/rc632_highlevel.c **** return opcd_rc632_set_bits(handle, RC632_REG_TX_CONTROL, 0x03); + 36 .loc 1 72 0 + 37 0004 1110A0E3 mov r1, #17 + 38 0008 0320A0E3 mov r2, #3 + 39 .cfi_offset 14, -4 + 40 .cfi_offset 3, -8 + 41 000c FEFFFFEB bl opcd_rc632_set_bits + 42 .LVL1: + 73:src/pcd/rc632_highlevel.c **** } + 43 .loc 1 73 0 + 44 0010 0840BDE8 ldmfd sp!, {r3, lr} + 45 0014 1EFF2FE1 bx lr + 46 .cfi_endproc + 47 .LFE1: + 49 .align 2 + 50 .global rc632_turn_off_rf + 52 rc632_turn_off_rf: + 53 .LFB2: + 74:src/pcd/rc632_highlevel.c **** + 75:src/pcd/rc632_highlevel.c **** int + 76:src/pcd/rc632_highlevel.c **** rc632_turn_off_rf(struct rfid_asic_handle *handle) + 77:src/pcd/rc632_highlevel.c **** { + 54 .loc 1 77 0 + 55 .cfi_startproc + 56 @ Function supports interworking. + 57 @ args = 0, pretend = 0, frame = 0 + 58 @ frame_needed = 0, uses_anonymous_args = 0 + 59 .LVL2: + 60 0018 08402DE9 stmfd sp!, {r3, lr} + 61 .LCFI1: + 62 .cfi_def_cfa_offset 8 + 78:src/pcd/rc632_highlevel.c **** ENTER(); + 79:src/pcd/rc632_highlevel.c **** return opcd_rc632_clear_bits(handle, RC632_REG_TX_CONTROL, 0x03); + 63 .loc 1 79 0 + 64 001c 1110A0E3 mov r1, #17 + 65 0020 0320A0E3 mov r2, #3 + 66 .cfi_offset 14, -4 + 67 .cfi_offset 3, -8 + 68 0024 FEFFFFEB bl opcd_rc632_clear_bits + 69 .LVL3: + 80:src/pcd/rc632_highlevel.c **** } + 70 .loc 1 80 0 + 71 0028 0840BDE8 ldmfd sp!, {r3, lr} + 72 002c 1EFF2FE1 bx lr + 73 .cfi_endproc + 74 .LFE2: + 76 .align 2 + 77 .global rc632_write_eeprom + 79 rc632_write_eeprom: + 80 .LFB5: + 81:src/pcd/rc632_highlevel.c **** + 82:src/pcd/rc632_highlevel.c **** static int + 83:src/pcd/rc632_highlevel.c **** rc632_power_up(struct rfid_asic_handle *handle) + 84:src/pcd/rc632_highlevel.c **** { + 85:src/pcd/rc632_highlevel.c **** ENTER(); + 86:src/pcd/rc632_highlevel.c **** return opcd_rc632_clear_bits(handle, RC632_REG_CONTROL, + 87:src/pcd/rc632_highlevel.c **** RC632_CONTROL_POWERDOWN); + 88:src/pcd/rc632_highlevel.c **** } + 89:src/pcd/rc632_highlevel.c **** + 90:src/pcd/rc632_highlevel.c **** static int + 91:src/pcd/rc632_highlevel.c **** rc632_power_down(struct rfid_asic_handle *handle) + 92:src/pcd/rc632_highlevel.c **** { + 93:src/pcd/rc632_highlevel.c **** return opcd_rc632_set_bits(handle, RC632_REG_CONTROL, + 94:src/pcd/rc632_highlevel.c **** RC632_CONTROL_POWERDOWN); + 95:src/pcd/rc632_highlevel.c **** } + 96:src/pcd/rc632_highlevel.c **** + 97:src/pcd/rc632_highlevel.c **** #define MAX_WRITE_LEN 16 /* see Sec. 18.6.1.2 of RC632 Spec Rev. 3.2. */ + 98:src/pcd/rc632_highlevel.c **** + 99:src/pcd/rc632_highlevel.c **** int + 100:src/pcd/rc632_highlevel.c **** rc632_write_eeprom(struct rfid_asic_handle *handle, + 101:src/pcd/rc632_highlevel.c **** u_int16_t addr, u_int8_t len, u_int8_t *data) + 102:src/pcd/rc632_highlevel.c **** { + 81 .loc 1 102 0 + 82 .cfi_startproc + 83 @ Function supports interworking. + 84 @ args = 0, pretend = 0, frame = 24 + 85 @ frame_needed = 0, uses_anonymous_args = 0 + 86 .LVL4: + 87 0030 30402DE9 stmfd sp!, {r4, r5, lr} + 88 .LCFI2: + 89 .cfi_def_cfa_offset 12 + 103:src/pcd/rc632_highlevel.c **** u_int8_t sndbuf[MAX_WRITE_LEN + 2]; + 104:src/pcd/rc632_highlevel.c **** u_int8_t reg; + 105:src/pcd/rc632_highlevel.c **** int ret; + 106:src/pcd/rc632_highlevel.c **** + 107:src/pcd/rc632_highlevel.c **** if (len > MAX_WRITE_LEN) + 90 .loc 1 107 0 + 91 0034 100052E3 cmp r2, #16 + 102:src/pcd/rc632_highlevel.c **** { + 92 .loc 1 102 0 + 93 0038 1CD04DE2 sub sp, sp, #28 + 94 .LCFI3: + 95 .cfi_def_cfa_offset 40 + 102:src/pcd/rc632_highlevel.c **** { + 96 .loc 1 102 0 + 97 003c 0240A0E1 mov r4, r2 + 98 .cfi_offset 14, -4 + 99 .cfi_offset 5, -8 + 100 .cfi_offset 4, -12 + 101 0040 0050A0E1 mov r5, r0 + 102 0044 01C0A0E1 mov ip, r1 + 103 .loc 1 107 0 + 104 0048 0300009A bls .L13 + 105 .L8: + 108:src/pcd/rc632_highlevel.c **** return -EINVAL; + 109:src/pcd/rc632_highlevel.c **** if (addr < 0x10) + 110:src/pcd/rc632_highlevel.c **** return -EPERM; + 111:src/pcd/rc632_highlevel.c **** if (addr > 0x1ff) + 112:src/pcd/rc632_highlevel.c **** return -EINVAL; + 106 .loc 1 112 0 + 107 004c 1500E0E3 mvn r0, #21 + 108 .LVL5: + 109 .L4: + 113:src/pcd/rc632_highlevel.c **** + 114:src/pcd/rc632_highlevel.c **** sndbuf[0] = addr & 0x00ff; /* LSB */ + 115:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; /* MSB */ + 116:src/pcd/rc632_highlevel.c **** memcpy(&sndbuf[2], data, len); + 117:src/pcd/rc632_highlevel.c **** + 118:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_fifo_write(handle, len + 2, sndbuf, 0x03); + 119:src/pcd/rc632_highlevel.c **** if (ret < 0) + 120:src/pcd/rc632_highlevel.c **** return ret; + 121:src/pcd/rc632_highlevel.c **** + 122:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_WRITE_E2); + 123:src/pcd/rc632_highlevel.c **** if (ret < 0) + 124:src/pcd/rc632_highlevel.c **** return ret; + 125:src/pcd/rc632_highlevel.c **** + 126:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + 127:src/pcd/rc632_highlevel.c **** if (ret < 0) + 128:src/pcd/rc632_highlevel.c **** return ret; + 129:src/pcd/rc632_highlevel.c **** + 130:src/pcd/rc632_highlevel.c **** if (reg & RC632_ERR_FLAG_ACCESS_ERR) + 131:src/pcd/rc632_highlevel.c **** return -EPERM; + 132:src/pcd/rc632_highlevel.c **** + 133:src/pcd/rc632_highlevel.c **** while (1) { + 134:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_SECONDARY_STATUS, ®); + 135:src/pcd/rc632_highlevel.c **** if (ret < 0) + 136:src/pcd/rc632_highlevel.c **** return ret; + 137:src/pcd/rc632_highlevel.c **** + 138:src/pcd/rc632_highlevel.c **** if (reg & RC632_SEC_ST_E2_READY) { + 139:src/pcd/rc632_highlevel.c **** /* the E2Write command must be terminated, See sec. 18.6.1.3 */ + 140:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + 141:src/pcd/rc632_highlevel.c **** break; + 142:src/pcd/rc632_highlevel.c **** } + 143:src/pcd/rc632_highlevel.c **** } + 144:src/pcd/rc632_highlevel.c **** + 145:src/pcd/rc632_highlevel.c **** return ret; + 146:src/pcd/rc632_highlevel.c **** } + 110 .loc 1 146 0 + 111 0050 1CD08DE2 add sp, sp, #28 + 112 0054 3040BDE8 ldmfd sp!, {r4, r5, lr} + 113 0058 1EFF2FE1 bx lr + 114 .LVL6: + 115 .L13: + 109:src/pcd/rc632_highlevel.c **** if (addr < 0x10) + 116 .loc 1 109 0 + 117 005c 0F0051E3 cmp r1, #15 + 118 0060 0100008A bhi .L14 + 119 .LVL7: + 120 .L9: + 131:src/pcd/rc632_highlevel.c **** return -EPERM; + 121 .loc 1 131 0 + 122 0064 0000E0E3 mvn r0, #0 + 123 0068 F8FFFFEA b .L4 + 124 .LVL8: + 125 .L14: + 111:src/pcd/rc632_highlevel.c **** if (addr > 0x1ff) + 126 .loc 1 111 0 + 127 006c 020C51E3 cmp r1, #512 + 128 0070 F5FFFF2A bcs .L8 + 115:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; /* MSB */ + 129 .loc 1 115 0 + 130 0074 21E4A0E1 mov lr, r1, lsr #8 + 116:src/pcd/rc632_highlevel.c **** memcpy(&sndbuf[2], data, len); + 131 .loc 1 116 0 + 132 0078 06008DE2 add r0, sp, #6 + 133 007c 0310A0E1 mov r1, r3 + 134 .LVL9: + 114:src/pcd/rc632_highlevel.c **** sndbuf[0] = addr & 0x00ff; /* LSB */ + 135 .loc 1 114 0 + 136 0080 04C0CDE5 strb ip, [sp, #4] + 115:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; /* MSB */ + 137 .loc 1 115 0 + 138 0084 05E0CDE5 strb lr, [sp, #5] + 116:src/pcd/rc632_highlevel.c **** memcpy(&sndbuf[2], data, len); + 139 .loc 1 116 0 + 140 0088 FEFFFFEB bl memcpy + 141 .LVL10: + 118:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_fifo_write(handle, len + 2, sndbuf, 0x03); + 142 .loc 1 118 0 + 143 008c 021084E2 add r1, r4, #2 + 144 0090 0500A0E1 mov r0, r5 + 145 0094 FF1001E2 and r1, r1, #255 + 146 0098 04208DE2 add r2, sp, #4 + 147 009c 0330A0E3 mov r3, #3 + 148 00a0 FEFFFFEB bl opcd_rc632_fifo_write + 149 .LVL11: + 119:src/pcd/rc632_highlevel.c **** if (ret < 0) + 150 .loc 1 119 0 + 151 00a4 000050E3 cmp r0, #0 + 152 00a8 E8FFFFBA blt .L4 + 122:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_WRITE_E2); + 153 .loc 1 122 0 + 154 00ac 0110A0E3 mov r1, #1 + 155 00b0 0500A0E1 mov r0, r5 + 156 .LVL12: + 157 00b4 0120A0E1 mov r2, r1 + 158 00b8 FEFFFFEB bl opcd_rc632_reg_write + 159 .LVL13: + 123:src/pcd/rc632_highlevel.c **** if (ret < 0) + 160 .loc 1 123 0 + 161 00bc 000050E3 cmp r0, #0 + 162 00c0 E2FFFFBA blt .L4 + 126:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + 163 .loc 1 126 0 + 164 00c4 0500A0E1 mov r0, r5 + 165 .LVL14: + 166 00c8 0A10A0E3 mov r1, #10 + 167 00cc 17208DE2 add r2, sp, #23 + 168 00d0 FEFFFFEB bl opcd_rc632_reg_read + 169 .LVL15: + 127:src/pcd/rc632_highlevel.c **** if (ret < 0) + 170 .loc 1 127 0 + 171 00d4 000050E3 cmp r0, #0 + 172 00d8 DCFFFFBA blt .L4 + 173 .LVL16: + 130:src/pcd/rc632_highlevel.c **** if (reg & RC632_ERR_FLAG_ACCESS_ERR) + 174 .loc 1 130 0 + 175 00dc 1730DDE5 ldrb r3, [sp, #23] @ zero_extendqisi2 + 176 .LVL17: + 177 00e0 200013E3 tst r3, #32 + 178 .LVL18: + 179 00e4 DEFFFF1A bne .L9 + 180 .LVL19: + 181 .L10: + 134:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_SECONDARY_STATUS, ®); + 182 .loc 1 134 0 + 183 00e8 0500A0E1 mov r0, r5 + 184 00ec 0510A0E3 mov r1, #5 + 185 00f0 17208DE2 add r2, sp, #23 + 186 00f4 FEFFFFEB bl opcd_rc632_reg_read + 187 .LVL20: + 135:src/pcd/rc632_highlevel.c **** if (ret < 0) + 188 .loc 1 135 0 + 189 00f8 000050E3 cmp r0, #0 + 190 00fc D3FFFFBA blt .L4 + 191 .LVL21: + 138:src/pcd/rc632_highlevel.c **** if (reg & RC632_SEC_ST_E2_READY) { + 192 .loc 1 138 0 + 193 0100 1700DDE5 ldrb r0, [sp, #23] @ zero_extendqisi2 + 194 .LVL22: + 195 0104 400010E3 tst r0, #64 + 196 .LVL23: + 197 0108 F6FFFF0A beq .L10 + 140:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + 198 .loc 1 140 0 + 199 010c 0500A0E1 mov r0, r5 + 200 .LVL24: + 201 0110 0110A0E3 mov r1, #1 + 202 0114 0020A0E3 mov r2, #0 + 203 0118 FEFFFFEB bl opcd_rc632_reg_write + 204 .LVL25: + 145:src/pcd/rc632_highlevel.c **** return ret; + 205 .loc 1 145 0 + 206 011c CBFFFFEA b .L4 + 207 .cfi_endproc + 208 .LFE5: + 210 .align 2 + 211 .global rc632_read_eeprom + 213 rc632_read_eeprom: + 214 .LFB6: + 147:src/pcd/rc632_highlevel.c **** + 148:src/pcd/rc632_highlevel.c **** int + 149:src/pcd/rc632_highlevel.c **** rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, u_int8_t len, + 150:src/pcd/rc632_highlevel.c **** u_int8_t *recvbuf) + 151:src/pcd/rc632_highlevel.c **** { + 215 .loc 1 151 0 + 216 .cfi_startproc + 217 @ Function supports interworking. + 218 @ args = 0, pretend = 0, frame = 8 + 219 @ frame_needed = 0, uses_anonymous_args = 0 + 220 .LVL26: + 221 0120 70402DE9 stmfd sp!, {r4, r5, r6, lr} + 222 .LCFI4: + 223 .cfi_def_cfa_offset 16 + 224 0124 01C0A0E1 mov ip, r1 + 225 0128 08D04DE2 sub sp, sp, #8 + 226 .LCFI5: + 227 .cfi_def_cfa_offset 24 + 152:src/pcd/rc632_highlevel.c **** u_int8_t sndbuf[3]; + 153:src/pcd/rc632_highlevel.c **** u_int8_t err; + 154:src/pcd/rc632_highlevel.c **** int ret; + 155:src/pcd/rc632_highlevel.c **** + 156:src/pcd/rc632_highlevel.c **** sndbuf[0] = (addr & 0xff); + 157:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; + 158:src/pcd/rc632_highlevel.c **** sndbuf[2] = len; + 159:src/pcd/rc632_highlevel.c **** + 160:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_fifo_write(handle, 3, sndbuf, 0x03); + 228 .loc 1 160 0 + 229 012c 0310A0E3 mov r1, #3 + 230 .LVL27: + 151:src/pcd/rc632_highlevel.c **** { + 231 .loc 1 151 0 + 232 0130 0240A0E1 mov r4, r2 + 233 .cfi_offset 14, -4 + 234 .cfi_offset 6, -8 + 235 .cfi_offset 5, -12 + 236 .cfi_offset 4, -16 + 157:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; + 237 .loc 1 157 0 + 238 0134 2CE4A0E1 mov lr, ip, lsr #8 + 151:src/pcd/rc632_highlevel.c **** { + 239 .loc 1 151 0 + 240 0138 0360A0E1 mov r6, r3 + 241 .loc 1 160 0 + 242 013c 04208DE2 add r2, sp, #4 + 243 .LVL28: + 244 0140 0130A0E1 mov r3, r1 + 245 .LVL29: + 151:src/pcd/rc632_highlevel.c **** { + 246 .loc 1 151 0 + 247 0144 0050A0E1 mov r5, r0 + 156:src/pcd/rc632_highlevel.c **** sndbuf[0] = (addr & 0xff); + 248 .loc 1 156 0 + 249 0148 04C0CDE5 strb ip, [sp, #4] + 157:src/pcd/rc632_highlevel.c **** sndbuf[1] = addr >> 8; + 250 .loc 1 157 0 + 251 014c 05E0CDE5 strb lr, [sp, #5] + 158:src/pcd/rc632_highlevel.c **** sndbuf[2] = len; + 252 .loc 1 158 0 + 253 0150 0640CDE5 strb r4, [sp, #6] + 254 .loc 1 160 0 + 255 0154 FEFFFFEB bl opcd_rc632_fifo_write + 256 .LVL30: + 161:src/pcd/rc632_highlevel.c **** if (ret < 0) + 257 .loc 1 161 0 + 258 0158 000050E3 cmp r0, #0 + 259 015c 050000BA blt .L16 + 162:src/pcd/rc632_highlevel.c **** return ret; + 163:src/pcd/rc632_highlevel.c **** + 164:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_READ_E2); + 260 .loc 1 164 0 + 261 0160 0500A0E1 mov r0, r5 + 262 .LVL31: + 263 0164 0110A0E3 mov r1, #1 + 264 0168 0320A0E3 mov r2, #3 + 265 016c FEFFFFEB bl opcd_rc632_reg_write + 266 .LVL32: + 165:src/pcd/rc632_highlevel.c **** if (ret < 0) + 267 .loc 1 165 0 + 268 0170 000050E3 cmp r0, #0 + 269 0174 020000AA bge .L18 + 270 .LVL33: + 271 .L16: + 166:src/pcd/rc632_highlevel.c **** return ret; + 167:src/pcd/rc632_highlevel.c **** + 168:src/pcd/rc632_highlevel.c **** /* usleep(20000); */ + 169:src/pcd/rc632_highlevel.c **** + 170:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + 171:src/pcd/rc632_highlevel.c **** if (err & RC632_ERR_FLAG_ACCESS_ERR) + 172:src/pcd/rc632_highlevel.c **** return -EPERM; + 173:src/pcd/rc632_highlevel.c **** + 174:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &err); + 175:src/pcd/rc632_highlevel.c **** if (err < len) + 176:src/pcd/rc632_highlevel.c **** len = err; + 177:src/pcd/rc632_highlevel.c **** + 178:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_fifo_read(handle, len, recvbuf); + 179:src/pcd/rc632_highlevel.c **** if (ret < 0) + 180:src/pcd/rc632_highlevel.c **** return ret; + 181:src/pcd/rc632_highlevel.c **** + 182:src/pcd/rc632_highlevel.c **** return len; + 183:src/pcd/rc632_highlevel.c **** } + 272 .loc 1 183 0 + 273 0178 08D08DE2 add sp, sp, #8 + 274 017c 7040BDE8 ldmfd sp!, {r4, r5, r6, lr} + 275 0180 1EFF2FE1 bx lr + 276 .LVL34: + 277 .L18: + 170:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + 278 .loc 1 170 0 + 279 0184 0500A0E1 mov r0, r5 + 280 .LVL35: + 281 0188 0A10A0E3 mov r1, #10 + 282 018c 07208DE2 add r2, sp, #7 + 283 0190 FEFFFFEB bl opcd_rc632_reg_read + 284 .LVL36: + 171:src/pcd/rc632_highlevel.c **** if (err & RC632_ERR_FLAG_ACCESS_ERR) + 285 .loc 1 171 0 + 286 0194 0730DDE5 ldrb r3, [sp, #7] @ zero_extendqisi2 + 287 .LVL37: + 288 0198 200013E3 tst r3, #32 + 289 .LVL38: + 172:src/pcd/rc632_highlevel.c **** return -EPERM; + 290 .loc 1 172 0 + 291 019c 0000E013 mvnne r0, #0 + 171:src/pcd/rc632_highlevel.c **** if (err & RC632_ERR_FLAG_ACCESS_ERR) + 292 .loc 1 171 0 + 293 01a0 F4FFFF1A bne .L16 + 174:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &err); + 294 .loc 1 174 0 + 295 01a4 0410A0E3 mov r1, #4 + 296 01a8 07208DE2 add r2, sp, #7 + 297 01ac 0500A0E1 mov r0, r5 + 298 01b0 FEFFFFEB bl opcd_rc632_reg_read + 299 .LVL39: + 300 01b4 0700DDE5 ldrb r0, [sp, #7] @ zero_extendqisi2 + 301 .LVL40: + 302 01b8 000054E1 cmp r4, r0 + 303 01bc 0040A021 movcs r4, r0 + 304 .LVL41: + 178:src/pcd/rc632_highlevel.c **** ret = opcd_rc632_fifo_read(handle, len, recvbuf); + 305 .loc 1 178 0 + 306 01c0 0410A0E1 mov r1, r4 + 307 01c4 0500A0E1 mov r0, r5 + 308 .LVL42: + 309 01c8 0620A0E1 mov r2, r6 + 310 01cc FEFFFFEB bl opcd_rc632_fifo_read + 182:src/pcd/rc632_highlevel.c **** return len; + 311 .loc 1 182 0 + 312 01d0 000050E3 cmp r0, #0 + 313 01d4 0400A0A1 movge r0, r4 + 314 01d8 E6FFFFEA b .L16 + 315 .cfi_endproc + 316 .LFE6: + 318 .align 2 + 319 .global rc632_get_serial + 321 rc632_get_serial: + 322 .LFB7: + 184:src/pcd/rc632_highlevel.c **** + 185:src/pcd/rc632_highlevel.c **** #define RC632_E2_PRODUCT_TYPE 0 + 186:src/pcd/rc632_highlevel.c **** #define RC632_E2_PRODUCT_SERIAL 8 + 187:src/pcd/rc632_highlevel.c **** #define RC632_E2_RS_MAX_P 14 + 188:src/pcd/rc632_highlevel.c **** + 189:src/pcd/rc632_highlevel.c **** int rc632_get_serial(struct rfid_asic_handle *handle, + 190:src/pcd/rc632_highlevel.c **** u_int32_t *serial) + 191:src/pcd/rc632_highlevel.c **** { + 323 .loc 1 191 0 + 324 .cfi_startproc + 325 @ Function supports interworking. + 326 @ args = 0, pretend = 0, frame = 0 + 327 @ frame_needed = 0, uses_anonymous_args = 0 + 328 @ link register save eliminated. + 329 .LVL43: + 330 .loc 1 191 0 + 331 01dc 0130A0E1 mov r3, r1 + 192:src/pcd/rc632_highlevel.c **** return rc632_read_eeprom(handle, RC632_E2_PRODUCT_SERIAL, + 332 .loc 1 192 0 + 333 01e0 0420A0E3 mov r2, #4 + 334 01e4 0810A0E3 mov r1, #8 + 335 .LVL44: + 193:src/pcd/rc632_highlevel.c **** 4, (u_int8_t *)serial); + 194:src/pcd/rc632_highlevel.c **** } + 336 .loc 1 194 0 + 192:src/pcd/rc632_highlevel.c **** return rc632_read_eeprom(handle, RC632_E2_PRODUCT_SERIAL, + 337 .loc 1 192 0 + 338 01e8 FEFFFFEA b rc632_read_eeprom + 339 .cfi_endproc + 340 .LFE7: + 342 .comm rc632,52,4 + 343 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 rc632_highlevel.c +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:24 .text:00000000 rc632_turn_on_rf +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:52 .text:00000018 rc632_turn_off_rf +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:79 .text:00000030 rc632_write_eeprom +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:213 .text:00000120 rc632_read_eeprom +C:\Users\netz\AppData\Local\Temp\ccJn8vw0.s:321 .text:000001dc rc632_get_serial + *COM*:00000034 rc632 + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +opcd_rc632_set_bits +opcd_rc632_clear_bits +memcpy +opcd_rc632_fifo_write +opcd_rc632_reg_write +opcd_rc632_reg_read +opcd_rc632_fifo_read diff --git a/firmware/src/pcd/usb_strings_app.h b/firmware/src/pcd/usb_strings_app.h new file mode 100644 index 0000000..172348f --- /dev/null +++ b/firmware/src/pcd/usb_strings_app.h @@ -0,0 +1,137 @@ +#ifndef _USB_STRINGS_H +#define _USB_STRINGS_H + +/* THIS FILE IS AUTOGENERATED, DO NOT MODIFY MANUALLY */ + +#include +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string0 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 1 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = {0x0409 /* English */ }, +}; + +/* String 1 "OpenPCD DFU Interface - Application Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string1 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 45 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, 0x0066, + 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, 0x0020, + 0x0041, 0x0070, 0x0070, 0x006c, 0x0069, 0x0063, + 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0x0020, + 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, + 0x0069, 0x006f, 0x006e, }, +}; + +/* String 2 "OpenPCD DFU Interface - Bootloader Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string2 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 44 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, 0x0066, + 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, 0x0020, + 0x0042, 0x006f, 0x006f, 0x0074, 0x006c, 0x006f, + 0x0061, 0x0064, 0x0065, 0x0072, 0x0020, 0x0050, + 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, 0x0069, + 0x006f, 0x006e, }, +}; + +/* String 3 "bitmanufaktur.de IT Solutions and hmw-consulting.de" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string3 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 51 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x0062, 0x0069, 0x0074, 0x006d, 0x0061, 0x006e, + 0x0075, 0x0066, 0x0061, 0x006b, 0x0074, 0x0075, + 0x0072, 0x002e, 0x0064, 0x0065, 0x0020, 0x0049, + 0x0054, 0x0020, 0x0053, 0x006f, 0x006c, 0x0075, + 0x0074, 0x0069, 0x006f, 0x006e, 0x0073, 0x0020, + 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x006d, + 0x0077, 0x002d, 0x0063, 0x006f, 0x006e, 0x0073, + 0x0075, 0x006c, 0x0074, 0x0069, 0x006e, 0x0067, + 0x002e, 0x0064, 0x0065, }, +}; + +/* String 4 "OpenPCD RFID Reader - Runtime Mode" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string4 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 34 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0052, 0x0046, 0x0049, 0x0044, + 0x0020, 0x0052, 0x0065, 0x0061, 0x0064, 0x0065, + 0x0072, 0x0020, 0x002d, 0x0020, 0x0052, 0x0075, + 0x006e, 0x0074, 0x0069, 0x006d, 0x0065, 0x0020, + 0x004d, 0x006f, 0x0064, 0x0065, }, +}; + +/* String 5 "OpenPCD Runtime Configuration" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string5 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 29 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0052, 0x0075, 0x006e, 0x0074, + 0x0069, 0x006d, 0x0065, 0x0020, 0x0043, 0x006f, + 0x006e, 0x0066, 0x0069, 0x0067, 0x0075, 0x0072, + 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, }, +}; + +/* String 6 "OpenPCD Runtime Interface" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string6 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 25 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0052, 0x0075, 0x006e, 0x0074, + 0x0069, 0x006d, 0x0065, 0x0020, 0x0049, 0x006e, + 0x0074, 0x0065, 0x0072, 0x0066, 0x0061, 0x0063, + 0x0065, }, +}; + +static const struct usb_descriptor_header *usb_strings[] = { + (struct usb_descriptor_header *) &string0, + (struct usb_descriptor_header *) &string1, + (struct usb_descriptor_header *) &string2, + (struct usb_descriptor_header *) &string3, + (struct usb_descriptor_header *) &string4, + (struct usb_descriptor_header *) &string5, + (struct usb_descriptor_header *) &string6, +}; + +#endif /* _USB_STRINGS_H */ diff --git a/firmware/src/pcd/usb_strings_app.txt b/firmware/src/pcd/usb_strings_app.txt new file mode 100644 index 0000000..a4e9f57 --- /dev/null +++ b/firmware/src/pcd/usb_strings_app.txt @@ -0,0 +1,6 @@ +OpenPCD DFU Interface - Application Partition +OpenPCD DFU Interface - Bootloader Partition +bitmanufaktur.de IT Solutions and hmw-consulting.de +OpenPCD RFID Reader - Runtime Mode +OpenPCD Runtime Configuration +OpenPCD Runtime Interface diff --git a/firmware/src/pcd/usb_strings_dfu.h b/firmware/src/pcd/usb_strings_dfu.h new file mode 100644 index 0000000..757035d --- /dev/null +++ b/firmware/src/pcd/usb_strings_dfu.h @@ -0,0 +1,120 @@ +#ifndef _USB_STRINGS_H +#define _USB_STRINGS_H + +/* THIS FILE IS AUTOGENERATED, DO NOT MODIFY MANUALLY */ + +#include +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string0 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 1 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = {0x0409 /* English */ }, +}; + +/* String 1 "bitmanufaktur.de IT Solutions and hmw-consulting.de" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string1 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 51 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x0062, 0x0069, 0x0074, 0x006d, 0x0061, 0x006e, + 0x0075, 0x0066, 0x0061, 0x006b, 0x0074, 0x0075, + 0x0072, 0x002e, 0x0064, 0x0065, 0x0020, 0x0049, + 0x0054, 0x0020, 0x0053, 0x006f, 0x006c, 0x0075, + 0x0074, 0x0069, 0x006f, 0x006e, 0x0073, 0x0020, + 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x006d, + 0x0077, 0x002d, 0x0063, 0x006f, 0x006e, 0x0073, + 0x0075, 0x006c, 0x0074, 0x0069, 0x006e, 0x0067, + 0x002e, 0x0064, 0x0065, }, +}; + +/* String 2 "OpenPCD RFID Reader - DFU Mode" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string2 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 30 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0052, 0x0046, 0x0049, 0x0044, + 0x0020, 0x0052, 0x0065, 0x0061, 0x0064, 0x0065, + 0x0072, 0x0020, 0x002d, 0x0020, 0x0044, 0x0046, + 0x0055, 0x0020, 0x004d, 0x006f, 0x0064, 0x0065, +}, +}; + +/* String 3 "OpenPCD DFU Configuration" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string3 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 25 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x0043, 0x006f, 0x006e, 0x0066, 0x0069, 0x0067, + 0x0075, 0x0072, 0x0061, 0x0074, 0x0069, 0x006f, + 0x006e, }, +}; + +/* String 4 "OpenPCD DFU Interface - Application Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string4 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 45 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, 0x0066, + 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, 0x0020, + 0x0041, 0x0070, 0x0070, 0x006c, 0x0069, 0x0063, + 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0x0020, + 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, + 0x0069, 0x006f, 0x006e, }, +}; + +/* String 5 "OpenPCD DFU Interface - Bootloader Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string5 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 44 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0043, + 0x0044, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, 0x0066, + 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, 0x0020, + 0x0042, 0x006f, 0x006f, 0x0074, 0x006c, 0x006f, + 0x0061, 0x0064, 0x0065, 0x0072, 0x0020, 0x0050, + 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, 0x0069, + 0x006f, 0x006e, }, +}; + +static const struct usb_descriptor_header *usb_strings[] = { + (struct usb_descriptor_header *) &string0, + (struct usb_descriptor_header *) &string1, + (struct usb_descriptor_header *) &string2, + (struct usb_descriptor_header *) &string3, + (struct usb_descriptor_header *) &string4, + (struct usb_descriptor_header *) &string5, +}; + +#endif /* _USB_STRINGS_H */ diff --git a/firmware/src/pcd/usb_strings_dfu.txt b/firmware/src/pcd/usb_strings_dfu.txt new file mode 100644 index 0000000..a7714b7 --- /dev/null +++ b/firmware/src/pcd/usb_strings_dfu.txt @@ -0,0 +1,5 @@ +bitmanufaktur.de IT Solutions and hmw-consulting.de +OpenPCD RFID Reader - DFU Mode +OpenPCD DFU Configuration +OpenPCD DFU Interface - Application Partition +OpenPCD DFU Interface - Bootloader Partition diff --git a/firmware/src/picc/adc.c b/firmware/src/picc/adc.c new file mode 100644 index 0000000..f350a49 --- /dev/null +++ b/firmware/src/picc/adc.c @@ -0,0 +1,157 @@ +/* AT91SAM7 ADC controller routines for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include "../openpcd.h" +#include + +#define OPENPICC_ADC_CH_FIELDSTR AT91C_ADC_CH4 +#define OPENPICC_ADC_CH_PLL_DEM AT91C_ADC_CH5 + +#define DEBUG_ADC + +#ifdef DEBUG_ADC +#define DEBUGADC DEBUGP +#else +#define DEBUGADC do { } while (0) +#endif + +static const AT91PS_ADC adc = AT91C_BASE_ADC; + +enum adc_states { + ADC_NONE, + ADC_READ_CONTINUOUS, + ADC_READ_CONTINUOUS_USB, + ADC_READ_SINGLE, +}; + +struct adc_state { + enum adc_states state; + struct req_ctx *rctx; +}; + +static struct adc_state adc_state; + +static void adc_irq(void) +{ + u_int32_t sr = adc->ADC_SR; + struct req_ctx *rctx = adc_state.rctx; + + DEBUGADC("adc_irq(SR=0x%08x, IMR=0x%08x, state=%u): ", + sr, adc->ADC_IMR, adc_state.state); + + switch (adc_state.state) { + case ADC_NONE: + //break; + case ADC_READ_CONTINUOUS_USB: + if (sr & AT91C_ADC_EOC4) + DEBUGADC("CDR4=0x%4x ", adc->ADC_CDR4); + if (sr & AT91C_ADC_EOC5) + DEBUGADC("CDR5=0x%4x ", adc->ADC_CDR5); + if (sr & AT91C_ADC_ENDRX) { + /* rctx full, get rid of it */ + DEBUGADC("sending rctx (val=%s) ", + hexdump(rctx->data[4], 2)); + + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + adc_state.state = ADC_NONE; + adc_state.rctx = NULL; + + //AT91F_PDC_SetRx(AT91C_BASE_PDC_ADC, NULL, 0); + + /* Disable EOC interrupts since we don't want to + * re-start conversion any further*/ + AT91F_ADC_DisableIt(AT91C_BASE_ADC, AT91C_ADC_ENDRX); + //AT91C_ADC_EOC4|AT91C_ADC_EOC5|AT91C_ADC_ENDRX); + AT91F_PDC_DisableRx(AT91C_BASE_PDC_ADC); + DEBUGADC("disabled IT/RX "); + } else { + if (sr & (AT91C_ADC_EOC4|AT91C_ADC_EOC5)) { + /* re-start conversion, since we need more values */ + AT91F_ADC_StartConversion(adc); + } + } + break; + } + + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_ADC); + DEBUGADC("cleeared ADC IRQ in AIC\r\n"); +} + +#if 0 +u_int16_t adc_read_fieldstr(void) +{ + return adc->ADC_CDR4; +} + +u_int16_T adc_read_pll_dem(void) +{ + return adc +} +#endif + +static int adc_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) &rctx->data[0]; + + switch (poh->cmd) { + case OPENPCD_CMD_ADC_READ: + DEBUGADC("ADC_READ(chan=%u, len=%u) ", poh->reg, poh->val); + //channel = poh->reg; + if (adc_state.rctx) { + /* FIXME: do something */ + req_ctx_put(rctx); + } + + adc_state.state = ADC_READ_CONTINUOUS_USB; + adc_state.rctx = rctx; + rctx->tot_len = sizeof(*poh) + poh->val * 2; + AT91F_PDC_SetRx(AT91C_BASE_PDC_ADC, rctx->data, poh->val); + AT91F_PDC_EnableRx(AT91C_BASE_PDC_ADC); + AT91F_ADC_EnableChannel(AT91C_BASE_ADC, OPENPICC_ADC_CH_FIELDSTR); + AT91F_ADC_EnableIt(AT91C_BASE_ADC, AT91C_ADC_ENDRX | + OPENPICC_ADC_CH_FIELDSTR); + AT91F_ADC_StartConversion(adc); + break; + } +} + +int adc_init(void) +{ + AT91F_ADC_CfgPMC(); + AT91F_ADC_CfgTimings(AT91C_BASE_ADC, 48 /*MHz*/, 5 /*MHz*/, + 20/*uSec*/, 700/*nSec*/); +#if 0 + AT91F_ADC_EnableChannel(AT91C_BASE_ADC, OPENPICC_ADC_CH_FIELDSTR | + OPENPICC_ADC_CH_PLL_DEM); +#endif + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_ADC, + AT91C_AIC_PRIOR_LOWEST, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &adc_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_ADC); + + usb_hdlr_register(&adc_usb_in, OPENPCD_CMD_CLS_ADC); +} diff --git a/firmware/src/picc/da.c b/firmware/src/picc/da.c new file mode 100644 index 0000000..aebb283 --- /dev/null +++ b/firmware/src/picc/da.c @@ -0,0 +1,70 @@ +/* SPI DAC AD5300 Driver for OpenPICC + * (C) 2006 by Harald Welte + * All bugs added by Henryk Plötz + * + * 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 + * + */ + + + +#include +#include +#include "../openpcd.h" + +static const AT91PS_SPI spi = AT91C_BASE_SPI; + +void da_comp_carr(u_int8_t position) +{ + volatile int i; + + while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { } + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + /* shift four left, since it is an eight-bit value written as 16 bit xfer + bits 15 and 14 are don't care + bits 13 and 12 are mode (0 is normal operation) + bits 11 thru 4 are data + bits 3 thru 0 are don't care + */ + spi->SPI_TDR = position << 4; + while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { } + for (i = 0; i < 0xff; i++) { } + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); +} + +void da_init(void) +{ + AT91F_SPI_CfgPMC(); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + AT91C_PA13_MOSI | AT91C_PA14_SPCK, 0); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + +#if 0 + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + OPENPCD_IRQ_PRIO_SPI, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &spi_irq); + AT91G_AIC_EnableIt(AT9C_BASE_AIC, AT91C_ID_SPI); +#endif + AT91F_SPI_CfgMode(spi, AT91C_SPI_MSTR | + AT91C_SPI_PS_FIXED | AT91C_SPI_MODFDIS); + /* CPOL = 1, NCPHA = 1, CSAAT = 0, BITS = 1000, SCBR = 13 (3.69MHz), + * DLYBS = 6 (125nS), DLYBCT = 0 */ + AT91F_SPI_CfgCs(spi, 0, AT91C_SPI_CPOL | AT91C_SPI_BITS_16 | + AT91C_SPI_NCPHA | (13 << 8) | (6 << 16)); + AT91F_SPI_Enable(spi); + +} diff --git a/firmware/src/picc/da.h b/firmware/src/picc/da.h new file mode 100644 index 0000000..e264e2b --- /dev/null +++ b/firmware/src/picc/da.h @@ -0,0 +1,7 @@ +#ifndef _DA_H +#define _DA_H + +extern void da_comp_carr(u_int8_t position); +extern void da_init(void); + +#endif diff --git a/firmware/src/picc/decoder.c b/firmware/src/picc/decoder.c new file mode 100644 index 0000000..bdd910e --- /dev/null +++ b/firmware/src/picc/decoder.c @@ -0,0 +1,80 @@ +/* Decoder Core for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +#include +#include +#include + +#include + +static struct decoder_algo *decoder_algo[DECODER_NUM_ALGOS]; + +static int get_next_data(struct decoder_state *st, u_int8_t *data) +{ + u_int8_t parity_sample; + u_int32_t bytesample; + + bytesample = st->algo->get_next_bytesample(st, &parity_sample); + + return st->algo->decode_sample(bytesample, data); +} + +/* iterate over sample buffer (size N bytes) and decode data */ +int decoder_decode(u_int8_t algo, const char *sample_buf, + int sample_buf_size, char *data_buf) +{ + int i, ret; + struct decoder_state st; + + if (algo >= DECODER_NUM_ALGOS) + return -EINVAL; + + st.buf = sample_buf; + st.buf32 = (u_int32_t *) st.buf; + st.bit_ofs = 0; + st.algo = decoder_algo[algo]; + + for (i = 0; i < (sample_buf_size*8)/st.algo->bits_per_sampled_char; + i++) { + ret = get_next_data(&st, &data_buf[i]); + if (ret < 0) { + DEBUGPCR("decoder error %d at data byte %u", + ret, i); + return ret; + } + } + + return i+1; +} + +int decoder_register(int algnum, struct decoder_algo *algo) +{ + if (algnum >= DECODER_NUM_ALGOS) + return -EINVAL; + + decoder_algo[algnum] = algo; + + return 0; +} + +void decoder_init(void) +{ + decoder_register(DECODER_MILLER, &miller_decoder); + decoder_register(DECODER_NRZL, &nrzl_decoder); +} diff --git a/firmware/src/picc/decoder.h b/firmware/src/picc/decoder.h new file mode 100644 index 0000000..aef0e20 --- /dev/null +++ b/firmware/src/picc/decoder.h @@ -0,0 +1,32 @@ +#ifndef _DECODER_H +#define _DECODER_H + +struct decoder_state; + +struct decoder_algo { + u_int8_t oversampling_rate; + u_int8_t bits_per_sampled_char; + u_int32_t bytesample_mask; + int (*decode_sample)(const u_int32_t sample, u_int8_t data); + u_int32_t (*get_next_bytesample)(struct decoder_state *st, u_int8_t *parity_sample); +}; + +struct decoder_state { + struct decoder_algo *algo; + u_int8_t bit_ofs; + const char *buf; + const u_int32_t *buf32; +}; + +extern int decoder_register(int algnum, struct decoder_algo *algo); +extern int decoder_decode(u_int8_t algo, const char *sample_buf, + int sample_buf_size, char *data_buf); + +#define DECODER_MILLER 0 +#define DECODER_NRZL 1 +#define DECODER_NUM_ALGOS 2 + +static struct decoder_algo nrzl_decoder; +static struct decoder_algo miller_decoder; + +#endif diff --git a/firmware/src/picc/decoder_miller.c b/firmware/src/picc/decoder_miller.c new file mode 100644 index 0000000..cc62672 --- /dev/null +++ b/firmware/src/picc/decoder_miller.c @@ -0,0 +1,129 @@ +/* + * ISO14443A modified Miller decoder for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +/* + * LSB First LSB hex + * Sequence X 0010 0100 0x4 + * Sequence Y 0000 0000 0x0 + * Sequence Z 1000 0001 0x1 + * + * Logic 1 Sequence X + * Logic 0 Sequence Y with two exceptions: + * - if there are more contiguous 0, Z used from second one + * - if the first bit after SOF is 0, sequence Z used for all contig 0's + * SOF Sequence Z + * EOF Logic 0 followed by Sequence Y + * + * cmd hex bits symbols hex (quad-sampled) + * + * REQA 0x26 S 0110010 E Z ZXXYZXY ZY 0x10410441 + * WUPA 0x52 S 0100101 E Z ZXYZXYX YY 0x04041041 + * + * SOF is 'eaten' by SSC start condition (Compare 0). Remaining bits are + * mirrored, e.g. samples for LSB of first byte are & 0xf + * + */ + +#include + +#include +#include + + +#define OVERSAMPLING_RATE 4 + +/* definitions for four-times oversampling */ +#define SEQ_X 0x4 +#define SEQ_Y 0x0 +#define SEQ_Z 0x1 + +/* decode a single sampled bit */ +static u_int8_t miller_decode_sampled_bit(u_int32_t sampled_bit) +{ + switch (sampled_bit) { + case SEQ_X: + return 1; + break; + case SEQ_Z: + case SEQ_Y: + return 0; + break; + default: + DEBUGP("unknown sequence sample `%x' ", sampled_bit); + return 2; + break; + } +} + +/* decode a single 32bit data sample of an 8bit miller encoded word */ +static int miller_decode_sample(u_int32_t sample, u_int8_t *data) +{ + u_int8_t ret = 0; + unsigned int i; + + for (i = 0; i < sizeof(sample)/OVERSAMPLING_RATE; i++) { + u_int8_t bit = miller_decode_sampled_bit(sample & 0xf); + + if (bit == 1) + ret |= 1; + /* else do nothing since ret was initialized with 0 */ + + /* skip shifting in case of last data bit */ + if (i == sizeof(sample)/OVERSAMPLING_RATE) + break; + + sample = sample >> OVERSAMPLING_RATE; + ret = ret << 1; + } + + *data = ret; + + return ret; +} + +static u_int32_t get_next_bytesample(struct decoder_state *ms, + u_int8_t *parity_sample) +{ + u_int32_t ret = 0; + + /* get remaining bits from the current word */ + ret = *(ms->buf32) >> ms->bit_ofs; + /* move to next word */ + ms->buf32++; + + /* if required, get remaining bits from next word */ + if (ms->bit_ofs) + ret |= *(ms->buf32) << (32 - ms->bit_ofs); + + *parity_sample = (*(ms->buf32) >> ms->bit_ofs & 0xf); + + /* increment bit offset (modulo 32) */ + ms->bit_ofs = (ms->bit_ofs + OVERSAMPLING_RATE) % 32; + + return ret; +} + +static struct decoder_algo miller_decoder = { + .oversampling_rate = OVERSAMPLING_RATE, + .bits_per_sampled_char = 9 * OVERSAMPLING_RATE, + .bytesample_mask = 0xffffffff, + .decode_sample = &miller_decode_sample, + .get_next_bytesample = &get_next_bytesample, +}; diff --git a/firmware/src/picc/decoder_nrzl.c b/firmware/src/picc/decoder_nrzl.c new file mode 100644 index 0000000..136a9c8 --- /dev/null +++ b/firmware/src/picc/decoder_nrzl.c @@ -0,0 +1,108 @@ +/* NRZ-L decoder implementation for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +/* + * speed(kbps) 106 212 424 848 + * etu 128/fc 64/fc 32/fc 16/fc + * etu(usec) 9.4 4.7 2.35 1.18 + * + * NRZ-L coding with logic level + * + * logic 1: carrier high field amplitude (no modulation) + * logic 0: carrier low field amplitude + * + * Character transmission format: + * start bit: logic 0 + * data: eight bits, lsb first + * stop bit logic 1 + * + * Frame Format: + * + * SOF char [EGT char, ...] EOF + * + * SOF: falling edge, 10..11 etu '0', rising edge in 1etu, 2..3etu '1' + * EGT: between 0 and 57uS + * EOF: falling edge, 10..11 etu '0', rising edge in 1etu + * + * + * Sampling + * - sample once per bit clock, exactly in the middle of it + * - synchronize CARRIER_DIV TC0 to first falling edge + * - Configure CARRIER_DIV RA compare (rising edge) to be at + * etu/2 carrier clocks. + * - problem: SOF 12..14etu length, therefore we cannot specify + * SOF as full start condition and then sample with 10bit + * frames :( + * + */ + +#include +#include +#include +#include + +/* currently this code will only work with oversampling_rate == 1 */ +#define OVERSAMPLING_RATE 1 + +static u_int32_t get_next_bytesample(struct decoder_state *st, + u_int8_t *parity_sample) +{ + u_int32_t ret = 0; + u_int8_t bits_per_sampled_char = st->algo->bits_per_sampled_char; + u_int8_t bytesample_mask = st->algo->bytesample_mask; + + /* FIXME: shift start and stop bit into parity_sample and just + * return plain 8-bit data word */ + + /* first part of 10-databit bytesample */ + ret = (*(st->buf32) >> st->bit_ofs) & bytesample_mask; + + if (st->bit_ofs > 32 - bits_per_sampled_char) { + /* second half of 10-databit bytesample */ + st->buf32++; + ret |= (*(st->buf32) << (32 - st->bit_ofs)); + } + st->bit_ofs = (st->bit_ofs + bits_per_sampled_char) % 32; + + return ret & bytesample_mask; +} + +static int nrzl_decode_sample(const u_int32_t sample, u_int8_t *data) +{ + *data = (sample >> 1) & 0xff; + + if (!(sample & 0x01)) { + DEBUGPCRF("invalid start bit 0!"); + return -EIO; + } + if (sample & 0x20) { + DEBUGPCRF("invalid stop bit 1!"); + return -EIO; + } + + return 0; +} + +static struct decoder_algo nrzl_decoder = { + .oversampling_rate = OVERSAMPLING_RATE, + .bits_per_sampled_char = 10 * OVERSAMPLING_RATE, + .bytesample_mask = 0x3ff, + .decode_sample = &nrzl_decode_sample, + .get_next_bytesample = &get_next_bytesample, +}; diff --git a/firmware/src/picc/iso14443a_manchester.c b/firmware/src/picc/iso14443a_manchester.c new file mode 100644 index 0000000..f9eba1e --- /dev/null +++ b/firmware/src/picc/iso14443a_manchester.c @@ -0,0 +1,123 @@ +/* ISO14443A Manchester encoder for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +/* + * Definitions for 106kBps, at sampling clock 1695kHz + * + * bit sample pattern for one bit cycle + * MSB first LSB first hex LSB first + * Sequence D 1010101000000000 0000000001010101 0x0055 + * Sequence E 0000000010101010 0101010100000000 0x5500 + * Sequence F 1010101010101010 0101010101010101 0x5555 + * + * Logic 1 Sequence D + * Logic 0 Sequence E + * SOF Sequence D + * EOF Sequence F + * + * 212/424/848kBps: BPSK. + * + * SOF: 32 subcarrier clocks + bit '0' + * + * SOF: hex LSB first: 0x55555555 55555555 + bit '0' + * + * EOF: even parity of last byte (!) + * + */ + +#define MANCHESTER_SEQ_D 0x0055 +#define MANCHESTER_SEQ_E 0x5500 +#define MANCHESTER_SEQ_F 0x5555 + +static u_int32_t manchester_sample_size(u_int8_t frame_bytelen) +{ + /* 16 bits (2 bytes) per bit => 16 bytes samples per data byte, + * plus 16bit (2 bytes) parity per data byte + * plus 16bit (2 bytes) SOF plus 16bit (2 bytes) EOF */ + return (frame_bytelen*18) + 2 + 2; + + /* this results in a maximum samples-per-frame size of 4612 bytes + * for a 256byte frame */ +} + +struct manch_enc_state { + const char *data; + char *samples; + u_int16_t *samples16; +}; + +static void manchester_enc_byte(struct manch_enc_state *mencs, u_int8_t data) +{ + int i; + u_int8_t sum_1 = 0; + + /* append 8 sample blobs, one for each bit */ + for (i = 0; i < 8; i++) { + if (data & (1 << i)) { + *(mencs->samples16) = MANCHESTER_SEQ_D; + sum_1++; + } else { + *(mencs->samples16) = MANCHESTER_SEQ_E; + } + mencs->samples16++ + } + /* append odd parity */ + if (sum_1 & 0x01) + *(mencs->samples16) = MANCHESTER_SEQ_E; + else + *(mencs->samples16) = MANCHESTER_SEQ_D; + mencs->samples16++ +} + +int manchester_encode(char *sample_buf, u_int16_t sample_buf_len, + const char *data, u_int8_t data_len) +{ + int i, enc_size; + struct manch_enc_state mencs + + enc_size = manchester_sample_size(data_len); + + if (sample_buf_len < enc_size) + return -EINVAL; + + /* SOF */ + *(mencs.samples16++) = MANCHESTER_SEQ_D; + + for (i = 0; i < data_len; i++) + manchester_enc_byte(mencs, data[i]); + + /* EOF */ + *(mencs.samples16++) = MANCHESTER_SEQ_F; + + return enc_size; +} + +#define BPSK_SPEED_212 + + +static u_int32_t bpsk_sample_size(u_int8_t frame_bytelen) + +int bpsk_encode(char *sample_buf, u_int16_t sample_buf_len, + const char *data, u_int8_t data_len) +{ + /* burst of 32 sub carrier cycles */ + memset(sample_buf, 0x55, 8); + +} diff --git a/firmware/src/picc/load_modulation.c b/firmware/src/picc/load_modulation.c new file mode 100644 index 0000000..576bc74 --- /dev/null +++ b/firmware/src/picc/load_modulation.c @@ -0,0 +1,49 @@ +/* AT91SAM7 PWM routines for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +#include +#include + +#include "../openpcd.h" + +void load_mod_level(u_int8_t level) +{ + if (level > 3) + level = 3; + + if (level & 0x1) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD1); + else + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD1); + + if (level & 0x2) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD2); + else + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD2); +} + +void load_mod_init(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD1); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD2); + + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD1); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_LOAD2); +} diff --git a/firmware/src/picc/load_modulation.h b/firmware/src/picc/load_modulation.h new file mode 100644 index 0000000..71f9d6f --- /dev/null +++ b/firmware/src/picc/load_modulation.h @@ -0,0 +1,7 @@ +#ifndef _LOAD_MODULATION_H +#define _LOAD_MODULATION_H + +extern void load_mod_level(u_int8_t level); +extern void load_mod_init(void); + +#endif diff --git a/firmware/src/picc/main_openpicc.c b/firmware/src/picc/main_openpicc.c new file mode 100644 index 0000000..74700f8 --- /dev/null +++ b/firmware/src/picc/main_openpicc.c @@ -0,0 +1,259 @@ +/* OpenPICC Main Program + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include "../openpcd.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static const u_int16_t cdivs[] = { 8192, 2048, 1024, 512, 128, 64, 32, 16 }; +static u_int8_t cdiv_idx = 6; + +static u_int16_t duty_percent = 22; +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +static u_int32_t pwm_freq[] = { 105937, 211875, 423750, 847500 }; +static u_int8_t pwm_freq_idx = 0; + +static u_int8_t load_mod = 0; + +#define DA_BASELINE 192 + +void _init_func(void) +{ + /* low-level hardware initialization */ + pio_irq_init(); + pll_init(); + da_init(); + load_mod_init(); + tc_cdiv_init(); + //tc_fdt_init(); + pwm_init(); + adc_init(); + ssc_rx_init(); + ssc_tx_init(); + + /* high-level protocol */ + decoder_init(); + opicc_usbapi_init(); + + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, OPENPICC_PIO_BOOTLDR); + da_comp_carr(DA_BASELINE); +} + +static void help(void) +{ + DEBUGPCR("q: da decrease w: da increase\r\n" + "e: da retransmit P: PLL inhibit toggle"); + DEBUGPCR("o: decrease duty p: increase duty\r\n" + "k: stop pwm l: start pwn\r\n" + "n: decrease freq m: incresae freq"); + DEBUGPCR("u: PA23 const 1 y: PA23 const 0\r\n" + "t: PA23 PWM0 L: display PLL LOCK\r\n" + "{: decrease cdiv_idx }: increse cdiv idx\r\n" + "<: decrease cdiv_phase >: increase cdiv_phase"); + DEBUGPCR("v: decrease load_mod b: increase load_mod\r\n" + "B: read button S: toggle nSLAVE_RESET\r\n" + "a: SSC stop s: SSC start\r\n" + "d: SSC mode select T: TC_CDIV_HELP enable\r\n"); +} + +int _main_dbgu(char key) +{ + static u_int8_t poti = DA_BASELINE; + static u_int8_t pll_inh = 1; + static u_int8_t ssc_mode = 1; + static u_int8_t sync_enabled = 0; + + DEBUGPCRF("main_dbgu"); + + switch (key) { + case 'q': + if (poti > 0) + poti--; + da_comp_carr(poti); + DEBUGPCRF("DA: %u", poti); + break; + case 'w': + if (poti < 255) + poti++; + da_comp_carr(poti); + DEBUGPCRF("DA: %u", poti); + break; + case 'e': + da_comp_carr(poti); + DEBUGPCRF("DA: %u", poti); + break; + case 'P': + pll_inh++; + pll_inh &= 0x01; + pll_inhibit(pll_inh); + DEBUGPCRF("PLL Inhibit: %u", pll_inh); + break; + case 'L': + DEBUGPCRF("PLL Lock: %u", pll_is_locked()); + break; + case 'o': + if (duty_percent >= 1) + duty_percent--; + pwm_duty_set_percent(0, duty_percent); + break; + case 'p': + if (duty_percent <= 99) + duty_percent++; + pwm_duty_set_percent(0, duty_percent); + break; + case 'k': + pwm_stop(0); + break; + case 'l': + pwm_start(0); + break; + case 'n': + if (pwm_freq_idx > 0) { + pwm_freq_idx--; + pwm_stop(0); + pwm_freq_set(0, pwm_freq[pwm_freq_idx]); + pwm_start(0); + pwm_duty_set_percent(0, 22); /* 22% of 9.43uS = 2.07uS */ + } + break; + case 'm': + if (pwm_freq_idx < ARRAY_SIZE(pwm_freq)-1) { + pwm_freq_idx++; + pwm_stop(0); + pwm_freq_set(0, pwm_freq[pwm_freq_idx]); + pwm_start(0); + pwm_duty_set_percent(0, 22); /* 22% of 9.43uS = 2.07uS */ + } + break; + case 'u': + DEBUGPCRF("PA23 output high"); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + break; + case 'y': + DEBUGPCRF("PA23 output low"); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, AT91C_PIO_PA23); + break; + case 't': + DEBUGPCRF("PA23 PeriphA (PWM)"); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, 0, AT91C_PA23_PWM0); + break; + case '?': + help(); + break; + case '<': + tc_cdiv_phase_inc(); + break; + case '>': + tc_cdiv_phase_dec(); + break; + case '{': + if (cdiv_idx > 0) + cdiv_idx--; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; + case '}': + if (cdiv_idx < ARRAY_SIZE(cdivs)-1) + cdiv_idx++; + tc_cdiv_set_divider(cdivs[cdiv_idx]); + break; + case 'v': + if (load_mod > 0) + load_mod--; + load_mod_level(load_mod); + DEBUGPCR("load_mod: %u\n", load_mod); + break; + case 'b': + if (load_mod < 3) + load_mod++; + load_mod_level(load_mod); + DEBUGPCR("load_mod: %u\n", load_mod); + break; + case 'B': + DEBUGPCRF("Button status: %u\n", + AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, AT91F_PIO_IsInputSet)); + break; + case 'S': + if (AT91F_PIO_IsOutputSet(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET)) { + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET); + DEBUGPCRF("nSLAVE_RESET == LOW"); + } else { + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET); + DEBUGPCRF("nSLAVE_RESET == HIGH"); + } + break; + case 'a': + DEBUGPCRF("SSC RX STOP"); + ssc_rx_stop(); + break; + case 's': + DEBUGPCRF("SSC RX START"); + ssc_rx_start(); + break; + case 'd': + ssc_mode++; + if (ssc_mode >= 6) + ssc_mode = 0; + ssc_rx_mode_set(ssc_mode); + DEBUGPCRF("SSC MODE %u", ssc_mode); + break; + case 'T': + if (sync_enabled) { + tc_cdiv_sync_disable(); + sync_enabled = 0; + } else { + tc_cdiv_sync_enable(); + sync_enabled = 1; + } + break; + } + + tc_cdiv_print(); + //tc_fdt_print(); + ssc_print(); + + return -EINVAL; +} + +void _main_func(void) +{ + /* first we try to get rid of pending to-be-sent stuff */ + usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + usb_in_process(); + + udp_unthrottle(); + ssc_rx_unthrottle(); +} diff --git a/firmware/src/picc/openpicc.c b/firmware/src/picc/openpicc.c new file mode 100644 index 0000000..54139a9 --- /dev/null +++ b/firmware/src/picc/openpicc.c @@ -0,0 +1,86 @@ +/* Main state machine and register implementation for OpenPICC + * (C) 2006 by Harald Welte */ + +#include +#include +#include +#include +#include +#include + +#include "opicc_reg.h" + +/******************************************************************** + * OpenPICC Register set + ********************************************************************/ + +#ifdef DEBUG +/* Our registers, including their power-up default values */ +static u_int16_t opicc_regs[_OPICC_NUM_REGS] = { + [OPICC_REG_14443A_UIDLEN] = 4, + [OPICC_REG_14443A_FDT0] = 1236, + [OPICC_REG_14443A_FDT1] = 1172, + [OPICC_REG_14443A_STATE] = ISO14443A_ST_POWEROFF, + [OPICC_REG_14443A_ATQA] = 0x0001, + [OPICC_REG_RX_CLK_DIV] = 32, + [OPICC_REG_RX_CLK_PHASE] = 0, + [OPICC_REG_RX_CONTROL] = 0, + [OPICC_REG_TX_CLK_DIV] = 16, + [OPICC_REG_TX_CONTROL] = 0, + [OPICC_REG_RX_COMP_LEVEL] = 0, +}; + +u_int16_t opicc_reg_read(enum opicc_reg reg) +{ + if (reg < _OPICC_NUM_REGS) + return opicc_regs[reg]; + return 0; +} + +void opicc_reg_write(enum opicc_reg reg, u_int16_t val) +{ + if (reg < _OPICC_NUM_REGS) + opicc_regs[reg] = val; + return; +} +#endif + +/******************************************************************** + * OpenPICC USB Commandset (access to register set, ...) + ********************************************************************/ + +static int opicc_reg_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) &rctx->data[0]; + u_int16_t *val16 = (u_int16_t *) poh->data; + + poh->val = 0; + rctx->tot_len = sizeof(*poh); + + switch (poh->cmd) { + case OPENPCD_CMD_PICC_REG_READ: + *val16 = opicc_reg_read(poh->reg); + rctx->tot_len += sizeof(u_int16_t); + poh->flags |= OPENPCD_FLAG_RESPOND; + break; + case OPENPCD_CMD_PICC_REG_WRITE: + if (rctx->tot_len < sizeof(*poh) + sizeof(u_int16_t)) { + /* we only have an 8bit write */ + opicc_reg_write(poh->reg, poh->val); + } else + opicc_reg_write(poh->reg, *val16); + break; + default: + return USB_ERR(USB_ERR_CMD_UNKNOWN); + } + + if (poh->flags & OPENPCD_FLAG_RESPOND) + return USB_RET_RESPOND; + + return 0; +} + +void opicc_usbapi_init(void) +{ + usb_hdlr_register(&opicc_reg_usb_in, OPENPCD_CMD_CLS_PICC); +} diff --git a/firmware/src/picc/opicc_reg.h b/firmware/src/picc/opicc_reg.h new file mode 100644 index 0000000..adc9305 --- /dev/null +++ b/firmware/src/picc/opicc_reg.h @@ -0,0 +1,18 @@ +#ifndef _OPCD_REG_H +#define _OPCD_REG_H + +#include +#include + +#ifdef DEBUG +u_int16_t opicc_reg_read(enum opicc_reg reg); +void opicc_reg_write(enum opicc_reg reg, u_int16_t val); +#else +u_int16_t opicc_regs[_OPICC_NUM_REGS]; +#define opicc_reg_read(x) (opicc_regs[x]) +#define opicc_reg_write(x, y) (opicc_regs[x] = y) +#endif + +void opicc_usbapi_init(void); + +#endif diff --git a/firmware/src/picc/piccsim.h b/firmware/src/picc/piccsim.h new file mode 100644 index 0000000..3cf6514 --- /dev/null +++ b/firmware/src/picc/piccsim.h @@ -0,0 +1,23 @@ + +#include + +struct piccsim_state { + enum rfid_layer2_id l2prot; + unsigned char uid[10]; + u_int8_t uid_len; + union { + struct { + enum iso14443a_state state; + enum iso14443a_level level; + u_int32_t flags; + } iso14443a; + struct { + } iso14443b; + } l2; + + union { + u_int32_t flags; + } proto; +} + +#define PICCSIM_PROT_F_AUTO_WTX 0x01 diff --git a/firmware/src/picc/pll.c b/firmware/src/picc/pll.c new file mode 100644 index 0000000..e48911d --- /dev/null +++ b/firmware/src/picc/pll.c @@ -0,0 +1,60 @@ +/* PLL routines for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +#include +#include +#include +#include +#include +#include "../openpcd.h" + +void pll_inhibit(int inhibit) +{ + if (inhibit) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_INHIBIT); + else + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_INHIBIT); +} + +int pll_is_locked(void) +{ + return AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_LOCK); +} + +static void pll_lock_change_cb(u_int32_t pio) +{ + DEBUGPCRF("PLL LOCK: %d", pll_is_locked()); +#if 1 + if (pll_is_locked()) + led_switch(2, 1); + else + led_switch(2, 0); +#endif +} + +void pll_init(void) +{ + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_INHIBIT); + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_LOCK); + pll_inhibit(0); + + pio_irq_register(OPENPICC_PIO_PLL_LOCK, &pll_lock_change_cb); + pio_irq_enable(OPENPICC_PIO_PLL_LOCK); +} diff --git a/firmware/src/picc/pll.h b/firmware/src/picc/pll.h new file mode 100644 index 0000000..fc00105 --- /dev/null +++ b/firmware/src/picc/pll.h @@ -0,0 +1,8 @@ +#ifndef _PLL_H +#define _PLL_H + +extern int pll_is_locked(void); +extern void pll_inhibit(int inhibit); +extern void pll_init(void); + +#endif diff --git a/firmware/src/picc/poti.c b/firmware/src/picc/poti.c new file mode 100644 index 0000000..e5701dc --- /dev/null +++ b/firmware/src/picc/poti.c @@ -0,0 +1,74 @@ +/* SPI Potentiometer AD 7367 Driver for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + + +#include +#include +#include "../openpcd.h" + +static const AT91PS_SPI spi = AT91C_BASE_SPI; + +void poti_comp_carr(u_int8_t position) +{ + volatile int i; + + while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { } + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + /* shift one left, since it is a seven-bit value written as 8 bit xfer */ + spi->SPI_TDR = position & 0x7f; + while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { } + for (i = 0; i < 0xff; i++) { } + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); +} + +void poti_reset(void) +{ + volatile int i; + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET); + for (i = 0; i < 0xff; i++) { } + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET); +} + +void poti_init(void) +{ + AT91F_SPI_CfgPMC(); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + AT91C_PA13_MOSI | AT91C_PA14_SPCK, 0); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_nSLAVE_RESET); + poti_reset(); + +#if 0 + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI, + OPENPCD_IRQ_PRIO_SPI, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &spi_irq); + AT91G_AIC_EnableIt(AT9C_BASE_AIC, AT91C_ID_SPI); +#endif + AT91F_SPI_CfgMode(spi, AT91C_SPI_MSTR | + AT91C_SPI_PS_FIXED | AT91C_SPI_MODFDIS); + /* CPOL = 0, NCPHA = 1, CSAAT = 0, BITS = 0000, SCBR = 13 (3.69MHz), + * DLYBS = 6 (125nS), DLYBCT = 0 */ + AT91F_SPI_CfgCs(spi, 0, AT91C_SPI_BITS_8 | AT91C_SPI_NCPHA | + (13 << 8) | (6 << 16)); + AT91F_SPI_Enable(spi); +} diff --git a/firmware/src/picc/poti.h b/firmware/src/picc/poti.h new file mode 100644 index 0000000..92ec00d --- /dev/null +++ b/firmware/src/picc/poti.h @@ -0,0 +1,7 @@ +#ifndef _POTI_H +#define _POTI_H + +extern void poti_comp_carr(u_int8_t position); +extern void poti_init(void); + +#endif diff --git a/firmware/src/picc/ssc_picc.c b/firmware/src/picc/ssc_picc.c new file mode 100644 index 0000000..8ec6f79 --- /dev/null +++ b/firmware/src/picc/ssc_picc.c @@ -0,0 +1,581 @@ +/* AT91SAM7 SSC controller routines for OpenPICC + * (C) 2006 by Harald Welte + * + * 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 + * + * We use SSC for both TX and RX side. + * + * RX side is interconnected with demodulated carrier + * + * TX side is interconnected with load modulation circuitry + */ + +//#undef DEBUG + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "../openpcd.h" + +#include + +//#define DEBUG_SSC_REFILL + +/* definitions for four-times oversampling */ +#define REQA 0x10410441 +#define WUPA 0x04041041 + +static const AT91PS_SSC ssc = AT91C_BASE_SSC; +static AT91PS_PDC rx_pdc; + +enum ssc_mode { + SSC_MODE_NONE, + SSC_MODE_14443A_SHORT, + SSC_MODE_14443A_STANDARD, + SSC_MODE_14443B, + SSC_MODE_EDGE_ONE_SHOT, + SSC_MODE_CONTINUOUS, +}; + +struct ssc_state { + struct req_ctx *rx_ctx[2]; + enum ssc_mode mode; +}; +static struct ssc_state ssc_state; + +static const u_int16_t ssc_dmasize[] = { + [SSC_MODE_NONE] = 16, + [SSC_MODE_14443A_SHORT] = 16, /* 64 bytes */ + [SSC_MODE_14443A_STANDARD] = 16, /* 64 bytes */ + [SSC_MODE_14443B] = 16, /* 64 bytes */ + [SSC_MODE_EDGE_ONE_SHOT] = 16, /* 64 bytes */ + [SSC_MODE_CONTINUOUS] = 511, /* 2044 bytes */ +}; + +/* This is for four-times oversampling */ +#define ISO14443A_SOF_SAMPLE 0x01 +#define ISO14443A_SOF_LEN 4 + +#define SSC_RX_IRQ_MASK (AT91C_SSC_RXRDY | \ + AT91C_SSC_OVRUN | \ + AT91C_SSC_ENDRX | \ + AT91C_SSC_RXBUFF | \ + AT91C_SSC_RXSYN | \ + AT91C_SSC_CP0 | \ + AT91C_SSC_CP1) + +#define SSC_TX_IRQ_MASK (AT91C_SSC_TXRDY | \ + AT91C_SSC_TXEMPTY | \ + AT91C_SSC_ENDTX | \ + AT91C_SSC_TXBUFE | \ + AT91C_SSC_TXSYN) + +void ssc_rx_mode_set(enum ssc_mode ssc_mode) +{ + u_int8_t data_len, num_data, sync_len; + u_int32_t start_cond; + + /* disable Rx and all Rx interrupt sources */ + AT91F_SSC_DisableRx(AT91C_BASE_SSC); + AT91F_SSC_DisableIt(ssc, SSC_RX_IRQ_MASK); + + switch (ssc_mode) { + case SSC_MODE_14443A_SHORT: + start_cond = AT91C_SSC_START_0; + sync_len = ISO14443A_SOF_LEN; + ssc->SSC_RC0R = ISO14443A_SOF_SAMPLE; + data_len = 32; + num_data = 16; + break; + case SSC_MODE_14443A_STANDARD: + start_cond = AT91C_SSC_START_0; + sync_len = ISO14443A_SOF_LEN; + ssc->SSC_RC0R = ISO14443A_SOF_SAMPLE; + data_len = 32; + num_data = 16; /* FIXME */ + break; + case SSC_MODE_14443B: + /* start sampling at first falling data edge */ + //start_cond = + break; + case SSC_MODE_EDGE_ONE_SHOT: + case SSC_MODE_CONTINUOUS: + /* unfortunately we don't have RD and RF interconnected + * (at least not yet in the current hardware) */ + //start_cond = AT91C_SSC_START_EDGE_RF; + start_cond = AT91C_SSC_START_CONTINOUS; + //AT91C_SSC_START_RISE_RF; + sync_len = 0; + data_len = 32; + num_data = 16; + break; + case SSC_MODE_NONE: + goto out_set_mode; + break; + } + //ssc->SSC_RFMR = AT91C_SSC_MSBF | (data_len-1) & 0x1f | + ssc->SSC_RFMR = (data_len-1) & 0x1f | + (((num_data-1) & 0x0f) << 8) | + (((sync_len-1) & 0x0f) << 16); + ssc->SSC_RCMR = AT91C_SSC_CKS_RK | AT91C_SSC_CKO_NONE | + (0x2 << 6) | AT91C_SSC_CKI | start_cond; + + /* Enable Rx DMA */ + AT91F_PDC_EnableRx(rx_pdc); + + /* Enable RX interrupts */ + AT91F_SSC_EnableIt(ssc, AT91C_SSC_OVRUN | AT91C_SSC_CP0 | + AT91C_SSC_ENDRX | AT91C_SSC_RXBUFF); +out_set_mode: + ssc_state.mode = ssc_mode; +} + +static void ssc_tx_mode_set(enum ssc_mode ssc_mode) +{ + u_int8_t data_len, num_data, sync_len; + u_int32_t start_cond; + + /* disable Tx */ + AT91F_SSC_DisableTx(AT91C_BASE_SSC); + + /* disable all Tx related interrupt sources */ + AT91F_SSC_DisableIt(ssc, SSC_TX_IRQ_MASK); + + switch (ssc_mode) { + case SSC_MODE_14443A_SHORT: + start_cond = AT91C_SSC_START_RISE_RF; + sync_len = 0; + data_len = 32; + num_data = 1; + break; + case SSC_MODE_14443A_STANDARD: + start_cond = AT91C_SSC_START_0; + sync_len = ISO14443A_SOF_LEN; + ssc->SSC_RC0R = ISO14443A_SOF_SAMPLE; + data_len = 32; + num_data = 1; /* FIXME */ + break; + } + ssc->SSC_TFMR = (data_len-1) & 0x1f | + (((num_data-1) & 0x0f) << 8) | + (((sync_len-1) & 0x0f) << 16); + ssc->SSC_TCMR = AT91C_SSC_CKS_RK | AT91C_SSC_CKO_NONE | start_cond; + + AT91F_SSC_EnableIt(ssc, AT91C_SSC_TXSYN); + AT91F_SSC_EnableTx(AT91C_BASE_SSC); +#if 0 + /* Enable RX interrupts */ + AT91F_SSC_EnableIt(ssc, AT91C_SSC_OVRUN | + AT91C_SSC_ENDTX | AT91C_SSC_TXBUFE); + AT91F_PDC_EnableTx(tx_pdc); + + ssc_state.mode = ssc_mode; +#endif +} + + + + +static struct openpcd_hdr opcd_ssc_hdr = { + .cmd = OPENPCD_CMD_SSC_READ, +}; + +static inline void init_opcdhdr(struct req_ctx *rctx) +{ + memcpy(rctx->data, &opcd_ssc_hdr, sizeof(opcd_ssc_hdr)); + rctx->tot_len = sizeof(opcd_ssc_hdr); +} + +#define DEBUG_SSC_REFILL 1 +#ifdef DEBUG_SSC_REFILL +#define DEBUGR(x, args ...) DEBUGPCRF(x, ## args) +#else +#define DEBUGR(x, args ...) +#endif + +static int __ramfunc __ssc_rx_refill(int secondary) +{ + struct req_ctx *rctx; + + rctx = req_ctx_find_get(1, RCTX_STATE_FREE, RCTX_STATE_SSC_RX_BUSY); + if (!rctx) { + DEBUGP("no_rctx_for_refill! "); + return -1; + } + init_opcdhdr(rctx); + DEBUGR("filling SSC RX%u dma ctx: %u (len=%u) ", secondary, + req_ctx_num(rctx), rctx->size); + rctx->tot_len = ssc_dmasize[ssc_state.mode]*4 + + sizeof(struct openpcd_hdr); + if (secondary) { + AT91F_PDC_SetNextRx(rx_pdc, rctx->data+MAX_HDRSIZE, + ssc_dmasize[ssc_state.mode]); + ssc_state.rx_ctx[1] = rctx; + } else { + AT91F_PDC_SetRx(rx_pdc, rctx->data+MAX_HDRSIZE, + ssc_dmasize[ssc_state.mode]); + ssc_state.rx_ctx[0] = rctx; + } + + tc_cdiv_sync_reset(); + + return 0; +} + +#if 0 +static char dmabuf1[512]; +static char dmabuf2[512]; + +/* Try to refill RX dma descriptors. Return values: + * 0) no dma descriptors empty + * 1) filled next/secondary descriptor + * 2) filled both primary and secondary descriptor + * -1) no free request contexts to use + * -2) only one free request context, but two free descriptors + */ +static int8_t ssc_rx_refill(void) +{ + struct req_ctx *rctx; + DEBUGR("refill "); +#if 1 + rctx = req_ctx_find_get(1, RCTX_STATE_FREE, RCTX_STATE_SSC_RX_BUSY); + DEBUGP("SSC_SR=0x%08x ", ssc->SSC_SR); + if (AT91F_PDC_IsRxEmpty(rx_pdc)) { + DEBUGR("filling primary SSC RX dma ctx: %u (len=%u) ", + req_ctx_num(rctx), rctx->size); + rctx->tot_len = rctx->size; + AT91F_PDC_SetRx(rx_pdc, rctx->data+MAX_HDRSIZE, + (rctx->size-MAX_HDRSIZE)>>2); + ssc_state.rx_ctx[0] = rctx; + + /* If primary is empty, secondary must be empty, too */ + rctx = req_ctx_find_get(1, RCTX_STATE_FREE, + RCTX_STATE_SSC_RX_BUSY); + if (!rctx) { + DEBUGPCRF("no rctx for secondary refill!"); + return -2; + } + init_opcdhdr(rctx); + } + + if (AT91F_PDC_IsNextRxEmpty(rx_pdc)) { + DEBUGR("filling secondary SSC RX dma ctx: %u (len=%u) ", + req_ctx_num(rctx), rctx->size); + rctx->tot_len = rctx->size; + AT91F_PDC_SetNextRx(rx_pdc, rctx->data+MAX_HDRSIZE, + (rctx->size-MAX_HDRSIZE)>2); + ssc_state.rx_ctx[1] = rctx; + return 2; + } else { + /* we were unable to fill*/ + DEBUGPCRF("prim/secnd DMA busy, can't refill"); + req_ctx_put(rctx); + return 0; + } +#else + if (AT91F_PDC_IsRxEmpty(rx_pdc)) + AT91F_PDC_SetRx(rx_pdc, dmabuf1, sizeof(dmabuf1)>>2); + + if (AT91F_PDC_IsNextRxEmpty(rx_pdc)) + AT91F_PDC_SetNextRx(rx_pdc, dmabuf2, sizeof(dmabuf2)>>2); + else + DEBUGPCRF("prim/secnd DMA busy, can't refill"); +#endif +} +#endif + +#define ISO14443A_FDT_SHORT_1 1236 +#define ISO14443A_FDT_SHORT_0 1172 + +static void __ramfunc ssc_irq(void) +{ + u_int32_t ssc_sr = ssc->SSC_SR; + int i, *tmp, emptyframe = 0; + DEBUGP("ssc_sr=0x%08x, mode=%u: ", ssc_sr, ssc_state.mode); + + if (ssc_sr & AT91C_SSC_ENDRX) { +#if 1 + /* in a one-shot sample, we don't want to keep + * sampling further after having received the first + * packet. */ + if (ssc_state.mode == SSC_MODE_EDGE_ONE_SHOT) { + DEBUGP("DISABLE_RX "); + ssc_rx_stop(); + } + //AT91F_SSC_DisableIt(AT91C_BASE_SSC, SSC_RX_IRQ_MASK); +#endif +#if 0 +/* Experimental start SSC on frame, stop on FFFFFFFF */ + if (ssc_state.mode == SSC_MODE_CONTINUOUS) { + //ssc->SSC_RCMR = (ssc->SSC_RCMR & ~AT91C_SSC_START) | AT91C_SSC_START_CONTINOUS; + tmp = (u_int32_t*)ssc_state.rx_ctx[0]->data; + for(i = ssc_state.rx_ctx[0]->size / 4; i >= 0 ; i--) { + if( *tmp++ == 0xFFFFFFFF ) { + *(tmp-1) = 0xAAAAAAAA; // debug marker + /* No modulation for a long time, stop sampling + * and prepare for next frame */ + DEBUGP("RESTART RX "); + ssc_rx_stop(); + ssc_rx_mode_set(ssc_state.mode); + ssc_rx_start(); + led_toggle(1); + break; + } + } + } +#endif + /* Ignore empty frames */ + if (ssc_state.mode == SSC_MODE_CONTINUOUS) { + tmp = (u_int32_t*)ssc_state.rx_ctx[0]->data + MAX_HDRSIZE; + emptyframe = 1; + for(i = (ssc_state.rx_ctx[0]->size-MAX_HDRSIZE) / 4 - 8/*WTF?*/; i > 0; i--) { + if( *tmp++ != 0xFFFFFFFF ) { + DEBUGPCR("NONEMPTY(%08x, %i): %08x", tmp, i, *(tmp-1)); + emptyframe = 0; + break; + } else { + //DEBUGPCR("DUNNO(%08x, %i): %08x", tmp, i, tmp[i]); + } + } + } + //DEBUGP("Sending primary RCTX(%u, len=%u) ", req_ctx_num(ssc_state.rx_ctx[0]), ssc_state.rx_ctx[0]->tot_len); + /* Mark primary RCTX as ready to send for usb */ + if(!emptyframe) { + DEBUGP("NONEMPTY"); + req_ctx_set_state(ssc_state.rx_ctx[0], + RCTX_STATE_UDP_EP2_PENDING); + //RCTX_STATE_FREE); + } else { + DEBUGP("EMPTY"); + req_ctx_put(ssc_state.rx_ctx[0]); + } + + /* second buffer gets propagated to primary */ + ssc_state.rx_ctx[0] = ssc_state.rx_ctx[1]; + ssc_state.rx_ctx[1] = NULL; + if (ssc_sr & AT91C_SSC_RXBUFF) { + DEBUGP("RXBUFF! "); + if (ssc_state.rx_ctx[0]) { + //DEBUGP("Sending secondary RCTX(%u, len=%u) ", req_ctx_num(ssc_state.rx_ctx[0]), ssc_state.rx_ctx[0]->tot_len); + req_ctx_set_state(ssc_state.rx_ctx[0], + RCTX_STATE_UDP_EP2_PENDING); + //RCTX_STATE_FREE); + } + if (__ssc_rx_refill(0) == -1) + AT91F_SSC_DisableIt(ssc, AT91C_SSC_ENDRX | + AT91C_SSC_RXBUFF | + AT91C_SSC_OVRUN); + } + + if (__ssc_rx_refill(1) == -1) + AT91F_SSC_DisableIt(ssc, AT91C_SSC_ENDRX | + AT91C_SSC_RXBUFF | + AT91C_SSC_OVRUN); + + udp_refill_ep(2); + +#if 0 + if (__ssc_rx_refill(1) == -1) + AT91F_SSC_DisableIt(ssc, AT91C_SSC_ENDRX | + AT91C_SSC_RXBUFF | + AT91C_SSC_OVRUN); +#endif + } + + if (ssc_sr & AT91C_SSC_OVRUN) + DEBUGP("RX_OVERRUN "); + + if (ssc_sr & AT91C_SSC_CP0) + DEBUGP("CP0 "); + + if (ssc_sr & AT91C_SSC_TXSYN) + DEBUGP("TXSYN "); +#if 0 + led_toggle(1); + + switch (ssc_state.mode) { + case SSC_MODE_14443A_SHORT: + if (ssc_sr & AT91C_SSC_RXSYN) + DEBUGP("RXSYN "); + if (ssc_sr & AT91C_SSC_RXRDY) { + u_int32_t sample = ssc->SSC_RHR; + DEBUGP("RXRDY=0x%08x ", sample); + /* Try to set FDT compare register ASAP */ + if (sample == REQA) { + tc_fdt_set(ISO14443A_FDT_SHORT_0); + /* FIXME: prepare and configure ATQA response */ + } else if (sample == WUPA) { + tc_fdt_set(ISO14443A_FDT_SHORT_1); + /* FIXME: prepare and configure ATQA response */ + } else + DEBUGP("<== unknown "); + } + break; + + case SSC_MODE_14443A_STANDARD: + case SSC_MODE_EDGE_ONE_SHOT: + DEBUGP("ONE_SHOT "); + break; + default: + DEBUGP("UNKNOWN_MODE "); + break; + } + +#endif + DEBUGPCR("I"); + AT91F_AIC_ClearIt(AT91C_BASE_AIC, AT91C_ID_SSC); +} + +void ssc_print(void) +{ + DEBUGP("PDC_RPR=0x%08x ", rx_pdc->PDC_RPR); + DEBUGP("PDC_RCR=0x%08x ", rx_pdc->PDC_RCR); + DEBUGP("PDC_RNPR=0x%08x ", rx_pdc->PDC_RNPR); + DEBUGP("PDC_RNCR=0x%08x ", rx_pdc->PDC_RNCR); +} + + +void ssc_rx_unthrottle(void) +{ + AT91F_SSC_EnableIt(ssc, AT91C_SSC_ENDRX | AT91C_SSC_CP0 | + AT91C_SSC_RXBUFF | AT91C_SSC_OVRUN); +} + +void ssc_rx_start(void) +{ + volatile int i; + //DEBUGPCRF("starting SSC RX\n"); + + /* Enable Reception */ + AT91F_SSC_EnableIt(ssc, AT91C_SSC_ENDRX | AT91C_SSC_CP0 | + AT91C_SSC_RXBUFF | AT91C_SSC_OVRUN); + AT91F_SSC_EnableRx(AT91C_BASE_SSC); + + /* Clear the flipflop */ + tc_cdiv_sync_reset(); +} + +void ssc_rx_stop(void) +{ + /* Disable reception */ + AT91F_SSC_DisableRx(AT91C_BASE_SSC); +} + +void ssc_tx_init(void) +{ + /* IMPORTANT: Disable PA23 (PWM0) output, since it is connected to + * PA17 !! */ + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, OPENPCD_PIO_MFIN_PWM); + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, OPENPCD_PIO_MFIN_SSC_TX | + OPENPCD_PIO_MFOUT_SSC_RX | OPENPCD_PIO_SSP_CKIN | + AT91C_PIO_PA15, 0); + + ssc_tx_mode_set(SSC_MODE_14443A_SHORT); +} + +static int ssc_usb_in(struct req_ctx *rctx) +{ + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; + + switch (poh->cmd) { + case OPENPCD_CMD_SSC_READ: + /* FIXME: allow host to specify mode */ + ssc_rx_mode_set(SSC_MODE_EDGE_ONE_SHOT); + ssc_rx_start(); + req_ctx_put(rctx); + return 0; + break; + case OPENPCD_CMD_SSC_WRITE: + /* FIXME: implement this */ + //ssc_tx_start() + break; + default: + return USB_ERR(USB_ERR_CMD_UNKNOWN); + break; + } + + return (poh->flags & OPENPCD_FLAG_RESPOND) ? USB_RET_RESPOND : 0; +} + +void ssc_rx_init(void) +{ + tc_cdiv_sync_init(); + tc_cdiv_sync_enable(); + + rx_pdc = (AT91PS_PDC) &(ssc->SSC_RPR); + + AT91F_SSC_CfgPMC(); + + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, + OPENPCD_PIO_MFOUT_SSC_RX | OPENPCD_PIO_SSP_CKIN | + OPENPICC_PIO_FRAME, + 0); + + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL); + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL); + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SSC, + OPENPCD_IRQ_PRIO_SSC, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &ssc_irq); + + /* don't divide clock inside SSC, we do that in tc_cdiv */ + ssc->SSC_CMR = 0; + +#if 0 + ssc->SSC_RCMR = AT91C_SSC_CKS_RK | AT91C_SSC_CKO_NONE | + AT91C_SSC_CKI | AT91C_SSC_START_CONTINOUS; + /* Data bits per Data N = 32-1 + * Data words per Frame = 15-1 (=60 byte)*/ + ssc->SSC_RFMR = 31 | AT91C_SSC_MSBF | (14 << 8); +#endif + + __ssc_rx_refill(0); + __ssc_rx_refill(1); + + ssc_rx_mode_set(SSC_MODE_NONE); +#if 0 + AT91F_PDC_EnableRx(rx_pdc); + + /* Enable RX interrupts */ + AT91F_SSC_EnableIt(ssc, AT91C_SSC_OVRUN | + AT91C_SSC_ENDRX | AT91C_SSC_RXBUFF); +#endif + /* FIXME: This is hardcoded for REQA 0x26 */ + tc_fdt_set(ISO14443A_FDT_SHORT_0); + + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SSC); + + //usb_hdlr_register(&ssc_usb_in, OPENPCD_CMD_CLS_SSC); + + DEBUGP("\r\n"); +} + +void ssc_fini(void) +{ + usb_hdlr_unregister(OPENPCD_CMD_CLS_SSC); + AT91F_PDC_DisableRx(rx_pdc); + AT91F_SSC_DisableTx(ssc); + AT91F_SSC_DisableRx(ssc); + AT91F_SSC_DisableIt(ssc, 0xfff); + AT91F_PMC_DisablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_SSC)); +} diff --git a/firmware/src/picc/ssc_picc.h b/firmware/src/picc/ssc_picc.h new file mode 100644 index 0000000..710ee45 --- /dev/null +++ b/firmware/src/picc/ssc_picc.h @@ -0,0 +1,15 @@ +#ifndef _SSC_H +#define _SSC_H + +extern void ssc_rx_start(void); +extern void ssc_rx_stop(void); + +/* Rx/Tx initialization separate, since Tx disables PWM output ! */ +extern void ssc_tx_init(void); +extern void ssc_rx_init(void); + +extern void ssc_fini(void); + +extern void ssc_rx_unthrottle(void); + +#endif diff --git a/firmware/src/picc/tc_cdiv_sync.c b/firmware/src/picc/tc_cdiv_sync.c new file mode 100644 index 0000000..e83ae88 --- /dev/null +++ b/firmware/src/picc/tc_cdiv_sync.c @@ -0,0 +1,105 @@ +/* Synchronize TC_CDIV divided sample clock with the SOF of the packet */ + +#include +#include +#include +#include "../openpcd.h" + +//#define USE_IRQ + +static u_int8_t enabled; + +static void pio_data_change(u_int32_t pio) +{ + DEBUGP("PIO_FRAME_IRQ: "); + /* we get one interrupt for each change. If now, after the + * change the level is high, then it must have been a rising + * edge */ + if (*AT91C_PIOA_PDSR & OPENPICC_PIO_FRAME) { + *AT91C_TC0_CCR = AT91C_TC_SWTRG; + DEBUGPCR("CDIV_SYNC_FLIP SWTRG CV=0x%08x", + *AT91C_TC0_CV); + } else + DEBUGPCR(""); +} + +#if 0 +static void __ramfunc cdsync_cb(void) +{ + DEBUGP("PIO_IRQ: "); + if (*AT91C_PIOA_ISR & OPENPICC_PIO_FRAME) { + DEBUGP("PIO_FRAME_IRQ: "); + /* we get one interrupt for each change. If now, after the + * change the level is high, then it must have been a rising + * edge */ + if (*AT91C_PIOA_PDSR & OPENPICC_PIO_FRAME) { + *AT91C_TC0_CCR = AT91C_TC_SWTRG; + DEBUGPCR("CDIV_SYNC_FLIP SWTRG CV=0x%08x", + *AT91C_TC0_CV); + } else + DEBUGPCR(""); + } else + DEBUGPCR(""); +} +#endif + +void tc_cdiv_sync_reset(void) +{ + if (enabled) { + u_int32_t tmp = *AT91C_PIOA_ISR; + volatile int i; + DEBUGPCRF("CDIV_SYNC_FLOP"); + + /* reset the hardware flipflop */ + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, + OPENPICC_PIO_SSC_DATA_CONTROL); + for (i = 0; i < 0xff; i++) ; + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, + OPENPICC_PIO_SSC_DATA_CONTROL); + } +} + +void tc_cdiv_sync_disable(void) +{ + enabled = 0; + *AT91C_PIOA_IDR = OPENPICC_PIO_FRAME; +} + +void tc_cdiv_sync_enable(void) +{ + enabled = 1; + + DEBUGPCRF("CDIV_SYNC_ENABLE "); + tc_cdiv_sync_reset(); + *AT91C_PIOA_IER = OPENPICC_PIO_FRAME; +} + +extern void (*fiq_handler)(void); +void tc_cdiv_sync_init(void) +{ + DEBUGPCRF("initializing"); + + enabled = 0; + + AT91F_PIOA_CfgPMC(); + +#ifdef USE_IRQ + /* Configure IRQ */ + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, + AT91C_AIC_PRIOR_HIGHEST, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &cdsync_cb); +#else + /* Configure FIQ */ + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_FIQ, + //0, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &cdsync_cb); + 0, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &fiq_handler); + /* enable fast forcing for PIOA interrupt */ + *AT91C_AIC_FFER = (1 << AT91C_ID_PIOA); + + /* register pio irq handler */ + pio_irq_register(OPENPICC_PIO_FRAME, &pio_data_change); +#endif + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA); + + tc_cdiv_sync_disable(); +} diff --git a/firmware/src/picc/tc_cdiv_sync.h b/firmware/src/picc/tc_cdiv_sync.h new file mode 100644 index 0000000..3df3886 --- /dev/null +++ b/firmware/src/picc/tc_cdiv_sync.h @@ -0,0 +1,5 @@ +#ifndef _TC_CDIV_SYNC_H +#define _TC_CDIV_SYNC_H +extern void tc_cdiv_sync_enable(void); +extern void tc_cdiv_sync_init(void); +#endif diff --git a/firmware/src/picc/tc_fdt.c b/firmware/src/picc/tc_fdt.c new file mode 100644 index 0000000..1651b32 --- /dev/null +++ b/firmware/src/picc/tc_fdt.c @@ -0,0 +1,126 @@ +/* OpenPICC TC (Timer / Clock) support code + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +/* PICC Simulator Side: + * In order to support responding to synchronous frames (REQA/WUPA/ANTICOL), + * we need a second Timer/Counter (TC2). This unit is reset by an external + * event (rising edge of modulation pause PCD->PICC, falling edge of + * demodulated data) connected to TIOB2, and counts up to a configurable + * number of carrier clock cycles (RA). Once the RA value is reached, TIOA2 + * will see a rising edge. This rising edge will be interconnected to TF (Tx + * Frame) of the SSC to start transmitting our synchronous response. + * + */ + +#include +#include +#include + +#include "../openpcd.h" +#include +#include + +static AT91PS_TC tcfdt = AT91C_BASE_TC2; + +void tc_fdt_set(u_int16_t count) +{ + tcfdt->TC_RA = count; +} + + +/* 'count' number of carrier cycles after the last modulation pause, + * we deem the frame to have ended */ +void tc_frame_end_set(u_int16_t count) +{ + tcfdt->TC_RB = count; +} + +static void tc_fdt_irq(void) +{ + u_int32_t sr = tcfdt->TC_SR; + DEBUGP("tc_fdt_irq: TC2_SR=0x%08x TC2_CV=0x%08x ", + sr, tcfdt->TC_CV); + + if (sr & AT91C_TC_ETRGS) { + DEBUGP("Ext_trigger "); + } + if (sr & AT91C_TC_CPAS) { + DEBUGP("FDT_expired "); + /* FIXME: if we are in anticol / sync mode, + * we could do software triggering of SSC TX, + * but IIRC the hardware does this by TF */ + } + if (sr & AT91C_TC_CPBS) { + DEBUGP("Frame_end "); + /* FIXME: stop ssc (in continuous mode), + * take care of preparing synchronous response if + * we operate in anticol mode.*/ + } + if (sr & AT91C_TC_CPCS) { + DEBUGP("Compare_C "); + } + DEBUGPCR(""); +} + +void tc_fdt_print(void) +{ + DEBUGP("TC2_CV=0x%08x ", tcfdt->TC_CV); + DEBUGP("TC2_CMR=0x%08x ", tcfdt->TC_CMR); + DEBUGP("TC2_SR=0x%08x ", tcfdt->TC_SR); + DEBUGP("TC2_RA=0x%04x, TC2_RB=0x%04x, TC2_RC=0x%04x", + tcfdt->TC_RA, tcfdt->TC_RB, tcfdt->TC_RC); +} + +void tc_fdt_init(void) +{ + AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, AT91C_PA15_TF, + AT91C_PA26_TIOA2 | AT91C_PA27_TIOB2); + AT91F_PMC_EnablePeriphClock(AT91C_BASE_PMC, + ((unsigned int) 1 << AT91C_ID_TC2)); + /* Enable Clock for TC2 */ + tcfdt->TC_CCR = AT91C_TC_CLKEN; + + tcfdt->TC_RC = 0xffff; + tc_frame_end_set(128*2); + + /* Clock XC1, Wave Mode, No automatic reset on RC comp + * TIOA2 in RA comp = set, TIOA2 on RC comp = clear, + * TIOA2 on EEVT = clear + * TIOB2 as input, EEVT = TIOB2, Reset/Trigger on EEVT */ + tcfdt->TC_CMR = AT91C_TC_CLKS_XC1 | AT91C_TC_WAVE | + AT91C_TC_WAVESEL_UP | + AT91C_TC_ACPA_SET | AT91C_TC_ACPC_CLEAR | + AT91C_TC_AEEVT_CLEAR | + AT91C_TC_BEEVT_NONE | AT91C_TC_BCPB_NONE | + AT91C_TC_EEVT_TIOB | AT91C_TC_ETRGEDG_FALLING | + AT91C_TC_ENETRG | AT91C_TC_CPCSTOP ; + + /* Reset to start timers */ + tcb->TCB_BCR = 1; + + AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_TC2, + OPENPCD_IRQ_PRIO_TC_FDT, + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &tc_fdt_irq); + AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_TC2); + + tcfdt->TC_IER = AT91C_TC_CPAS | AT91C_TC_CPBS | AT91C_TC_CPCS | + AT91C_TC_ETRGS; +} + diff --git a/firmware/src/picc/tc_fdt.h b/firmware/src/picc/tc_fdt.h new file mode 100644 index 0000000..b39b935 --- /dev/null +++ b/firmware/src/picc/tc_fdt.h @@ -0,0 +1,9 @@ +#ifndef _TC_FDT_H +#define _TC_FDT_H + +#include + +extern void tc_fdt_init(void); +extern void tc_fdt_set(u_int16_t count); + +#endif diff --git a/firmware/src/picc/usb_strings_app.h b/firmware/src/picc/usb_strings_app.h new file mode 100644 index 0000000..b52464a --- /dev/null +++ b/firmware/src/picc/usb_strings_app.h @@ -0,0 +1,139 @@ +#ifndef _USB_STRINGS_H +#define _USB_STRINGS_H + +/* THIS FILE IS AUTOGENERATED, DO NOT MODIFY MANUALLY */ + +#include +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string0 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 1 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = {0x0409 /* English */ }, +}; + +/* String 1 "OpenPICC DFU Interface - Application Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string1 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 46 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0044, 0x0046, 0x0055, + 0x0020, 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, + 0x0066, 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, + 0x0020, 0x0041, 0x0070, 0x0070, 0x006c, 0x0069, + 0x0063, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, + 0x0020, 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, + 0x0074, 0x0069, 0x006f, 0x006e, }, +}; + +/* String 2 "OpenPICC DFU Interface - Bootloader Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string2 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 45 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0044, 0x0046, 0x0055, + 0x0020, 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, + 0x0066, 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, + 0x0020, 0x0042, 0x006f, 0x006f, 0x0074, 0x006c, + 0x006f, 0x0061, 0x0064, 0x0065, 0x0072, 0x0020, + 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, + 0x0069, 0x006f, 0x006e, }, +}; + +/* String 3 "bitmanufaktur.de IT Solutions and hmw-consulting.de" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string3 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 51 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x0062, 0x0069, 0x0074, 0x006d, 0x0061, 0x006e, + 0x0075, 0x0066, 0x0061, 0x006b, 0x0074, 0x0075, + 0x0072, 0x002e, 0x0064, 0x0065, 0x0020, 0x0049, + 0x0054, 0x0020, 0x0053, 0x006f, 0x006c, 0x0075, + 0x0074, 0x0069, 0x006f, 0x006e, 0x0073, 0x0020, + 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x006d, + 0x0077, 0x002d, 0x0063, 0x006f, 0x006e, 0x0073, + 0x0075, 0x006c, 0x0074, 0x0069, 0x006e, 0x0067, + 0x002e, 0x0064, 0x0065, }, +}; + +/* String 4 "OpenPICC RFID Simulator - Runtime Mode" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string4 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 38 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0052, 0x0046, 0x0049, + 0x0044, 0x0020, 0x0053, 0x0069, 0x006d, 0x0075, + 0x006c, 0x0061, 0x0074, 0x006f, 0x0072, 0x0020, + 0x002d, 0x0020, 0x0052, 0x0075, 0x006e, 0x0074, + 0x0069, 0x006d, 0x0065, 0x0020, 0x004d, 0x006f, + 0x0064, 0x0065, }, +}; + +/* String 5 "OpenPICC Runtime Configuration" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string5 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 30 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0052, 0x0075, 0x006e, + 0x0074, 0x0069, 0x006d, 0x0065, 0x0020, 0x0043, + 0x006f, 0x006e, 0x0066, 0x0069, 0x0067, 0x0075, + 0x0072, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, +}, +}; + +/* String 6 "OpenPICC Runtime Interface" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string6 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 26 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0052, 0x0075, 0x006e, + 0x0074, 0x0069, 0x006d, 0x0065, 0x0020, 0x0049, + 0x006e, 0x0074, 0x0065, 0x0072, 0x0066, 0x0061, + 0x0063, 0x0065, }, +}; + +static const struct usb_descriptor_header *usb_strings[] = { + (struct usb_descriptor_header *) &string0, + (struct usb_descriptor_header *) &string1, + (struct usb_descriptor_header *) &string2, + (struct usb_descriptor_header *) &string3, + (struct usb_descriptor_header *) &string4, + (struct usb_descriptor_header *) &string5, + (struct usb_descriptor_header *) &string6, +}; + +#endif /* _USB_STRINGS_H */ diff --git a/firmware/src/picc/usb_strings_app.txt b/firmware/src/picc/usb_strings_app.txt new file mode 100644 index 0000000..d892c72 --- /dev/null +++ b/firmware/src/picc/usb_strings_app.txt @@ -0,0 +1,6 @@ +OpenPICC DFU Interface - Application Partition +OpenPICC DFU Interface - Bootloader Partition +bitmanufaktur.de IT Solutions and hmw-consulting.de +OpenPICC RFID Simulator - Runtime Mode +OpenPICC Runtime Configuration +OpenPICC Runtime Interface diff --git a/firmware/src/picc/usb_strings_dfu.h b/firmware/src/picc/usb_strings_dfu.h new file mode 100644 index 0000000..e022de4 --- /dev/null +++ b/firmware/src/picc/usb_strings_dfu.h @@ -0,0 +1,120 @@ +#ifndef _USB_STRINGS_H +#define _USB_STRINGS_H + +/* THIS FILE IS AUTOGENERATED, DO NOT MODIFY MANUALLY */ + +#include +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string0 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 1 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = {0x0409 /* English */ }, +}; + +/* String 1 "bitmanufaktur.de IT Solutions and hmw-consulting.de" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string1 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 51 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x0062, 0x0069, 0x0074, 0x006d, 0x0061, 0x006e, + 0x0075, 0x0066, 0x0061, 0x006b, 0x0074, 0x0075, + 0x0072, 0x002e, 0x0064, 0x0065, 0x0020, 0x0049, + 0x0054, 0x0020, 0x0053, 0x006f, 0x006c, 0x0075, + 0x0074, 0x0069, 0x006f, 0x006e, 0x0073, 0x0020, + 0x0061, 0x006e, 0x0064, 0x0020, 0x0068, 0x006d, + 0x0077, 0x002d, 0x0063, 0x006f, 0x006e, 0x0073, + 0x0075, 0x006c, 0x0074, 0x0069, 0x006e, 0x0067, + 0x002e, 0x0064, 0x0065, }, +}; + +/* String 2 "OpenPICC RFID Simulator - DFU Mode" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string2 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 34 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0052, 0x0046, 0x0049, + 0x0044, 0x0020, 0x0053, 0x0069, 0x006d, 0x0075, + 0x006c, 0x0061, 0x0074, 0x006f, 0x0072, 0x0020, + 0x002d, 0x0020, 0x0044, 0x0046, 0x0055, 0x0020, + 0x004d, 0x006f, 0x0064, 0x0065, }, +}; + +/* String 3 "OpenPIIC DFU Configuration" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string3 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 26 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0049, 0x0043, 0x0020, 0x0044, 0x0046, 0x0055, + 0x0020, 0x0043, 0x006f, 0x006e, 0x0066, 0x0069, + 0x0067, 0x0075, 0x0072, 0x0061, 0x0074, 0x0069, + 0x006f, 0x006e, }, +}; + +/* String 4 "OpenPICC DFU Interface - Application Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string4 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 46 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0044, 0x0046, 0x0055, + 0x0020, 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, + 0x0066, 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, + 0x0020, 0x0041, 0x0070, 0x0070, 0x006c, 0x0069, + 0x0063, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, + 0x0020, 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, + 0x0074, 0x0069, 0x006f, 0x006e, }, +}; + +/* String 5 "OpenPICC DFU Interface - Bootloader Partition" */ +static const struct { + struct usb_descriptor_header hdr; + u_int16_t wData[]; +} __attribute__((packed)) string5 = { + .hdr = { + .bLength = sizeof(struct usb_descriptor_header) + 45 * sizeof(u_int16_t), + .bDescriptorType = USB_DT_STRING, + }, + .wData = { 0x004f, 0x0070, 0x0065, 0x006e, 0x0050, 0x0049, + 0x0043, 0x0043, 0x0020, 0x0044, 0x0046, 0x0055, + 0x0020, 0x0049, 0x006e, 0x0074, 0x0065, 0x0072, + 0x0066, 0x0061, 0x0063, 0x0065, 0x0020, 0x002d, + 0x0020, 0x0042, 0x006f, 0x006f, 0x0074, 0x006c, + 0x006f, 0x0061, 0x0064, 0x0065, 0x0072, 0x0020, + 0x0050, 0x0061, 0x0072, 0x0074, 0x0069, 0x0074, + 0x0069, 0x006f, 0x006e, }, +}; + +static const struct usb_descriptor_header *usb_strings[] = { + (struct usb_descriptor_header *) &string0, + (struct usb_descriptor_header *) &string1, + (struct usb_descriptor_header *) &string2, + (struct usb_descriptor_header *) &string3, + (struct usb_descriptor_header *) &string4, + (struct usb_descriptor_header *) &string5, +}; + +#endif /* _USB_STRINGS_H */ diff --git a/firmware/src/picc/usb_strings_dfu.txt b/firmware/src/picc/usb_strings_dfu.txt new file mode 100644 index 0000000..681c30a --- /dev/null +++ b/firmware/src/picc/usb_strings_dfu.txt @@ -0,0 +1,5 @@ +bitmanufaktur.de IT Solutions and hmw-consulting.de +OpenPICC RFID Simulator - DFU Mode +OpenPIIC DFU Configuration +OpenPICC DFU Interface - Application Partition +OpenPICC DFU Interface - Bootloader Partition diff --git a/firmware/src/start/Cstartup.S b/firmware/src/start/Cstartup.S new file mode 100644 index 0000000..83e7696 --- /dev/null +++ b/firmware/src/start/Cstartup.S @@ -0,0 +1,450 @@ +/* AT91SAM7 low-level startup outines for OpenPCD / OpenPICC DFU loader + * (C) 2006 by Harald Welte + * + * 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 + * + */ + +/*------------------------------------------------------------------------------ +//*- ATMEL Microcontroller Software Support - ROUSSET - +//*------------------------------------------------------------------------------ +//* The software is delivered "AS IS" without warranty or condition of any +//* kind, either express, implied or statutory. This includes without +//* limitation any warranty or condition with respect to merchantability or +//* fitness for any particular purpose, or against the infringements of +//* intellectual property rights of others. +//*----------------------------------------------------------------------------- +//*- File source : Cstartup.s +//*- Object : Generic CStartup for KEIL and GCC No Use REMAP +//*- Compilation flag : None +//*- +//*- 1.0 18/Oct/04 JPP : Creation +//*- 1.1 21/Feb/05 JPP : Set Interrupt +//*- 1.1 01/Apr/05 JPP : save SPSR +//*-----------------------------------------------------------------------------*/ + +/* Enable DFU by press of hardware POI_BOOTLDR switch */ +#define CONFIG_DFU_SWITCH + +/* Enable DFU by magic value in RAM and software reset */ +#define CONFIG_DFU_MAGIC + +//#define DEBUG_LL + +#define PIOA_PER 0xFFFFF400 +#define PIOA_OER 0xFFFFF410 +#define PIOA_SODR 0xFFFFF430 +#define PIOA_CODR 0xFFFFF434 +#define LED1 25 /* this only works on OpenPICC, not Olimex */ + +#ifdef DEBUG_LL +/* Debugging macros for switching on/off LED1 (green) */ + .macro led1on + ldr r2, =PIOA_CODR + mov r1, #(1 << LED1) + str r1, [r2] + .endm + .macro led1off + ldr r2, =PIOA_SODR + mov r1, #(1 << LED1) + str r1, [r2] + .endm + .macro ledinit + ldr r2, =PIOA_PER + mov r1, #(1 << LED1) + str r1, [r2] + ldr r2, =PIOA_OER + str r1, [r2] + led1off + .endm +#else + .macro ledinit + .endm + .macro led1on + .endm + .macro led1off + .endm +#endif + + .equ IRQ_Stack_Size, 0x00000400 + .equ FIQ_Stack_Size, 0x00000400 + + .equ AIC_IVR, (256) + .equ AIC_FVR, (260) + .equ AIC_EOICR, (304) + .equ AIC_MCR_RCR, (0xf00) + .equ AT91C_BASE_AIC, (0xFFFFF000) + .equ AT91C_PMC_PCER, (0xFFFFFC10) + .equ AT91C_BASE_PIOA, (0xFFFFF400) + .equ AT91C_ID_PIOA, (2) + .equ PIOA_PDSR, (0x3c) +#if defined(PCD) + .equ PIO_BOOTLDR, (1 << 27) +#elif defined(PICC) + .equ PIO_BOOTLDR, (1 << 6) +#elif defined(OLIMEX) + .equ PIO_BOOTLDR, (1 << 19) +#else +#error please define PIO_BOOTLDR +#endif + + +/* #include "AT91SAM7S64_inc.h" */ + +/* Exception Vectors in RAM */ + + .text + .arm + .section .vectram, "ax" + + .global _remap_call_dfu + .func _remap_call_dfu +_remap_call_dfu: + led1on + /* Remap RAM to 0x00000000 for DFU */ + ldr r1, =AT91C_BASE_AIC + mov r2, #0x01 + str r2, [r1, #AIC_MCR_RCR] + + ldr r4, =dfu_main + bx r4 + + .size _remap_call_dfu, . - _remap_call_dfu + .endfunc + + +#;------------------------------------------------------------------------------ +#;- Section Definition +#;----------------- +#;- Section +#;- .internal_ram_top Top_Stack: used by the cstartup for vector initalisation +#;- management defined by ld and affect from ldscript +#;------------------------------------------------------------------------------ + .section .internal_ram_top + .code 32 + .align 0 + .global Top_Stack +Top_Stack: + +/*------------------------------------------------------------------------------ +*- Area Definition +*------------------------------------------------------------------------------ +* .text is used instead of .section .text so it works with arm-aout too. */ + .section .reset + .text +reset: +/*------------------------------------------------------------------------------ +//*- Exception vectors +//*-------------------- +//*- These vectors can be read at address 0 or at RAM address +//*- They ABSOLUTELY requires to be in relative addresssing mode in order to +//*- guarantee a valid jump. For the moment, all are just looping. +//*- If an exception occurs before remap, this would result in an infinite loop. +//*- To ensure if a exeption occurs before start application to infinite loop. +//*------------------------------------------------------------------------------*/ + + B InitReset /* 0x00 Reset handler */ +undefvec: + B undefvec /* 0x04 Undefined Instruction */ +swivec: + B swivec /* 0x08 Software Interrupt */ +pabtvec: + B pabtvec /* 0x0C Prefetch Abort */ +dabtvec: + b dabtvec /* 0x10 Data Abort */ +rsvdvec: + b rsvdvec /* 0x14 reserved */ +irqvec: + b IRQ_Handler_Entry /* 0x18 IRQ */ +fiqvec: + ldr pc, [pc, #-0xF20] /* 0x1c FIQ */ + +dfu_state_dummy: + .word 0 + + .global IRQ_Handler_Entry + .func IRQ_Handler_Entry + +FIQ_Handler_Entry: + +/*- Switch in SVC/User Mode to allow User Stack access for C code */ +/* because the FIQ is not yet acknowledged*/ + +/*- Save and r0 in FIQ_Register */ + mov r9, r0 + ldr r0, [r8, #AIC_FVR] + msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_SVC + + /*- Save scratch/used registers and LR in User Stack */ + stmfd sp!, { r1-r3, r12, lr} + + /*- Branch to the routine pointed by the AIC_FVR */ + mov r14, pc + bx r0 + + /*- Restore scratch/used registers and LR from User Stack */ + ldmia sp!, { r1-r3, r12, lr} + + /*- Leave Interrupts disabled and switch back in FIQ mode */ + msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ + + /*- Restore the R0 ARM_MODE_SVC register */ + mov r0,r9 + + /*- Restore the Program Counter using the LR_fiq directly in the PC */ + subs pc, lr, #4 + +IRQ_Handler_Entry: + + /*- Manage Exception Entry */ + /*- Adjust and save LR_irq in IRQ stack */ + sub lr, lr, #4 + stmfd sp!, {lr} + + /*- Save SPSR need to be saved for nested interrupt */ + mrs r14, SPSR + stmfd sp!, {r14} + + /*- Save and r0 in IRQ stack */ + stmfd sp!, {r0} + + /*- Write in the IVR to support Protect Mode */ + /*- No effect in Normal Mode */ + /*- De-assert the NIRQ and clear the source in Protect Mode */ + ldr r14, =AT91C_BASE_AIC + ldr r0 , [r14, #AIC_IVR] + str r14, [r14, #AIC_IVR] + + /*- Enable Interrupt and Switch in Supervisor Mode */ + msr CPSR_c, #ARM_MODE_SVC + + /*- Save scratch/used registers and LR in User Stack */ + stmfd sp!, { r1-r3, r12, r14} + + /*- Branch to the routine pointed by the AIC_IVR */ + mov r14, pc + bx r0 + + /*- Restore scratch/used registers and LR from User Stack*/ + ldmia sp!, { r1-r3, r12, r14} + + /*- Disable Interrupt and switch back in IRQ mode */ + msr CPSR_c, #I_BIT | ARM_MODE_IRQ + + /*- Mark the End of Interrupt on the AIC */ + ldr r14, =AT91C_BASE_AIC + str r14, [r14, #AIC_EOICR] + + /*- Restore SPSR_irq and r0 from IRQ stack */ + ldmia sp!, {r0} + + /*- Restore SPSR_irq and r0 from IRQ stack */ + ldmia sp!, {r14} + msr SPSR_cxsf, r14 + + /*- Restore adjusted LR_irq from IRQ stack directly in the PC */ + ldmia sp!, {pc}^ + + .size IRQ_Handler_Entry, . - IRQ_Handler_Entry + .endfunc + .align 0 +.RAM_TOP: + .word Top_Stack + + .global _startup + .func _startup +InitReset: +/*------------------------------------------------------------------------------ +/*- Low level Init (PMC, AIC, ? ....) by C function AT91F_LowLevelInit +/*------------------------------------------------------------------------------*/ + .extern AT91F_LowLevelInit +/*- minumum C initialization */ +/*- call AT91F_LowLevelInit( void) */ + + ldr r13,.RAM_TOP /* temporary stack in internal RAM */ +/*--Call Low level init function in ABSOLUTE through the Interworking */ + ldr r0,=AT91F_LowLevelInit + mov lr, pc + bx r0 + ledinit + +/*------------------------------------------------------------------------------ +//*- Top of Stack Definition +//*------------------------- +//*- Interrupt and Supervisor Stack are located at the top of internal memory in +//*- order to speed the exception handling context saving and restoring. +//*- ARM_MODE_SVC (Application, C) Stack is located at the top of the external memory. +//*------------------------------------------------------------------------------*/ + + .EQU ARM_MODE_FIQ, 0x11 + .EQU ARM_MODE_IRQ, 0x12 + .EQU ARM_MODE_SVC, 0x13 + + .EQU I_BIT, 0x80 + .EQU F_BIT, 0x40 + + +#define AT91C_RSTC_RSR 0xFFFFFD04 +#define AT91C_RSTC_RSTTYP_SOFTWARE (0x03 << 8) +#define DFU_STATE_appDETACH 1 + + +/*------------------------------------------------------------------------------ +//*- Setup the stack for each mode +//*-------------------------------*/ + mov r0,r13 + +/*- Set up Fast Interrupt Mode and set FIQ Mode Stack*/ + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + mov r13, r0 + sub r0, r0, #FIQ_Stack_Size + +/*- Init the FIQ register*/ + ldr r8, =AT91C_BASE_AIC + +/*- Set up Interrupt Mode and set IRQ Mode Stack*/ + msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT + mov r13, r0 /* Init stack IRQ */ + sub r0, r0, #IRQ_Stack_Size + +/*- Set up Supervisor Mode and set Supervisor Mode Stack*/ + msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT + mov r13, r0 /* Init stack Sup */ + +/* - Enable Interrupts and FIQ */ + msr CPSR_c, #ARM_MODE_SVC + +#ifdef CONFIG_DFU_MAGIC + ldr r1, =AT91C_RSTC_RSR + ldr r2, [r1] + #and r2, r2, AT91C_RSTC_RSTTYP + tst r2, #AT91C_RSTC_RSTTYP_SOFTWARE + beq dfu_magic_end + + ldr r1, =dfu_state + ldr r2, [r1] + cmp r2, #DFU_STATE_appDETACH + beq _reloc_dfu +dfu_magic_end: +#endif + +# Relocate DFU .data.shared section (Copy from ROM to RAM) + LDR R1, =_etext + LDR R2, =_data_shared + LDR R3, =_edata_shared +LoopRelDS: CMP R2, R3 + LDRLO R0, [R1], #4 + STRLO R0, [R2], #4 + BLO LoopRelDS + +/* +# Clear DFU .bss section (Zero init) + MOV R0, #0 + LDR R1, =__bss_start__ + LDR R2, =__bss_end__ +LoopZI: CMP R1, R2 + STRLO R0, [R1], #4 + BLO LoopZI +*/ + + /* prepare c function call to main */ + mov r0, #0 /* argc = 0 */ + ldr lr, =exit + ldr r10, =0x00104000 + +#ifdef CONFIG_DFU_SWITCH + /* check whether bootloader button is pressed */ + ldr r1, =AT91C_PMC_PCER + mov r2, #(1 << AT91C_ID_PIOA) + str r2, [r1] + + ldr r1, =AT91C_BASE_PIOA + ldr r2, [r1, #PIOA_PDSR] + tst r2, #PIO_BOOTLDR + bne _reloc_dfu +#endif + + bx r10 + +_reloc_dfu: + /* Relocate DFU .data section (Copy from ROM to RAM) */ + LDR R1, =_data_flash + LDR R2, =_data + LDR R3, =_edata +LoopRel: CMP R2, R3 + LDRLO R0, [R1], #4 + STRLO R0, [R2], #4 + BLO LoopRel + + /* Clear DFU .bss section (Zero init) */ + MOV R0, #0 + LDR R1, =__bss_start__ + LDR R2, =__bss_end__ +LoopZI: CMP R1, R2 + STRLO R0, [R1], #4 + BLO LoopZI + + /* relocate DFU .text into RAM */ + ldr r1, =0x00100000 + ldr r2, =0x00200000 + ldr r3, =_etext + add r3, r3, r2 +loop_rel_t: cmp r2, r3 + ldrlo r4, [r1], #4 + strlo r4, [r2], #4 + blo loop_rel_t + ldr r4, =_remap_call_dfu + bx r4 + + .size _startup, . - _startup + .endfunc + +/* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + .global exit + .func exit +exit: + b . + .size exit, . - exit + .endfunc + +/*--------------------------------------------------------------- +//* ?EXEPTION_VECTOR +//* This module is only linked if needed for closing files. +//*---------------------------------------------------------------*/ + .global AT91F_Default_FIQ_handler + .func AT91F_Default_FIQ_handler +AT91F_Default_FIQ_handler: + b AT91F_Default_FIQ_handler + .size AT91F_Default_FIQ_handler, . - AT91F_Default_FIQ_handler + .endfunc + + .global AT91F_Default_IRQ_handler + .func AT91F_Default_IRQ_handler +AT91F_Default_IRQ_handler: + b AT91F_Default_IRQ_handler + .size AT91F_Default_IRQ_handler, . - AT91F_Default_IRQ_handler + .endfunc + + .global AT91F_Spurious_handler + .func AT91F_Spurious_handler +AT91F_Spurious_handler: + b AT91F_Spurious_handler + .size AT91F_Spurious_handler, . - AT91F_Spurious_handler + .endfunc + + + + .end + diff --git a/firmware/src/start/Cstartup.lst b/firmware/src/start/Cstartup.lst new file mode 100644 index 0000000..5eebb5a --- /dev/null +++ b/firmware/src/start/Cstartup.lst @@ -0,0 +1,515 @@ + 1 # 1 "src/start/Cstartup.S" + 1 /* AT91SAM7 low-level startup outines for OpenPCD / OpenPICC DFU loader + 0 + 0 + 2 * (C) 2006 by Harald Welte + 3 * + 4 * This program is free software; you can redistribute it and/or modify + 5 * it under the terms of the GNU General Public License as published by + 6 * the Free Software Foundation; either version 2 of the License, or + 7 * (at your option) any later version. + 8 * + 9 * This program is distributed in the hope that it will be useful, + 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12 * GNU General Public License for more details. + 13 * + 14 * You should have received a copy of the GNU General Public License + 15 * along with this program; if not, write to the Free Software + 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17 * + 18 */ + 19 + 20 /*------------------------------------------------------------------------------ + 21 //*- ATMEL Microcontroller Software Support - ROUSSET - + 22 //*------------------------------------------------------------------------------ + 23 //* The software is delivered "AS IS" without warranty or condition of any + 24 //* kind, either express, implied or statutory. This includes without + 25 //* limitation any warranty or condition with respect to merchantability or + 26 //* fitness for any particular purpose, or against the infringements of + 27 //* intellectual property rights of others. + 28 //*----------------------------------------------------------------------------- + 29 //*- File source : Cstartup.s + 30 //*- Object : Generic CStartup for KEIL and GCC No Use REMAP + 31 //*- Compilation flag : None + 32 //*- + 33 //*- 1.0 18/Oct/04 JPP : Creation + 34 //*- 1.1 21/Feb/05 JPP : Set Interrupt + 35 //*- 1.1 01/Apr/05 JPP : save SPSR + 36 //*-----------------------------------------------------------------------------*/ + 37 + 38 /* Enable DFU by press of hardware POI_BOOTLDR switch */ + 39 #define CONFIG_DFU_SWITCH + 40 + 41 /* Enable DFU by magic value in RAM and software reset */ + 42 #define CONFIG_DFU_MAGIC + 43 + 44 //#define DEBUG_LL + 45 + 46 #define PIOA_PER 0xFFFFF400 + 47 #define PIOA_OER 0xFFFFF410 + 48 #define PIOA_SODR 0xFFFFF430 + 49 #define PIOA_CODR 0xFFFFF434 + 50 #define LED1 25 /* this only works on OpenPICC, not Olimex */ + 51 + 52 #ifdef DEBUG_LL + 53 /* Debugging macros for switching on/off LED1 (green) */ + 54 .macro led1on + 55 ldr r2, =PIOA_CODR + 56 mov r1, #(1 << LED1) + 57 str r1, [r2] + 58 .endm + 59 .macro led1off + 60 ldr r2, =PIOA_SODR + 61 mov r1, #(1 << LED1) + 62 str r1, [r2] + 63 .endm + 64 .macro ledinit + 65 ldr r2, =PIOA_PER + 66 mov r1, #(1 << LED1) + 67 str r1, [r2] + 68 ldr r2, =PIOA_OER + 69 str r1, [r2] + 70 led1off + 71 .endm + 72 #else + 73 .macro ledinit + 74 .endm + 75 .macro led1on + 76 .endm + 77 .macro led1off + 78 .endm + 79 #endif + 80 + 81 .equ IRQ_Stack_Size, 0x00000400 + 82 .equ FIQ_Stack_Size, 0x00000400 + 83 + 84 .equ AIC_IVR, (256) + 85 .equ AIC_FVR, (260) + 86 .equ AIC_EOICR, (304) + 87 .equ AIC_MCR_RCR, (0xf00) + 88 .equ AT91C_BASE_AIC, (0xFFFFF000) + 89 .equ AT91C_PMC_PCER, (0xFFFFFC10) + 90 .equ AT91C_BASE_PIOA, (0xFFFFF400) + 91 .equ AT91C_ID_PIOA, (2) + 92 .equ PIOA_PDSR, (0x3c) + 93 #if defined(PCD) + 94 .equ PIO_BOOTLDR, (1 << 27) + 95 #elif defined(PICC) + 96 .equ PIO_BOOTLDR, (1 << 6) + 97 #elif defined(OLIMEX) + 98 .equ PIO_BOOTLDR, (1 << 19) + 99 #else + 100 #error please define PIO_BOOTLDR + 101 #endif + 102 + 103 + 104 /* #include "AT91SAM7S64_inc.h" */ + 105 + 106 /* Exception Vectors in RAM */ + 107 + 108 .text + 109 .arm + 110 .section .vectram, "ax" + 111 + 112 .global _remap_call_dfu + 113 .func _remap_call_dfu + 114 _remap_call_dfu: + 115 led1on + 116 /* Remap RAM to 0x00000000 for DFU */ + 117 0000 0C109FE5 ldr r1, =AT91C_BASE_AIC + 118 0004 0120A0E3 mov r2, #0x01 + 119 0008 002F81E5 str r2, [r1, #AIC_MCR_RCR] + 120 + 121 000c 04409FE5 ldr r4, =dfu_main + 122 0010 14FF2FE1 bx r4 + 123 + 125 .endfunc + 126 + 127 + 128 #;------------------------------------------------------------------------------ + 129 #;- Section Definition + 130 #;----------------- + 131 #;- Section + 132 #;- .internal_ram_top Top_Stack: used by the cstartup for vector initalisation + 133 #;- management defined by ld and affect from ldscript + 134 #;------------------------------------------------------------------------------ + 135 .section .internal_ram_top + 136 .code 32 + 137 .align 0 + 138 .global Top_Stack + 139 Top_Stack: + 140 + 141 /*------------------------------------------------------------------------------ + 142 *- Area Definition + 143 *------------------------------------------------------------------------------ + 144 * .text is used instead of .section .text so it works with arm-aout too. */ + 145 .section .reset + 146 .text + 147 reset: + 148 /*------------------------------------------------------------------------------ + 149 //*- Exception vectors + 150 //*-------------------- + 151 //*- These vectors can be read at address 0 or at RAM address + 152 //*- They ABSOLUTELY requires to be in relative addresssing mode in order to + 153 //*- guarantee a valid jump. For the moment, all are just looping. + 154 //*- If an exception occurs before remap, this would result in an infinite loop. + 155 //*- To ensure if a exeption occurs before start application to infinite loop. + 156 //*------------------------------------------------------------------------------*/ + 157 + 158 0000 260000EA B InitReset /* 0x00 Reset handler */ + 159 undefvec: + 160 0004 FEFFFFEA B undefvec /* 0x04 Undefined Instruction */ + 161 swivec: + 162 0008 FEFFFFEA B swivec /* 0x08 Software Interrupt */ + 163 pabtvec: + 164 000c FEFFFFEA B pabtvec /* 0x0C Prefetch Abort */ + 165 dabtvec: + 166 0010 FEFFFFEA b dabtvec /* 0x10 Data Abort */ + 167 rsvdvec: + 168 0014 FEFFFFEA b rsvdvec /* 0x14 reserved */ + 169 irqvec: + 170 0018 FEFFFFEA b IRQ_Handler_Entry /* 0x18 IRQ */ + 171 fiqvec: + 172 001c 20FF1FE5 ldr pc, [pc, #-0xF20] /* 0x1c FIQ */ + 173 + 174 dfu_state_dummy: + 175 0020 00000000 .word 0 + 176 + 177 .global IRQ_Handler_Entry + 178 .func IRQ_Handler_Entry + 179 + 180 FIQ_Handler_Entry: + 181 + 182 /*- Switch in SVC/User Mode to allow User Stack access for C code */ + 183 /* because the FIQ is not yet acknowledged*/ + 184 + 185 /*- Save and r0 in FIQ_Register */ + 186 0024 0090A0E1 mov r9, r0 + 187 0028 040198E5 ldr r0, [r8, #AIC_FVR] + 188 002c D3F021E3 msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_SVC + 189 + 190 /*- Save scratch/used registers and LR in User Stack */ + 191 0030 0E502DE9 stmfd sp!, { r1-r3, r12, lr} + 192 + 193 /*- Branch to the routine pointed by the AIC_FVR */ + 194 0034 0FE0A0E1 mov r14, pc + 195 0038 10FF2FE1 bx r0 + 196 + 197 /*- Restore scratch/used registers and LR from User Stack */ + 198 003c 0E50BDE8 ldmia sp!, { r1-r3, r12, lr} + 199 + 200 /*- Leave Interrupts disabled and switch back in FIQ mode */ + 201 0040 D1F021E3 msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ + 202 + 203 /*- Restore the R0 ARM_MODE_SVC register */ + 204 0044 0900A0E1 mov r0,r9 + 205 + 206 /*- Restore the Program Counter using the LR_fiq directly in the PC */ + 207 0048 04F05EE2 subs pc, lr, #4 + 208 + 209 IRQ_Handler_Entry: + 210 + 211 /*- Manage Exception Entry */ + 212 /*- Adjust and save LR_irq in IRQ stack */ + 213 004c 04E04EE2 sub lr, lr, #4 + 214 0050 04E02DE5 stmfd sp!, {lr} + 215 + 216 /*- Save SPSR need to be saved for nested interrupt */ + 217 0054 00E04FE1 mrs r14, SPSR + 218 0058 04E02DE5 stmfd sp!, {r14} + 219 + 220 /*- Save and r0 in IRQ stack */ + 221 005c 04002DE5 stmfd sp!, {r0} + 222 + 223 /*- Write in the IVR to support Protect Mode */ + 224 /*- No effect in Normal Mode */ + 225 /*- De-assert the NIRQ and clear the source in Protect Mode */ + 226 0060 48E19FE5 ldr r14, =AT91C_BASE_AIC + 227 0064 00019EE5 ldr r0 , [r14, #AIC_IVR] + 228 0068 00E18EE5 str r14, [r14, #AIC_IVR] + 229 + 230 /*- Enable Interrupt and Switch in Supervisor Mode */ + 231 006c 13F021E3 msr CPSR_c, #ARM_MODE_SVC + 232 + 233 /*- Save scratch/used registers and LR in User Stack */ + 234 0070 0E502DE9 stmfd sp!, { r1-r3, r12, r14} + 235 + 236 /*- Branch to the routine pointed by the AIC_IVR */ + 237 0074 0FE0A0E1 mov r14, pc + 238 0078 10FF2FE1 bx r0 + 239 + 240 /*- Restore scratch/used registers and LR from User Stack*/ + 241 007c 0E50BDE8 ldmia sp!, { r1-r3, r12, r14} + 242 + 243 /*- Disable Interrupt and switch back in IRQ mode */ + 244 0080 92F021E3 msr CPSR_c, #I_BIT | ARM_MODE_IRQ + 245 + 246 /*- Mark the End of Interrupt on the AIC */ + 247 0084 24E19FE5 ldr r14, =AT91C_BASE_AIC + 248 0088 30E18EE5 str r14, [r14, #AIC_EOICR] + 249 + 250 /*- Restore SPSR_irq and r0 from IRQ stack */ + 251 008c 04009DE4 ldmia sp!, {r0} + 252 + 253 /*- Restore SPSR_irq and r0 from IRQ stack */ + 254 0090 04E09DE4 ldmia sp!, {r14} + 255 0094 0EF06FE1 msr SPSR_cxsf, r14 + 256 + 257 /*- Restore adjusted LR_irq from IRQ stack directly in the PC */ + 258 0098 0080FDE8 ldmia sp!, {pc}^ + 259 + 261 .endfunc + 262 .align 0 + 263 .RAM_TOP: + 264 009c 00000000 .word Top_Stack + 265 + 266 .global _startup + 267 .func _startup + 268 InitReset: + 269 /*------------------------------------------------------------------------------ + 270 /*- Low level Init (PMC, AIC, ? ....) by C function AT91F_LowLevelInit + 271 /*------------------------------------------------------------------------------*/ + 272 .extern AT91F_LowLevelInit + 273 /*- minumum C initialization */ + 274 /*- call AT91F_LowLevelInit( void) */ + 275 + 276 00a0 0CD01FE5 ldr r13,.RAM_TOP /* temporary stack in internal RAM */ + 277 /*--Call Low level init function in ABSOLUTE through the Interworking */ + 278 00a4 08019FE5 ldr r0,=AT91F_LowLevelInit + 279 00a8 0FE0A0E1 mov lr, pc + 280 00ac 10FF2FE1 bx r0 + 281 ledinit + 282 + 283 /*------------------------------------------------------------------------------ + 284 //*- Top of Stack Definition + 285 //*------------------------- + 286 //*- Interrupt and Supervisor Stack are located at the top of internal memory in + 287 //*- order to speed the exception handling context saving and restoring. + 288 //*- ARM_MODE_SVC (Application, C) Stack is located at the top of the external memory. + 289 //*------------------------------------------------------------------------------*/ + 290 + 291 .EQU ARM_MODE_FIQ, 0x11 + 292 .EQU ARM_MODE_IRQ, 0x12 + 293 .EQU ARM_MODE_SVC, 0x13 + 294 + 295 .EQU I_BIT, 0x80 + 296 .EQU F_BIT, 0x40 + 297 + 298 + 299 #define AT91C_RSTC_RSR 0xFFFFFD04 + 300 #define AT91C_RSTC_RSTTYP_SOFTWARE (0x03 << 8) + 301 #define DFU_STATE_appDETACH 1 + 302 + 303 + 304 /*------------------------------------------------------------------------------ + 305 //*- Setup the stack for each mode + 306 //*-------------------------------*/ + 307 00b0 0D00A0E1 mov r0,r13 + 308 + 309 /*- Set up Fast Interrupt Mode and set FIQ Mode Stack*/ + 310 00b4 D1F021E3 msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + 311 00b8 00D0A0E1 mov r13, r0 + 312 00bc 010B40E2 sub r0, r0, #FIQ_Stack_Size + 313 + 314 /*- Init the FIQ register*/ + 315 00c0 E8809FE5 ldr r8, =AT91C_BASE_AIC + 316 + 317 /*- Set up Interrupt Mode and set IRQ Mode Stack*/ + 318 00c4 D2F021E3 msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT + 319 00c8 00D0A0E1 mov r13, r0 /* Init stack IRQ */ + 320 00cc 010B40E2 sub r0, r0, #IRQ_Stack_Size + 321 + 322 /*- Set up Supervisor Mode and set Supervisor Mode Stack*/ + 323 00d0 D3F021E3 msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT + 324 00d4 00D0A0E1 mov r13, r0 /* Init stack Sup */ + 325 + 326 /* - Enable Interrupts and FIQ */ + 327 00d8 13F021E3 msr CPSR_c, #ARM_MODE_SVC + 328 + 329 #ifdef CONFIG_DFU_MAGIC + 330 00dc D4109FE5 ldr r1, =AT91C_RSTC_RSR + 331 00e0 002091E5 ldr r2, [r1] + 332 #and r2, r2, AT91C_RSTC_RSTTYP + 333 00e4 030C12E3 tst r2, #AT91C_RSTC_RSTTYP_SOFTWARE + 334 00e8 0300000A beq dfu_magic_end + 335 + 336 00ec C8109FE5 ldr r1, =dfu_state + 337 00f0 002091E5 ldr r2, [r1] + 338 00f4 010052E3 cmp r2, #DFU_STATE_appDETACH + 339 00f8 1100000A beq _reloc_dfu + 340 dfu_magic_end: + 341 #endif + 342 + 343 # Relocate DFU .data.shared section (Copy from ROM to RAM) + 344 00fc BC109FE5 LDR R1, =_etext + 345 0100 BC209FE5 LDR R2, =_data_shared + 346 0104 BC309FE5 LDR R3, =_edata_shared + 347 0108 030052E1 LoopRelDS: CMP R2, R3 + 348 010c 04009134 LDRLO R0, [R1], #4 + 349 0110 04008234 STRLO R0, [R2], #4 + 350 0114 FBFFFF3A BLO LoopRelDS + 351 + 352 /* + 353 # Clear DFU .bss section (Zero init) + 354 MOV R0, #0 + 355 LDR R1, =__bss_start__ + 356 LDR R2, =__bss_end__ + 357 LoopZI: CMP R1, R2 + 358 STRLO R0, [R1], #4 + 359 BLO LoopZI + 360 */ + 361 + 362 /* prepare c function call to main */ + 363 0118 0000A0E3 mov r0, #0 /* argc = 0 */ + 364 011c A8E09FE5 ldr lr, =exit + 365 0120 41A9A0E3 ldr r10, =0x00104000 + 366 + 367 #ifdef CONFIG_DFU_SWITCH + 368 /* check whether bootloader button is pressed */ + 369 0124 A4109FE5 ldr r1, =AT91C_PMC_PCER + 370 0128 0420A0E3 mov r2, #(1 << AT91C_ID_PIOA) + 371 012c 002081E5 str r2, [r1] + 372 + 373 0130 9C109FE5 ldr r1, =AT91C_BASE_PIOA + 374 0134 3C2091E5 ldr r2, [r1, #PIOA_PDSR] + 375 0138 020312E3 tst r2, #PIO_BOOTLDR + 376 013c 0000001A bne _reloc_dfu + 377 #endif + 378 + 379 0140 1AFF2FE1 bx r10 + 380 + 381 _reloc_dfu: + 382 /* Relocate DFU .data section (Copy from ROM to RAM) */ + 383 0144 8C109FE5 LDR R1, =_data_flash + 384 0148 8C209FE5 LDR R2, =_data + 385 014c 8C309FE5 LDR R3, =_edata + 386 0150 030052E1 LoopRel: CMP R2, R3 + 387 0154 04009134 LDRLO R0, [R1], #4 + 388 0158 04008234 STRLO R0, [R2], #4 + 389 015c FBFFFF3A BLO LoopRel + 390 + 391 /* Clear DFU .bss section (Zero init) */ + 392 0160 0000A0E3 MOV R0, #0 + 393 0164 78109FE5 LDR R1, =__bss_start__ + 394 0168 78209FE5 LDR R2, =__bss_end__ + 395 016c 020051E1 LoopZI: CMP R1, R2 + 396 0170 04008134 STRLO R0, [R1], #4 + 397 0174 FCFFFF3A BLO LoopZI + 398 + 399 /* relocate DFU .text into RAM */ + 400 0178 0116A0E3 ldr r1, =0x00100000 + 401 017c 0226A0E3 ldr r2, =0x00200000 + 402 0180 38309FE5 ldr r3, =_etext + 403 0184 023083E0 add r3, r3, r2 + 404 0188 030052E1 loop_rel_t: cmp r2, r3 + 405 018c 04409134 ldrlo r4, [r1], #4 + 406 0190 04408234 strlo r4, [r2], #4 + 407 0194 FBFFFF3A blo loop_rel_t + 408 0198 4C409FE5 ldr r4, =_remap_call_dfu + 409 019c 14FF2FE1 bx r4 + 410 + 412 .endfunc + 413 + 414 /* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + 415 .global exit + 416 .func exit + 417 exit: + 418 01a0 FEFFFFEA b . + 420 .endfunc + 421 + 422 /*--------------------------------------------------------------- + 423 //* ?EXEPTION_VECTOR + 424 //* This module is only linked if needed for closing files. + 425 //*---------------------------------------------------------------*/ + 426 .global AT91F_Default_FIQ_handler + 427 .func AT91F_Default_FIQ_handler + 428 AT91F_Default_FIQ_handler: + 429 01a4 FEFFFFEA b AT91F_Default_FIQ_handler + 431 .endfunc + 432 + 433 .global AT91F_Default_IRQ_handler + 434 .func AT91F_Default_IRQ_handler + 435 AT91F_Default_IRQ_handler: + 436 01a8 FEFFFFEA b AT91F_Default_IRQ_handler + 438 .endfunc + 439 + 440 .global AT91F_Spurious_handler + 441 .func AT91F_Spurious_handler + 442 AT91F_Spurious_handler: + 443 01ac FEFFFFEA b AT91F_Spurious_handler + 445 .endfunc + 446 + 447 + 448 + 449 01b0 00F0FFFF .end + 449 00000000 + 449 04FDFFFF + 449 00000000 + 449 00000000 +DEFINED SYMBOLS +src/start/Cstartup.S:81 *ABS*:00000400 IRQ_Stack_Size +src/start/Cstartup.S:82 *ABS*:00000400 FIQ_Stack_Size +src/start/Cstartup.S:84 *ABS*:00000100 AIC_IVR +src/start/Cstartup.S:85 *ABS*:00000104 AIC_FVR +src/start/Cstartup.S:86 *ABS*:00000130 AIC_EOICR +src/start/Cstartup.S:87 *ABS*:00000f00 AIC_MCR_RCR +src/start/Cstartup.S:88 *ABS*:fffff000 AT91C_BASE_AIC +src/start/Cstartup.S:89 *ABS*:fffffc10 AT91C_PMC_PCER +src/start/Cstartup.S:90 *ABS*:fffff400 AT91C_BASE_PIOA +src/start/Cstartup.S:91 *ABS*:00000002 AT91C_ID_PIOA +src/start/Cstartup.S:92 *ABS*:0000003c PIOA_PDSR +src/start/Cstartup.S:94 *ABS*:08000000 PIO_BOOTLDR +src/start/Cstartup.S:114 .vectram:00000000 _remap_call_dfu +src/start/Cstartup.S:117 .vectram:00000000 $a +src/start/Cstartup.S:139 .internal_ram_top:00000000 Top_Stack +src/start/Cstartup.S:147 .text:00000000 reset +src/start/Cstartup.S:268 .text:000000a0 InitReset +src/start/Cstartup.S:158 .text:00000000 $a +src/start/Cstartup.S:159 .text:00000004 undefvec +src/start/Cstartup.S:161 .text:00000008 swivec +src/start/Cstartup.S:163 .text:0000000c pabtvec +src/start/Cstartup.S:165 .text:00000010 dabtvec +src/start/Cstartup.S:167 .text:00000014 rsvdvec +src/start/Cstartup.S:169 .text:00000018 irqvec +src/start/Cstartup.S:209 .text:0000004c IRQ_Handler_Entry +src/start/Cstartup.S:171 .text:0000001c fiqvec +src/start/Cstartup.S:174 .text:00000020 dfu_state_dummy +src/start/Cstartup.S:175 .text:00000020 $d +src/start/Cstartup.S:180 .text:00000024 FIQ_Handler_Entry +src/start/Cstartup.S:186 .text:00000024 $a + *ABS*:00000080 I_BIT + *ABS*:00000040 F_BIT + *ABS*:00000013 ARM_MODE_SVC + *ABS*:00000011 ARM_MODE_FIQ + *ABS*:00000012 ARM_MODE_IRQ +src/start/Cstartup.S:263 .text:0000009c .RAM_TOP +src/start/Cstartup.S:264 .text:0000009c $d +src/start/Cstartup.S:276 .text:000000a0 $a +src/start/Cstartup.S:340 .text:000000fc dfu_magic_end +src/start/Cstartup.S:381 .text:00000144 _reloc_dfu +src/start/Cstartup.S:347 .text:00000108 LoopRelDS +src/start/Cstartup.S:417 .text:000001a0 exit +src/start/Cstartup.S:386 .text:00000150 LoopRel +src/start/Cstartup.S:395 .text:0000016c LoopZI +src/start/Cstartup.S:404 .text:00000188 loop_rel_t +src/start/Cstartup.S:428 .text:000001a4 AT91F_Default_FIQ_handler +src/start/Cstartup.S:435 .text:000001a8 AT91F_Default_IRQ_handler +src/start/Cstartup.S:442 .text:000001ac AT91F_Spurious_handler +src/start/Cstartup.S:449 .text:000001b0 $d +src/start/Cstartup.S:135 .vectram:00000014 $d + .debug_aranges:0000000c $d + +UNDEFINED SYMBOLS +dfu_main +_startup +AT91F_LowLevelInit +dfu_state +_etext +_data_shared +_edata_shared +_data_flash +_data +_edata +__bss_start__ +__bss_end__ diff --git a/firmware/src/start/Cstartup_SAM7.c b/firmware/src/start/Cstartup_SAM7.c new file mode 100644 index 0000000..4ab263f --- /dev/null +++ b/firmware/src/start/Cstartup_SAM7.c @@ -0,0 +1,90 @@ +//*---------------------------------------------------------------------------- +//* ATMEL Microcontroller Software Support - ROUSSET - +//*---------------------------------------------------------------------------- +//* The software is delivered "AS IS" without warranty or condition of any +//* kind, either express, implied or statutory. This includes without +//* limitation any warranty or condition with respect to merchantability or +//* fitness for any particular purpose, or against the infringements of +//* intellectual property rights of others. +//*---------------------------------------------------------------------------- +//* File Name : Cstartup_SAM7.c +//* Object : Low level initializations written in C for GCC Tools +//* Creation : 12/Jun/04 +//* 1.2 28/Feb/05 JPP : LIB change AT91C_WDTC_WDDIS & PLL +//* 1.3 21/Mar/05 JPP : Change PLL Wait time +//*---------------------------------------------------------------------------- + +// Include the board file description +#include + +// The following functions must be write in ARM mode this function called directly +// by exception vector +extern void AT91F_Spurious_handler (void); +extern void AT91F_Default_IRQ_handler (void); +extern void AT91F_Default_FIQ_handler (void); + +//*---------------------------------------------------------------------------- +//* \fn AT91F_LowLevelInit +//* \brief This function performs very low level HW initialization +//* this function can be use a Stack, depending the compilation +//* optimization mode +//*---------------------------------------------------------------------------- +void +AT91F_LowLevelInit (void) +{ + volatile int i; + + //* Debounce power supply + for(i=0;i<1024;i++); + + AT91PS_PMC pPMC = AT91C_BASE_PMC; + //* Set Flash Waite sate + // Single Cycle Access at Up to 30 MHz, or 40 + // if MCK = 47923200 I have 50 Cycle for 1 usecond ( flied MC_FMR->FMCN + AT91C_BASE_MC->MC_FMR = ((AT91C_MC_FMCN) & (48 << 16)) | AT91C_MC_FWS_1FWS; + + //* Set MCK at 47 923 200 + // 1 Enabling the Main Oscillator: + // SCK = 1/32768 = 30.51 uSecond + // Start up time = 8 * 6 / SCK = 56 * 30.51 = 1,46484375 ms + pPMC->PMC_MOR = ((AT91C_CKGR_OSCOUNT) & (0x06 << 8)) | AT91C_CKGR_MOSCEN; + // Wait the startup time + while (!(pPMC->PMC_SR & AT91C_PMC_MOSCS)); + // 2 Checking the Main Oscillator Frequency (Optional) + // 3 Setting PLL and divider: + // - div by 24 Fin = 0,7680 =(18,432 / 24) + // - Mul 125: Fout = 96,0000 =(0,7680 *125) + // for 96 MHz the erroe is 0.16% + // Field out NOT USED = 0 + // PLLCOUNT pll startup time estimate at : 0.844 ms + // PLLCOUNT 28 = 0.000844 /(1/32768) +#if 0 + pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) | + (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + (AT91C_CKGR_MUL & (25 << 16))); +#else + pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 24) | + (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + (AT91C_CKGR_MUL & (125 << 16))); +#endif + + // Wait the startup time + while (!(pPMC->PMC_SR & AT91C_PMC_LOCK)); + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + // 4. Selection of Master Clock and Processor Clock + // select the PLL clock divided by 2 + pPMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + + pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; + while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + + // Set up the default interrupts handler vectors + AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler; + for (i = 1; i < 31; i++) + { + AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler; + } + AT91C_BASE_AIC->AIC_SPU = (int) AT91F_Spurious_handler; + +} diff --git a/firmware/src/start/Cstartup_SAM7.lst b/firmware/src/start/Cstartup_SAM7.lst new file mode 100644 index 0000000..d8d835c --- /dev/null +++ b/firmware/src/start/Cstartup_SAM7.lst @@ -0,0 +1,233 @@ + 1 .cpu arm7tdmi + 2 .fpu softvfp + 3 .eabi_attribute 20, 1 + 4 .eabi_attribute 21, 1 + 5 .eabi_attribute 23, 3 + 6 .eabi_attribute 24, 1 + 7 .eabi_attribute 25, 1 + 8 .eabi_attribute 26, 1 + 9 .eabi_attribute 30, 4 + 10 .eabi_attribute 18, 4 + 11 .file "Cstartup_SAM7.c" + 19 .Ltext0: + 20 .cfi_sections .debug_frame + 21 .align 2 + 22 .global AT91F_LowLevelInit + 24 AT91F_LowLevelInit: + 25 .LFB273: + 26 .file 1 "src/start/Cstartup_SAM7.c" + 1:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 2:src/start/Cstartup_SAM7.c **** //* ATMEL Microcontroller Software Support - ROUSSET - + 3:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 4:src/start/Cstartup_SAM7.c **** //* The software is delivered "AS IS" without warranty or condition of any + 5:src/start/Cstartup_SAM7.c **** //* kind, either express, implied or statutory. This includes without + 6:src/start/Cstartup_SAM7.c **** //* limitation any warranty or condition with respect to merchantability or + 7:src/start/Cstartup_SAM7.c **** //* fitness for any particular purpose, or against the infringements of + 8:src/start/Cstartup_SAM7.c **** //* intellectual property rights of others. + 9:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 10:src/start/Cstartup_SAM7.c **** //* File Name : Cstartup_SAM7.c + 11:src/start/Cstartup_SAM7.c **** //* Object : Low level initializations written in C for GCC Tools + 12:src/start/Cstartup_SAM7.c **** //* Creation : 12/Jun/04 + 13:src/start/Cstartup_SAM7.c **** //* 1.2 28/Feb/05 JPP : LIB change AT91C_WDTC_WDDIS & PLL + 14:src/start/Cstartup_SAM7.c **** //* 1.3 21/Mar/05 JPP : Change PLL Wait time + 15:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 16:src/start/Cstartup_SAM7.c **** + 17:src/start/Cstartup_SAM7.c **** // Include the board file description + 18:src/start/Cstartup_SAM7.c **** #include + 19:src/start/Cstartup_SAM7.c **** + 20:src/start/Cstartup_SAM7.c **** // The following functions must be write in ARM mode this function called directly + 21:src/start/Cstartup_SAM7.c **** // by exception vector + 22:src/start/Cstartup_SAM7.c **** extern void AT91F_Spurious_handler (void); + 23:src/start/Cstartup_SAM7.c **** extern void AT91F_Default_IRQ_handler (void); + 24:src/start/Cstartup_SAM7.c **** extern void AT91F_Default_FIQ_handler (void); + 25:src/start/Cstartup_SAM7.c **** + 26:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 27:src/start/Cstartup_SAM7.c **** //* \fn AT91F_LowLevelInit + 28:src/start/Cstartup_SAM7.c **** //* \brief This function performs very low level HW initialization + 29:src/start/Cstartup_SAM7.c **** //* this function can be use a Stack, depending the compilation + 30:src/start/Cstartup_SAM7.c **** //* optimization mode + 31:src/start/Cstartup_SAM7.c **** //*---------------------------------------------------------------------------- + 32:src/start/Cstartup_SAM7.c **** void + 33:src/start/Cstartup_SAM7.c **** AT91F_LowLevelInit (void) + 34:src/start/Cstartup_SAM7.c **** { + 27 .loc 1 34 0 + 28 .cfi_startproc + 29 @ Function supports interworking. + 30 @ args = 0, pretend = 0, frame = 8 + 31 @ frame_needed = 0, uses_anonymous_args = 0 + 32 @ link register save eliminated. + 33 0000 08D04DE2 sub sp, sp, #8 + 34 .LCFI0: + 35 .cfi_def_cfa_offset 8 + 35:src/start/Cstartup_SAM7.c **** volatile int i; + 36:src/start/Cstartup_SAM7.c **** + 37:src/start/Cstartup_SAM7.c **** //* Debounce power supply + 38:src/start/Cstartup_SAM7.c **** for(i=0;i<1024;i++); + 36 .loc 1 38 0 + 37 0004 0030A0E3 mov r3, #0 + 38 0008 010000EA b .L11 + 39 .LVL0: + 40 .L3: + 41 .loc 1 38 0 is_stmt 0 discriminator 2 + 42 000c 04309DE5 ldr r3, [sp, #4] + 43 0010 013083E2 add r3, r3, #1 + 44 .LVL1: + 45 .L11: + 46 0014 04308DE5 str r3, [sp, #4] + 47 0018 04309DE5 ldr r3, [sp, #4] + 48 .LVL2: + 49 001c 010B53E3 cmp r3, #1024 + 50 0020 F9FFFFBA blt .L3 + 51 .LVL3: + 39:src/start/Cstartup_SAM7.c **** + 40:src/start/Cstartup_SAM7.c **** AT91PS_PMC pPMC = AT91C_BASE_PMC; + 41:src/start/Cstartup_SAM7.c **** //* Set Flash Waite sate + 42:src/start/Cstartup_SAM7.c **** // Single Cycle Access at Up to 30 MHz, or 40 + 43:src/start/Cstartup_SAM7.c **** // if MCK = 47923200 I have 50 Cycle for 1 usecond ( flied MC_FMR->FMCN + 44:src/start/Cstartup_SAM7.c **** AT91C_BASE_MC->MC_FMR = ((AT91C_MC_FMCN) & (48 << 16)) | AT91C_MC_FWS_1FWS; + 52 .loc 1 44 0 is_stmt 1 + 53 0024 C8209FE5 ldr r2, .L13 + 54 0028 0030E0E3 mvn r3, #0 + 55 002c 9F2003E5 str r2, [r3, #-159] + 45:src/start/Cstartup_SAM7.c **** + 46:src/start/Cstartup_SAM7.c **** //* Set MCK at 47 923 200 + 47:src/start/Cstartup_SAM7.c **** // 1 Enabling the Main Oscillator: + 48:src/start/Cstartup_SAM7.c **** // SCK = 1/32768 = 30.51 uSecond + 49:src/start/Cstartup_SAM7.c **** // Start up time = 8 * 6 / SCK = 56 * 30.51 = 1,46484375 ms + 50:src/start/Cstartup_SAM7.c **** pPMC->PMC_MOR = ((AT91C_CKGR_OSCOUNT) & (0x06 << 8)) | AT91C_CKGR_MOSCEN; + 56 .loc 1 50 0 + 57 0030 C0209FE5 ldr r2, .L13+4 + 58 0034 DF2303E5 str r2, [r3, #-991] + 59 .L4: + 51:src/start/Cstartup_SAM7.c **** // Wait the startup time + 52:src/start/Cstartup_SAM7.c **** while (!(pPMC->PMC_SR & AT91C_PMC_MOSCS)); + 60 .loc 1 52 0 discriminator 1 + 61 0038 033CE0E3 mvn r3, #768 + 62 003c 972013E5 ldr r2, [r3, #-151] + 63 0040 010012E3 tst r2, #1 + 64 0044 FBFFFF0A beq .L4 + 53:src/start/Cstartup_SAM7.c **** // 2 Checking the Main Oscillator Frequency (Optional) + 54:src/start/Cstartup_SAM7.c **** // 3 Setting PLL and divider: + 55:src/start/Cstartup_SAM7.c **** // - div by 24 Fin = 0,7680 =(18,432 / 24) + 56:src/start/Cstartup_SAM7.c **** // - Mul 125: Fout = 96,0000 =(0,7680 *125) + 57:src/start/Cstartup_SAM7.c **** // for 96 MHz the erroe is 0.16% + 58:src/start/Cstartup_SAM7.c **** // Field out NOT USED = 0 + 59:src/start/Cstartup_SAM7.c **** // PLLCOUNT pll startup time estimate at : 0.844 ms + 60:src/start/Cstartup_SAM7.c **** // PLLCOUNT 28 = 0.000844 /(1/32768) + 61:src/start/Cstartup_SAM7.c **** #if 0 + 62:src/start/Cstartup_SAM7.c **** pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) | + 63:src/start/Cstartup_SAM7.c **** (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + 64:src/start/Cstartup_SAM7.c **** (AT91C_CKGR_MUL & (25 << 16))); + 65:src/start/Cstartup_SAM7.c **** #else + 66:src/start/Cstartup_SAM7.c **** pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 24) | + 65 .loc 1 66 0 + 66 0048 AC209FE5 ldr r2, .L13+8 + 67 004c D32003E5 str r2, [r3, #-211] + 68 .L5: + 67:src/start/Cstartup_SAM7.c **** (AT91C_CKGR_PLLCOUNT & (28 << 8)) | + 68:src/start/Cstartup_SAM7.c **** (AT91C_CKGR_MUL & (125 << 16))); + 69:src/start/Cstartup_SAM7.c **** #endif + 70:src/start/Cstartup_SAM7.c **** + 71:src/start/Cstartup_SAM7.c **** // Wait the startup time + 72:src/start/Cstartup_SAM7.c **** while (!(pPMC->PMC_SR & AT91C_PMC_LOCK)); + 69 .loc 1 72 0 discriminator 1 + 70 0050 033CE0E3 mvn r3, #768 + 71 0054 973013E5 ldr r3, [r3, #-151] + 72 0058 040013E3 tst r3, #4 + 73 005c FBFFFF0A beq .L5 + 74 .L6: + 73:src/start/Cstartup_SAM7.c **** while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 75 .loc 1 73 0 discriminator 1 + 76 0060 033CE0E3 mvn r3, #768 + 77 0064 972013E5 ldr r2, [r3, #-151] + 78 0068 080012E3 tst r2, #8 + 79 006c FBFFFF0A beq .L6 + 74:src/start/Cstartup_SAM7.c **** // 4. Selection of Master Clock and Processor Clock + 75:src/start/Cstartup_SAM7.c **** // select the PLL clock divided by 2 + 76:src/start/Cstartup_SAM7.c **** pPMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; + 80 .loc 1 76 0 + 81 0070 0420A0E3 mov r2, #4 + 82 0074 CF2003E5 str r2, [r3, #-207] + 83 .L7: + 77:src/start/Cstartup_SAM7.c **** while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 84 .loc 1 77 0 discriminator 1 + 85 0078 033CE0E3 mvn r3, #768 + 86 007c 972013E5 ldr r2, [r3, #-151] + 87 0080 080012E3 tst r2, #8 + 88 0084 FBFFFF0A beq .L7 + 78:src/start/Cstartup_SAM7.c **** + 79:src/start/Cstartup_SAM7.c **** pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; + 89 .loc 1 79 0 + 90 0088 CF2013E5 ldr r2, [r3, #-207] + 91 008c 032082E3 orr r2, r2, #3 + 92 0090 CF2003E5 str r2, [r3, #-207] + 93 .L8: + 80:src/start/Cstartup_SAM7.c **** while (!(pPMC->PMC_SR & AT91C_PMC_MCKRDY)); + 94 .loc 1 80 0 discriminator 1 + 95 0094 033CE0E3 mvn r3, #768 + 96 0098 973013E5 ldr r3, [r3, #-151] + 97 009c 080013E3 tst r3, #8 + 98 00a0 FBFFFF0A beq .L8 + 81:src/start/Cstartup_SAM7.c **** + 82:src/start/Cstartup_SAM7.c **** // Set up the default interrupts handler vectors + 83:src/start/Cstartup_SAM7.c **** AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler; + 99 .loc 1 83 0 + 100 00a4 54209FE5 ldr r2, .L13+12 + 101 00a8 0F3CE0E3 mvn r3, #3840 + 102 00ac 7F2003E5 str r2, [r3, #-127] + 84:src/start/Cstartup_SAM7.c **** for (i = 1; i < 31; i++) + 103 .loc 1 84 0 + 104 00b0 0130A0E3 mov r3, #1 + 105 00b4 050000EA b .L12 + 106 .L10: + 85:src/start/Cstartup_SAM7.c **** { + 86:src/start/Cstartup_SAM7.c **** AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler; + 107 .loc 1 86 0 discriminator 2 + 108 00b8 04309DE5 ldr r3, [sp, #4] + 109 00bc 40209FE5 ldr r2, .L13+16 + 110 00c0 0331A0E1 mov r3, r3, asl #2 + 111 00c4 802F03E5 str r2, [r3, #-3968] + 84:src/start/Cstartup_SAM7.c **** for (i = 1; i < 31; i++) + 112 .loc 1 84 0 discriminator 2 + 113 00c8 04309DE5 ldr r3, [sp, #4] + 114 00cc 013083E2 add r3, r3, #1 + 115 .LVL4: + 116 .L12: + 117 00d0 04308DE5 str r3, [sp, #4] + 118 00d4 04309DE5 ldr r3, [sp, #4] + 119 00d8 1E0053E3 cmp r3, #30 + 120 00dc F5FFFFDA ble .L10 + 87:src/start/Cstartup_SAM7.c **** } + 88:src/start/Cstartup_SAM7.c **** AT91C_BASE_AIC->AIC_SPU = (int) AT91F_Spurious_handler; + 121 .loc 1 88 0 + 122 00e0 20209FE5 ldr r2, .L13+20 + 123 00e4 0F3CE0E3 mvn r3, #3840 + 124 00e8 352083E5 str r2, [r3, #53] + 89:src/start/Cstartup_SAM7.c **** + 90:src/start/Cstartup_SAM7.c **** } + 125 .loc 1 90 0 + 126 00ec 08D08DE2 add sp, sp, #8 + 127 00f0 1EFF2FE1 bx lr + 128 .L14: + 129 .align 2 + 130 .L13: + 131 00f4 00013000 .word 3145984 + 132 00f8 01060000 .word 1537 + 133 00fc 181C7D00 .word 8199192 + 134 0100 00000000 .word AT91F_Default_FIQ_handler + 135 0104 00000000 .word AT91F_Default_IRQ_handler + 136 0108 00000000 .word AT91F_Spurious_handler + 137 .cfi_endproc + 138 .LFE273: + 140 .Letext0: +DEFINED SYMBOLS + *ABS*:00000000 Cstartup_SAM7.c +C:\Users\netz\AppData\Local\Temp\ccKE3Rjt.s:21 .text:00000000 $a +C:\Users\netz\AppData\Local\Temp\ccKE3Rjt.s:24 .text:00000000 AT91F_LowLevelInit +C:\Users\netz\AppData\Local\Temp\ccKE3Rjt.s:131 .text:000000f4 $d + .debug_frame:00000010 $d + +UNDEFINED SYMBOLS +AT91F_Default_FIQ_handler +AT91F_Default_IRQ_handler +AT91F_Spurious_handler diff --git a/firmware/src/start/Cstartup_app.S b/firmware/src/start/Cstartup_app.S new file mode 100644 index 0000000..448cc93 --- /dev/null +++ b/firmware/src/start/Cstartup_app.S @@ -0,0 +1,194 @@ +/* Cstartup header for the application to be started by at91dfu + * (C) 2006 by Harald Welte + * + * 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 + * + */ + + +//#define DEBUG_LL + + .equ AIC_FVR, (260) + .equ AIC_EOICR, (304) + .equ AT91C_BASE_AIC, (0xFFFFF000) + .equ ARM_MODE_FIQ, 0x11 + .equ ARM_MODE_IRQ, 0x12 + .equ ARM_MODE_SVC, 0x13 + + .equ I_BIT, 0x80 + .equ F_BIT, 0x40 + + +#define AT91C_BASE_PIOA 0xFFFFF400 +#define AT91C_BASE_TC0 0xFFFA0000 +#define AT91C_TC_SWTRG (1 << 2) +#define PIOA_SODR 0x30 +#define PIOA_CODR 0x34 +#define PIOA_PDSR 0x3c +#define PIOA_ISR 0x4c +#define PIOA_IDR 0x44 +#define PIO_DATA (1 << 27) +#define TC_CCR 0x00 + + +#define PIO_LED1 (1 << 25) /* this only works on OpenPICC, not Olimex */ + +#ifdef DEBUG_LL +/* Debugging macros for switching on/off LED1 (green) */ +#define PIOA_PER 0xFFFFF400 +#define PIOA_OER 0xFFFFF410 + .macro led1on + ldr r2, =AT91C_BASE_PIOA + mov r1, #PIO_LED1 + str r1, [r2, #PIOA_CODR] + .endm + .macro led1off + ldr r2, =AT91C_BASE_PIOA + mov r1, #PIO_LED1 + str r1, [r2, #PIOA_SODR] + .endm + .macro ledinit + ldr r2, =PIOA_PER + mov r1, #PIO_LED1 + str r1, [r2] + ldr r2, =PIOA_OER + str r1, [r2] + led1off + .endm +#else + .macro ledinit + .endm + .macro led1on + .endm + .macro led1off + .endm +#endif + + .global _startup + .func _startup +_startup: + /* Relocate .data section (copy from Flash to RAM) */ + ldr r1, =_etext + ldr r2, =_data + ldr r3, =_edata +loop_r: cmp r2, r3 + ldrlo r0, [r1], #4 + strlo r0, [r2], #4 + blo loop_r + + /* Clear .bss section (Zero init) */ + mov r0, #0 + ldr r1, =__bss_start__ + ldr r2, =__bss_end__ +loop_z: cmp r1, r2 + strlo r0, [r1], #4 + blo loop_z + + /* initialize FIQ mode registers */ + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + ldr r10, =AT91C_BASE_PIOA + ldr r12, =AT91C_BASE_TC0 + mov r9, #AT91C_TC_SWTRG + msr CPSR_c, #ARM_MODE_SVC + + led1on + + /* prepare C function call to main */ + mov r0, #0 /* argc = 0 */ + ldr lr, =exit + ldr r10, =main + + bx r10 + + .size _startup, . - _startup + .endfunc + +/* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + .global exit + .func exit +exit: + b . + .size exit, . - exit + .endfunc + + +#define LED_TRIGGER +#define CALL_PIO_IRQ_DEMUX + + .text + .arm + .section .fastrun, "ax" + + .global fiq_handler + .func fiq_handler +fiq_handler: + /* code that uses pre-initialized FIQ reg */ + /* r8 AT91C_BASE_AIC (dfu init) + r9 AT91C_TC_SWTRG + r10 AT91C_BASE_PIOA + r11 tmp + r12 AT91C_BASE_TC0 + r13 stack + r14 lr + */ + + ldr r8, [r10, #PIOA_ISR] + tst r8, #PIO_DATA /* check for PIO_DATA change */ + ldrne r11, [r10, #PIOA_PDSR] + tstne r11, #PIO_DATA /* check for PIO_DATA == 1 */ + strne r9, [r12, #TC_CCR] /* software trigger */ +#ifdef LED_TRIGGER + movne r11, #PIO_LED1 + strne r11, [r10, #PIOA_CODR] /* enable LED */ +#endif + +#if 1 + movne r11, #PIO_DATA + strne r11, [r10, #PIOA_IDR] /* disable further PIO_DATA FIQ */ +#endif + + /*- Mark the End of Interrupt on the AIC */ + ldr r11, =AT91C_BASE_AIC + str r11, [r11, #AIC_EOICR] + +#ifdef LED_TRIGGER + mov r11, #PIO_LED1 + str r11, [r10, #PIOA_SODR] /* disable LED */ +#endif + +#ifdef CALL_PIO_IRQ_DEMUX + /* push r0, r1-r3, r12, r14 onto FIQ stack */ + stmfd sp!, { r0-r3, r12, lr} + mov r0, r8 + + /* enable interrupts while handling demux */ + /* msr CPSR_c, #F_BIT | ARM_MODE_SVC */ + + /* Call C function, give PIOA_ISR as argument */ + ldr r11, =__pio_irq_demux + mov r14, pc + bx r11 + + /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ */ + ldmia sp!, { r0-r3, r12, lr } +#endif + + /*- Restore the Program Counter using the LR_fiq directly in the PC */ + subs pc, lr, #4 + + .size fiq_handler, . - fiq_handler + .endfunc + .end + diff --git a/firmware/src/start/Cstartup_app.lst b/firmware/src/start/Cstartup_app.lst new file mode 100644 index 0000000..6852066 --- /dev/null +++ b/firmware/src/start/Cstartup_app.lst @@ -0,0 +1,222 @@ + 1 # 1 "src/start/Cstartup_app.S" + 1 /* Cstartup header for the application to be started by at91dfu + 0 + 0 + 2 * (C) 2006 by Harald Welte + 3 * + 4 * This program is free software; you can redistribute it and/or modify + 5 * it under the terms of the GNU General Public License as published by + 6 * the Free Software Foundation; either version 2 of the License, or + 7 * (at your option) any later version. + 8 * + 9 * This program is distributed in the hope that it will be useful, + 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of + 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 12 * GNU General Public License for more details. + 13 * + 14 * You should have received a copy of the GNU General Public License + 15 * along with this program; if not, write to the Free Software + 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 17 * + 18 */ + 19 + 20 + 21 //#define DEBUG_LL + 22 + 23 .equ AIC_FVR, (260) + 24 .equ AIC_EOICR, (304) + 25 .equ AT91C_BASE_AIC, (0xFFFFF000) + 26 .equ ARM_MODE_FIQ, 0x11 + 27 .equ ARM_MODE_IRQ, 0x12 + 28 .equ ARM_MODE_SVC, 0x13 + 29 + 30 .equ I_BIT, 0x80 + 31 .equ F_BIT, 0x40 + 32 + 33 + 34 #define AT91C_BASE_PIOA 0xFFFFF400 + 35 #define AT91C_BASE_TC0 0xFFFA0000 + 36 #define AT91C_TC_SWTRG (1 << 2) + 37 #define PIOA_SODR 0x30 + 38 #define PIOA_CODR 0x34 + 39 #define PIOA_PDSR 0x3c + 40 #define PIOA_ISR 0x4c + 41 #define PIOA_IDR 0x44 + 42 #define PIO_DATA (1 << 27) + 43 #define TC_CCR 0x00 + 44 + 45 + 46 #define PIO_LED1 (1 << 25) /* this only works on OpenPICC, not Olimex */ + 47 + 48 #ifdef DEBUG_LL + 49 /* Debugging macros for switching on/off LED1 (green) */ + 50 #define PIOA_PER 0xFFFFF400 + 51 #define PIOA_OER 0xFFFFF410 + 52 .macro led1on + 53 ldr r2, =AT91C_BASE_PIOA + 54 mov r1, #PIO_LED1 + 55 str r1, [r2, #PIOA_CODR] + 56 .endm + 57 .macro led1off + 58 ldr r2, =AT91C_BASE_PIOA + 59 mov r1, #PIO_LED1 + 60 str r1, [r2, #PIOA_SODR] + 61 .endm + 62 .macro ledinit + 63 ldr r2, =PIOA_PER + 64 mov r1, #PIO_LED1 + 65 str r1, [r2] + 66 ldr r2, =PIOA_OER + 67 str r1, [r2] + 68 led1off + 69 .endm + 70 #else + 71 .macro ledinit + 72 .endm + 73 .macro led1on + 74 .endm + 75 .macro led1off + 76 .endm + 77 #endif + 78 + 79 .global _startup + 80 .func _startup + 81 _startup: + 82 /* Relocate .data section (copy from Flash to RAM) */ + 83 0000 54109FE5 ldr r1, =_etext + 84 0004 54209FE5 ldr r2, =_data + 85 0008 54309FE5 ldr r3, =_edata + 86 000c 030052E1 loop_r: cmp r2, r3 + 87 0010 04009134 ldrlo r0, [r1], #4 + 88 0014 04008234 strlo r0, [r2], #4 + 89 0018 FBFFFF3A blo loop_r + 90 + 91 /* Clear .bss section (Zero init) */ + 92 001c 0000A0E3 mov r0, #0 + 93 0020 40109FE5 ldr r1, =__bss_start__ + 94 0024 40209FE5 ldr r2, =__bss_end__ + 95 0028 020051E1 loop_z: cmp r1, r2 + 96 002c 04008134 strlo r0, [r1], #4 + 97 0030 FCFFFF3A blo loop_z + 98 + 99 /* initialize FIQ mode registers */ + 100 0034 D1F021E3 msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + 101 0038 30A09FE5 ldr r10, =AT91C_BASE_PIOA + 102 003c 30C09FE5 ldr r12, =AT91C_BASE_TC0 + 103 0040 0490A0E3 mov r9, #AT91C_TC_SWTRG + 104 0044 13F021E3 msr CPSR_c, #ARM_MODE_SVC + 105 + 106 led1on + 107 + 108 /* prepare C function call to main */ + 109 0048 0000A0E3 mov r0, #0 /* argc = 0 */ + 110 004c 24E09FE5 ldr lr, =exit + 111 0050 24A09FE5 ldr r10, =main + 112 + 113 0054 1AFF2FE1 bx r10 + 114 + 116 .endfunc + 117 + 118 /* "exit" dummy to avoid sbrk write read etc. needed by the newlib default "exit" */ + 119 .global exit + 120 .func exit + 121 exit: + 122 0058 FEFFFFEA b . + 124 .endfunc + 125 + 126 + 127 #define LED_TRIGGER + 128 #define CALL_PIO_IRQ_DEMUX + 129 + 130 .text + 131 .arm + 132 .section .fastrun, "ax" + 133 + 134 .global fiq_handler + 135 .func fiq_handler + 136 fiq_handler: + 137 /* code that uses pre-initialized FIQ reg */ + 138 /* r8 AT91C_BASE_AIC (dfu init) + 139 r9 AT91C_TC_SWTRG + 140 r10 AT91C_BASE_PIOA + 141 r11 tmp + 142 r12 AT91C_BASE_TC0 + 143 r13 stack + 144 r14 lr + 145 */ + 146 + 147 0000 4C809AE5 ldr r8, [r10, #PIOA_ISR] + 148 0004 020318E3 tst r8, #PIO_DATA /* check for PIO_DATA change */ + 149 0008 3CB09A15 ldrne r11, [r10, #PIOA_PDSR] + 150 000c 02031B13 tstne r11, #PIO_DATA /* check for PIO_DATA == 1 */ + 151 0010 00908C15 strne r9, [r12, #TC_CCR] /* software trigger */ + 152 #ifdef LED_TRIGGER + 153 0014 02B4A013 movne r11, #PIO_LED1 + 154 0018 34B08A15 strne r11, [r10, #PIOA_CODR] /* enable LED */ + 155 #endif + 156 + 157 #if 1 + 158 001c 02B3A013 movne r11, #PIO_DATA + 159 0020 44B08A15 strne r11, [r10, #PIOA_IDR] /* disable further PIO_DATA FIQ */ + 160 #endif + 161 + 162 /*- Mark the End of Interrupt on the AIC */ + 163 0024 24B09FE5 ldr r11, =AT91C_BASE_AIC + 164 0028 30B18BE5 str r11, [r11, #AIC_EOICR] + 165 + 166 #ifdef LED_TRIGGER + 167 002c 02B4A0E3 mov r11, #PIO_LED1 + 168 0030 30B08AE5 str r11, [r10, #PIOA_SODR] /* disable LED */ + 169 #endif + 170 + 171 #ifdef CALL_PIO_IRQ_DEMUX + 172 /* push r0, r1-r3, r12, r14 onto FIQ stack */ + 173 0034 0F502DE9 stmfd sp!, { r0-r3, r12, lr} + 174 0038 0800A0E1 mov r0, r8 + 175 + 176 /* enable interrupts while handling demux */ + 177 /* msr CPSR_c, #F_BIT | ARM_MODE_SVC */ + 178 + 179 /* Call C function, give PIOA_ISR as argument */ + 180 003c 10B09FE5 ldr r11, =__pio_irq_demux + 181 0040 0FE0A0E1 mov r14, pc + 182 0044 1BFF2FE1 bx r11 + 183 + 184 /* msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ */ + 185 0048 0F50BDE8 ldmia sp!, { r0-r3, r12, lr } + 186 #endif + 187 + 188 /*- Restore the Program Counter using the LR_fiq directly in the PC */ + 189 004c 04F05EE2 subs pc, lr, #4 + 190 + 192 .endfunc + 193 0050 00F0FFFF .end + 193 00000000 +DEFINED SYMBOLS +src/start/Cstartup_app.S:23 *ABS*:00000104 AIC_FVR +src/start/Cstartup_app.S:24 *ABS*:00000130 AIC_EOICR +src/start/Cstartup_app.S:25 *ABS*:fffff000 AT91C_BASE_AIC +src/start/Cstartup_app.S:26 *ABS*:00000011 ARM_MODE_FIQ +src/start/Cstartup_app.S:27 *ABS*:00000012 ARM_MODE_IRQ +src/start/Cstartup_app.S:28 *ABS*:00000013 ARM_MODE_SVC +src/start/Cstartup_app.S:30 *ABS*:00000080 I_BIT +src/start/Cstartup_app.S:31 *ABS*:00000040 F_BIT +src/start/Cstartup_app.S:81 .text:00000000 _startup +src/start/Cstartup_app.S:83 .text:00000000 $a +src/start/Cstartup_app.S:86 .text:0000000c loop_r +src/start/Cstartup_app.S:95 .text:00000028 loop_z +src/start/Cstartup_app.S:121 .text:00000058 exit +src/start/Cstartup_app.S:136 .fastrun:00000000 fiq_handler +src/start/Cstartup_app.S:147 .fastrun:00000000 $a +src/start/Cstartup_app.S:193 .fastrun:00000050 $d +src/start/Cstartup_app.S:132 .text:0000005c $d + .debug_aranges:0000000c $d + +UNDEFINED SYMBOLS +_etext +_data +_edata +__bss_start__ +__bss_end__ +main +__pio_irq_demux diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..c1921a9 Binary files /dev/null and b/icon.ico differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..b0e49be Binary files /dev/null and b/icon.png differ diff --git a/librfid.patch b/librfid.patch new file mode 100644 index 0000000..b85148b --- /dev/null +++ b/librfid.patch @@ -0,0 +1,52 @@ +Index: src/rc632.h +=================================================================== +--- src/rc632.h (revision 2150) ++++ src/rc632.h (working copy) +@@ -70,8 +70,8 @@ + enum rc632_reg_status { + RC632_STAT_LOALERT = 0x01, + RC632_STAT_HIALERT = 0x02, +- RC632_STAT_ERR = 0x04, +- RC632_STAT_IRQ = 0x08, ++ RC632_STAT_IRQ = 0x04, ++ RC632_STAT_ERR = 0x08, + #define RC632_STAT_MODEM_MASK 0x70 + RC632_STAT_MODEM_IDLE = 0x00, + RC632_STAT_MODEM_TXSOF = 0x10, +Index: src/rfid_asic_rc632.c +=================================================================== +--- src/rfid_asic_rc632.c (revision 2150) ++++ src/rfid_asic_rc632.c (working copy) +@@ -258,7 +258,7 @@ + ret = rc632_clear_irqs(handle, RC632_IRQ_TIMER); + + /* enable timer IRQ */ +- ret |= rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET | RC632_IRQ_TIMER); ++ // ret |= rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET | RC632_IRQ_TIMER); + + ret |= rc632_reg_write(handle, RC632_REG_TIMER_RELOAD, divisor); + +@@ -276,12 +276,12 @@ + return ret; + DEBUGP_INTERRUPT_FLAG("irq_en",irq); + +- ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET ++ /* ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET + | RC632_IRQ_TIMER + | RC632_IRQ_IDLE + | RC632_IRQ_RX ); + if (ret < 0) +- return ret; ++ return ret; */ + + while (1) { + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &stat); +@@ -308,7 +308,7 @@ + + if (irq & RC632_IRQ_TIMER && !(irq & RC632_IRQ_RX)) { + DEBUGP("timer expired before RX!!\n"); +- rc632_clear_irqs(handle, RC632_IRQ_TIMER); ++ // rc632_clear_irqs(handle, RC632_IRQ_TIMER); + return -ETIMEDOUT; + } + } \ No newline at end of file diff --git a/librfid/COPYING b/librfid/COPYING new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/librfid/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General +Public License instead of this License. diff --git a/librfid/LICENSING b/librfid/LICENSING new file mode 100644 index 0000000..d1b0aae --- /dev/null +++ b/librfid/LICENSING @@ -0,0 +1,11 @@ +librfid is licensed under GNU General Public License, Version 2 as published +by the Free Software Foundation (see the file COPYING). + +This means that as soon as you wish to distribute a program that links to +librfid, that other program has to be licensed under the GPL or a compatible +license, too. + +However, an alternative (royalty-based) licensing is possible. If you want to +create a proprietary program based on librfid, contact Harald Welte + for licensing details. + diff --git a/librfid/Makefile b/librfid/Makefile new file mode 100644 index 0000000..3cc806c --- /dev/null +++ b/librfid/Makefile @@ -0,0 +1,723 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am \ + $(top_srcdir)/configure COPYING TODO compile config.guess \ + config.sub depcomp install-sh ltmain.sh missing +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +am__append_5 = utils +#am__append_6 = win32 +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 config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = etc include src utils win32 +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)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = +top_builddir = . +top_srcdir = . +AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +SUBDIRS = etc include src $(am__append_5) $(am__append_6) +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch README.MinGW +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__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: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(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 + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(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) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__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 \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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 + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +$(OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck + +# 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: diff --git a/librfid/Makefile.am b/librfid/Makefile.am new file mode 100644 index 0000000..7c0f889 --- /dev/null +++ b/librfid/Makefile.am @@ -0,0 +1,20 @@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 + +include $(top_srcdir)/Makefile.flags.am + +SUBDIRS = etc include src + +if ENABLE_FIRMWARE +else +SUBDIRS += utils +endif + +if ENABLE_WIN32 +SUBDIRS += win32 +endif + +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch README.MinGW + +$(OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck diff --git a/librfid/Makefile.flags.am b/librfid/Makefile.flags.am new file mode 100644 index 0000000..8a1d383 --- /dev/null +++ b/librfid/Makefile.flags.am @@ -0,0 +1,18 @@ +LIBVERSION= 0:0:0 + +AM_CFLAGS = -std=gnu99 +INCLUDES = $(all_includes) -I$(top_srcdir)/include + +if ENABLE_WIN32 +AM_LDFLAGS = -mno-cygwin +AM_CFLAGS += -mno-cygwin +else +if HAVE_LIBUSB +LIBS += -lusb +AM_CFLAGS += -DHAVE_LIBUSB +endif +endif + +if ENABLE_FIRMWARE +AM_CFLAGS += -DLIBRFID_FIRMWARE +endif diff --git a/librfid/Makefile.in b/librfid/Makefile.in new file mode 100644 index 0000000..696c41d --- /dev/null +++ b/librfid/Makefile.in @@ -0,0 +1,723 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am \ + $(top_srcdir)/configure COPYING TODO compile config.guess \ + config.sub depcomp install-sh ltmain.sh missing +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +@ENABLE_FIRMWARE_FALSE@am__append_5 = utils +@ENABLE_WIN32_TRUE@am__append_6 = win32 +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 config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = etc include src utils win32 +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)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +SUBDIRS = etc include src $(am__append_5) $(am__append_6) +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch README.MinGW +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__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: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(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 + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(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) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__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 \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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 + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +$(OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck + +# 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: diff --git a/librfid/README b/librfid/README new file mode 100644 index 0000000..711e507 --- /dev/null +++ b/librfid/README @@ -0,0 +1,145 @@ +librfid - low-level RFID access library +(C) 2005-2008 by Harald Welte +====================================================================== + +This library intends to provide a reader and (as much as possible) +PICC / tag independent API for RFID applications. + +1. Supported Protocols: + +At this stage of implementation, it offers only ISO 14443-2, ISO 14443-3 A and +B as well as ISO 14443-4 (T=CL) support. ISO15693 is only partiall +implemented. Other protocols are to be added as soon as I find some more time. + +2. Supported Readers: + +At this time, the Omnikey Cardman 5121/5321 and the OpenPCD readers are supported. + +2.1 Omnikey Cardman 5121/5321 RFID (http://www.omnikey.de/) + +The cm5121 is a relatively stupid piece of hardware. Basically a contact-based +cm3121 that was enhanced by putting a Philips CL RC632 reader ASIC next to it. +There is no RFID protocol implementation on the cm5121, everything is done on +the host (PC) software. Four primitives (read/write byte/fifo) are provided +via simple PC_to_RDR_Escape CCID messages. + +The cm5321 seems to be an improved version of the 5121, mainly with different +antenna geometrics for better communications reliability. + +2.2 OpenPCD (http://www.openpcd.org/) + +The OpenPCD reader is completely free. You get the full schematics, the PCB +design, and the source code to the device firmware (written in C, to be +compiled with the free GNU toolchain). Also, all required development tools +are available under Free Software licenses! + +In addition, it has various headers for access to the intermediate signal +processing steps. + +This makes it the ideal device to learn and play with RFID, since you don't +have any (proprietary) software interfere and puts you in full control of +everything. + +This is now the primary development target for librfid. However, this doesn't +mean that we don't want to support as many readers as possible. + +Another interesting new option is to cross-compile librfid to fit it _inside_ +the OpenPCD firmware, enabling a fully autonomous RFID stack (and RFID +applications) on the reader, without any requirement for a host PC! + +2.3 Philips Pegoda + +This reader is not yet supported. Some initial experiments have shown that +adding support for it is feasible. + +2.4 spidev RC632 + +This is not actually a specific reader, but a generic implementation of a +CL RC632 based redaer attached to a SPI bus supported by the standard Linux +SPI kernel driver architecture and it's spidev userspace interface. + +If you want to build this reader driver, use the '--enable-spidev' option +to the './configure' command. + +2.x Further Readers + +Support for more devices shouldn't be too difficult to add, provided the +devices are stupid enough. More sophisticated readers like Integrated +Engineering or Philips Pegoda do much of the protocol handling in firmware on a +microcontroller. This makes them (at least till now) faster, but also of +limited use, especially in education and research. + +So if you happen to run into any other dumb RFID readers, especially those +based on Philips CL RC622, RC531 and RC632, adding support should be very +straightforward. If you want to contract me for implementing a driver +backend, don't hesitate to contact me. + + +3. Building / Installing + +In the default configuration, librfid only includes the driver for the OpenPCD +dumbreader firmware. + +If you want support for Omnikey Cardman 5121/5321, you have to choose the +backend you want to use, either: + +3.1 (new) native CCID backend + +If you add the '--enable-ccid' option to the './configure' command, then the new +native CCID driver (courtesy of Werner Koch) will be linked into the library. +This requires a working libusb with development headers. + +In order to use the reader, you will need to set the permissions of the +respective /proc/bus/usb or /sys/bus/usb files (or run the application as +root, if you trust my code, which you shouldn't). + +If you run udev, just use the 'etc/udev/librfid.rules' udev rulefile, which should +change the group of the usb device to 'users'. + +3.2 (old) OpenCT backend + +This backend has the advantage that it will allow you to use the contact-based +part and the contactless part of the CM5121 simultaneously. + +Please note that while librfid in this configuration _uses_ OpenCT as a +lower-layer transport interface, it doesn't actually provide a virtual reader +interface to it, i.e. you can't use CT-API/OpenCT/PCSC API's to access RFID +transponders. + +In order to use this backend, you need to use the +'--enable-openct' option and - if it is not installed in a default +location like /usr or /usr/local - set the environment variables +PATH, LD_LIBRARY_PATH and PKG_CONFIG_PATH so all files are found. + + +4. Testing + +In the 'utils' directory, you will get a 'librfid-tool' binary. It is very +minimalist, and mainly an example on how to use the librfid API. For an ICAO +compliant passport, you may try "--layer2 iso14443a --protocol tcl". For a +mifare ultralight transponder, "--layer2 iso14443a --protocol +mifare-ultralight" will give you a full dump of the transponder. + +The most basic command to get started is "librfid-tool --scan" to make it +auto-detect the first available (and supported) transponder + + +5. Help and Support + +If you run into any problems using librfid, the primary contact address is the +mailinglist of librfid developers at librfid-devel@lists.gnumonks.org. Please +note that while the development community is trying to provide the best level +of support, response times might vary. + +You can subscribe to this list at + https://lists.gnumonks.org/mailman/listinfo/librfid-devel + +If you are interested in commercial grade support of librfid, feel free to +contact me privately to discuss your requirements and provide you with a quote. + +6. Licensing + +Pleas read the file LICENSING. + +-- Harald Welte + diff --git a/librfid/README.MinGW b/librfid/README.MinGW new file mode 100644 index 0000000..b23960a --- /dev/null +++ b/librfid/README.MinGW @@ -0,0 +1,31 @@ +Quick steps for MinGW+autotools setup +===================================== + +1. Download MinGW/MSys packages from MinGW's project homepage[A]. I've downloaded[B]. +2. Unpack MinGW packages to some directory. In my case it was to c:\mingw. +3. Install MSys using exe installer. In my case I've installed it in c:\mingw\msys. +4. Unpack MSys packages[B] to directory, where you've installed MSys in step 4. +5. Install msysDTK (very old Perl etc. needed for autotools). +6. Run msys.bat and just cd to librfid directory and run ./autogen.sh, then ./configure +7. Lucky number + +A. http://http://www.mingw.org/download.shtml +B. MinGW packages: + --------------- + gcc-g++-3.4.5-20060117-1.tar.gz + gcc-core-3.4.5-20060117-1.tar.gz + binutils-2.16.91-20060119-1.tar.gz + w32api-3.6.tar.gz + mingw-runtime-3.9.tar.gz + mingw32-make-3.80.0-3.tar.gz + gdb-6.3-2.exe + mingw-utils-0.3.tar.gz + + MSys packages: + -------------- + MSYS-1.0.10.exe + bash-2.05b-MSYS.tar.bz2 + msys-autoconf-2.59.tar.bz2 + msys-automake-1.8.2.tar.bz2 + msys-libtool-1.5.tar.bz2 + msysDTK-1.0.1.exe diff --git a/librfid/TODO b/librfid/TODO new file mode 100644 index 0000000..f3d8b4e --- /dev/null +++ b/librfid/TODO @@ -0,0 +1,57 @@ +architecture: +- somehow have some more abstrcat handle type in order to enable the generic + rfid_{get,set}opt() functions +- remove additional transceive_{acf,sf} functions from reader and asic structs, + make the code reuse the existing transceive() function by using the frametype + to differentiate different cases. + +rc632: +- make timeout tolerance factor (TIMER_RELAX_FACTOR) user-specified +- try to use built-in timer for timing analysis, i.e. determine the exact time + until a card response by reading the remaining timer ticks from the register +- make sure interrupt mode for timer wait works + +cm5121: +- fix handling of TX or RX > 0x7f [buffer length in atmel chip?] + +iso14443a: +[none] + +iso14443b: +- implement 'option 2' frame markers +- test anticollission (need multiple tags) + +iso15693: +- implement anticollision + +mifare_clasic: +[none] + +icode1: +- implement and test code (I only have ICode2 tags) + +tcl: +- implement pps for asymmetric (rx/tx) speeds + +openct: +- add ifdhandler driver for PC/SC support +- add various standardized PC/SC remappings for cards != tcl + +other: +- implementation of code for various passive tags, ie. ITRX, I*Code1, I*Code2, Tag-it, ... +- documentation +- add notion of 'asic implementation' for specifying reader-specific + initialization values such as mod_conductance +- abstract a read single block / read multiple block API where l2/proto + layer can provide multi-block function (e.g. iso15693), which will be + emulated in case there only is a single-block function +- switch over to use of rfid_buf structure, similar to linux skb. upper + layers have sufficient headroom in order to have lower layers add protocol + headers in front of a packet +- implement software checksumming support. The reader should be able to + indicate whether it supports hardware checksum generation / verification. +- application software should be able to override hardware csumming on request +- implement some auto-calibration mode where the user is requested to leave a + single PICC/VICC on the reader and the software iterates through various + mod_conductance and bitphase values to see whether it can calibrate to a given + [new] card. The resulting calibration values are printed by the program. diff --git a/librfid/aclocal.m4 b/librfid/aclocal.m4 new file mode 100644 index 0000000..76c23b1 --- /dev/null +++ b/librfid/aclocal.m4 @@ -0,0 +1,9413 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 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. + +# 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. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # 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) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/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. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_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${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# 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. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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 + ;; +sparc*-*solaris*) + # 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 + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# 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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_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 <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_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* | cegcc*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $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 .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_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 +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_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 +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; 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 +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +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" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +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" +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' + ;; + +aix[[4-9]]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 + +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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[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]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 + +_LT_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 +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_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 + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +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 + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# 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]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_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 + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # 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 + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_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_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # 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. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[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 + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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]].*|aix[[5-9]]*) + 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + 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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_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' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_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' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$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_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [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]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +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_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will 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 + ;; + + aix[[4-9]]*) + 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]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +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 +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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_CFLAGS=$CFLAGS + 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 + $as_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 + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + 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]].*|aix[[5-9]]*) + 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + 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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + 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_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_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; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_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' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_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=`func_echo_all "$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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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 -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_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} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -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 -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_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 -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + 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 +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([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. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +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... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); 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 + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${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 + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$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 "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + 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 + ;; + aix[[4-9]]*) + 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]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + 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 + ;; + aix[[4-9]]*) + 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]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_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_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# 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. +_LT_TAG_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_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# 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. # + +m4_defun([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 +IFS=$as_save_IFS +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_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# @configure_input@ + +# serial 3294 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4]) +m4_define([LT_PACKAGE_REVISION], [1.3294]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4' +macro_revision='1.3294' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# 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 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# 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, 2006, 2008 +# 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 9 + +# 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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, 2006, 2009 +# 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 10 + +# 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# 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 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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, 2006, 2008, 2009 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 16 + +# 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.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# 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_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 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 +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +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])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 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_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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 6 + +# 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 +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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, 2006 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 for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 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_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], +[m4_foreach_w([_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, 2008 +# 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 5 + +# 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 +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 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_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# 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 + diff --git a/librfid/autogen.sh b/librfid/autogen.sh new file mode 100644 index 0000000..990e162 --- /dev/null +++ b/librfid/autogen.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +run () +{ + echo "running: $*" + eval $* + + if test $? != 0 ; then + echo "error: while running '$*'" + exit 1 + fi +} + +run aclocal +run libtoolize -f +run automake -a +run autoconf diff --git a/librfid/autom4te.cache/output.0 b/librfid/autom4te.cache/output.0 new file mode 100644 index 0000000..5509a0a --- /dev/null +++ b/librfid/autom4te.cache/output.0 @@ -0,0 +1,14320 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.67. +@%:@ +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_SPIDEV_FALSE +ENABLE_SPIDEV_TRUE +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_ccid +enable_openct +enable_spidev +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + @<:@@<:@default=no@:>@@:>@ + --enable-spidev Enable spidev reader + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_func +cat >config.log <<_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.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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=librfid + VERSION=0.2.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "@%:@define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4' +macro_revision='1.3294' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if test "${lt_cv_to_host_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if test "${lt_cv_to_tool_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if test "${lt_cv_ar_at_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +@%:@ Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +@%:@ Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test "${lt_cv_path_mainfest_tool+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + + + 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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if test "${lt_cv_prog_compiler_pic+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + 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' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test "${lt_cv_irix_exported_symbol+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +$as_echo "@%:@define RFID_BIG_ENDIAN_BITFIELD 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then : + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then : + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +@%:@ Check whether --enable-spidev was given. +if test "${enable_spidev+set}" = set; then : + enableval=$enable_spidev; ENABLE_SPIDEV=1 +else + ENABLE_SPIDEV=0 +fi + + if test "$ENABLE_SPIDEV" == "1"; then + ENABLE_SPIDEV_TRUE= + ENABLE_SPIDEV_FALSE='#' +else + ENABLE_SPIDEV_TRUE='#' + ENABLE_SPIDEV_FALSE= +fi + + +OPENCT_MSG=no + + + + + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then : + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then : + withval=$with_; +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_close=yes +else + ac_cv_lib_usb_usb_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then : + HAVE_LIBUSB=1 +else + HAVE_LIBUSB=0 +fi + + if test "$HAVE_LIBUSB" == "1"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_SPIDEV_TRUE}" && test -z "${ENABLE_SPIDEV_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SPIDEV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid/autom4te.cache/output.1 b/librfid/autom4te.cache/output.1 new file mode 100644 index 0000000..b9debd3 --- /dev/null +++ b/librfid/autom4te.cache/output.1 @@ -0,0 +1,14316 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.67. +@%:@ +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_SPIDEV_FALSE +ENABLE_SPIDEV_TRUE +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_ccid +enable_openct +enable_spidev +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + @<:@@<:@default=no@:>@@:>@ + --enable-spidev Enable spidev reader + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_func +cat >config.log <<_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.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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=librfid + VERSION=0.2.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "@%:@define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4' +macro_revision='1.3294' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if test "${lt_cv_to_host_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if test "${lt_cv_to_tool_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if test "${lt_cv_ar_at_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +@%:@ Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +@%:@ Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test "${lt_cv_path_mainfest_tool+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + + + 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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if test "${lt_cv_prog_compiler_pic+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + 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' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test "${lt_cv_irix_exported_symbol+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +$as_echo "@%:@define RFID_BIG_ENDIAN_BITFIELD 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then : + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then : + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +@%:@ Check whether --enable-spidev was given. +if test "${enable_spidev+set}" = set; then : + enableval=$enable_spidev; ENABLE_SPIDEV=1 +else + ENABLE_SPIDEV=0 +fi + + if test "$ENABLE_SPIDEV" == "1"; then + ENABLE_SPIDEV_TRUE= + ENABLE_SPIDEV_FALSE='#' +else + ENABLE_SPIDEV_TRUE='#' + ENABLE_SPIDEV_FALSE= +fi + + +OPENCT_MSG=no + + + + + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then : + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then : + withval=$with_; +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_close=yes +else + ac_cv_lib_usb_usb_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then : + HAVE_LIBUSB=1 +else + HAVE_LIBUSB=0 +fi + + if test "$HAVE_LIBUSB" == "1"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_SPIDEV_TRUE}" && test -z "${ENABLE_SPIDEV_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SPIDEV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid/autom4te.cache/requests b/librfid/autom4te.cache/requests new file mode 100644 index 0000000..569a3ad --- /dev/null +++ b/librfid/autom4te.cache/requests @@ -0,0 +1,282 @@ +# This file was generated by Autom4te Mon Aug 2 13:04:52 PDT 2010. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/mingw/share/autoconf' + ], + [ + '/mingw/share/autoconf/autoconf/autoconf.m4f', + '/mingw/share/aclocal/argz.m4', + '/mingw/share/aclocal/libtool.m4', + '/mingw/share/aclocal/ltdl.m4', + '/mingw/share/aclocal/ltoptions.m4', + '/mingw/share/aclocal/ltsugar.m4', + '/mingw/share/aclocal/ltversion.m4', + '/mingw/share/aclocal/lt~obsolete.m4', + '/mingw/share/aclocal-1.11/amversion.m4', + '/mingw/share/aclocal-1.11/auxdir.m4', + '/mingw/share/aclocal-1.11/cond.m4', + '/mingw/share/aclocal-1.11/depend.m4', + '/mingw/share/aclocal-1.11/depout.m4', + '/mingw/share/aclocal-1.11/init.m4', + '/mingw/share/aclocal-1.11/install-sh.m4', + '/mingw/share/aclocal-1.11/lead-dot.m4', + '/mingw/share/aclocal-1.11/make.m4', + '/mingw/share/aclocal-1.11/minuso.m4', + '/mingw/share/aclocal-1.11/missing.m4', + '/mingw/share/aclocal-1.11/mkdirp.m4', + '/mingw/share/aclocal-1.11/options.m4', + '/mingw/share/aclocal-1.11/runlog.m4', + '/mingw/share/aclocal-1.11/sanity.m4', + '/mingw/share/aclocal-1.11/silent.m4', + '/mingw/share/aclocal-1.11/strip.m4', + '/mingw/share/aclocal-1.11/substnot.m4', + '/mingw/share/aclocal-1.11/tar.m4', + 'configure.in' + ], + { + 'AC_LIB_LTDL' => 1, + 'AC_LIBTOOL_RC' => 1, + '_LT_PROG_FC' => 1, + 'LT_AC_PROG_RC' => 1, + '_LT_PROG_ECHO_BACKSLASH' => 1, + '_LT_AC_LANG_F77' => 1, + '_LT_AC_LANG_F77_CONFIG' => 1, + 'AC_PATH_MAGIC' => 1, + 'AC_PROG_EGREP' => 1, + '_LT_COMPILER_BOILERPLATE' => 1, + '_LTDL_SETUP' => 1, + 'AM_MAKE_INCLUDE' => 1, + '_LT_AC_LANG_GCJ' => 1, + 'LT_AC_PROG_EGREP' => 1, + 'AC_LIBTOOL_DLOPEN_SELF' => 1, + 'AC_DISABLE_SHARED' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_LTDL_SHLIBEXT' => 1, + 'AC_LIBTOOL_PICMODE' => 1, + 'gl_PREREQ_ARGZ' => 1, + 'LT_OUTPUT' => 1, + 'AC_CHECK_LIBM' => 1, + 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, + '_LT_PROG_F77' => 1, + 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, + 'AC_LIBLTDL_CONVENIENCE' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + '_LT_AC_TRY_DLOPEN_SELF' => 1, + '_LT_AC_CHECK_DLFCN' => 1, + 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, + '_LT_AC_PROG_ECHO_BACKSLASH' => 1, + 'AC_LTDL_SYMBOL_USCORE' => 1, + 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, + 'AC_DEPLIBS_CHECK_METHOD' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AC_PROG_LD' => 1, + '_LT_AC_LANG_GCJ_CONFIG' => 1, + 'AU_DEFUN' => 1, + '_AM_PROG_TAR' => 1, + '_LT_AC_LANG_CXX_CONFIG' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_LT_AC_PROG_CXXCPP' => 1, + 'LTOPTIONS_VERSION' => 1, + 'AM_ENABLE_SHARED' => 1, + 'AC_LIBTOOL_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_CONFIG' => 1, + 'AC_LTDL_PREOPEN' => 1, + 'AM_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_LANG_C_CONFIG' => 1, + 'AC_PROG_LD_GNU' => 1, + 'LTDL_INSTALLABLE' => 1, + 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, + '_LT_LINKER_BOILERPLATE' => 1, + 'LT_WITH_LTDL' => 1, + 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, + 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, + 'LT_SYS_SYMBOL_USCORE' => 1, + 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, + '_LT_AC_LOCK' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'LTSUGAR_VERSION' => 1, + '_AM_IF_OPTION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'LT_SYS_MODULE_PATH' => 1, + '_LT_AC_LANG_CXX' => 1, + 'LT_PROG_RC' => 1, + 'm4_include' => 1, + 'AC_ENABLE_SHARED' => 1, + 'LT_LIB_M' => 1, + 'AC_LIBTOOL_FC' => 1, + 'AC_LIBTOOL_F77' => 1, + 'LTOBSOLETE_VERSION' => 1, + 'm4_pattern_forbid' => 1, + 'AM_MISSING_PROG' => 1, + 'AC_WITH_LTDL' => 1, + 'LT_PATH_LD' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, + '_AC_PROG_LIBTOOL' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_LT_AC_SYS_LIBPATH_AIX' => 1, + '_LT_AC_LANG_C_CONFIG' => 1, + '_LT_AC_SHELL_INIT' => 1, + '_LT_WITH_SYSROOT' => 1, + 'AC_LIBTOOL_DLOPEN' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_LIBTOOL_GCJ' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFUN' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AC_LIBLTDL_INSTALLABLE' => 1, + 'gl_FUNC_ARGZ' => 1, + 'AC_PROG_NM' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_LT_PROG_CXX' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_SANITY_CHECK' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, + 'AC_LTDL_SHLIBPATH' => 1, + 'AC_LTDL_DLSYM_USCORE' => 1, + 'AM_DEP_TRACK' => 1, + '_LT_CC_BASENAME' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_PROG_LD' => 1, + '_LT_LIBOBJ' => 1, + 'AM_MISSING_HAS_RUN' => 1, + '_AM_DEPENDENCIES' => 1, + '_LT_PROG_LTMAIN' => 1, + '_AM_SET_OPTION' => 1, + 'AC_LTDL_DLLIB' => 1, + 'AC_LTDL_ENABLE_INSTALL' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_PROG_CC_C_O' => 1, + 'LT_AC_PROG_SED' => 1, + 'AC_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, + 'LT_SYS_DLOPEN_SELF' => 1, + 'LTVERSION_VERSION' => 1, + 'AM_PROG_MKDIR_P' => 1, + '_LT_REQUIRED_DARWIN_CHECKS' => 1, + 'LT_LANG' => 1, + '_LT_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_SETUP' => 1, + 'LT_CMD_MAX_LEN' => 1, + 'AC_PROG_LD_RELOAD_FLAG' => 1, + 'include' => 1, + 'LTDL_INIT' => 1, + '_LT_PREPARE_SED_QUOTE_VARS' => 1, + 'AM_RUN_LOG' => 1, + 'AM_DISABLE_SHARED' => 1, + '_LT_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_OBJDIR' => 1, + '_LT_AC_LANG_RC_CONFIG' => 1, + 'LT_PATH_NM' => 1, + 'LT_AC_PROG_GCJ' => 1, + '_LT_LINKER_OPTION' => 1, + 'LT_SYS_DLSEARCH_PATH' => 1, + 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, + 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, + 'AC_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_CXX' => 1, + 'AM_ENABLE_STATIC' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'LT_INIT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AC_LIBTOOL_PROG_CC_C_O' => 1, + 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, + 'AC_ENABLE_FAST_INSTALL' => 1, + 'AM_PROG_NM' => 1, + 'LT_SYS_DLOPEN_DEPLIBS' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_LT_AC_TAGVAR' => 1, + 'LT_FUNC_DLSYM_USCORE' => 1, + 'm4_pattern_allow' => 1, + 'LT_LIB_DLLOAD' => 1, + 'LTDL_CONVENIENCE' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_LTDL_OBJDIR' => 1, + 'AC_DISABLE_FAST_INSTALL' => 1, + 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, + '_LT_AC_SYS_COMPILER' => 1, + 'AC_ENABLE_STATIC' => 1, + 'AC_LTDL_SYSSEARCHPATH' => 1, + 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, + 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + 'LT_PROG_GCJ' => 1, + 'AC_LIBTOOL_LINKER_OPTION' => 1, + 'LT_SYS_MODULE_EXT' => 1, + '_AM_SET_OPTIONS' => 1, + 'AC_LIBTOOL_WIN32_DLL' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/mingw/share/autoconf' + ], + [ + '/mingw/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.in' + ], + { + 'AM_PROG_CXX_C_O' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_sinclude' => 1, + 'LT_INIT' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_PROG_FC_C_O' => 1, + 'sinclude' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AC_INIT' => 1, + 'AC_SUBST_TRACE' => 1, + 'AM_CONDITIONAL' => 1, + 'AH_OUTPUT' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + '_AM_COND_IF' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_CANONICAL_HOST' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AM_PROG_F77_C_O' => 1, + 'm4_pattern_allow' => 1, + 'm4_include' => 1, + 'm4_pattern_forbid' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_SILENT_RULES' => 1, + '_AM_COND_ELSE' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_FC_SRCEXT' => 1, + 'include' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_SUBST' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_AUTOMAKE_VERSION' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/librfid/autom4te.cache/traces.0 b/librfid/autom4te.cache/traces.0 new file mode 100644 index 0000000..d9f3285 --- /dev/null +++ b/librfid/autom4te.cache/traces.0 @@ -0,0 +1,2468 @@ +m4trace:/mingw/share/aclocal/argz.m4:12: -1- AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ + +AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.]) + AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h + does not typedef error_t.])], + [#if defined(HAVE_ARGZ_H) +# include +#endif]) + +ARGZ_H= +AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ + argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) + +dnl if have system argz functions, allow forced use of +dnl libltdl-supplied implementation (and default to do so +dnl on "known bad" systems). Could use a runtime check, but +dnl (a) detecting malloc issues is notoriously unreliable +dnl (b) only known system that declares argz functions, +dnl provides them, yet they are broken, is cygwin +dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) +dnl So, it's more straightforward simply to special case +dnl this for known bad systems. +AS_IF([test -z "$ARGZ_H"], + [AC_CACHE_CHECK( + [if argz actually works], + [lt_cv_sys_argz_works], + [[case $host_os in #( + *cygwin*) + lt_cv_sys_argz_works=no + if test "$cross_compiling" != no; then + lt_cv_sys_argz_works="guessing no" + else + lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' + save_IFS=$IFS + IFS=-. + set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` + IFS=$save_IFS + lt_os_major=${2-0} + lt_os_minor=${3-0} + lt_os_micro=${4-0} + if test "$lt_os_major" -gt 1 \ + || { test "$lt_os_major" -eq 1 \ + && { test "$lt_os_minor" -gt 5 \ + || { test "$lt_os_minor" -eq 5 \ + && test "$lt_os_micro" -gt 24; }; }; }; then + lt_cv_sys_argz_works=yes + fi + fi + ;; #( + *) lt_cv_sys_argz_works=yes ;; + esac]]) + AS_IF([test "$lt_cv_sys_argz_works" = yes], + [AC_DEFINE([HAVE_WORKING_ARGZ], 1, + [This value is set to 1 to indicate that the system argz facility works])], + [ARGZ_H=argz.h + AC_LIBOBJ([argz])])]) + +AC_SUBST([ARGZ_H]) +]) +m4trace:/mingw/share/aclocal/argz.m4:79: -1- AC_DEFUN([gl_PREREQ_ARGZ], [:]) +m4trace:/mingw/share/aclocal/libtool.m4:69: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:107: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:107: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:108: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:108: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:607: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +]) +m4trace:/mingw/share/aclocal/libtool.m4:788: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) +m4trace:/mingw/share/aclocal/libtool.m4:799: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:861: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +m4trace:/mingw/share/aclocal/libtool.m4:861: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. +You should run autoupdate.])dnl +LT_LANG(C++)]) +m4trace:/mingw/share/aclocal/libtool.m4:862: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +m4trace:/mingw/share/aclocal/libtool.m4:862: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran 77)]) +m4trace:/mingw/share/aclocal/libtool.m4:863: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +m4trace:/mingw/share/aclocal/libtool.m4:863: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran)]) +m4trace:/mingw/share/aclocal/libtool.m4:864: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +m4trace:/mingw/share/aclocal/libtool.m4:864: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Java)]) +m4trace:/mingw/share/aclocal/libtool.m4:865: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +m4trace:/mingw/share/aclocal/libtool.m4:865: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Windows Resource)]) +m4trace:/mingw/share/aclocal/libtool.m4:1181: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) +m4trace:/mingw/share/aclocal/libtool.m4:1445: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +]) +m4trace:/mingw/share/aclocal/libtool.m4:1487: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1487: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1496: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +]) +m4trace:/mingw/share/aclocal/libtool.m4:1531: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1531: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1538: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +# 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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:1671: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1671: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1782: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_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* | cegcc*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:1899: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1899: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2871: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 + +_LT_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 +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:2933: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2933: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2956: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 | 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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:3430: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3430: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3431: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3431: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3501: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:3520: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3520: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7478: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:7487: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7487: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7494: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) +]) +m4trace:/mingw/share/aclocal/libtool.m4:7499: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7499: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7619: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7619: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) +_$0($*) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:68: -1- AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/mingw/share/aclocal/ltdl.m4:81: -1- AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/mingw/share/aclocal/ltdl.m4:81: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_CONVENIENCE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/mingw/share/aclocal/ltdl.m4:124: -1- AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/mingw/share/aclocal/ltdl.m4:137: -1- AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/mingw/share/aclocal/ltdl.m4:137: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_INSTALLABLE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/mingw/share/aclocal/ltdl.m4:213: -1- AC_DEFUN([_LT_LIBOBJ], [ + m4_pattern_allow([^_LT_LIBOBJS$]) + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" +]) +m4trace:/mingw/share/aclocal/ltdl.m4:226: -1- AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +dnl We need to keep our own list of libobjs separate from our parent project, +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while +dnl we look for our own LIBOBJs. +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) +m4_pushdef([AC_LIBSOURCES]) + +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: +m4_if(_LTDL_MODE, [], + [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) + +AC_ARG_WITH([included_ltdl], + [AS_HELP_STRING([--with-included-ltdl], + [use the GNU ltdl sources included here])]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_DECL([lt_dlinterface_register], + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], + [with_included_ltdl=no], + [with_included_ltdl=yes])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT + #include ])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT] + ) +fi + +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE +dnl was called yet, then for old times' sake, we assume libltdl is in an +dnl eponymous directory: +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) + +AC_ARG_WITH([ltdl_include], + [AS_HELP_STRING([--with-ltdl-include=DIR], + [use the ltdl headers installed in DIR])]) + +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) + fi +else + with_ltdl_include=no +fi + +AC_ARG_WITH([ltdl_lib], + [AS_HELP_STRING([--with-ltdl-lib=DIR], + [use the libltdl.la installed in DIR])]) + +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) + fi +else + with_ltdl_lib=no +fi + +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + m4_case(m4_default(_LTDL_TYPE, [convenience]), + [convenience], [_LTDL_CONVENIENCE], + [installable], [_LTDL_INSTALLABLE], + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL="-I$with_ltdl_include" + ;; +esac +INCLTDL="$LTDLINCL" + +# Report our decision... +AC_MSG_CHECKING([where to find libltdl headers]) +AC_MSG_RESULT([$LTDLINCL]) +AC_MSG_CHECKING([where to find libltdl library]) +AC_MSG_RESULT([$LIBLTDL]) + +_LTDL_SETUP + +dnl restore autoconf definition. +m4_popdef([AC_LIBOBJ]) +m4_popdef([AC_LIBSOURCES]) + +AC_CONFIG_COMMANDS_PRE([ + _ltdl_libobjs= + _ltdl_ltlibobjs= + if test -n "$_LT_LIBOBJS"; then + # Remove the extension. + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" + done + fi + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) +]) + +# Only expand once: +m4_define([LTDL_INIT]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:352: -1- AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:352: -1- AC_DEFUN([AC_LIB_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIB_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:353: -1- AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:353: -1- AC_DEFUN([AC_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:354: -1- AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:354: -1- AC_DEFUN([LT_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `LT_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:367: -1- AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl +AC_REQUIRE([LT_LIB_DLLOAD])dnl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl +AC_REQUIRE([gl_FUNC_ARGZ])dnl + +m4_require([_LT_CHECK_OBJDIR])dnl +m4_require([_LT_HEADER_DLFCN])dnl +m4_require([_LT_CHECK_DLPREOPEN])dnl +m4_require([_LT_DECL_SED])dnl + +dnl Don't require this, or it will be expanded earlier than the code +dnl that sets the variables it relies on: +_LT_ENABLE_INSTALL + +dnl _LTDL_MODE specific code must be called at least once: +_LTDL_MODE_DISPATCH + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +AC_CONFIG_COMMANDS_PRE([dnl +m4_pattern_allow([^LT_CONFIG_H$])dnl +m4_ifset([AH_HEADER], + [LT_CONFIG_H=AH_HEADER], + [m4_ifset([AC_LIST_HEADERS], + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], + [])])]) +AC_SUBST([LT_CONFIG_H]) + +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], + [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) + +m4_pattern_allow([LT_LIBEXT])dnl +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) + +name= +eval "lt_libprefix=\"$libname_spec\"" +m4_pattern_allow([LT_LIBPREFIX])dnl +AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) + +name=ltdl +eval "LTDLOPEN=\"$libname_spec\"" +AC_SUBST([LTDLOPEN]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:443: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [lt_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say `no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$lt_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:542: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:542: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:549: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which extension is used for runtime loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_MODULE_EXT])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for runtime loadable modules, say, ".so".]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:565: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:565: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:572: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which variable specifies run-time module search path], + [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) +if test -n "$lt_cv_module_path_var"; then + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], + [Define to the name of the environment variable that determines the run-time module search path.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:584: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:584: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:591: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([for the default library search path], + [lt_cv_sys_dlsearch_path], + [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path="$dir" + else + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" + fi + done + m4_pattern_allow([LT_DLSEARCH_PATH])dnl + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], + [Define to the system default library search path.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:612: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:612: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:638: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) +LT_DLLOADERS= +AC_SUBST([LT_DLLOADERS]) + +AC_LANG_PUSH([C]) + +LIBADD_DLOPEN= +AC_SEARCH_LIBS([dlopen], [dl], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + if test "$ac_cv_search_dlopen" != "none required" ; then + LIBADD_DLOPEN="-ldl" + fi + libltdl_cv_lib_dl_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H +# include +#endif + ]], [[dlopen(0, 0);]])], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_SUBST([LIBADD_DLOPEN]) + +LIBADD_SHL_LOAD= +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD="-ldld"])]) +AC_SUBST([LIBADD_SHL_LOAD]) + +case $host_os in +darwin[[1567]].*) +# We only want this for pre-Mac OS X 10.4. + AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | mingw* | os2* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac + +AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) +AC_SUBST([LIBADD_DLD_LINK]) + +m4_pattern_allow([^LT_DLPREOPEN$]) +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + AC_DEFINE([HAVE_LIBDLLOADER], [1], + [Define if libdlloader will be built on this platform]) +fi +AC_SUBST([LT_DLPREOPEN]) + +dnl This isn't used anymore, but set it for backwards compatibility +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" +AC_SUBST([LIBADD_DL]) + +AC_LANG_POP +]) +m4trace:/mingw/share/aclocal/ltdl.m4:731: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:731: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:739: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [lt_cv_sys_symbol_underscore], + [lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + AC_SUBST([sys_symbol_underscore]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:776: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:776: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:783: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +if test x"$lt_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + _LT_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:808: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:808: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +m4trace:/mingw/share/aclocal/ltoptions.m4:111: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:111: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:146: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:146: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:195: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:199: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:203: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:203: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:204: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:204: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:249: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:253: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:257: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:257: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:258: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:258: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:303: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:303: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:310: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:310: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:343: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:343: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltsugar.m4:13: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) +m4trace:/mingw/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' +macro_revision='1.3294' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:36: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:40: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:44: -1- AC_DEFUN([_LT_AC_TAGVAR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:45: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_PREOPEN]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:47: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_LOCK]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:49: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:50: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:51: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LTDL_OBJDIR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:57: -1- AC_DEFUN([AC_PATH_MAGIC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PROG_LD_GNU]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:60: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:61: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:66: -1- AC_DEFUN([LT_AC_PROG_EGREP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:71: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:72: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:73: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:74: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:77: -1- AC_DEFUN([_LT_AC_LANG_CXX]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_F77]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:93: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:96: -1- AC_DEFUN([_LT_PROG_F77]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_FC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_CXX]) +m4trace:/mingw/share/aclocal-1.11/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/mingw/share/aclocal-1.11/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/mingw/share/aclocal-1.11/auxdir.m4:47: -1- 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` +]) +m4trace:/mingw/share/aclocal-1.11/cond.m4:15: -1- 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:28: -1- 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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]) +]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:171: -1- 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) +m4trace:/mingw/share/aclocal-1.11/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 +} +]) +m4trace:/mingw/share/aclocal-1.11/depout.m4:75: -1- 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"]) +]) +m4trace:/mingw/share/aclocal-1.11/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/mingw/share/aclocal-1.11/init.m4:126: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/mingw/share/aclocal-1.11/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/mingw/share/aclocal-1.11/lead-dot.m4:12: -1- 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])]) +m4trace:/mingw/share/aclocal-1.11/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/mingw/share/aclocal-1.11/minuso.m4:14: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) +m4trace:/mingw/share/aclocal-1.11/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/mingw/share/aclocal-1.11/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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 +]) +m4trace:/mingw/share/aclocal-1.11/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/mingw/share/aclocal-1.11/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/mingw/share/aclocal-1.11/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/mingw/share/aclocal-1.11/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/mingw/share/aclocal-1.11/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/mingw/share/aclocal-1.11/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/mingw/share/aclocal-1.11/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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)]) +m4trace:/mingw/share/aclocal-1.11/silent.m4:14: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/mingw/share/aclocal-1.11/strip.m4:17: -1- 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/mingw/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/mingw/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/mingw/share/aclocal-1.11/tar.m4:24: -1- 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]) +]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:1858: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.2.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11.1]) +m4trace:configure.in:5: -1- _AM_AUTOCONF_VERSION([2.67]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AM_SANITY_CHECK +m4trace:configure.in:5: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.in:5: -1- AM_MISSING_HAS_RUN +m4trace:configure.in:5: -1- AM_AUX_DIR_EXPAND +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_SH +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AM_PROG_MKDIR_P +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AM_SET_LEADING_DOT +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.in:5: -1- _AM_PROG_TAR([v7]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AMTAR], [tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:5: -1- _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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([silent-rules]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.in:7: -1- AM_SET_DEPDIR +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:7: -1- AM_MAKE_INCLUDE +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_DEP_TRACK +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:11: -1- AC_LIBTOOL_WIN32_DLL +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [/mingw/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [/mingw/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- AM_PROG_LIBTOOL +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [/mingw/share/aclocal/libtool.m4:108: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- LTOPTIONS_VERSION +m4trace:configure.in:12: -1- LTSUGAR_VERSION +m4trace:configure.in:12: -1- LTVERSION_VERSION +m4trace:configure.in:12: -1- LTOBSOLETE_VERSION +m4trace:configure.in:12: -1- _LT_PROG_LTMAIN +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- _LT_PREPARE_SED_QUOTE_VARS +m4trace:configure.in:12: -1- _LT_PROG_ECHO_BACKSLASH +m4trace:configure.in:12: -1- LT_PATH_LD +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_PROG_EGREP +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- LT_PATH_NM +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- LT_CMD_MAX_LEN +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_AR$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- _LT_WITH_SYSROOT +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; + esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) +m4trace:configure.in:12: -1- m4_pattern_allow([^MANIFEST_TOOL$]) +m4trace:configure.in:12: -1- _LT_REQUIRED_DARWIN_CHECKS +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) +m4trace:configure.in:12: -1- LT_SYS_DLOPEN_SELF +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:26: -2- m4_pattern_allow([^RFID_BIG_ENDIAN_BITFIELD$]) +m4trace:configure.in:26: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.in:32: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:32: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:32: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:32: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:32: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:36: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:36: the top level]) +m4trace:configure.in:43: -1- AM_CONDITIONAL([ENABLE_SPIDEV], [test "$ENABLE_SPIDEV" == "1"]) +m4trace:configure.in:43: -1- m4_pattern_allow([^ENABLE_SPIDEV_TRUE$]) +m4trace:configure.in:43: -1- m4_pattern_allow([^ENABLE_SPIDEV_FALSE$]) +m4trace:configure.in:43: -1- _AM_SUBST_NOTMAKE([ENABLE_SPIDEV_TRUE]) +m4trace:configure.in:43: -1- _AM_SUBST_NOTMAKE([ENABLE_SPIDEV_FALSE]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:60: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:60: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:65: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:66: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:66: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:66: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:66: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:66: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:71: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:71: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:71: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:71: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:71: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:76: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "$HAVE_LIBUSB" == "1"]) +m4trace:configure.in:76: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:76: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:76: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:76: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:79: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:79: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:79: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:79: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:79: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:79: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:79: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:79: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:79: -1- _m4_warn([obsolete], [AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS], []) +m4trace:configure.in:79: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:79: -1- _LT_PROG_LTMAIN diff --git a/librfid/autom4te.cache/traces.1 b/librfid/autom4te.cache/traces.1 new file mode 100644 index 0000000..a0efec3 --- /dev/null +++ b/librfid/autom4te.cache/traces.1 @@ -0,0 +1,641 @@ +m4trace:configure.in:3: -1- AC_INIT +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- AC_SUBST([SHELL]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.in:3: -1- AC_SUBST([DEFS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- AC_SUBST([LIBS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- AC_SUBST([build_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([host_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([target_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- AC_CANONICAL_SYSTEM +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:1858: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- AC_CANONICAL_TARGET +m4trace:configure.in:4: -1- AC_CANONICAL_HOST +m4trace:configure.in:4: -1- AC_CANONICAL_BUILD +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.in:4: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([build_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([host_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- AC_SUBST([target], [$ac_cv_target]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- AC_SUBST([target_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([target_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([target_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.2.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11.1]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- AC_SUBST([PACKAGE], [librfid]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AC_SUBST([VERSION], [0.2.0]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.in:5: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AC_SUBST([install_sh]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AC_SUBST([STRIP]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- AC_SUBST([AWK]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- AC_SUBST([AMTAR]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- AC_SUBST([am__tar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- AC_SUBST([am__untar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LIBS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AC_SUBST([am__include]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- AC_SUBST([am__quote]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:8: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */ +@%:@undef NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.in:9: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:9: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +@%:@undef const]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [aclocal.m4:7980: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- AC_SUBST([AS]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([AS]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [aclocal.m4:7980: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [aclocal.m4:129: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) +m4trace:configure.in:12: -1- AC_SUBST([LIBTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIBTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([SED]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([EGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([FGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([FGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([LD]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([NM]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NM]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- AC_SUBST([LN_S], [$as_ln_s]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LN_S]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([AR]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- AC_SUBST([ac_ct_AR]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([ac_ct_AR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_AR$]) +m4trace:configure.in:12: -1- AC_SUBST([STRIP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- AC_SUBST([RANLIB]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +@%:@undef LT_OBJDIR]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- AC_SUBST([MANIFEST_TOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([MANIFEST_TOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^MANIFEST_TOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([DSYMUTIL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DSYMUTIL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- AC_SUBST([NMEDIT]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NMEDIT]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- AC_SUBST([LIPO]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIPO]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL64]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL64]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_DLFCN_H]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:12: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MEMORY_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H]) +m4trace:configure.in:12: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) +m4trace:configure.in:13: -1- AC_SUBST([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- AC_SUBST_TRACE([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- AC_SUBST([BUILDENV]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([BUILDENV]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:26: -2- AC_DEFINE_TRACE_LITERAL([RFID_BIG_ENDIAN_BITFIELD]) +m4trace:configure.in:26: -2- m4_pattern_allow([^RFID_BIG_ENDIAN_BITFIELD$]) +m4trace:configure.in:26: -2- AH_OUTPUT([RFID_BIG_ENDIAN_BITFIELD], [/* Big-endian bitfield */ +@%:@undef RFID_BIG_ENDIAN_BITFIELD]) +m4trace:configure.in:26: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.in:26: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.in:26: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.in:26: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.in:32: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:32: -1- AC_SUBST([ENABLE_CCID_TRUE]) +m4trace:configure.in:32: -1- AC_SUBST_TRACE([ENABLE_CCID_TRUE]) +m4trace:configure.in:32: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:32: -1- AC_SUBST([ENABLE_CCID_FALSE]) +m4trace:configure.in:32: -1- AC_SUBST_TRACE([ENABLE_CCID_FALSE]) +m4trace:configure.in:32: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:32: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:32: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:36: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:36: the top level]) +m4trace:configure.in:43: -1- AM_CONDITIONAL([ENABLE_SPIDEV], [test "$ENABLE_SPIDEV" == "1"]) +m4trace:configure.in:43: -1- AC_SUBST([ENABLE_SPIDEV_TRUE]) +m4trace:configure.in:43: -1- AC_SUBST_TRACE([ENABLE_SPIDEV_TRUE]) +m4trace:configure.in:43: -1- m4_pattern_allow([^ENABLE_SPIDEV_TRUE$]) +m4trace:configure.in:43: -1- AC_SUBST([ENABLE_SPIDEV_FALSE]) +m4trace:configure.in:43: -1- AC_SUBST_TRACE([ENABLE_SPIDEV_FALSE]) +m4trace:configure.in:43: -1- m4_pattern_allow([^ENABLE_SPIDEV_FALSE$]) +m4trace:configure.in:43: -1- _AM_SUBST_NOTMAKE([ENABLE_SPIDEV_TRUE]) +m4trace:configure.in:43: -1- _AM_SUBST_NOTMAKE([ENABLE_SPIDEV_FALSE]) +m4trace:configure.in:46: -1- AC_SUBST([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- AC_SUBST_TRACE([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:46: -1- AC_SUBST([OPENCT_LIBS]) +m4trace:configure.in:46: -1- AC_SUBST_TRACE([OPENCT_LIBS]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:60: -1- AC_SUBST([HAVE_OPENCT_TRUE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:60: -1- AC_SUBST([HAVE_OPENCT_FALSE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:65: -1- AC_SUBST([FIRMWARE_PATH]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([FIRMWARE_PATH]) +m4trace:configure.in:65: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:66: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:66: -1- AC_SUBST([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:66: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:66: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:66: -1- AC_SUBST([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:66: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:66: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:66: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:66: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:71: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:71: -1- AC_SUBST([ENABLE_STATIC_TRUE]) +m4trace:configure.in:71: -1- AC_SUBST_TRACE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:71: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:71: -1- AC_SUBST([ENABLE_STATIC_FALSE]) +m4trace:configure.in:71: -1- AC_SUBST_TRACE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:71: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:71: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:71: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:76: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "$HAVE_LIBUSB" == "1"]) +m4trace:configure.in:76: -1- AC_SUBST([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:76: -1- AC_SUBST_TRACE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:76: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:76: -1- AC_SUBST([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:76: -1- AC_SUBST_TRACE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:76: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:76: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:76: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:79: -1- AC_CONFIG_FILES([Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile]) +m4trace:configure.in:79: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:79: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:79: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:79: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.in:79: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:79: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:79: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.in:79: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:79: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.in:79: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:79: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:79: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:79: -1- _m4_warn([obsolete], [AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS], []) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:79: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) diff --git a/librfid/compile b/librfid/compile new file mode 100644 index 0000000..c0096a7 --- /dev/null +++ b/librfid/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid/config.guess b/librfid/config.guess new file mode 100644 index 0000000..dc84c68 --- /dev/null +++ b/librfid/config.guess @@ -0,0 +1,1501 @@ +#! /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, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# 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 (context +# diff format) to and include a 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. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +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, 2006, 2007, 2008 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 "$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 ; set_cc_for_build= ;' + +# 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 + +# 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 ;; + sh5el) machine=sh5le-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 -q __ELF__ + 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 ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-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 ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-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:*:[456]) + 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 + 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 -q __LP64__ + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *: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 ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-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*:*:* | x86_64: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 ;; + 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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.[02]*:*) + 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 i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-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; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) + 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 ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + 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 ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-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 + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + 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 ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + 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: diff --git a/librfid/config.log b/librfid/config.log new file mode 100644 index 0000000..a8f52e7 --- /dev/null +++ b/librfid/config.log @@ -0,0 +1,835 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.67. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = BlubbFish +uname -m = i686 +uname -r = 1.0.16(0.48/3/2) +uname -s = MINGW32_NT-6.1 +uname -v = 2010-09-29 00:07 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /usr/local/bin +PATH: /mingw/bin +PATH: /bin +PATH: /c/Program Files/PC Connectivity Solution/ +PATH: /c/Program Files/ATI Stream/bin/x86 +PATH: /e/Programme/MikTeX/miktex/bin +PATH: /c/Windows/system32 +PATH: /c/Windows +PATH: /c/Windows/System32/Wbem +PATH: /c/Windows/System32/WindowsPowerShell/v1.0/ +PATH: /e/Programme/SVN/bin/ +PATH: /c/Program Files/ATI Stream/Tools/Stream KernelAnalyzer 1.5/ +PATH: /c/VXIPNP/WinNT/Bin +PATH: /e/Programme/JAF +PATH: /mingw/libexec/arm/bin +PATH: /e/Programme/hacker/Nmap +PATH: /c/Program Files/OpenVPN/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2144: checking build system type +configure:2158: result: i686-pc-mingw32 +configure:2178: checking host system type +configure:2191: result: i686-pc-mingw32 +configure:2211: checking target system type +configure:2224: result: i686-pc-mingw32 +configure:2267: checking for a BSD-compatible install +configure:2335: result: /bin/install -c +configure:2346: checking whether build environment is sane +configure:2396: result: yes +configure:2537: checking for a thread-safe mkdir -p +configure:2576: result: /bin/mkdir -p +configure:2589: checking for gawk +configure:2605: found /bin/gawk +configure:2616: result: gawk +configure:2627: checking whether make sets $(MAKE) +configure:2649: result: yes +configure:2778: checking for gcc +configure:2794: found /mingw/bin/gcc +configure:2805: result: gcc +configure:3034: checking for C compiler version +configure:3043: gcc --version >&5 +gcc.exe (GCC) 4.5.2 +Copyright (C) 2010 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. + +configure:3054: $? = 0 +configure:3043: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=E:\Programme\mingw\bin\gcc.exe +COLLECT_LTO_WRAPPER=e:/programme/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe +Target: mingw32 +Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw +Thread model: win32 +gcc version 4.5.2 (GCC) +configure:3054: $? = 0 +configure:3043: gcc -V >&5 +gcc.exe: '-V' option must have argument +configure:3054: $? = 1 +configure:3043: gcc -qversion >&5 +gcc.exe: unrecognized option '-qversion' +gcc.exe: no input files +configure:3054: $? = 1 +configure:3074: checking whether the C compiler works +configure:3096: gcc conftest.c >&5 +configure:3100: $? = 0 +configure:3148: result: yes +configure:3151: checking for C compiler default output file name +configure:3153: result: a.exe +configure:3159: checking for suffix of executables +configure:3166: gcc -o conftest.exe conftest.c >&5 +configure:3170: $? = 0 +configure:3192: result: .exe +configure:3214: checking whether we are cross compiling +configure:3222: gcc -o conftest.exe conftest.c >&5 +configure:3226: $? = 0 +configure:3233: ./conftest.exe +configure:3237: $? = 0 +configure:3252: result: no +configure:3257: checking for suffix of object files +configure:3279: gcc -c conftest.c >&5 +configure:3283: $? = 0 +configure:3304: result: o +configure:3308: checking whether we are using the GNU C compiler +configure:3327: gcc -c conftest.c >&5 +configure:3327: $? = 0 +configure:3336: result: yes +configure:3345: checking whether gcc accepts -g +configure:3365: gcc -c -g conftest.c >&5 +configure:3365: $? = 0 +configure:3406: result: yes +configure:3423: checking for gcc option to accept ISO C89 +configure:3487: gcc -c -g -O2 conftest.c >&5 +configure:3487: $? = 0 +configure:3500: result: none needed +configure:3531: checking for style of include used by make +configure:3559: result: GNU +configure:3584: checking dependency style of gcc +configure:3694: result: gcc3 +configure:3710: checking whether gcc and cc understand -c and -o together +configure:3741: gcc -c conftest.c -o conftest2.o >&5 +configure:3745: $? = 0 +configure:3751: gcc -c conftest.c -o conftest2.o >&5 +configure:3755: $? = 0 +configure:3766: cc -c conftest.c >&5 +./configure: line 3768: cc: command not found +configure:3770: $? = 127 +configure:3810: result: yes +configure:3836: checking for an ANSI C-conforming const +configure:3901: gcc -c -g -O2 conftest.c >&5 +configure:3901: $? = 0 +configure:3908: result: yes +configure:3964: checking for as +configure:3980: found /mingw/bin/as +configure:3991: result: as +configure:4056: checking for dlltool +configure:4072: found /mingw/bin/dlltool +configure:4083: result: dlltool +configure:4148: checking for objdump +configure:4164: found /mingw/bin/objdump +configure:4175: result: objdump +configure:4222: WARNING: Libtool does not cope well with whitespace in `pwd` +configure:4266: checking how to print strings +configure:4293: result: printf +configure:4314: checking for a sed that does not truncate output +configure:4378: result: /bin/sed +configure:4396: checking for grep that handles long lines and -e +configure:4454: result: /bin/grep +configure:4459: checking for egrep +configure:4521: result: /bin/grep -E +configure:4526: checking for fgrep +configure:4588: result: /bin/grep -F +configure:4623: checking for ld used by gcc +configure:4690: result: e:/programme/mingw/mingw32/bin/ld.exe +configure:4697: checking if the linker (e:/programme/mingw/mingw32/bin/ld.exe) is GNU ld +configure:4712: result: yes +configure:4724: checking for BSD- or MS-compatible name lister (nm) +configure:4773: result: /mingw/bin/nm +configure:4903: checking the name lister (/mingw/bin/nm) interface +configure:4910: gcc -c -g -O2 conftest.c >&5 +configure:4913: /mingw/bin/nm "conftest.o" +configure:4916: output +00000000 b .bss +00000000 d .data +00000000 N .debug_abbrev +00000000 N .debug_info +00000000 N .debug_line +00000000 N .debug_pubnames +00000000 t .text +00000000 B _some_variable +configure:4923: result: BSD nm +configure:4926: checking whether ln -s works +configure:4933: result: no, using cp -p +configure:4938: checking the maximum length of command line arguments +configure:5063: result: 8192 +configure:5080: checking whether the shell understands some XSI constructs +configure:5090: result: yes +configure:5094: checking whether the shell understands "+=" +configure:5100: result: yes +configure:5135: checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format +configure:5175: result: func_convert_file_msys_to_w32 +configure:5182: checking how to convert i686-pc-mingw32 file names to toolchain format +configure:5202: result: func_convert_file_msys_to_w32 +configure:5209: checking for e:/programme/mingw/mingw32/bin/ld.exe option to reload object files +configure:5216: result: -r +configure:5290: checking for objdump +configure:5317: result: objdump +configure:5346: checking how to recognize dependent libraries +configure:5548: result: file_magic ^x86 archive import|^x86 DLL +configure:5633: checking for dlltool +configure:5660: result: dlltool +configure:5690: checking how to associate runtime and link libraries +configure:5717: result: func_cygming_dll_for_implib +configure:5777: checking for ar +configure:5793: found /mingw/bin/ar +configure:5804: result: ar +configure:5841: checking for archiver @FILE support +configure:5858: gcc -c -g -O2 conftest.c >&5 +configure:5858: $? = 0 +configure:5861: ar cru libconftest.a @conftest.lst >&5 +configure:5864: $? = 0 +configure:5869: ar cru libconftest.a @conftest.lst >&5 +E:\Programme\mingw\bin\ar.exe: conftest.o: No such file or directory +configure:5872: $? = 1 +configure:5884: result: @ +configure:5942: checking for strip +configure:5958: found /mingw/bin/strip +configure:5969: result: strip +configure:6041: checking for ranlib +configure:6057: found /mingw/bin/ranlib +configure:6068: result: ranlib +configure:6170: checking command to parse /mingw/bin/nm output from gcc object +configure:6289: gcc -c -g -O2 conftest.c >&5 +configure:6292: $? = 0 +configure:6296: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm +configure:6299: $? = 0 +cannot find nm_test_var in conftest.nm +configure:6289: gcc -c -g -O2 conftest.c >&5 +configure:6292: $? = 0 +configure:6296: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm +configure:6299: $? = 0 +configure:6365: gcc -o conftest.exe -g -O2 conftest.c conftstm.o >&5 +configure:6368: $? = 0 +configure:6406: result: ok +configure:6443: checking for sysroot +configure:6473: result: no +configure:6716: checking for mt +configure:6746: result: no +configure:6766: checking if : is a manifest tool +configure:6772: : '-?' +configure:6780: result: no +configure:7412: checking how to run the C preprocessor +configure:7443: gcc -E conftest.c +configure:7443: $? = 0 +configure:7457: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:7457: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| /* end confdefs.h. */ +| #include +configure:7482: result: gcc -E +configure:7502: gcc -E conftest.c +configure:7502: $? = 0 +configure:7516: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:7516: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| /* end confdefs.h. */ +| #include +configure:7545: checking for ANSI C header files +configure:7565: gcc -c -g -O2 conftest.c >&5 +configure:7565: $? = 0 +configure:7638: gcc -o conftest.exe -g -O2 conftest.c >&5 +configure:7638: $? = 0 +configure:7638: ./conftest.exe +configure:7638: $? = 0 +configure:7649: result: yes +configure:7662: checking for sys/types.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for sys/stat.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for stdlib.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for string.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for memory.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for strings.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for inttypes.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for stdint.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7662: checking for unistd.h +configure:7662: gcc -c -g -O2 conftest.c >&5 +configure:7662: $? = 0 +configure:7662: result: yes +configure:7676: checking for dlfcn.h +configure:7676: gcc -c -g -O2 conftest.c >&5 +conftest.c:55:19: fatal error: dlfcn.h: No such file or directory +compilation terminated. +configure:7676: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| +| #include +configure:7676: result: no +configure:7861: checking for objdir +configure:7876: result: .libs +configure:8143: checking if gcc supports -fno-rtti -fno-exceptions +configure:8161: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 +cc1.exe: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C +configure:8165: $? = 0 +configure:8178: result: no +configure:8488: checking for gcc option to produce PIC +configure:8495: result: -DDLL_EXPORT -DPIC +configure:8503: checking if gcc PIC flag -DDLL_EXPORT -DPIC works +configure:8521: gcc -c -g -O2 -DDLL_EXPORT -DPIC -DPIC conftest.c >&5 +configure:8525: $? = 0 +configure:8538: result: yes +configure:8567: checking if gcc static flag -static works +configure:8595: result: yes +configure:8610: checking if gcc supports -c -o file.o +configure:8631: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 +configure:8635: $? = 0 +configure:8657: result: yes +configure:8665: checking if gcc supports -c -o file.o +configure:8712: result: yes +configure:8745: checking whether the gcc linker (e:/programme/mingw/mingw32/bin/ld.exe) supports shared libraries +configure:9903: result: yes +configure:9940: checking whether -lc should be explicitly linked in +configure:9948: gcc -c -g -O2 conftest.c >&5 +configure:9951: $? = 0 +configure:9966: gcc -shared conftest.o -v -o ./conftest -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 +configure:9969: $? = 1 +configure:9983: result: yes +configure:10148: checking dynamic linker characteristics +configure:10884: result: Win32 ld.exe +configure:10991: checking how to hardcode library paths into programs +configure:11016: result: immediate +configure:11556: checking whether stripping libraries is possible +configure:11561: result: yes +configure:11596: checking if libtool supports shared libraries +configure:11598: result: yes +configure:11601: checking whether to build shared libraries +configure:11622: result: yes +configure:11625: checking whether to build static libraries +configure:11629: result: yes +configure:11666: checking for build environment +configure:11673: result: UNIX +configure:11693: checking whether byte ordering is bigendian +configure:11708: gcc -c -g -O2 conftest.c >&5 +conftest.c:23:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' +configure:11708: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define LT_OBJDIR ".libs/" +| /* end confdefs.h. */ +| #ifndef __APPLE_CC__ +| not a universal capable compiler +| #endif +| typedef int dummy; +| +configure:11753: gcc -c -g -O2 conftest.c >&5 +configure:11753: $? = 0 +configure:11771: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:29:4: error: 'not' undeclared (first use in this function) +conftest.c:29:4: note: each undeclared identifier is reported only once for each function it appears in +conftest.c:29:8: error: expected ';' before 'big' +configure:11771: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define LT_OBJDIR ".libs/" +| /* end confdefs.h. */ +| #include +| #include +| +| int +| main () +| { +| #if BYTE_ORDER != BIG_ENDIAN +| not big endian +| #endif +| +| ; +| return 0; +| } +configure:11899: result: no +configure:12015: checking for usb_close in -lusb +configure:12040: gcc -o conftest.exe -g -O2 conftest.c -lusb >&5 +e:/programme/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lusb +collect2: ld returned 1 exit status +configure:12040: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define PACKAGE "librfid" +| #define VERSION "0.2.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define LT_OBJDIR ".libs/" +| /* end confdefs.h. */ +| +| /* Override any GCC internal prototype to avoid an error. +| Use char because int might match the return type of a GCC +| builtin and then its argument prototype would still apply. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| char usb_close (); +| int +| main () +| { +| return usb_close (); +| ; +| return 0; +| } +configure:12049: result: no +configure:12256: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on BlubbFish + +config.status:1054: creating Makefile +config.status:1054: creating etc/Makefile +config.status:1054: creating etc/udev/Makefile +config.status:1054: creating src/Makefile +config.status:1054: creating include/Makefile +config.status:1054: creating include/librfid/Makefile +config.status:1054: creating utils/Makefile +config.status:1054: creating src/librfid.pc +config.status:1054: creating win32/Makefile +config.status:1225: executing depfiles commands +config.status:1225: executing libtool commands + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=i686-pc-mingw32 +ac_cv_c_bigendian=no +ac_cv_c_compiler_gnu=yes +ac_cv_c_const=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext=.exe +ac_cv_header_dlfcn_h=no +ac_cv_header_inttypes_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=i686-pc-mingw32 +ac_cv_lib_usb_usb_close=no +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_FGREP='/bin/grep -F' +ac_cv_path_GREP=/bin/grep +ac_cv_path_SED=/bin/sed +ac_cv_path_install='/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=gawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_AS=as +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_DLLTOOL=dlltool +ac_cv_prog_ac_ct_OBJDUMP=objdump +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_gcc_c_o=yes +ac_cv_prog_make_make_set=yes +ac_cv_target=i686-pc-mingw32 +am_cv_CC_dependencies_compiler_type=gcc3 +lt_cv_ar_at_file=@ +lt_cv_archive_cmds_need_lc=yes +lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +lt_cv_file_magic_cmd=func_win32_libid +lt_cv_file_magic_test_file= +lt_cv_ld_reload_flag=-r +lt_cv_nm_interface='BSD nm' +lt_cv_objdir=.libs +lt_cv_path_LD=e:/programme/mingw/mingw32/bin/ld.exe +lt_cv_path_NM=/mingw/bin/nm +lt_cv_path_mainfest_tool=no +lt_cv_prog_compiler_c_o=yes +lt_cv_prog_compiler_pic='-DDLL_EXPORT -DPIC' +lt_cv_prog_compiler_pic_works=yes +lt_cv_prog_compiler_rtti_exceptions=no +lt_cv_prog_compiler_static_works=yes +lt_cv_prog_gnu_ld=yes +lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\) \{0,1\}$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_max_cmd_len=8192 +lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 +lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar' +AR='ar' +AS='as' +AUTOCONF='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf' +AUTOHEADER='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader' +AUTOMAKE='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11' +AWK='gawk' +BUILDENV='UNIX' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFLAGS='-g -O2' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH_W='echo' +DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\"' +DEPDIR='.deps' +DISABLE_WIN32_FALSE='#' +DISABLE_WIN32_TRUE='' +DLLTOOL='dlltool' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +ENABLE_CCID_FALSE='' +ENABLE_CCID_TRUE='#' +ENABLE_FIRMWARE_FALSE='' +ENABLE_FIRMWARE_TRUE='#' +ENABLE_SPIDEV_FALSE='' +ENABLE_SPIDEV_TRUE='#' +ENABLE_STATIC_FALSE='#' +ENABLE_STATIC_TRUE='' +ENABLE_WIN32_FALSE='' +ENABLE_WIN32_TRUE='#' +EXEEXT='.exe' +FGREP='/bin/grep -F' +FIRMWARE_PATH='' +GREP='/bin/grep' +HAVE_LIBUSB_FALSE='' +HAVE_LIBUSB_TRUE='#' +HAVE_OPENCT_FALSE='' +HAVE_OPENCT_TRUE='#' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LD='e:/programme/mingw/mingw32/bin/ld.exe' +LDFLAGS='' +LIBOBJS='' +LIBS='' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIBTOOL_DEPS='./ltmain.sh' +LIPO='' +LN_S='cp -p' +LTLIBOBJS='' +MAKEINFO='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo' +MANIFEST_TOOL=':' +MKDIR_P='/bin/mkdir -p' +NM='/mingw/bin/nm' +NMEDIT='' +OBJDUMP='objdump' +OBJEXT='o' +OPENCT_CFLAGS='' +OPENCT_LIBS='' +OTOOL64='' +OTOOL='' +PACKAGE='librfid' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_URL='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +RANLIB='ranlib' +SED='/bin/sed' +SET_MAKE='' +SHELL='/bin/sh' +STRIP='strip' +VERSION='0.2.0' +ac_ct_AR='ar' +ac_ct_CC='gcc' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='#' +am__EXEEXT_TRUE='' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__quote='' +am__tar='${AMTAR} chof - "$$tardir"' +am__untar='${AMTAR} xf -' +bindir='${exec_prefix}/bin' +build='i686-pc-mingw32' +build_alias='' +build_cpu='i686' +build_os='mingw32' +build_vendor='pc' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='i686-pc-mingw32' +host_alias='' +host_cpu='i686' +host_os='mingw32' +host_vendor='pc' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} '\''/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh'\''' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='i686-pc-mingw32' +target_alias='' +target_cpu='i686' +target_os='mingw32' +target_vendor='pc' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_URL "" +#define PACKAGE "librfid" +#define VERSION "0.2.0" +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define LT_OBJDIR ".libs/" + +configure: exit 0 diff --git a/librfid/config.status b/librfid/config.status new file mode 100644 index 0000000..4695d95 --- /dev/null +++ b/librfid/config.status @@ -0,0 +1,1966 @@ +#! /bin/sh +# Generated by configure. +# 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-/bin/sh} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile" +config_commands=" depfiles libtool" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.67, + with options \"$ac_cs_config\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/D/Visual Studio 2010/Projects/Matomat/librfid' +srcdir='.' +INSTALL='/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='gawk' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 + +if $ac_cs_recheck; then + set X '/bin/sh' './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 + CONFIG_SHELL='/bin/sh' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" ac_aux_dir="." + + +# 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 + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +double_quote_subst='s/\(["`\\]\)/\\\1/g' +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +AS='as' +DLLTOOL='dlltool' +OBJDUMP='objdump' +macro_version='2.4' +macro_revision='1.3294' +enable_shared='yes' +enable_static='yes' +pic_mode='default' +enable_fast_install='needless' +SHELL='/bin/sh' +ECHO='printf %s\n' +host_alias='' +host='i686-pc-mingw32' +host_os='mingw32' +build_alias='' +build='i686-pc-mingw32' +build_os='mingw32' +SED='/bin/sed' +Xsed='/bin/sed -e 1s/^X//' +GREP='/bin/grep' +EGREP='/bin/grep -E' +FGREP='/bin/grep -F' +LD='e:/programme/mingw/mingw32/bin/ld.exe' +NM='/mingw/bin/nm' +LN_S='cp -p' +max_cmd_len='8192' +ac_objext='o' +exeext='' +lt_unset='unset' +lt_SP2NL='tr \040 \012' +lt_NL2SP='tr \015\012 \040\040' +lt_cv_to_host_file_cmd='func_convert_file_msys_to_w32' +lt_cv_to_tool_file_cmd='func_convert_file_msys_to_w32' +reload_flag=' -r' +reload_cmds='$LD$reload_flag -o $output$reload_objs' +deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +file_magic_cmd='func_win32_libid' +file_magic_glob='' +want_nocaseglob='yes' +sharedlib_from_linklib_cmd='func_cygming_dll_for_implib' +AR='ar' +AR_FLAGS='cru' +archiver_list_spec='@' +STRIP='strip' +RANLIB='ranlib' +old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $oldlib' +old_postuninstall_cmds='' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib' +lock_old_archive_extraction='no' +CC='gcc' +CFLAGS='-g -O2' +compiler='gcc' +GCC='yes' +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\) \{0,1\}$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +nm_file_list_spec='@' +lt_sysroot='' +objdir='.libs' +MAGIC_CMD='file' +lt_prog_compiler_no_builtin_flag=' -fno-builtin' +lt_prog_compiler_pic=' -DDLL_EXPORT -DPIC' +lt_prog_compiler_wl='-Wl,' +lt_prog_compiler_static='-static' +lt_cv_prog_compiler_c_o='yes' +need_locks='no' +MANIFEST_TOOL=':' +DSYMUTIL='' +NMEDIT='' +LIPO='' +OTOOL='' +OTOOL64='' +libext='a' +shrext_cmds='.dll' +extract_expsyms_cmds='' +archive_cmds_need_lc='yes' +enable_shared_with_static_runtimes='yes' +export_dynamic_flag_spec='${wl}--export-all-symbols' +whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +compiler_needs_object='no' +old_archive_from_new_cmds='' +old_archive_from_expsyms_cmds='' +archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +module_cmds='' +module_expsym_cmds='' +with_gnu_ld='yes' +allow_undefined_flag='unsupported' +no_undefined_flag='' +hardcode_libdir_flag_spec='-L$libdir' +hardcode_libdir_flag_spec_ld='' +hardcode_libdir_separator='' +hardcode_direct='no' +hardcode_direct_absolute='no' +hardcode_minus_L='no' +hardcode_shlibpath_var='unsupported' +hardcode_automatic='no' +inherit_rpath='no' +link_all_deplibs='unknown' +always_export_symbols='no' +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' +include_expsyms='' +prelink_cmds='' +postlink_cmds='' +file_list_spec='' +variables_saved_for_relink='PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' +need_lib_prefix='no' +need_version='no' +version_type='windows' +runpath_var='LD_RUN_PATH' +shlibpath_var='PATH' +shlibpath_overrides_runpath='yes' +libname_spec='lib$name' +library_names_spec='$libname.dll.a' +soname_spec='${libname}`echo ${release} | $SED -e s/[.]/-/g`${versuffix}${shared_ext}' +install_override_mode='' +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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' +postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' +finish_cmds='' +finish_eval='' +hardcode_into_libs='no' +sys_lib_search_path_spec='e:/programme/mingw/lib/gcc/mingw32/4.5.2 e:/programme/mingw/lib/gcc e:/programme/mingw/mingw32/lib e:/programme/mingw/lib /mingw/lib ' +sys_lib_dlsearch_path_spec='/lib /usr/lib' +hardcode_action='immediate' +enable_dlopen='unknown' +enable_dlopen_self='unknown' +enable_dlopen_self_static='unknown' +old_striplib='strip --strip-debug' +striplib='strip --strip-unneeded' + +LTCC='gcc' +LTCFLAGS='-g -O2' +compiler='gcc' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS DLLTOOL OBJDUMP SHELL ECHO SED GREP EGREP FGREP LD NM LN_S lt_SP2NL lt_NL2SP reload_flag deplibs_check_method file_magic_cmd file_magic_glob want_nocaseglob sharedlib_from_linklib_cmd AR AR_FLAGS archiver_list_spec STRIP RANLIB CC CFLAGS compiler lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl lt_cv_sys_global_symbol_to_c_name_address lt_cv_sys_global_symbol_to_c_name_address_lib_prefix nm_file_list_spec lt_prog_compiler_no_builtin_flag lt_prog_compiler_pic lt_prog_compiler_wl lt_prog_compiler_static lt_cv_prog_compiler_c_o need_locks MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 shrext_cmds export_dynamic_flag_spec whole_archive_flag_spec compiler_needs_object with_gnu_ld allow_undefined_flag no_undefined_flag hardcode_libdir_flag_spec hardcode_libdir_flag_spec_ld hardcode_libdir_separator exclude_expsyms include_expsyms file_list_spec variables_saved_for_relink libname_spec library_names_spec soname_spec install_override_mode finish_eval old_striplib striplib; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postlink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +ac_aux_dir='.' +xsi_shell='yes' +lt_shell_append='yes' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='librfid' + VERSION='0.2.0' + TIMESTAMP='' + RM='rm -f' + ofile='libtool' + + + + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +cat >>"$tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="#" +S["am__EXEEXT_TRUE"]="" +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["HAVE_LIBUSB_FALSE"]="" +S["HAVE_LIBUSB_TRUE"]="#" +S["ENABLE_STATIC_FALSE"]="#" +S["ENABLE_STATIC_TRUE"]="" +S["ENABLE_FIRMWARE_FALSE"]="" +S["ENABLE_FIRMWARE_TRUE"]="#" +S["FIRMWARE_PATH"]="" +S["HAVE_OPENCT_FALSE"]="" +S["HAVE_OPENCT_TRUE"]="#" +S["OPENCT_LIBS"]="" +S["OPENCT_CFLAGS"]="" +S["ENABLE_SPIDEV_FALSE"]="" +S["ENABLE_SPIDEV_TRUE"]="#" +S["ENABLE_CCID_FALSE"]="" +S["ENABLE_CCID_TRUE"]="#" +S["DISABLE_WIN32_FALSE"]="#" +S["DISABLE_WIN32_TRUE"]="" +S["ENABLE_WIN32_FALSE"]="" +S["ENABLE_WIN32_TRUE"]="#" +S["BUILDENV"]="UNIX" +S["LIBTOOL_DEPS"]="./ltmain.sh" +S["CPP"]="gcc -E" +S["OTOOL64"]="" +S["OTOOL"]="" +S["LIPO"]="" +S["NMEDIT"]="" +S["DSYMUTIL"]="" +S["MANIFEST_TOOL"]=":" +S["RANLIB"]="ranlib" +S["ac_ct_AR"]="ar" +S["AR"]="ar" +S["LN_S"]="cp -p" +S["NM"]="/mingw/bin/nm" +S["ac_ct_DUMPBIN"]="" +S["DUMPBIN"]="" +S["LD"]="e:/programme/mingw/mingw32/bin/ld.exe" +S["FGREP"]="/bin/grep -F" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["SED"]="/bin/sed" +S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" +S["OBJDUMP"]="objdump" +S["DLLTOOL"]="dlltool" +S["AS"]="as" +S["am__fastdepCC_FALSE"]="#" +S["am__fastdepCC_TRUE"]="" +S["CCDEPMODE"]="depmode=gcc3" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]=".exe" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CFLAGS"]="-g -O2" +S["CC"]="gcc" +S["am__untar"]="${AMTAR} xf -" +S["am__tar"]="${AMTAR} chof - \"$$tardir\"" +S["AMTAR"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run tar" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="gawk" +S["mkdir_p"]="/bin/mkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="strip" +S["install_sh"]="${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh'" +S["MAKEINFO"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run makeinfo" +S["AUTOHEADER"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run autoheader" +S["AUTOMAKE"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run automake-1.11" +S["AUTOCONF"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run autoconf" +S["ACLOCAL"]="${SHELL} \"/D/Visual Studio 2010/Projects/Matomat/librfid/missing\" --run aclocal-1.11" +S["VERSION"]="0.2.0" +S["PACKAGE"]="librfid" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_os"]="mingw32" +S["target_vendor"]="pc" +S["target_cpu"]="i686" +S["target"]="i686-pc-mingw32" +S["host_os"]="mingw32" +S["host_vendor"]="pc" +S["host_cpu"]="i686" +S["host"]="i686-pc-mingw32" +S["build_os"]="mingw32" +S["build_vendor"]="pc" +S["build_cpu"]="i686" +S["build"]="i686-pc-mingw32" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE_URL=\\\"\\\" -DPACKAGE=\\\"libr"\ +"fid\\\" -DVERSION=\\\"0.2.0\\\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STR"\ +"INGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\\\".libs/\\\"" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/sh" +_ACAWK +cat >>"$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 diff --git a/librfid/config.sub b/librfid/config.sub new file mode 100644 index 0000000..2a55a50 --- /dev/null +++ b/librfid/config.sub @@ -0,0 +1,1705 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# 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 GNU 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. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# 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, 2006, 2007, 2008 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-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-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 | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -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 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -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/'` + ;; + -sco5v6*) + # 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 | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # 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-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # 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 + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + 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 + ;; + cr16) + basic_machine=cr16-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 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + 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 + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + 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 + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + 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 + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + 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 + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + 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 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + 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 + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + 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 + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + 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 + ;; + z80-*-coff) + basic_machine=z80-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 + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + 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. + -auroraux) + os=-auroraux + ;; + -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* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -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* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # 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* | -haiku* \ + | -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 + ;; + -dicos*) + os=-dicos + ;; + -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 + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-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 + ;; + mep-*) + os=-elf + ;; + 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 + ;; + *-haiku) + os=-haiku + ;; + *-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 + ;; + -cnk*|-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: diff --git a/librfid/configure b/librfid/configure new file mode 100644 index 0000000..46844f5 --- /dev/null +++ b/librfid/configure @@ -0,0 +1,14316 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.67. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_SPIDEV_FALSE +ENABLE_SPIDEV_TRUE +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_ccid +enable_openct +enable_spidev +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + [[default=no]] + --enable-spidev Enable spidev reader + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func +cat >config.log <<_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.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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=librfid + VERSION=0.2.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4' +macro_revision='1.3294' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if test "${lt_cv_to_host_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if test "${lt_cv_to_tool_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if test "${lt_cv_ar_at_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test "${lt_cv_path_mainfest_tool+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + + + 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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if test "${lt_cv_prog_compiler_pic+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + 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' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test "${lt_cv_irix_exported_symbol+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +$as_echo "#define RFID_BIG_ENDIAN_BITFIELD 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then : + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +# Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then : + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +# Check whether --enable-spidev was given. +if test "${enable_spidev+set}" = set; then : + enableval=$enable_spidev; ENABLE_SPIDEV=1 +else + ENABLE_SPIDEV=0 +fi + + if test "$ENABLE_SPIDEV" == "1"; then + ENABLE_SPIDEV_TRUE= + ENABLE_SPIDEV_FALSE='#' +else + ENABLE_SPIDEV_TRUE='#' + ENABLE_SPIDEV_FALSE= +fi + + +OPENCT_MSG=no + + + + + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +# Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then : + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +# Check whether --with- was given. +if test "${with_+set}" = set; then : + withval=$with_; +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_close=yes +else + ac_cv_lib_usb_usb_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then : + HAVE_LIBUSB=1 +else + HAVE_LIBUSB=0 +fi + + if test "$HAVE_LIBUSB" == "1"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_SPIDEV_TRUE}" && test -z "${ENABLE_SPIDEV_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SPIDEV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid/configure.in b/librfid/configure.in new file mode 100644 index 0000000..36702ac --- /dev/null +++ b/librfid/configure.in @@ -0,0 +1,79 @@ +dnl Process this file with autoconf to create configure. + +AC_INIT +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE(librfid, 0.2.0) + +AC_PROG_CC +AM_PROG_CC_C_O +AC_C_CONST +AC_EXEEXT +AC_LIBTOOL_WIN32_DLL +AM_PROG_LIBTOOL +AC_SUBST(LIBTOOL_DEPS) + +AC_MSG_CHECKING([for build environment]) +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +AC_MSG_RESULT($BUILDENV) +AC_SUBST(BUILDENV) +AM_CONDITIONAL(ENABLE_WIN32, test "$BUILDENV" == "WIN32") +AM_CONDITIONAL(DISABLE_WIN32, test "$BUILDENV" != "WIN32") + +AC_C_BIGENDIAN(AC_DEFINE(RFID_BIG_ENDIAN_BITFIELD, 1, [Big-endian bitfield]),,) + +AC_ARG_ENABLE(ccid, + [ --enable-ccid Include internal CCID driver for CM5121], + [MY_CCID=1], [MY_CCID=0]) +# AC_SUBST(MY_CCID) +AM_CONDITIONAL(ENABLE_CCID, test "$MY_CCID" == "1") + +dnl Enable/disable openct +AC_ARG_ENABLE(openct, + AC_HELP_STRING([--enable-openct], [Use (patched) OpenCT for CM5121 CCID access. [[default=no]]]), + [ENABLE_OPENCT="${enableval}"], + [ENABLE_OPENCT="no"]) + +AC_ARG_ENABLE(spidev, + [ --enable-spidev Enable spidev reader], + [ENABLE_SPIDEV=1], [ENABLE_SPIDEV=0]) +AM_CONDITIONAL(ENABLE_SPIDEV, test "$ENABLE_SPIDEV" == "1") + +OPENCT_MSG=no +AC_PROVIDE_IFELSE([PKG_CHECK_MODULES)], [ + if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, [libopenct], [ + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + ], [ + OPENCT_MSG=no + ]) + AC_SUBST(OPENCT_CFLAGS) + AC_SUBST(OPENCT_LIBS) + fi ], [ + AC_SUBST(OPENCT_CFLAGS) + AC_SUBST(OPENCT_LIBS) + ]) +AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes") + +AC_ARG_WITH(firmware, + [ --with-firmware=PATH Compile for running inside firmware], + [FIRMWARE_PATH="$withval"], [FIRMWARE_PATH=""]) +AC_SUBST(FIRMWARE_PATH) +AM_CONDITIONAL(ENABLE_FIRMWARE, test "$FIRMWARE_PATH" != "") + +AC_ARG_ENABLE(static, + [ --enable-static Don't use dynamic allocations at all], + [ENABLE_STATIC=1], [ENABLE_STATIC=0]) +AM_CONDITIONAL(ENABLE_STATIC, test "$ENABLE_STATIC" == "1") + +AC_ARG_WITH() + +AC_CHECK_LIB(usb, usb_close, [HAVE_LIBUSB=1], [HAVE_LIBUSB=0]) +AM_CONDITIONAL(HAVE_LIBUSB, test "$HAVE_LIBUSB" == "1") + +dnl Output the makefile +AC_OUTPUT(Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile) diff --git a/librfid/depcomp b/librfid/depcomp new file mode 100644 index 0000000..df8eea7 --- /dev/null +++ b/librfid/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . + +# 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 + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +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. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + 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. + 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 + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + 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 + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +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 mechanism 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 $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + 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. + -arch) + eat=yes ;; + -*|$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 "X$1" != 'X--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. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # 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 + ;; + +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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid/etc/Makefile b/librfid/etc/Makefile new file mode 100644 index 0000000..d5b9f14 --- /dev/null +++ b/librfid/etc/Makefile @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# etc/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +subdir = etc +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/etc +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/etc +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +SUBDIRS = udev +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid/etc/Makefile.am b/librfid/etc/Makefile.am new file mode 100644 index 0000000..92618ac --- /dev/null +++ b/librfid/etc/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.flags.am + +SUBDIRS = udev diff --git a/librfid/etc/Makefile.in b/librfid/etc/Makefile.in new file mode 100644 index 0000000..259f00b --- /dev/null +++ b/librfid/etc/Makefile.in @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +subdir = etc +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +SUBDIRS = udev +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid/etc/udev/Makefile b/librfid/etc/udev/Makefile new file mode 100644 index 0000000..5d013ed --- /dev/null +++ b/librfid/etc/udev/Makefile @@ -0,0 +1,369 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# etc/udev/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +subdir = etc/udev +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/etc/udev +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/etc/udev +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +EXTRA_DIST = librfid.rules +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/udev/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/udev/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: diff --git a/librfid/etc/udev/Makefile.am b/librfid/etc/udev/Makefile.am new file mode 100644 index 0000000..e266e50 --- /dev/null +++ b/librfid/etc/udev/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.flags.am + +EXTRA_DIST = librfid.rules diff --git a/librfid/etc/udev/Makefile.in b/librfid/etc/udev/Makefile.in new file mode 100644 index 0000000..52e448f --- /dev/null +++ b/librfid/etc/udev/Makefile.in @@ -0,0 +1,369 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +subdir = etc/udev +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +EXTRA_DIST = librfid.rules +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/udev/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/udev/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: diff --git a/librfid/etc/udev/librfid.rules b/librfid/etc/udev/librfid.rules new file mode 100644 index 0000000..52942c4 --- /dev/null +++ b/librfid/etc/udev/librfid.rules @@ -0,0 +1,16 @@ +# This file is part of the librfid distribution +# +# udev rules file for supported readers +# +# + +ACTION!="add", GOTO="librfid_rules_end" +SUBSYSTEM!="usb_device", GOTO="librfid_rules_end" + +# Omnikey 5121 +SYSFS{idVendor}=="076b", SYSFS{idProduct}=="5121", MODE="664", GROUP="users" + +# OpenPCD +SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="076b", MODE="664", GROUP="users" + +LABEL="librfid_rules_end" diff --git a/librfid/include/Makefile b/librfid/include/Makefile new file mode 100644 index 0000000..05486ea --- /dev/null +++ b/librfid/include/Makefile @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# include/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +subdir = include +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/include +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/include +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +SUBDIRS = librfid +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid/include/Makefile.am b/librfid/include/Makefile.am new file mode 100644 index 0000000..d78be8d --- /dev/null +++ b/librfid/include/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.flags.am + +SUBDIRS = librfid diff --git a/librfid/include/Makefile.in b/librfid/include/Makefile.in new file mode 100644 index 0000000..06f2f78 --- /dev/null +++ b/librfid/include/Makefile.in @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +subdir = include +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +SUBDIRS = librfid +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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): + @fail= 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid/include/librfid/Makefile b/librfid/include/librfid/Makefile new file mode 100644 index 0000000..d49915f --- /dev/null +++ b/librfid/include/librfid/Makefile @@ -0,0 +1,481 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# include/librfid/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +subdir = include/librfid +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/include/librfid +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/include/librfid +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \ + rfid_layer2.h rfid_layer2_iso14443a.h \ + rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \ + rfid_layer2_icode1.h \ + rfid_protocol.h rfid_protocol_tcl.h \ + rfid_protocol_mifare_ul.h \ + rfid_protocol_mifare_classic.h \ + rfid_protocol_tagit.h \ + rfid_protocol_icode.h \ + rfid_reader.h \ + rfid_system.h \ + rfid_access_mifare_classic.h \ + rfid_reader_cm5121.h \ + rfid_reader_spidev.h \ + rfid_reader_openpcd.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/librfid/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/librfid/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + + +# 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: diff --git a/librfid/include/librfid/Makefile.am b/librfid/include/librfid/Makefile.am new file mode 100644 index 0000000..a5deb20 --- /dev/null +++ b/librfid/include/librfid/Makefile.am @@ -0,0 +1,18 @@ +include $(top_srcdir)/Makefile.flags.am + +pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \ + rfid_layer2.h rfid_layer2_iso14443a.h \ + rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \ + rfid_layer2_icode1.h \ + rfid_protocol.h rfid_protocol_tcl.h \ + rfid_protocol_mifare_ul.h \ + rfid_protocol_mifare_classic.h \ + rfid_protocol_tagit.h \ + rfid_protocol_icode.h \ + rfid_reader.h \ + rfid_system.h \ + rfid_access_mifare_classic.h \ + rfid_reader_cm5121.h \ + rfid_reader_spidev.h \ + rfid_reader_openpcd.h + diff --git a/librfid/include/librfid/Makefile.in b/librfid/include/librfid/Makefile.in new file mode 100644 index 0000000..3d593cb --- /dev/null +++ b/librfid/include/librfid/Makefile.in @@ -0,0 +1,481 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +subdir = include/librfid +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \ + rfid_layer2.h rfid_layer2_iso14443a.h \ + rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \ + rfid_layer2_icode1.h \ + rfid_protocol.h rfid_protocol_tcl.h \ + rfid_protocol_mifare_ul.h \ + rfid_protocol_mifare_classic.h \ + rfid_protocol_tagit.h \ + rfid_protocol_icode.h \ + rfid_reader.h \ + rfid_system.h \ + rfid_access_mifare_classic.h \ + rfid_reader_cm5121.h \ + rfid_reader_spidev.h \ + rfid_reader_openpcd.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/librfid/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/librfid/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + + +# 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: diff --git a/librfid/include/librfid/rfid.h b/librfid/include/librfid/rfid.h new file mode 100644 index 0000000..bf21319 --- /dev/null +++ b/librfid/include/librfid/rfid.h @@ -0,0 +1,73 @@ +#ifndef _RFID_H +#define _RFID_H + +#include +#include +#include + +#define ECOLLISION 1000 + +#ifdef __MINGW32__ +#define ENOTSUP 100 +/* 110 under linux */ +#define ETIMEDOUT 101 + +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; +typedef unsigned long u_int32_t; +typedef unsigned long long u_int64_t; +#endif/*__MINGW32__*/ + +#ifdef __LIBRFID__ + +#include + +#ifdef DEBUG_LIBRFID + +#ifdef LIBRFID_FIRMWARE +extern void debugp(const char *format, ...); +extern const char *hexdump(const void *data, unsigned int len); +#define rfid_hexdump(x, y) hexdump(x, y) +#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) +#define DEBUGPC(x, args ...) debugp(x, ## args) +#else /* LIBRFID_FIRMWARE */ +extern const char *rfid_hexdump(const void *data, unsigned int len); +#define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) +#define DEBUGPC(x, args ...) fprintf(stderr, x, ## args) +#endif /* LIBRFID_FIRMWARE */ + +#include + +#else /* DEBUG */ +extern const char *rfid_hexdump(const void *data, unsigned int len); + +#define DEBUGP(x, args ...) +#define DEBUGPC(x, args ...) + +#endif /* DEBUG */ + + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + +#endif /* __LIBRFID__ */ + +int rfid_init(); + +enum rfid_opt_level { + RFID_LEVEL_ASIC, + RFID_LEVEL_READER, + RFID_LEVEL_LAYER2, + RFID_LEVEL_LAYER3, +}; + +enum rfid_frametype { + RFID_14443A_FRAME_REGULAR, + RFID_14443B_FRAME_REGULAR, + RFID_MIFARE_FRAME, + RFID_15693_FRAME, + RFID_15693_FRAME_ICODE1, +}; + +#endif /* _RFID_H */ diff --git a/librfid/include/librfid/rfid_access_mifare_classic.h b/librfid/include/librfid/rfid_access_mifare_classic.h new file mode 100644 index 0000000..4c7fbdf --- /dev/null +++ b/librfid/include/librfid/rfid_access_mifare_classic.h @@ -0,0 +1,64 @@ +#ifndef _RFID_MIFARE_ACCESS_H +#define _RFID_MIFARE_ACCESS_H + +struct mfcl_access_sect { + u_int8_t block[4]; +}; + +int mfcl_compile_access(u_int8_t *encoded, + const struct mfcl_access_sect *ac); +int mfcl_parse_access(struct mfcl_access_sect *ac, u_int8_t *encoded); + + +enum mfcl_access_exp_data { + MFCL_ACCESS_NEVER = 0, + MFCL_ACCESS_KEY_A = 1, + MFCL_ACCESS_KEY_B = 2, +}; + +struct mfcl_access_exp_block { +#ifndef RFID_BIG_ENDIAN_BITFIELD + u_int8_t read:2, + write:2, + inc:2, + dec:2; +#else + u_int8_t dec:2, + inc:2, + write:2, + read:2; +#endif +} __attribute__ ((packed)); + +struct mfcl_access_exp_acc { +#ifndef RFID_BIG_ENDIAN_BITFIELD + u_int8_t key_a_rd:2, + key_a_wr:2, + acc_rd:2, + acc_wr:2; + u_int8_t key_b_rd:2, + key_b_wr:2, + reserved:4; +#else + u_int8_t acc_wr:2, + acc_rd:2, + key_a_wr:2, + key_a_rd:2; + u_int8_t reserved:4, + key_b_wr:2, + key_b_rd:2; +#endif +} __attribute__ ((packed)); + + +struct mfcl_access_exp_sect { + struct mfcl_access_exp_block block[3]; + struct mfcl_access_exp_acc acc; +}; + +void mfcl_access_to_exp(struct mfcl_access_exp_sect *exp, + const struct mfcl_access_sect *sect); + +char *mfcl_access_exp_stringify(const struct mfcl_access_exp_block *exp); +char *mfcl_access_exp_acc_stringify(const struct mfcl_access_exp_acc *acc); +#endif diff --git a/librfid/include/librfid/rfid_asic.h b/librfid/include/librfid/rfid_asic.h new file mode 100644 index 0000000..8768baf --- /dev/null +++ b/librfid/include/librfid/rfid_asic.h @@ -0,0 +1,55 @@ +#ifndef _RFID_ASIC_H +#define _RFID_ASIC_H + +enum rfid_frametype; + +#include + +/* a low-level transport, over which the ASIC layer can talk to its ASIC */ +struct rfid_asic_transport { + char *name; + union { + struct rfid_asic_rc632_transport rc632; + } priv; +}; + +/* An instance handle to 'struct rfid_asic_transport' */ +struct rfid_asic_transport_handle { + void *data; /* handle to stuff like even lower layers */ + + const struct rfid_asic_transport *rat; +}; + +/* Some implementation-specific data. A reader will specify one of these for + * ASIC-specific parameters such as e.g. RC632 mod conductance */ + +struct rfid_asic_implementation { + union { + struct rfid_asic_rc632_impl rc632; + } priv; +}; + +struct rfid_asic_handle { + struct rfid_asic_transport_handle *rath; + unsigned int fc; + unsigned int mtu; + unsigned int mru; + + union { + struct rfid_asic_rc632_handle rc632; + //struct rfid_asic_rc531_handle rc531; + } priv; + struct rfid_asic *asic; +}; + + +struct rfid_asic { + char *name; + unsigned int fc; /* carrier frequency */ + union { + struct rfid_asic_rc632 rc632; + //struct rfid_asic_rc531 rc531; + } priv; +}; + +#endif /* _RFID_ASIC_H */ diff --git a/librfid/include/librfid/rfid_asic_rc632.h b/librfid/include/librfid/rfid_asic_rc632.h new file mode 100644 index 0000000..1400756 --- /dev/null +++ b/librfid/include/librfid/rfid_asic_rc632.h @@ -0,0 +1,165 @@ +#ifndef _RFID_ASIC_RC632_H +#define _RFID_ASIC_RC632_H + +struct rfid_asic_transport_handle; + +#include +#include +#include + +struct rfid_asic_rc632_transport { + struct { + int (*reg_write)(struct rfid_asic_transport_handle *rath, + u_int8_t reg, + u_int8_t value); + int (*reg_read)(struct rfid_asic_transport_handle *rath, + u_int8_t reg, + u_int8_t *value); + int (*fifo_write)(struct rfid_asic_transport_handle *rath, + u_int8_t len, + const u_int8_t *buf, + u_int8_t flags); + int (*fifo_read)(struct rfid_asic_transport_handle *rath, + u_int8_t len, + u_int8_t *buf); + } fn; +}; + +struct rfid_asic_handle; + +struct iso14443a_atqa; +struct iso14443a_anticol_cmd; +struct iso15693_anticol_cmd; +struct iso15693_anticol_resp; + +struct rfid_asic_rc632 { + struct { + int (*power)(struct rfid_asic_handle *h, int on); + int (*rf_power)(struct rfid_asic_handle *h, int on); + int (*init)(struct rfid_asic_handle *h, enum rfid_layer2_id); + int (*transceive)(struct rfid_asic_handle *h, + enum rfid_frametype, + const u_int8_t *tx_buf, + unsigned int tx_len, + u_int8_t *rx_buf, + unsigned int *rx_len, + u_int64_t timeout, + unsigned int flags); + struct { + int (*transceive_sf)(struct rfid_asic_handle *h, + u_int8_t cmd, + struct iso14443a_atqa *atqa); + int (*transceive_acf)(struct rfid_asic_handle *h, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col); + int (*set_speed)(struct rfid_asic_handle *h, + unsigned int tx, + unsigned int speed); + } iso14443a; + struct { + int (*transceive_ac)(struct rfid_asic_handle *h, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *rx_len, unsigned char *bit_of_col); + } iso15693; + struct { + int (*setkey)(struct rfid_asic_handle *h, + const unsigned char *key); + int (*setkey_ee)(struct rfid_asic_handle *h, + const unsigned int addr); + int (*auth)(struct rfid_asic_handle *h, u_int8_t cmd, + u_int32_t serno, u_int8_t block); + } mifare_classic; + } fn; +}; + +struct rc632_transport_handle { +}; + +/* A handle to a specific RC632 chip */ +struct rfid_asic_rc632_handle { + struct rc632_transport_handle th; +}; + +struct rfid_asic_rc632_impl_proto { + u_int8_t mod_conductance; + u_int8_t cw_conductance; + u_int8_t bitphase; + u_int8_t threshold; +}; + +struct rfid_asic_rc632_impl { + u_int32_t mru; /* maximum receive unit (PICC->PCD) */ + u_int32_t mtu; /* maximum transmit unit (PCD->PICC) */ + //struct rfid_asic_rc632_impl_proto proto[NUM_RFID_PROTOCOLS]; +}; + +extern struct rfid_asic_handle * rc632_open(struct rfid_asic_transport_handle *th); +extern void rc632_close(struct rfid_asic_handle *h); +extern int rc632_register_dump(struct rfid_asic_handle *handle, u_int8_t *buf); + + +/* register decoding inlines... */ +#define DEBUGP_ERROR_FLAG(value) do {DEBUGP("error_flag: 0x%0.2x",value); \ + if (value & RC632_ERR_FLAG_CRC_ERR ) \ + DEBUGPC(", CRC"); \ + if (value & RC632_ERR_FLAG_COL_ERR ) \ + DEBUGPC(", COL"); \ + if (value & RC632_ERR_FLAG_FRAMING_ERR ) \ + DEBUGPC(", FRAMING"); \ + if (value & RC632_ERR_FLAG_PARITY_ERR) \ + DEBUGPC(", PARITY"); \ + if (value & RC632_ERR_FLAG_KEY_ERR ) \ + DEBUGPC(", KEY"); \ + if (value & RC632_ERR_FLAG_ACCESS_ERR ) \ + DEBUGPC(", ACCESS"); \ + DEBUGPC("\n");} while (0); + +#define DEBUGP_STATUS_FLAG(foo) do {\ + DEBUGP("status_flag: 0x%0.2x",foo); \ + if (foo & RC632_STAT_ERR ) \ + DEBUGPC(", ERR"); \ + if (foo & RC632_STAT_HIALERT ) \ + DEBUGPC(", Hi"); \ + if (foo & RC632_STAT_IRQ ) \ + DEBUGPC(", IRQ"); \ + if (foo & RC632_STAT_LOALERT ) \ + DEBUGPC(", Lo"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_AWAITINGRX ) \ + DEBUGPC(", mAwaitingRX"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_GOTORX ) \ + DEBUGPC(", mGotoRX"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_IDLE ) \ + DEBUGPC(", mIdle"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_PREPARERX ) \ + DEBUGPC(", mPrepareRX"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_RECV ) \ + DEBUGPC(", mRX"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_TXDATA ) \ + DEBUGPC(", mTXData"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_TXEOF ) \ + DEBUGPC(", mTXeof"); \ + if ((foo & RC632_STAT_MODEM_MASK) == RC632_STAT_MODEM_TXSOF ) \ + DEBUGPC(", mTXsof"); \ + DEBUGPC("\n"); } while (0); + +#define DEBUGP_INTERRUPT_FLAG(txt,foo) do {\ + DEBUGP("%s: 0x%0.2x",txt,foo); \ + if (foo & RC632_INT_HIALERT) \ + DEBUGPC(", HiA"); \ + if (foo & RC632_INT_LOALERT) \ + DEBUGPC(", LoA"); \ + if (foo & RC632_INT_IDLE) \ + DEBUGPC(", IDLE"); \ + if (foo & RC632_INT_RX) \ + DEBUGPC(", RX"); \ + if (foo & RC632_INT_TX) \ + DEBUGPC(", TX"); \ + if (foo & RC632_INT_TIMER) \ + DEBUGPC(", TIMER"); \ + if (foo & RC632_INT_SET) \ + DEBUGPC(", SET"); \ + DEBUGPC("\n"); } while (0); + +#endif diff --git a/librfid/include/librfid/rfid_layer2.h b/librfid/include/librfid/rfid_layer2.h new file mode 100644 index 0000000..7fbf81c --- /dev/null +++ b/librfid/include/librfid/rfid_layer2.h @@ -0,0 +1,86 @@ +#ifndef _RFID_LAYER2_H +#define _RFID_LAYER2_H + +#include + +struct rfid_layer2_handle; +struct rfid_reader_handle; + +enum rfid_layer2_id { + RFID_LAYER2_NONE, + RFID_LAYER2_ISO14443A, + RFID_LAYER2_ISO14443B, + RFID_LAYER2_ISO15693, + RFID_LAYER2_ICODE1, +}; + +/* 0...0xffff = global options, 0x10000...0x1ffff = private options */ +#define RFID_OPT_L2_PRIV 0x00010000 +enum rfid_layer2_opt { + RFID_OPT_LAYER2_UID = 0x0001, + RFID_OPT_LAYER2_PROTO_SUPP = 0x0002, + RFID_OPT_LAYER2_WUP = 0x0003, +}; + +struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh, + unsigned int id); +int rfid_layer2_open(struct rfid_layer2_handle *l2h); +int rfid_layer2_transceive(struct rfid_layer2_handle *l2h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags); +int rfid_layer2_close(struct rfid_layer2_handle *l2h); +int rfid_layer2_fini(struct rfid_layer2_handle *l2h); +int rfid_layer2_getopt(struct rfid_layer2_handle *l2h, int optname, + void *optval, unsigned int *optlen); +int rfid_layer2_setopt(struct rfid_layer2_handle *l2h, int optname, + const void *optval, unsigned int optlen); +char *rfid_layer2_name(struct rfid_layer2_handle *l2h); +#ifdef __LIBRFID__ + +#include +#include +#include +#include + +struct rfid_layer2 { + unsigned int id; + char *name; + + struct { + struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h); + int (*open)(struct rfid_layer2_handle *h); + int (*transceive)(struct rfid_layer2_handle *h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, + unsigned int tx_len, unsigned char *rx_buf, + unsigned int *rx_len, u_int64_t timeout, + unsigned int flags); + int (*close)(struct rfid_layer2_handle *h); + int (*fini)(struct rfid_layer2_handle *h); + int (*getopt)(struct rfid_layer2_handle *h, + int optname, void *optval, unsigned int *optlen); + int (*setopt)(struct rfid_layer2_handle *h, + int optname, const void *optval, + unsigned int optlen); + } fn; +}; + +struct rfid_layer2_handle { + struct rfid_reader_handle *rh; + unsigned char uid[10]; /* triple size 14443a id is 10 bytes */ + unsigned int uid_len; + unsigned int proto_supported; + unsigned int flags; + union { + struct iso14443a_handle iso14443a; + struct iso14443b_handle iso14443b; + struct iso15693_handle iso15693; + } priv; + const struct rfid_layer2 *l2; +}; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_layer2_icode1.h b/librfid/include/librfid/rfid_layer2_icode1.h new file mode 100644 index 0000000..e8ebddb --- /dev/null +++ b/librfid/include/librfid/rfid_layer2_icode1.h @@ -0,0 +1,11 @@ +#ifndef _RFID_L2_ICODE1_H +#define _RFID_L2_ICODE1_H + +#ifdef __LIBRFID__ + +#include +extern const struct rfid_layer2 rfid_layer2_icode1; + + +#endif /* __LIBRFID__ */ +#endif /* _ISO15693_H */ diff --git a/librfid/include/librfid/rfid_layer2_iso14443a.h b/librfid/include/librfid/rfid_layer2_iso14443a.h new file mode 100644 index 0000000..d38fb2e --- /dev/null +++ b/librfid/include/librfid/rfid_layer2_iso14443a.h @@ -0,0 +1,105 @@ +#ifndef _RFID_ISO14443A_H +#define _RFID_ISO14443A_H + +enum rfid_14443a_opt { + RFID_OPT_14443A_SPEED_RX = 0x00010001, + RFID_OPT_14443A_SPEED_TX = 0x00010002, + RFID_OPT_14443A_ATQA = 0x00010003, + RFID_OPT_14443A_WUPA = 0x00010004, + RFID_OPT_14443A_SAK = 0x00010005, +}; + +enum rfid_14443_opt_speed { + RFID_14443A_SPEED_106K = 0x01, + RFID_14443A_SPEED_212K = 0x02, + RFID_14443A_SPEED_424K = 0x04, + RFID_14443A_SPEED_848K = 0x08, +}; + +#ifdef __LIBRFID__ + +#include + +/* protocol definitions */ + +/* ISO 14443-3, Chapter 6.3.1 */ +enum iso14443a_sf_cmd { + ISO14443A_SF_CMD_REQA = 0x26, + ISO14443A_SF_CMD_WUPA = 0x52, + ISO14443A_SF_CMD_OPT_TIMESLOT = 0x35, /* Annex C */ + /* 40 to 4f and 78 to 7f: proprietary */ +}; + +struct iso14443a_atqa { +#ifndef RFID_BIG_ENDIAN_BITFIELD + u_int8_t bf_anticol:5, + rfu1:1, + uid_size:2; + u_int8_t proprietary:4, + rfu2:4; +#else + u_int8_t uid_size:2, + rfu1:1, + bf_anticol:5; + u_int8_t rfu2:4, + proprietary:4; +#endif +} __attribute__((packed)); + +#define ISO14443A_HLTA 0x5000 + +/* ISO 14443-3, Chapter 6.3.2 */ +struct iso14443a_anticol_cmd { + unsigned char sel_code; + unsigned char nvb; + unsigned char uid_bits[5]; +} __attribute__((packed)); + +enum iso14443a_anticol_sel_code { + ISO14443A_AC_SEL_CODE_CL1 = 0x93, + ISO14443A_AC_SEL_CODE_CL2 = 0x95, + ISO14443A_AC_SEL_CODE_CL3 = 0x97, +}; + +#define ISO14443A_BITOFCOL_NONE 0xffffffff + +struct iso14443a_handle { + unsigned int state; + unsigned int level; + unsigned int tcl_capable; + struct iso14443a_atqa atqa; + u_int8_t sak; +}; + +enum iso14443a_level { + ISO14443A_LEVEL_NONE, + ISO14443A_LEVEL_CL1, + ISO14443A_LEVEL_CL2, + ISO14443A_LEVEL_CL3, +}; + +enum iso14443a_state { + ISO14443A_STATE_ERROR, + ISO14443A_STATE_NONE, + ISO14443A_STATE_REQA_SENT, + ISO14443A_STATE_ATQA_RCVD, + ISO14443A_STATE_NO_BITFRAME_ANTICOL, + ISO14443A_STATE_ANTICOL_RUNNING, + ISO14443A_STATE_SELECTED, +}; + +/* Section 6.1.2 values in usec, rounded up to next usec */ +#define ISO14443A_FDT_ANTICOL_LAST1 92 /* 1236 / fc = 91.15 usec */ +#define ISO14443A_FDT_ANTICOL_LAST0 87 /* 1172 / fc = 86.43 usec */ + +#define ISO14443_CARRIER_FREQ 13560000 +#define ISO14443A_FDT_OTHER_LAST1(n) (((n*128+84)*1000000)/ISO14443_CARRIER_FREQ) + + +#include +extern const struct rfid_layer2 rfid_layer2_iso14443a; + +#endif /* __LIBRFID__ */ + + +#endif /* _ISO14443A_H */ diff --git a/librfid/include/librfid/rfid_layer2_iso14443b.h b/librfid/include/librfid/rfid_layer2_iso14443b.h new file mode 100644 index 0000000..2a31997 --- /dev/null +++ b/librfid/include/librfid/rfid_layer2_iso14443b.h @@ -0,0 +1,128 @@ +#ifndef _RFID_LAYER2_ISO14443B_H +#define _RFID_LAYER2_ISO14443B_H + +#include + +enum rfid_iso14443_opt { + RFID_OPT_14443B_CID = 0x00010001, + RFID_OPT_14443B_FSC = 0x00010002, + RFID_OPT_14443B_FSD = 0x00010003, + RFID_OPT_14443B_FWT = 0x00010004, + RFID_OPT_14443B_TR0 = 0x00010005, + RFID_OPT_14443B_TR1 = 0x00010006, +}; + +#ifdef __LIBRFID__ + +struct iso14443b_atqb { + unsigned char fifty; + unsigned char pupi[4]; + unsigned char app_data[4]; + struct { + unsigned char bit_rate_capability; +#ifndef RFID_BIG_ENDIAN_BITFIELD + unsigned char protocol_type:4, + max_frame_size:4; + unsigned char fo:2, + adc:2, + fwi:4; +#else + unsigned char max_frame_size:4, + protocol_type:4; + unsigned char fwi:4, + adc:2, + fo:2; +#endif + } __attribute__ ((packed)) protocol_info; +} __attribute__ ((packed)); + +struct iso14443b_attrib_hdr { + unsigned char one_d; + unsigned char identifier[4]; + struct { +#ifndef RFID_BIG_ENDIAN_BITFIELD + unsigned char rfu:2, + sof:1, + eof:1, + min_tr1:2, + min_tr0:2; +#else + unsigned char min_tr0:2, + min_tr1:1, + eof:1, + sof:1, + rfu:2; +#endif + } __attribute__ ((packed)) param1; + struct { +#ifndef RFID_BIG_ENDIAN_BITFIELD + unsigned char fsdi:4, + spd_out:2, + spd_in:2; +#else + unsigned char spd_in:2, + spd_out:2, + fsdi:4; +#endif + } __attribute__ ((packed)) param2; + struct { +#ifndef RFID_BIG_ENDIAN_BITFIELD + unsigned char protocol_type:4, + rfu:4; +#else + unsigned char rfu:4, + protocol_type:4; +#endif + } __attribute__ ((packed)) param3; + struct { +#ifndef RFID_BIG_ENDIAN_BITFIELD + unsigned char cid:4, + rfu:4; +#else + unsigned char rfu:4, + cid:4; +#endif + } __attribute__ ((packed)) param4; +} __attribute__ ((packed)); + +struct iso14443b_handle { + unsigned int tcl_capable; /* do we support T=CL */ + + unsigned int cid; /* Card ID */ + + unsigned int fsc; /* max. frame size card */ + unsigned int fsd; /* max. frame size reader */ + + unsigned int fwt; /* frame waiting time (in usec) */ + + unsigned int mbl; /* maximum buffer length */ + + unsigned int tr0; /* pcd-eof to picc-subcarrier-on */ + unsigned int tr1; /* picc-subcarrier-on to picc-sof */ + + unsigned int flags; + unsigned int state; +}; + +enum { + ISO14443B_CID_SUPPORTED = 0x01, + ISO14443B_NAD_SUPPORTED = 0x02, +}; + +enum { + ISO14443B_STATE_ERROR, + ISO14443B_STATE_NONE, + ISO14443B_STATE_REQB_SENT, + ISO14443B_STATE_ATQB_RCVD, + ISO14443B_STATE_ATTRIB_SENT, + ISO14443B_STATE_SELECTED, + ISO14443B_STATE_HLTB_SENT, + ISO14443B_STATE_HALTED, +}; + +#include +extern const struct rfid_layer2 rfid_layer2_iso14443b; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_layer2_iso15693.h b/librfid/include/librfid/rfid_layer2_iso15693.h new file mode 100644 index 0000000..b678893 --- /dev/null +++ b/librfid/include/librfid/rfid_layer2_iso15693.h @@ -0,0 +1,217 @@ +#ifndef _RFID_ISO15693_H +#define _RFID_ISO15693_H + +#include + +/* + * ISO15693 tag manufacturer codes as found at + * http://rfid-handbook.de/forum/read.php?5,437,580#msg-580 + * + * 01h = Motorola + * 02h = ST Microelectronics + * 03h = Hitachi + * 04h = Philips/NXP I.CODE + * 05h = Siemens/Infineon + * 06h = Cylinc + * 07h = Texas Instruments TagIt + * 08h = Fujitsu Limited + * 09h = Mashushita Electric Industrial + * 0Ah = NEC + * 0Bh = Oki Electric + * 0Ch = Toshiba + * 0Dh = Mishubishi Electric + * 0Eh = Samsung Electronics + * 0Fh = Hyundai Electronics + * 10h = LG Semiconductors + * 16h = EMarin Microelectronic + * + */ + +/* protocol definitions */ + +struct iso15693_handle { + unsigned int state; + unsigned int vcd_ask100:1, + vicc_two_subc:1, + vicc_fast:1, + single_slot:1, + use_afi:1, + vcd_out256:1; + u_int8_t afi; /* appplication family identifier */ + u_int8_t dsfid; /* data storage format identifier */ +}; + +enum rfid_15693_state { + ISO15693_STATE_ERROR, + ISO15693_STATE_NONE, + ISO15693_STATE_ANTICOL_RUNNING, +}; + +enum rfid_15693_opt { + RFID_OPT_15693_MOD_DEPTH = 0x00010001, + RFID_OPT_15693_VCD_CODING = 0x00010002, + RFID_OPT_15693_VICC_SUBC = 0x00010003, + RFID_OPT_15693_VICC_SPEED = 0x00010004, + RFID_OPT_15693_VCD_SLOTS = 0x00010005, + RFID_OPT_15693_USE_AFI = 0x00010006, + RFID_OPT_15693_AFI = 0x00010007, + RFID_OPT_15693_DSFID = 0x00010008, +}; + +enum rfid_15693_opt_mod_depth { + RFID_15693_MOD_10ASK = 0x01, + RFID_15693_MOD_100ASK = 0x02, +}; + +enum rfid_15693_opt_vcd_coding { + RFID_15693_VCD_CODING_1OUT256 = 0x01, + RFID_15693_VCD_CODING_1OUT4 = 0x02, +}; + +enum rfid_15693_opt_vicc_subc { + RFID_15693_VICC_SUBC_SINGLE = 0x01, + RFID_15693_VICC_SUBC_DUAL = 0x02, +}; + +enum rfid_15693_opt_vicc_speed { + RFID_15693_VICC_SPEED_SLOW = 0x01, + RFID_15693_VICC_SPEED_FAST = 0x02, +}; + +#ifdef __LIBRFID__ + +#define ISO15693_UID_LEN 8 +#define ISO15693_CRC_LEN 2 + +/* ISO 15693-3, Ch. 7.2 Table 3 */ +enum iso15693_request_flags { + RFID_15693_F_SUBC_TWO = 0x01, + RFID_15693_F_RATE_HIGH = 0x02, + RFID_15693_F_INV_TABLE_5 = 0x04, + RFID_15693_F_PROT_OEXT = 0x08, +}; + +/* ISO 15693-3, Ch. 7.2 Table 4 */ +enum iso15693_request_flags_table4 { + RFID_15693_F4_SELECTED = 0x10, /* only VICC in 'select' state */ + RFID_15693_F4_ADDRESS = 0x20, /* request is addressed */ + RFID_15693_F4_CUSTOM = 0x40, +}; + +/* ISO 15693-3, Ch. 7.2 Table 5 */ +enum iso15693_request_flags_table5 { + RFID_15693_F5_AFI_PRES = 0x10, /* AFI is present */ + RFID_15693_F5_NSLOTS_1 = 0x20, /* only 1 slot (instead of 16) */ + RFID_15693_F5_CUSTOM = 0x40, +}; + +/* ISO 15963-3, Ch. 7.2 Figure 4 */ +struct iso15693_request { + u_int8_t flags; + u_int8_t command; + u_int8_t data[0]; +} __attribute__ ((packed)); + +/* ISO 15963-3, Ch. 7.2 Figure 5 */ +struct iso15693_response { + u_int8_t flags; + u_int8_t data[0]; +} __attribute__ ((packed)); + +/* ISO 15693, Ch. 7.3 Table 6 */ +enum iso15693_response_flags { + RFID_15693_RF_ERROR = 0x01, + RFID_15693_RF_EXTENDED = 0x08, +}; + +/* ISO 15693, Ch. 7.3.2 Table 7 */ +enum iso15693_response_errors { + RFID_15693_ERR_NOTSUPP = 0x01, + RFID_15693_ERR_INVALID = 0x02, /* command not recognized */ + RFID_15693_ERR_NOTSUPP_OPTION = 0x03, /* option not supported*/ + RFID_15693_ERR_UNKNOWN = 0x0f, /* unknown error */ + RFID_15693_ERR_BLOCK_NA = 0x10, /* block not available */ + RFID_15693_ERR_BLOCK_LOCKED = 0x11, + RFID_15693_ERR_BLOCK_LOCKED_CH = 0x12, + RFID_15693_ERR_BLOCK_NOTPROG = 0x13, + RFID_15693_ERR_BLOCK_NOTLOCK = 0x14, + /* 0xA0 .. 0xDF Custom Command error Codes */ +}; + +/* ISO 15693, Ch. 7.4 */ +enum iso15693_vicc_states { + RFID_15693_STATE_POWER_OFF, + RFID_15693_STATE_READY, + RFID_15693_STATE_QUIET, + RFID_15693_STATE_SELECTED, +}; + +/* ISO 15693, Ch. 9.1 Table 10*/ +enum iso15693_commands { + /* Mandatory 0x01 .. 0x1f */ + ISO15693_CMD_INVENTORY = 0x01, + ISO15693_CMD_STAY_QUIET = 0x02, + /* Optional 0x20 .. 0x9f */ + ISO15693_CMD_READ_BLOCK_SINGLE = 0x20, + ISO15693_CMD_WRITE_BLOCK_SINGLE = 0x21, + ISO15693_CMD_LOCK_BLOCK = 0x22, + ISO15693_CMD_READ_BLOCK_MULTI = 0x23, + ISO15693_CMD_WRITE_BLOCK_MULTI = 0x24, + ISO15693_CMD_SELECT = 0x25, + ISO15693_CMD_RESET_TO_READY = 0x26, + ISO15693_CMD_WRITE_AFI = 0x27, + ISO15693_CMD_LOCK_AFI = 0x28, + ISO15693_CMD_WRITE_DSFID = 0x29, + ISO15693_CMD_LOCK_DSFID = 0x2a, + ISO15693_CMD_GET_SYSINFO = 0x2b, + ISO15693_CMD_GET_BLOCK_SECURITY = 0x2c, + /* Custom 0xa0 .. 0xdf */ + ICODE_CMD_INVENTORY_READ = 0xa0, + ICODE_CMD_FAST_INVENTORY_READ = 0xa1, + ICODE_CMD_EAS_SET = 0xa2, + ICODE_CMD_EAS_RESET = 0xa3, + ICODE_CMD_EAS_LOCK = 0xa4, + ICODE_CMD_EAS_ALARM = 0xa5, + /* Proprietary 0xe0 .. 0xff */ +}; + +struct iso15693_anticol_cmd { + struct iso15693_request req; + unsigned char mask_len; + unsigned char mask_bits[ISO15693_UID_LEN]; + unsigned char current_slot; +} __attribute__((packed)); + +struct iso15693_anticol_cmd_afi { + struct iso15693_request req; + unsigned char afi; + unsigned char mask_len; + unsigned char mask_bits[ISO15693_UID_LEN]; +} __attribute__((packed)); + +/* Figure 11, Chapter 9.2.1 */ +struct iso15693_anticol_resp { + struct iso15693_response resp; + u_int8_t dsfid; + u_int8_t uuid[ISO15693_UID_LEN]; +} __attribute__((packed)); + + +#define ISO15693_T_SLOW 0 +#define ISO15693_T_FAST 1 +enum iso15693_t { + ISO15693_T1, + ISO15693_T2, + ISO15693_T3, + ISO15693_T4, + ISO15693_T4_WRITE, +}; + +/* in microseconds as per Chapter 8.4 table 8 */ +extern const unsigned int iso15693_timing[2][5]; + +#include +extern const struct rfid_layer2 rfid_layer2_iso15693; + +#endif /* __LIBRFID__ */ +#endif /* _ISO15693_H */ diff --git a/librfid/include/librfid/rfid_protocol.h b/librfid/include/librfid/rfid_protocol.h new file mode 100644 index 0000000..b4a145d --- /dev/null +++ b/librfid/include/librfid/rfid_protocol.h @@ -0,0 +1,106 @@ +#ifndef _RFID_PROTOCOL_H +#define _RFID_PROTOCOL_H + +#include + +struct rfid_protocol_handle; + +struct rfid_protocol_handle * +rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id); +int rfid_protocol_open(struct rfid_protocol_handle *ph); +int rfid_protocol_transceive(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + unsigned int timeout, unsigned int flags); +int +rfid_protocol_read(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len); + +int +rfid_protocol_write(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len); + +int rfid_protocol_fini(struct rfid_protocol_handle *ph); +int rfid_protocol_close(struct rfid_protocol_handle *ph); + +int rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname, + void *optval, unsigned int *optlen); + +int rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname, + const void *optval, unsigned int optlen); + +char *rfid_protocol_name(struct rfid_protocol_handle *ph); + +enum rfid_protocol_id { + RFID_PROTOCOL_UNKNOWN, + RFID_PROTOCOL_TCL, + RFID_PROTOCOL_MIFARE_UL, + RFID_PROTOCOL_MIFARE_CLASSIC, + RFID_PROTOCOL_ICODE_SLI, + RFID_PROTOCOL_TAGIT, + NUM_RFID_PROTOCOLS +}; + +enum rfid_protocol_opt { + RFID_OPT_PROTO_ID, + RFID_OPT_PROTO_SIZE = 0x10000001, +}; + +#ifdef __LIBRFID__ + +struct rfid_protocol { + unsigned int id; + char *name; + struct { + struct rfid_protocol_handle *(*init)(struct rfid_layer2_handle *l2h); + int (*open)(struct rfid_protocol_handle *ph); + int (*close)(struct rfid_protocol_handle *ph); + int (*fini)(struct rfid_protocol_handle *ph); + /* transceive for session based transport protocols */ + int (*transceive)(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, + unsigned int tx_len, + unsigned char *rx_buf, + unsigned int *rx_len, + unsigned int timeout, + unsigned int flags); + /* read/write for synchronous memory cards */ + int (*read)(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len); + int (*write)(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len); + int (*getopt)(struct rfid_protocol_handle *h, + int optname, void *optval, unsigned int *optlen); + int (*setopt)(struct rfid_protocol_handle *h, + int optname, const void *optval, + unsigned int optlen); + } fn; +}; + +#include +#include +#include +#include + +struct rfid_protocol_handle { + struct rfid_layer2_handle *l2h; + const struct rfid_protocol *proto; + union { + struct tcl_handle tcl; + } priv; /* priv has to be last, since + * it could contain additional + * private data over the end of + * sizeof(priv). */ +}; + +#endif /* __LIBRFID__ */ + +#endif /* _RFID_PROTOCOL_H */ diff --git a/librfid/include/librfid/rfid_protocol_icode.h b/librfid/include/librfid/rfid_protocol_icode.h new file mode 100644 index 0000000..9019243 --- /dev/null +++ b/librfid/include/librfid/rfid_protocol_icode.h @@ -0,0 +1,10 @@ +#ifndef _RFID_PROTOCOL_TAGIT_H +#define _RFID_PROTOCOL_TAGIT_H + +#ifdef __LIBRFID__ + +extern const struct rfid_protocol rfid_protocol_icode; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_protocol_mifare_classic.h b/librfid/include/librfid/rfid_protocol_mifare_classic.h new file mode 100644 index 0000000..bfa49ba --- /dev/null +++ b/librfid/include/librfid/rfid_protocol_mifare_classic.h @@ -0,0 +1,49 @@ +#ifndef _MIFARE_CLASSIC_H +#define _MIFARE_CLASSIC_H + +#include + +#define MIFARE_CL_KEYA_DEFAULT "\xa0\xa1\xa2\xa3\xa4\xa5" +#define MIFARE_CL_KEYB_DEFAULT "\xb0\xb1\xb2\xb3\xb4\xb5" + +#define MIFARE_CL_KEYA_DEFAULT_INFINEON "\xff\xff\xff\xff\xff\xff" +#define MIFARE_CL_KEYB_DEFAULT_INFINEON MIFARE_CL_KEYA_DEFAULT_INFINEON + +#define MIFARE_CL_KEY_LEN (sizeof(MIFARE_CL_KEYA_DEFAULT)-1) + +#define MIFARE_CL_PAGE_MAX 0xff +#define MIFARE_CL_PAGE_SIZE 0x10 + +#define RFID_CMD_MIFARE_AUTH1A 0x60 +#define RFID_CMD_MIFARE_AUTH1B 0x61 + +#define MIFARE_CL_BLOCKS_P_SECTOR_1k 4 +#define MIFARE_CL_BLOCKS_P_SECTOR_4k 16 +#define MIFARE_CL_SMALL_SECTORS 32 +#define MIFARE_CL_LARGE_SECTORS 4 + +enum rfid_proto_mfcl_opt { + RFID_OPT_P_MFCL_SIZE = 0x10000001, +}; + +#ifdef __LIBRFID__ + +extern const struct rfid_protocol rfid_protocol_mfcl; + + +#define MIFARE_CL_CMD_WRITE16 0xA0 +#define MIFARE_CL_CMD_WRITE4 0xA2 +#define MIFARE_CL_CMD_READ 0x30 + +#define MIFARE_CL_RESP_ACK 0x0a +#define MIFARE_CL_RESP_NAK 0x00 + +#endif /* __LIBRFID__ */ + +extern int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key); +extern int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block); +extern int mfcl_sector2block(u_int8_t sector); +extern int mfcl_block2sector(u_int8_t block); +extern int mfcl_sector_blocks(u_int8_t sector); + +#endif /* _MIFARE_CLASSIC_H */ diff --git a/librfid/include/librfid/rfid_protocol_mifare_ul.h b/librfid/include/librfid/rfid_protocol_mifare_ul.h new file mode 100644 index 0000000..593894e --- /dev/null +++ b/librfid/include/librfid/rfid_protocol_mifare_ul.h @@ -0,0 +1,24 @@ +#ifndef _RFID_PROTOCOL_MFUL_H +#define _RFID_PROTOCOL_MFUL_H + +int rfid_mful_lock_page(struct rfid_protocol_handle *ph, unsigned int page); +int rfid_mful_lock_otp(struct rfid_protocol_handle *ph); + +#define MIFARE_UL_PAGE_MAX 15 + +#ifdef __LIBRFID__ + +#define MIFARE_UL_CMD_WRITE 0xA2 +#define MIFARE_UL_CMD_READ 0x30 + +#define MIFARE_UL_RESP_ACK 0x0a +#define MIFARE_UL_RESP_NAK 0x00 + +#define MIFARE_UL_PAGE_LOCK 2 +#define MIFARE_UL_PAGE_OTP 3 + +extern const struct rfid_protocol rfid_protocol_mful; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_protocol_tagit.h b/librfid/include/librfid/rfid_protocol_tagit.h new file mode 100644 index 0000000..46a73bc --- /dev/null +++ b/librfid/include/librfid/rfid_protocol_tagit.h @@ -0,0 +1,10 @@ +#ifndef _RFID_PROTOCOL_TAGIT_H +#define _RFID_PROTOCOL_TAGIT_H + +#ifdef __LIBRFID__ + +extern const struct rfid_protocol rfid_protocol_tagit; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_protocol_tcl.h b/librfid/include/librfid/rfid_protocol_tcl.h new file mode 100644 index 0000000..535af11 --- /dev/null +++ b/librfid/include/librfid/rfid_protocol_tcl.h @@ -0,0 +1,76 @@ +#ifndef _RFID_PROTOCOL_TCL_H +#define _RFID_PROTOCOL_TCL_H + +enum rfid_proto_tcl_opt { + RFID_OPT_P_TCL_ATS = 0x00010001, + RFID_OPT_P_TCL_ATS_LEN = 0x00010002, +}; + +#ifdef __LIBRFID__ + +enum tcl_transport_rate { + TCL_RATE_106 = 0x01, + TCL_RATE_212 = 0x02, + TCL_RATE_424 = 0x04, + TCL_RATE_848 = 0x08, +}; + +enum tcl_transport_transceive_flags { + TCL_TRANSP_F_TX_CRC = 0x01, /* transport adds TX CRC */ + TCL_TRANSP_F_RX_CRC = 0x02, +}; + +struct tcl_handle { + /* derived from ats */ + unsigned char *historical_bytes; /* points into ats */ + unsigned int historical_len; + + unsigned int fsc; /* max frame size accepted by card */ + unsigned int fsd; /* max frame size accepted by reader */ + unsigned int fwt; /* frame waiting time (in usec)*/ + unsigned char ta; /* divisor information */ + unsigned char sfgt; /* start-up frame guard time (in usec) */ + + /* otherwise determined */ + unsigned int cid; /* Card ID */ + unsigned int nad; /* Node Address */ + + unsigned int flags; + unsigned int state; /* protocol state */ + + unsigned int toggle; /* send toggle with next frame */ + + unsigned int ats_len; + unsigned char ats[256]; /* ATS cannot be bigger than FSD-2 bytes, + according to ISO 14443-4 5.2.2 */ +}; + +enum tcl_handle_flags { + TCL_HANDLE_F_NAD_SUPPORTED = 0x0001, + TCL_HANDLE_F_CID_SUPPORTED = 0x0002, + TCL_HANDLE_F_NAD_USED = 0x0010, + TCL_HANDLE_F_CID_USED = 0x0020, +}; + + +enum tcl_pcb_bits { + TCL_PCB_CID_FOLLOWING = 0x08, + TCL_PCB_NAD_FOLLOWING = 0x04, +}; + +enum tcl_pcd_state { + TCL_STATE_NONE = 0x00, + TCL_STATE_INITIAL, + TCL_STATE_RATS_SENT, /* waiting for ATS */ + TCL_STATE_ATS_RCVD, /* ATS received */ + TCL_STATE_PPS_SENT, /* waiting for PPS response */ + TCL_STATE_ESTABLISHED, /* xchg transparent data */ + TCL_STATE_DESELECT_SENT, /* waiting for DESELECT response */ + TCL_STATE_DESELECTED, /* card deselected or HLTA'd */ +}; + +extern const struct rfid_protocol rfid_protocol_tcl; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid/include/librfid/rfid_reader.h b/librfid/include/librfid/rfid_reader.h new file mode 100644 index 0000000..27bcef3 --- /dev/null +++ b/librfid/include/librfid/rfid_reader.h @@ -0,0 +1,105 @@ +#ifndef _RFID_READER_H +#define _RFID_READER_H + +#include +#include +#include + +struct rfid_reader_handle; + +/* 0...0xffff = global options, 0x10000...0x1ffff = private options */ +#define RFID_OPT_RDR_PRIV 0x00010000 +enum rfid_reader_opt { + RFID_OPT_RDR_FW_VERSION = 0x0001, + RFID_OPT_RDR_RF_KILL = 0x0002, +}; + + +struct rfid_reader { + char *name; + unsigned int id; + unsigned int l2_supported; + unsigned int proto_supported; + + int (*reset)(struct rfid_reader_handle *h); + + /* open the reader */ + struct rfid_reader_handle * (*open)(void *data); + + /* Initialize the reader for a given layer 2 */ + int (*init)(struct rfid_reader_handle *h, enum rfid_layer2_id); + + /* completely close the reader */ + void (*close)(struct rfid_reader_handle *h); + + + int (*getopt)(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen); + + int (*setopt)(struct rfid_reader_handle *rh, int optname, + const void *optval, unsigned int optlen); + + /* transceive one frame */ + int (*transceive)(struct rfid_reader_handle *h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags); + + struct rfid_14443a_reader { + int (*transceive_sf)(struct rfid_reader_handle *h, + unsigned char cmd, + struct iso14443a_atqa *atqa); + int (*transceive_acf)(struct rfid_reader_handle *h, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col); + int (*set_speed)(struct rfid_reader_handle *h, + unsigned int tx, + unsigned int speed); + unsigned int speed; + } iso14443a; + struct rfid_14443b_reader { + unsigned int speed; + } iso14443b; + struct rfid_15693_reader { + int (*transceive_ac)(struct rfid_reader_handle *h, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *rx_len, char *bit_of_col); + } iso15693; + struct rfid_mifare_classic_reader { + int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key); + int (*setkey_ee)(struct rfid_reader_handle *h, const unsigned int addr); + int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd, + u_int32_t serno, u_int8_t block); + } mifare_classic; +}; + +enum rfid_reader_id { + RFID_READER_CM5121, + RFID_READER_PEGODA, + RFID_READER_OPENPCD, + RFID_READER_SPIDEV, +}; + +struct rfid_reader_handle { + struct rfid_asic_handle *ah; + + union { + + } priv; + const struct rfid_reader *reader; +}; + +extern struct rfid_reader_handle * +rfid_reader_open(void *data, unsigned int id); + +extern void rfid_reader_close(struct rfid_reader_handle *rh); + +extern int rfid_reader_getopt(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen); +extern int rfid_reader_setopt(struct rfid_reader_handle *rh, int optname, + const void *optval, unsigned int optlen); + +#endif diff --git a/librfid/include/librfid/rfid_reader_cm5121.h b/librfid/include/librfid/rfid_reader_cm5121.h new file mode 100644 index 0000000..e3e64c0 --- /dev/null +++ b/librfid/include/librfid/rfid_reader_cm5121.h @@ -0,0 +1,22 @@ +#ifndef _RFID_READER_CM5121_H +#define _RFID_READER_CM5121_H + +#include + +#define CM5121_CW_CONDUCTANCE 0x3f +#define CM5121_MOD_CONDUCTANCE 0x3f +#define CM5121_14443A_BITPHASE 0xa9 +#define CM5121_14443A_THRESHOLD 0xff + +#define CM5121_14443B_BITPHASE 0xad +#define CM5121_14443B_THRESHOLD 0xff + +extern int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len); + +extern const struct rfid_reader rfid_reader_cm5121; +// extern struct rfid_asic_transport cm5121_ccid; + +#endif diff --git a/librfid/include/librfid/rfid_reader_openpcd.h b/librfid/include/librfid/rfid_reader_openpcd.h new file mode 100644 index 0000000..05ea45e --- /dev/null +++ b/librfid/include/librfid/rfid_reader_openpcd.h @@ -0,0 +1,107 @@ +#ifndef _OPENPCD_PROTO_H +#define _OPENPCD_PROTO_H + +/* This header file describes the USB protocol of the OpenPCD RFID reader */ + +#include + +struct openpcd_hdr { + u_int8_t cmd; /* command. high nibble: class, + * low nibble: cmd */ + u_int8_t flags; + u_int8_t reg; /* register */ + u_int8_t val; /* value (in case of write *) */ + u_int8_t data[0]; +} __attribute__ ((packed)); + +#define OPCD_REV_LEN 16 +struct openpcd_compile_version { + char svnrev[OPCD_REV_LEN]; + char by[OPCD_REV_LEN]; + char date[OPCD_REV_LEN]; +} __attribute__ ((packed)); + +#define OPENPCD_FLAG_RESPOND 0x01 /* Response requested */ +#define OPENPCD_FLAG_ERROR 0x80 /* An error occurred */ + +enum openpcd_cmd_class { + OPENPCD_CMD_CLS_GENERIC = 0x0, + /* PCD (reader) side */ + OPENPCD_CMD_CLS_RC632 = 0x1, + //OPENPCD_CMD_CLS_LED = 0x2, + OPENPCD_CMD_CLS_SSC = 0x3, + OPENPCD_CMD_CLS_PWM = 0x4, + OPENPCD_CMD_CLS_ADC = 0x5, + /* PICC (transponder) side */ + OPENPCD_CMD_CLS_PICC = 0xe, + + OPENPCD_CMD_CLS_USBTEST = 0xf, +}; + +#define OPENPCD_REG_MAX 0x3f + +#define OPENPCD_CMD_CLS(x) (x >> 4) +#define OPENPCD_CMD(x) (x & 0xf) + +#define OPENPCD_CLS2CMD(x) (x << 4) + +#define OPENPCD_CMD_GET_VERSION (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_LED (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_SERIAL (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_API_VERSION (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_ENVIRONMENT (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_ENVIRONMENT (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_RESET (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) + +/* CMD_CLS_RC632 */ +#define OPENPCD_CMD_WRITE_REG (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_FIFO (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_VFIFO (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_CLEAR (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_SET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_REG (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_FIFO (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_VFIFO (0x8|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_DUMP_REGS (0x9|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_IRQ (0xa|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) + +/* CMD_CLS_SSC */ +#define OPENPCD_CMD_SSC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) +#define OPENPCD_CMD_SSC_WRITE (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) + +/* CMD_CLS_PWM */ +#define OPENPCD_CMD_PWM_ENABLE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_SET (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_GET (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_SET (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_GET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) + +/* CMD_CLS_PICC */ +#define OPENPCD_CMD_PICC_REG_WRITE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) +#define OPENPCD_CMD_PICC_REG_READ (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) + +/* CMD_CLS_ADC */ +#define OPENPCD_CMD_ADC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_ADC)) + +/* CMD_CLS_USBTEST */ +#define OPENPCD_CMD_USBTEST_IN (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) +#define OPENPCD_CMD_USBTEST_OUT (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + +/* FIXME */ +#define OPENPCD_CMD_PIO_IRQ (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + + +#define OPENPCD_VENDOR_ID 0x2342 +#define OPENPCD_PRODUCT_ID 0x0001 +#define OPENPCD_OUT_EP 0x01 +#define OPENPCD_IN_EP 0x82 +#define OPENPCD_IRQ_EP 0x83 + +extern const struct rfid_reader rfid_reader_openpcd; + +/* 0...0xffff = global options, 0x10000...0x1ffff = private options */ +enum rfid_reader_openpcd_opt { + RFID_OPT_RDR_ENVIRONMENT = 0x10001, +}; + +#endif diff --git a/librfid/include/librfid/rfid_reader_spidev.h b/librfid/include/librfid/rfid_reader_spidev.h new file mode 100644 index 0000000..be04a54 --- /dev/null +++ b/librfid/include/librfid/rfid_reader_spidev.h @@ -0,0 +1,6 @@ +#ifndef _RFID_READER_SPIDEV_H +#define _RFID_READER_SPIDEV_H + +extern struct rfid_reader rfid_reader_spidev; + +#endif diff --git a/librfid/include/librfid/rfid_scan.h b/librfid/include/librfid/rfid_scan.h new file mode 100644 index 0000000..50910fb --- /dev/null +++ b/librfid/include/librfid/rfid_scan.h @@ -0,0 +1,18 @@ +#ifndef _RFID_SCAN_H +#define _RFID_SCAN_H + +#include +#include +#include + +struct rfid_layer2_handle * +rfid_layer2_scan(struct rfid_reader_handle *rh); + +struct rfid_protocol_handle * +rfid_protocol_scan(struct rfid_layer2_handle *l2h); + +int rfid_scan(struct rfid_reader_handle *rh, + struct rfid_layer2_handle **l2h, + struct rfid_protocol_handle **ph); + +#endif /* _RFID_SCAN_H */ diff --git a/librfid/include/librfid/rfid_system.h b/librfid/include/librfid/rfid_system.h new file mode 100644 index 0000000..9b6ffb7 --- /dev/null +++ b/librfid/include/librfid/rfid_system.h @@ -0,0 +1,57 @@ +/* system / environment specific defines */ + +/* build for openpcd firmware */ +//#define LIBRFID_FIRMWARE + +/* build without dynamic allocations */ +//#define LIBRFID_STATIC + +#ifdef __LIBRFID__ + +#ifndef LIBRFID_STATIC +/* If we're not doing a firmware compile, then we just use the regular + * malloc()/free() functions as expected */ + +#define malloc_asic_handle(x) malloc(x) +#define free_asic_handle(x) free(x) + +#define malloc_layer2_handle(x) malloc(x) +#define free_layer2_handle(x) free(x) + +#define malloc_protocol_handle(x) malloc(x) +#define free_protocol_handle(x) free(x) + +#define malloc_rat_handle(x) malloc(x) +#define free_rat_handle(x) free(x) + +#define malloc_reader_handle(x) malloc(x) +#define free_reader_handle(x) free(x) + +#else +/* If we're actually doing a firmware compile, then we use pre-allocated + * handles in order to avoid dynamic memory allocation. */ + +#define EMPTY_STATEMENT do {} while(0) +extern struct rfid_asic_handle rfid_ah; +#define malloc_asic_handle(x) &rfid_ah +#define free_asic_handle(x) EMPTY_STATEMENT + +extern struct rfid_layer2_handle rfid_l2h; +#define malloc_layer2_handle(x) &rfid_l2h +#define free_layer2_handle(x) EMPTY_STATEMENT + +extern struct rfid_protocol_handle rfid_ph; +#define malloc_protocol_handle(x) &rfid_ph +#define free_protocol_handle(x) EMPTY_STATEMENT + +extern struct rfid_asic_transport_handle rfid_ath; +#define malloc_rat_handle(x) &rfid_ath +#define free_rat_handle(x) EMPTY_STATEMENT + +extern struct rfid_reader_handle rfid_rh; +#define malloc_reader_handle(x) &rfid_rh +#define free_reader_handle(x) EMPTY_STATEMENT + +#endif /* LIBRFID_STATIC */ + +#endif /* __LIBRFID__ */ diff --git a/librfid/install-sh b/librfid/install-sh new file mode 100644 index 0000000..6781b98 --- /dev/null +++ b/librfid/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +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: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -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. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; 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 + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + 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 "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # 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: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # 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 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid/librfid.spec b/librfid/librfid.spec new file mode 100644 index 0000000..3823bf6 --- /dev/null +++ b/librfid/librfid.spec @@ -0,0 +1,73 @@ +Name: librfid +Version: 0.1.0 +Release: 1%{?dist} +Summary: The librfid is a Free Software RFID library + +Group: System Environment/Libraries +License: GPL +URL: http://www.openmrtd.org/projects/librfid/ +Source0: http://www.openmrtd.org/projects/librfid/files/%{name}-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: libusb-devel + + +%description +librfid is a Free Software RFID library. It implements the PCD (reader) +side protocol stack of ISO 14443 A, ISO 14443 B, ISO 15693, +Mifare Ultralight and Mifare Classic. Support for iCODE and +other 13.56MHz based transponders is planned. + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%setup -q + + +%build +%configure --disable-static +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc COPYING README TODO +%{_libdir}/*.so.* +%{_bindir}/librfid-tool +%{_bindir}/mifare-tool +%{_bindir}/send_script + +%files devel +%defattr(-,root,root,-) +%doc COPYING README TODO +%{_includedir}/* +%{_libdir}/*.so + + +%changelog +* Sat Dec 30 2006 Kushal Das 0.1.0-1 +- Initial release diff --git a/librfid/libtool b/librfid/libtool new file mode 100644 index 0000000..7af5513 --- /dev/null +++ b/librfid/libtool @@ -0,0 +1,10126 @@ +#! /bin/sh + +# libtool - Provide generalized library-building support services. +# Generated automatically by config.status (librfid) 0.2.0 +# Libtool was configured on host BlubbFish: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS="as" + +# DLL creation program. +DLLTOOL="dlltool" + +# Object dumper program. +OBJDUMP="objdump" + +# Which release of libtool.m4 was used? +macro_version=2.4 +macro_revision=1.3294 + +# Whether or not to build shared libraries. +build_libtool_libs=yes + +# Whether or not to build static libraries. +build_old_libs=yes + +# What type of objects to build. +pic_mode=default + +# Whether or not to optimize for fast installation. +fast_install=needless + +# Shell to use when invoking shell scripts. +SHELL="/bin/sh" + +# An echo program that protects backslashes. +ECHO="printf %s\\n" + +# The host system. +host_alias= +host=i686-pc-mingw32 +host_os=mingw32 + +# The build system. +build_alias= +build=i686-pc-mingw32 +build_os=mingw32 + +# A sed program that does not truncate output. +SED="/bin/sed" + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP="/bin/grep" + +# An ERE matcher. +EGREP="/bin/grep -E" + +# A literal string matcher. +FGREP="/bin/grep -F" + +# A BSD- or MS-compatible name lister. +NM="/mingw/bin/nm" + +# Whether we need soft or hard links. +LN_S="cp -p" + +# What is the maximum length of a command? +max_cmd_len=8192 + +# Object file suffix (normally "o"). +objext=o + +# Executable file suffix (normally ""). +exeext= + +# whether the shell understands "unset". +lt_unset=unset + +# turn spaces into newlines. +SP2NL="tr \\040 \\012" + +# turn newlines into spaces. +NL2SP="tr \\015\\012 \\040\\040" + +# convert $build file names to $host format. +to_host_file_cmd=func_convert_file_msys_to_w32 + +# convert $build files to toolchain format. +to_tool_file_cmd=func_convert_file_msys_to_w32 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method="file_magic ^x86 archive import|^x86 DLL" + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd="func_win32_libid" + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob="" + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob="yes" + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd="func_cygming_dll_for_implib" + +# The archiver. +AR="ar" + +# Flags to create an archive. +AR_FLAGS="cru" + +# How to feed a file listing to the archiver. +archiver_list_spec="@" + +# A symbol stripping program. +STRIP="strip" + +# Commands used to install an old-style archive. +RANLIB="ranlib" +old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" +old_postuninstall_cmds="" + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=no + +# A C compiler. +LTCC="gcc" + +# LTCC compiler flags. +LTCFLAGS="-g -O2" + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\\{0,1\\}\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'" + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'" + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'" + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'" + +# Specify filename containing input files for $NM. +nm_file_list_spec="@" + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot= + +# The name of the directory that contains temporary libtool files. +objdir=.libs + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=file + +# Must we lock files when doing compilation? +need_locks="no" + +# Manifest tool. +MANIFEST_TOOL=":" + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL="" + +# Tool to change global to local symbols on Mac OS X. +NMEDIT="" + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO="" + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL="" + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64="" + +# Old archive suffix (normally "a"). +libext=a + +# Shared library suffix (normally ".so"). +shrext_cmds=".dll" + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds="" + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + +# Do we need the "lib" prefix for modules? +need_lib_prefix=no + +# Do we need a version for libraries? +need_version=no + +# Library versioning type. +version_type=windows + +# Shared library runtime path variable. +runpath_var=LD_RUN_PATH + +# Shared library path variable. +shlibpath_var=PATH + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=yes + +# Format of library name prefix. +libname_spec="lib\$name" + +# 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="\$libname.dll.a" + +# The coded name of the library, if different from the real name. +soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}" + +# Permission mode override for installation of shared libraries. +install_override_mode="" + +# Command to use after installation of a shared archive. +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~ + chmod a+x \\\$dldir/\$dlname~ + if test -n '\$stripme' && test -n '\$striplib'; then + eval '\$striplib \\\$dldir/\$dlname' || exit \\\$?; + fi" + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~ + dlpath=\$dir/\\\$dldll~ + \$RM \\\$dlpath" + +# Commands used to finish a libtool library installation in a directory. +finish_cmds="" + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval="" + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=no + +# Compile-time system search path for libraries. +sys_lib_search_path_spec="e:/programme/mingw/lib/gcc/mingw32/4.5.2 e:/programme/mingw/lib/gcc e:/programme/mingw/mingw32/lib e:/programme/mingw/lib /mingw/lib " + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec="/lib /usr/lib" + +# Whether dlopen is supported. +dlopen_support=unknown + +# Whether dlopen of programs is supported. +dlopen_self=unknown + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=unknown + +# Commands to strip libraries. +old_striplib="strip --strip-debug" +striplib="strip --strip-unneeded" + + +# The linker used to build libraries. +LD="e:/programme/mingw/mingw32/bin/ld.exe" + +# How to create reloadable object files. +reload_flag=" -r" +reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" + +# Commands used to build an old-style archive. +old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" + +# A language specific compiler. +CC="gcc" + +# Is the compiler the GNU compiler? +with_gcc=yes + +# Compiler flag to turn off builtin functions. +no_builtin_flag=" -fno-builtin" + +# Additional compiler flags for building library objects. +pic_flag=" -DDLL_EXPORT -DPIC" + +# How to pass a linker flag through the compiler. +wl="-Wl," + +# Compiler flag to prevent dynamic linking. +link_static_flag="-static" + +# Does compiler simultaneously support -c and -o options? +compiler_c_o="yes" + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=yes + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=yes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec="\${wl}--export-all-symbols" + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object="no" + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds="" + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds="" + +# Commands used to build a shared archive. +archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" +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}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds="" +module_expsym_cmds="" + +# Whether we are building with GNU ld or not. +with_gnu_ld="yes" + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag="unsupported" + +# Flag that enforces no undefined symbols. +no_undefined_flag="" + +# Flag to hardcode $libdir into a binary during linking. +# This must work even if $libdir does not exist +hardcode_libdir_flag_spec="-L\$libdir" + +# 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="" + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator="" + +# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=no + +# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting ${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=no + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=no + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=unsupported + +# 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=no + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=no + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=unknown + +# Set to "yes" if exported symbols are required. +always_export_symbols=no + +# The commands to list exported symbols. +export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1 DATA/;s/^.*[ ]__nm__\\\\([^ ]*\\\\)[ ][^ ]*/\\\\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //' | sort | uniq > \$export_symbols" + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms="[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname" + +# Symbols that must always be exported. +include_expsyms="" + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds="" + +# Commands necessary for finishing linking programs. +postlink_cmds="" + +# Specify filename containing input files. +file_list_spec="" + +# How to hardcode a shared library path into an executable. +hardcode_action=immediate + +# ### END LIBTOOL CONFIG + + +# libtool (GNU libtool) 2.4 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 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. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [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 +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# 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. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4 +TIMESTAMP="" +package_revision=1.3294 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# 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" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="cp -p"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} # Extended-shell func_dirname implementation + + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} # Extended-shell func_basename implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} # Extended-shell func_dirname_and_basename implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} # Extended-shell func_stripname implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +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 that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} +} # Extended-shell func_split_short_opt implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=} +} # Extended-shell func_split_long_opt implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# 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= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}+=\${2}" +} # Extended-shell func_append implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}+=\\ \$func_quote_for_eval_result" +} # Extended-shell func_append_quoted implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} # Extended-shell func_arith implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} # Extended-shell func_len implementation + + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} # Extended-shell func_lo2o implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} # Extended-shell func_xform implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_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 $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +preserve_args+=" $opt" + ;; + --no-verbose) + opt_verbose=false +preserve_args+=" $opt" + ;; + --silent|--quiet) + opt_silent=: +preserve_args+=" $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +preserve_args+=" $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +preserve_args+=" $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || preserve_args+=" --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# 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 () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # 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. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # 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 + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_to_host_path_result+="$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # 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= + pie_flag= + + 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) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + pie_flag+=" $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + 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,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to 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. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # 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 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "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." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist+=" $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist+=" $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command+=" -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command+=" -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command+="$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [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: $progname [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 + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [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 + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -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 + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +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: $progname [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." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir+="/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + 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 + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # 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 +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + libdirs+=" $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + libs+=" $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds+=" + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + 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" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # 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. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog+="$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files+=" $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog+=" $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog+=" $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog+=" -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + 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+=" $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # 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+=" $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs+=" $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + 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 -e "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. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + 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 + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && 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 + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_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 + func_basename "$file" + destfile="$func_basename_result" + 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 + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # 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/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + 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*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags+=" $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + 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 "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# 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. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + 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 + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + 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_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + 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 + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_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've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# 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 variables: + generated_by_libtool_version='$macro_version' + 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 + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + 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 "\ + + # 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 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + 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 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_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 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +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; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_emit_exe_manifest +# emit a Win32 UAC manifest for executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_exe_manifest () +{ + cat < + + + + + + + + + + + + +EOF +} + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_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 + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + libtool_args+=" $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command+=" @OUTPUT@" + finalize_command+=" @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command+=" @SYMFILE@" + 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+=" $arg" + else + dlprefiles+=" $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs+=" $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs+=" $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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+=" $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+=" $pic_object" + prev= + fi + + # A PIC object. + 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_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects+=" $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + libobjs+=" $pic_object" + non_pic_objects+=" $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath+=" $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath+=" $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs+=" $arg" + prev= + continue + ;; + xcclinker) + linker_flags+=" $qarg" + compiler_flags+=" $qarg" + prev= + compile_command+=" $qarg" + finalize_command+=" $qarg" + continue + ;; + xcompiler) + compiler_flags+=" $qarg" + prev= + compile_command+=" $qarg" + finalize_command+=" $qarg" + continue + ;; + xlinker) + linker_flags+=" $qarg" + compiler_flags+=" $wl$qarg" + prev= + compile_command+=" $wl$qarg" + finalize_command+=" $wl$qarg" + 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 + # See comment for -static flag below, for more details. + compile_command+=" $link_static_flag" + finalize_command+=" $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + 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 + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + 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+=" $arg" + finalize_command+=" $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;; + *) deplibs+=" -L$dir" ;; + esac + lib_search_path+=" $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath+=":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath+=":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-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+=" System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && 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+=" $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + compiler_flags+=" $arg" + compile_command+=" $arg" + finalize_command+=" $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags+=" $arg" + compile_command+=" $arg" + finalize_command+=" $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags+=" $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + 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*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath+=" $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # 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 + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg+=" $func_quote_for_eval_result" + compiler_flags+=" $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg+=" $wl$func_quote_for_eval_result" + compiler_flags+=" $wl$func_quote_for_eval_result" + linker_flags+=" $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -{shared,static}-libgcc, -static-{libgfortran|libstdc++} + # link against specified runtime library + # -fstack-protector* stack protector flags for GCC + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin| \ + -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++| \ + -fstack-protector*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + compile_command+=" $arg" + finalize_command+=" $arg" + compiler_flags+=" $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs+=" $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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+=" $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+=" $pic_object" + prev= + fi + + # A PIC object. + 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_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects+=" $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + libobjs+=" $pic_object" + non_pic_objects+=" $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs+=" $arg" + old_deplibs+=" $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles+=" $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles+=" $func_resolve_sysroot_result" + prev= + else + deplibs+=" $func_resolve_sysroot_result" + 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. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command+=" $arg" + finalize_command+=" $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command+=" $arg" + finalize_command+=" $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + 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 $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs+=" $deplib" ;; + esac + fi + 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 $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;; + esac + 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 dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + 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 + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + 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 "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs+=" $deplib" ;; + esac + done + done + libs="$dlprefiles" + 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|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags+=" $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags+=" $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; 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 func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + 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 + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + 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 + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags+=" $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + newlib_search_path+=" $func_resolve_sysroot_result" + ;; + 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 + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + newlib_search_path+=" $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath+=" $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + 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 use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + 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+=" $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles+=" $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # 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 + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles+=" $dlopen" + test -n "$dlpreopen" && 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 + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience+=" $ladir/$objdir/$old_library" + old_convenience+=" $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs+=" $deplib" ;; + esac + fi + tmp_libs+=" $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + 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+=" $lib $dependency_libs" + else + 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 + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$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+=" $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path+=" $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + newdlprefiles+=" $dir/$linklib" + else + newdlprefiles+=" $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs+=" $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles+=" $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs+=" $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles+=" $dir/$dlname" + else + newdlprefiles+=" $dir/$linklib" + fi + ;; + esac + 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+=" $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*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + newlib_search_path+=" $func_resolve_sysroot_result" + ;; + 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 $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs+=" $deplib" ;; + esac + fi + 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 "$prefer_static_libs,$installed" = "built,yes"; } || + 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 + *"$absdir:"*) ;; + *) temp_rpath+="$absdir:" ;; + 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+=" $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs+=" $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs+=" $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && 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+=" $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath+=" $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + 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* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + 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 "$opt_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.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; 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 + elif test -n "$old_library"; then + 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 && + test "$hardcode_direct_absolute" = no; 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+=" -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 + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_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+="$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; 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+="$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+=" -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 + 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*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath+=" $temp_xrpath";; + esac;; + *) temp_deplibs+=" $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + 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" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + specialdeplibs+=" $func_resolve_sysroot_result" ;; + esac + fi + tmp_libs+=" $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + 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 "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + 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+=" $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+=" $deplib" ;; + esac + ;; + *) 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+=" $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs+="$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs+=" $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + 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 + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # 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="$1" + number_minor="$2" + number_revision="$3" + # + # 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|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + 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]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + 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 + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + 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 + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + 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 + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring+=":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + 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 + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs+=" $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_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 | *.gcno) + ;; + $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+=" $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs+=" $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 + func_replace_sysroot "$libdir" + temp_xrpath+=" -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) 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+=" $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+=" $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs+=" System.ltframework" + ;; + *-*-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. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + 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. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + 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 + ;; + *) + # Add a -L argument. + newdeplibs+=" $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + 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+=" $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 + ;; + *) + # Add a -L argument. + newdeplibs+=" $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + 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 + ;; + esac + ;; + 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 with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + 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 + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs+=" -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs+=" $deplib" ;; + esac + ;; + *) new_libs+=" $deplib" ;; + esac + done + deplibs="$new_libs" + + # 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 "$opt_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 + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + 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_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath+=" $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_apped 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+="$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 "$opt_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 + shift + realname="$1" + 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" + linknames= + for link + do + linknames+=" $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles+=" $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + delfiles+=" $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles+=" $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs+=" $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated+=" $gentop" + + func_extract_archives $gentop $convenience + libobjs+=" $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags+=" $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_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:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # 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 + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + delfiles+=" $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + delfiles+=" $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + 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. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + 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~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles+=" $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "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" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles+=" $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + 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\" + test "X$libobjs" = "X " && libobjs= + 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 + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated+=" $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs+=" $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_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 and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated+=" $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${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" + # $opt_dry_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" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command+=" ${wl}-bind_at_load" + finalize_command+=" ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs+=" -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs+=" $deplib" ;; + esac + ;; + *) new_libs+=" $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command+=" $compile_deplibs" + 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+=" $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_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath+=" $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath+=" $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath+=":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath+=":$testbindir";; + 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_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath+=" $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + 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+="$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+="$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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + 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" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED '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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + # Create the UAC manifests first if necessary (but the + # manifest files must have executable permission regardless). + case $output_name in + *instal*|*patch*|*setup*|*update*) + func_emit_exe_manifest > $cwrapper.manifest + func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest + chmod +x $cwrapper.manifest + chmod +x $output_path/$objdir/$output_name.exe.manifest + ;; + esac + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + 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 $symfileobj" + 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" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs+=" $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated+=" $gentop" + + func_extract_archives $gentop $addlibs + 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 + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated+=" $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs+=" $func_extract_archives_result" + fi + + # 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 + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated+=" $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs+=" $gentop/$newobj" + ;; + *) oldobjs+=" $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$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 + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + objlist+=" $obj" + if test "$len" -lt "$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= + len=$len0 + 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 + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + 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) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + newdependency_libs+=" -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + newdependency_libs+=" -R$func_replace_sysroot_result" + ;; + *) newdependency_libs+=" $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles+=" ${lt_sysroot:+=}$libdir/$name" + ;; + *) newdlfiles+=" $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles+=" $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles+=" $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_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 + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + 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+=" $arg"; rmforce=yes ;; + -*) RM+=" $arg" ;; + *) files+=" $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) rmdirs+=" $odir" ;; + 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 func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles+=" $odir/$n" + done + test -n "$old_library" && rmfiles+=" $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;; + esac + test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + 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+=" $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles+=" $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles+=" $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles+=" $odir/$name $odir/${name}S.${objext}" + rmfiles+=" ${name}.manifest $objdir/${name}.manifest" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles+=" $odir/lt-$name $objdir/lt-${name}.manifest" + fi + if test "X$noexename" != "X$name" ; then + rmfiles+=" $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# 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: +# vi:sw=2 + diff --git a/librfid/ltmain.sh b/librfid/ltmain.sh new file mode 100644 index 0000000..49542af --- /dev/null +++ b/librfid/ltmain.sh @@ -0,0 +1,9687 @@ + +# libtool (GNU libtool) 2.4 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 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. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [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 +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# 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. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4 +TIMESTAMP="" +package_revision=1.3294 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# 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" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="cp -p"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +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 that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# 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= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_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 $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# 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 () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # 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. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # 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 + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # 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= + pie_flag= + + 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) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append 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,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append 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. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # 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 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "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." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [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: $progname [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 + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [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 + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -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 + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +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: $progname [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." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + 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 + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # 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 +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + 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" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # 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. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + 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. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append 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 -e "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. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + 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 + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append 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 + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_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 + func_basename "$file" + destfile="$func_basename_result" + 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 + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # 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/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + 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*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + 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 "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# 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. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + 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 + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + 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_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + 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 + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_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've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# 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 variables: + generated_by_libtool_version='$macro_version' + 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 + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + 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 "\ + + # 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 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + 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 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_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 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +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; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_emit_exe_manifest +# emit a Win32 UAC manifest for executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_exe_manifest () +{ + cat < + + + + + + + + + + + + +EOF +} + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_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 + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append 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 + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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 + func_append 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. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append 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 + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + 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 + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + 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 + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + 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*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-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 + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && 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 + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + 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*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # 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 + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -{shared,static}-libgcc, -static-{libgfortran|libstdc++} + # link against specified runtime library + # -fstack-protector* stack protector flags for GCC + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin| \ + -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++| \ + -fstack-protector*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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 + func_append 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. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append 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 + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + 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. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + 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 $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append 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 $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append 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 dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + 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 + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + 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 "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + 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|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; 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 func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + 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 + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + 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 + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + 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 + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + 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 use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + 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. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # 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 + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append 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 + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + 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. + func_append dlprefiles " $lib $dependency_libs" + else + func_append 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 + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$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 + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + 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 + func_append 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*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + 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 $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append 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 "$prefer_static_libs,$installed" = "built,yes"; } || + 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 + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + 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 "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && 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 "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + 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* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + 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 "$opt_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.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; 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 + elif test -n "$old_library"; then + 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 && + test "$hardcode_direct_absolute" = no; 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 + [\\/]*) + func_append 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 + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append 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:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; 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:"*) ;; + *) func_append 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 + [\\/]*) + func_append 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 + 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*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append 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" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + 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 "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + 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 "*) ;; + *) func_append 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 "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append 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 + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + 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 + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # 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="$1" + number_minor="$2" + number_revision="$3" + # + # 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|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + 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]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + 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 + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + 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 + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + 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 + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + 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 + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_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 | *.gcno) + ;; + $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 + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append 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 "*) ;; + *) func_append 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 "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-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. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append 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. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append 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 + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append 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 + func_append 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 + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + 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 + ;; + esac + ;; + 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 with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + 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 + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # 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 "$opt_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 + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_apped 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 + func_append 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 "$opt_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 + shift + realname="$1" + 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" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_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:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # 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 + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append 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. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + 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~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "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" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + 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\" + test "X$libobjs" = "X " && libobjs= + 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 + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_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 and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${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" + # $opt_dry_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" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append 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 "*) ;; + *) func_append 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + 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 + func_append 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 + func_append 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + 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" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED '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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + # Create the UAC manifests first if necessary (but the + # manifest files must have executable permission regardless). + case $output_name in + *instal*|*patch*|*setup*|*update*) + func_emit_exe_manifest > $cwrapper.manifest + func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest + chmod +x $cwrapper.manifest + chmod +x $output_path/$objdir/$output_name.exe.manifest + ;; + esac + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + 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 $symfileobj" + 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" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append 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 + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # 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 + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$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 + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$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= + len=$len0 + 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 + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + 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) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_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 + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + 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) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + 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 func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append 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 + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + func_append rmfiles " ${name}.manifest $objdir/${name}.manifest" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name $objdir/lt-${name}.manifest" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# 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: +# vi:sw=2 + diff --git a/librfid/missing b/librfid/missing new file mode 100644 index 0000000..28055d2 --- /dev/null +++ b/librfid/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 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, see . + +# 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=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# 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' + autom4te touch the output file, or create a stub one + 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] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +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 + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# 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). This is about non-GNU programs, so use $1 not +# $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 $program 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid/openct-cm5121-librfid.patch b/librfid/openct-cm5121-librfid.patch new file mode 100644 index 0000000..1163cb6 --- /dev/null +++ b/librfid/openct-cm5121-librfid.patch @@ -0,0 +1,306 @@ +diff -Nru openct-0.6.7/src/ifd/Makefile.am openct-0.6.7-rfid/src/ifd/Makefile.am +--- openct-0.6.7/src/ifd/Makefile.am 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/Makefile.am 2006-05-27 19:32:21.000000000 +0200 +@@ -20,7 +20,7 @@ + ifd-wbeiuu.c \ + \ + proto-gbp.c proto-sync.c proto-t0.c proto-t1.c \ +- proto-trans.c \ ++ proto-trans.c proto-escape.c \ + \ + sys-sunray.c sys-solaris.c sys-bsd.c sys-linux.c sys-null.c sys-osx.c \ + \ +diff -Nru openct-0.6.7/src/ifd/ifd-ccid.c openct-0.6.7-rfid/src/ifd/ifd-ccid.c +--- openct-0.6.7/src/ifd/ifd-ccid.c 2006-04-24 21:52:03.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/ifd-ccid.c 2006-05-27 19:46:29.000000000 +0200 +@@ -5,6 +5,9 @@ + * + * 2005-04-20: Harald Welte + * Add support for PCMCIA based CCID Device (CardMan 4040) ++ * ++ * 2005-05-22: Harald Welte ++ * Add suport for OmniKey Cardman 5121 RFID extensions + */ + + #include "internal.h" +@@ -122,6 +125,7 @@ + + #define SUPPORT_T0 0x1 + #define SUPPORT_T1 0x2 ++#define SUPPORT_ESCAPE 0x80 + + #define SUPPORT_50V 1 + #define SUPPORT_33V 2 +@@ -740,6 +744,12 @@ + st->reader_type = TYPE_TPDU; + } + ++ if (de.idVendor == 0x076b && de.idProduct == 0x5121) { ++ /* special handling of RFID part of OmniKey 5121 */ ++ reader->nslots++; /* one virtual slot for RFID escape */ ++ st->proto_support |= SUPPORT_ESCAPE; ++ } ++ + return 0; + } + +@@ -816,6 +826,13 @@ + int any = 0; + int i, j, bits, stat; + ++ if (st->proto_support & SUPPORT_ESCAPE ++ && slot == reader->nslots-1) { ++ ifd_debug(1, "virtual escape slot, setting card present\n"); ++ *status = IFD_CARD_PRESENT; ++ return 0; ++ } ++ + i = 1 + (slot / 4); + j = 2 * (slot % 4); + stat = 0; +@@ -880,6 +897,8 @@ + return 0; + } + ++static int ccid_set_protocol(ifd_reader_t *reader, int s, int proto); ++ + /* + * Reset + */ +@@ -898,6 +917,13 @@ + if (!(status & IFD_CARD_PRESENT)) + return IFD_ERROR_NO_CARD; + ++ if (st->proto_support & SUPPORT_ESCAPE ++ && slot == reader->nslots-1) { ++ ifd_debug(1, "slot: %d, setting atr to 0xff", slot); ++ *((char *)atr) = 0xff; ++ ccid_set_protocol(reader, slot, IFD_PROTOCOL_ESCAPE); ++ return 1; ++ } + memset(ctlbuf, 0, 3); + + n = -1; +@@ -940,6 +966,17 @@ + ifd_atr_info_t atr_info; + int r; + ++ slot = &reader->slot[s]; ++ ++ /* If we support RFID escaping, we only allow ESCAPE protocol ++ * at the last (== virtual) slot */ ++ if ((st->proto_support & SUPPORT_ESCAPE) ++ && (proto != IFD_PROTOCOL_ESCAPE) ++ && (s == reader->nslots-1)) { ++ ct_error("reader doesn't support this protocol at this slot\n"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ + switch (proto) { + case IFD_PROTOCOL_T0: + if (!(st->proto_support & SUPPORT_T0)) { +@@ -953,13 +990,36 @@ + return IFD_ERROR_NOT_SUPPORTED; + } + break; ++ case IFD_PROTOCOL_ESCAPE: ++ /* virtual "escape" fallthrough protocol for stacking RFID ++ * protocol stack on top of openct */ ++ if (!(st->proto_support & SUPPORT_ESCAPE)) { ++ ct_error("reader does not support this protocol"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ if (s != reader->nslots-1) { ++ ct_error("reader doesn't support this protocol at this slot"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ p = ifd_protocol_new(IFD_PROTOCOL_ESCAPE,reader, slot->dad); ++ if (!p) { ++ ct_error("%s: internal error", reader->name); ++ return -1; ++ } ++ if (slot->proto) { ++ ifd_protocol_free(slot->proto); ++ slot->proto = NULL; ++ } ++ slot->proto = p; ++ st->icc_proto[s] = proto; ++ ifd_debug(1, "set protocol to ESCAPE\n"); ++ return 0; ++ break; + default: + ct_error("protocol unknown"); + return IFD_ERROR_NOT_SUPPORTED; + } + +- slot = &reader->slot[s]; +- + if (st->reader_type == TYPE_APDU) { + p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, + reader, slot->dad); +@@ -1103,6 +1163,27 @@ + return 0; + } + ++static int ccid_escape(ifd_reader_t *reader, int slot, void *sbuf, ++ size_t slen, void *rbuf, size_t rlen) ++{ ++ unsigned char sendbuf[CCID_MAX_MSG_LEN]; ++ unsigned char recvbuf[CCID_MAX_MSG_LEN]; ++ int r; ++ ++ ifd_debug(1, "slot: %d, slen %d, rlen %d", slot, slen, rlen); ++ ++ r = ccid_prepare_cmd(reader, sendbuf, sizeof(sendbuf), slot, ++ CCID_CMD_ESCAPE, NULL, sbuf, slen); ++ if (r < 0) ++ return r; ++ ++ r = ccid_command(reader, &sendbuf[0], r, recvbuf, sizeof(recvbuf)); ++ if (r < 0) ++ return r; ++ ++ return ccid_extract_data(&recvbuf, r, rbuf, rlen); ++} ++ + static int + ccid_transparent(ifd_reader_t * reader, int slot, + const void *sbuf, size_t slen, void *rbuf, size_t rlen) +@@ -1177,6 +1258,7 @@ + ccid_driver.transparent = ccid_transparent; + ccid_driver.send = ccid_send; + ccid_driver.recv = ccid_recv; ++ ccid_driver.escape = ccid_escape; + + ifd_driver_register("ccid", &ccid_driver); + } +diff -Nru openct-0.6.7/src/ifd/init.c openct-0.6.7-rfid/src/ifd/init.c +--- openct-0.6.7/src/ifd/init.c 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/init.c 2006-05-27 19:32:21.000000000 +0200 +@@ -54,6 +54,7 @@ + ifd_protocol_register(&ifd_protocol_2wire); + ifd_protocol_register(&ifd_protocol_3wire); + ifd_protocol_register(&ifd_protocol_eurochip); ++ ifd_protocol_register(&ifd_protocol_esc); + + if (ifd_conf_get_integer("debug", &ival) >= 0 && ival > ct_config.debug) + ct_config.debug = ival; +diff -Nru openct-0.6.7/src/ifd/internal.h openct-0.6.7-rfid/src/ifd/internal.h +--- openct-0.6.7/src/ifd/internal.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/internal.h 2006-05-27 19:32:21.000000000 +0200 +@@ -118,6 +118,7 @@ + extern struct ifd_protocol_ops ifd_protocol_2wire; + extern struct ifd_protocol_ops ifd_protocol_3wire; + extern struct ifd_protocol_ops ifd_protocol_eurochip; ++extern struct ifd_protocol_ops ifd_protocol_esc; + + extern void ifd_acr30u_register(void); + extern void ifd_cardman_register(void); +diff -Nru openct-0.6.7/src/ifd/proto-escape.c openct-0.6.7-rfid/src/ifd/proto-escape.c +--- openct-0.6.7/src/ifd/proto-escape.c 1970-01-01 01:00:00.000000000 +0100 ++++ openct-0.6.7-rfid/src/ifd/proto-escape.c 2006-05-27 19:32:21.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * Escape protocol - simply pass everything to the reader driver's escape() ++ * ++ * This is required for exporting access to vendor-specific CCID extensions, ++ * such as the Omnikey CardMan 5121 RFID support. ++ * ++ * The higher-level applications select a virtual slot (the last available slot ++ * number). This virtual slot will automatically get the IFD_PROTOCOL_ESCAPE ++ * assgigned to it and can then be used to transceive() data to/from the CCID. ++ * ++ * It's a bit ugly, but I was unable to come up with something cleaner. ++ * ++ * Copyright (C) 2005, Harald Welte ++ */ ++ ++#include "internal.h" ++#include ++#include ++#include ++ ++static int ++escape_init(ifd_protocol_t *prot) ++{ ++ ifd_reader_t *reader = prot->reader; ++ const ifd_driver_t *drv; ++ ++ if (!reader || !(drv = reader->driver) ++ || !drv->ops || !drv->ops->escape) ++ return -1; ++ return 0; ++} ++ ++static void ++escape_release(ifd_protocol_t *prot) ++{ ++ /* NOP */ ++} ++ ++static int ++escape_set_param(ifd_protocol_t *prot, int type, long value) ++{ ++ ct_error("set_pameter not supported"); ++ return -1; ++} ++ ++static int ++escape_get_param(ifd_protocol_t *prot, int type, long *result) ++{ ++ ct_error("get_pameter not supported"); ++ return -1; ++} ++ ++static int ++escape_transceive(ifd_protocol_t *prot, int dad, ++ const void *sbuf, size_t slen, ++ void *rbuf, size_t rlen) ++{ ++ ifd_reader_t *reader = prot->reader; ++ const ifd_driver_t *drv = reader->driver; ++ ++ return drv->ops->escape(reader, dad, sbuf, slen, rbuf, rlen); ++} ++ ++struct ifd_protocol_ops ifd_protocol_esc = { ++ IFD_PROTOCOL_ESCAPE, /* id */ ++ "escape", /* name */ ++ sizeof(ifd_protocol_t), /* size */ ++ escape_init, /* init */ ++ escape_release, /* release */ ++ escape_set_param, /* set_param */ ++ escape_get_param, /* get_param */ ++ NULL, /* resynchronize */ ++ escape_transceive, /* transceive */ ++ NULL, /* sync_read */ ++ NULL, /* sync_write */ ++}; ++ +diff -Nru openct-0.6.7/src/include/openct/driver.h openct-0.6.7-rfid/src/include/openct/driver.h +--- openct-0.6.7/src/include/openct/driver.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/include/openct/driver.h 2006-05-27 19:32:21.000000000 +0200 +@@ -318,6 +318,11 @@ + int (*sync_write)(ifd_reader_t *reader, int slot, int proto, + unsigned short addr, + const unsigned char *sbuf, size_t slen); ++ ++ /*Support for transparent access to "escape" */ ++ int (*escape)(ifd_reader_t *reader, int slot, ++ void *sbuf, size_t slen, ++ void *rbuf, size_t rlen); + }; + + extern void ifd_driver_register(const char *, +diff -Nru openct-0.6.7/src/include/openct/ifd.h openct-0.6.7-rfid/src/include/openct/ifd.h +--- openct-0.6.7/src/include/openct/ifd.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/include/openct/ifd.h 2006-05-27 19:42:54.000000000 +0200 +@@ -29,6 +29,8 @@ + IFD_PROTOCOL_TLP, /* older Gemplus protocol */ + IFD_PROTOCOL_GBP, /* Gemplus block protocol */ + IFD_PROTOCOL_EUROCHIP, /* Eurochip Countercard */ ++ IFD_PROTOCOL_TCL, /* ISO 14443-4 T=CL */ ++ IFD_PROTOCOL_ESCAPE, /* Virtual 'escape' protocol */ + IFD_PROTOCOL_TRANSPARENT = 128 + }; + diff --git a/librfid/pegoda/Makefile b/librfid/pegoda/Makefile new file mode 100644 index 0000000..7310022 --- /dev/null +++ b/librfid/pegoda/Makefile @@ -0,0 +1,8 @@ + +all: pegoda + +pegoda: pegoda.o + $(CC) -lusb -o $@ $^ + +clean: + rm -f pegoda *.o diff --git a/librfid/pegoda/pegoda.c b/librfid/pegoda/pegoda.c new file mode 100644 index 0000000..7422efe --- /dev/null +++ b/librfid/pegoda/pegoda.c @@ -0,0 +1,298 @@ +/* + * (C) 2005 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + + +#include +#include +#include +#include +#include + +#include +#include "pegoda.h" + +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +struct pegoda_handle { + struct usb_dev_handle *handle; + unsigned char seq; + unsigned char snr[4]; +}; + + +struct usb_device *find_device(u_int16_t vendor, u_int16_t device) +{ + struct usb_bus *bus; + + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + for (dev = bus->devices; dev; dev = dev->next) { + if (dev->descriptor.idVendor == vendor && + dev->descriptor.idProduct == device) { + return dev; + } + } + } + return NULL; +} + +int pegoda_transceive(struct pegoda_handle *ph, + u_int8_t cmd, unsigned char *tx, unsigned int tx_len, + unsigned char *rx, unsigned int *rx_len) +{ + unsigned char txbuf[256]; + unsigned char rxbuf[256]; + int rc; + unsigned int len_expected; + struct pegoda_cmd_hdr *hdr = (struct pegoda_cmd_hdr *)txbuf; + struct pegoda_cmd_hdr *rxhdr = (struct pegoda_cmd_hdr *)rxbuf; + + hdr->seq = ++(ph->seq); + hdr->cmd = cmd; + hdr->len = htons(tx_len); + memcpy(txbuf + sizeof(*hdr), tx, tx_len); + + printf("tx [%u]: %s\n", tx_len+sizeof(*hdr), + hexdump(txbuf, tx_len + sizeof(*hdr))); + rc = usb_bulk_write(ph->handle, 0x02, (char *)txbuf, + tx_len + sizeof(*hdr), 0); + if (rc < 0) + return rc; + + rc = usb_bulk_read(ph->handle, 0x81, (char *)rxbuf, sizeof(rxbuf), 0); + if (rc <= 0) + return rc; + + if (rc != 2) { + fprintf(stderr, "unexpected: received %u bytes as length?\n"); + return -EIO; + } + printf("len [%u]: %s\n", rc, hexdump(rxbuf, rc)); + + len_expected = rxbuf[0]; + + if (len_expected > sizeof(rxbuf)) + return -EIO; + + rc = usb_bulk_read(ph->handle, 0x81, (char *)rxbuf, len_expected, 0); + if (rc <= 0) + return rc; + printf("rx [%u]: %s\n", rc, hexdump(rxbuf, rc)); + + if (rc < 4) + return -EIO; + + if (rxhdr->seq != hdr->seq) + return -EIO; + + *rx_len = ntohs(rxhdr->len); + + memcpy(rx, rxbuf+sizeof(*rxhdr), rc-sizeof(*rxhdr)); + + return rxhdr->cmd; +} + +struct pegoda_handle *pegoda_open(void) +{ + struct usb_device *pegoda; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + struct pegoda_handle *ph; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + + pegoda = find_device(USB_VENDOR_PHILIPS, USB_DEVICE_PEGODA); + + if (!pegoda) + return NULL; + + ph = malloc(sizeof(*ph)); + if (!ph) + return NULL; + memset(ph, 0, sizeof(*ph)); + + printf("found pegoda, %u configurations\n", + pegoda->descriptor.bNumConfigurations); + + printf("config 2 [nr %u] has %u interfaces\n", + pegoda->config[1].bConfigurationValue, + pegoda->config[1].bNumInterfaces); + + printf("config 2 interface 0 has %u altsettings\n", + pegoda->config[1].interface[0].num_altsetting); + + ph->handle = usb_open(pegoda); + if (!ph->handle) + goto out_free; + + if (usb_set_configuration(ph->handle, 2)) + goto out_free; + + printf("configuration 2 successfully set\n"); + + if (usb_claim_interface(ph->handle, 0)) + goto out_free; + + printf("interface 0 claimed\n"); + + if (usb_set_altinterface(ph->handle, 1)) + goto out_free; + + printf("alt setting 1 selected\n"); + + pegoda_transceive(ph, PEGODA_CMD_PCD_CONFIG, NULL, 0, rbuf, &rlen); + + return ph; +out_free: + free(ph); + return NULL; +} + +/* Transform crypto1 key from generic 6byte into rc632 specific 12byte */ +static int +mifare_transform_key(const u_int8_t *key6, u_int8_t *key12) +{ + int i; + u_int8_t ln; + u_int8_t hn; + + for (i = 0; i < 6; i++) { + ln = key6[i] & 0x0f; + hn = key6[i] >> 4; + key12[i * 2 + 1] = (~ln << 4) | ln; + key12[i * 2] = (~hn << 4) | hn; + } + return 0; +} + +static int pegoda_auth_e2(struct pegoda_handle *ph, + u_int8_t keynr, u_int8_t sector) +{ + unsigned char buf[3]; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + + buf[0] = 0x60; + buf[1] = keynr; /* key number */ + buf[2] = sector; /* sector */ + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH, buf, 3, rbuf, &rlen); + + /* FIXME: check response */ + + return 0; +} + +static int pegoda_auth_key(struct pegoda_handle *ph, + u_int8_t sector, const unsigned char *key6) +{ + unsigned char buf[1+4+12+1]; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + + buf[0] = 0x60; + memcpy(buf+1, ph->snr, 4); + mifare_transform_key(key6, buf+5); + buf[17] = sector; + + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH_KEY, buf, 18, rbuf, &rlen); + + /* FIXME: check response */ + + return 0; +} + +static int pegoda_read16(struct pegoda_handle *ph, + u_int8_t page, unsigned char *rx) +{ + int rc; + unsigned int rlen = 16; + + rc = pegoda_transceive(ph, PEGODA_CMD_PICC_READ, + &page, 1, rx, &rlen); + if (rlen != 16) + return -EIO; + + return 0; +} + +int main(int argc, char **argv) +{ + unsigned char buf[256]; + unsigned char rbuf[256]; + unsigned int rlen = sizeof(rbuf); + struct pegoda_handle *ph; + int i; + + ph = pegoda_open(); + if (!ph) + exit(1); + + /* LED off */ + buf[0] = 0x00; + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_SWITCH_LED, buf, 1, rbuf, &rlen); + + /* anticollision */ + + buf[0] = 0x26; + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_COMMON_REQUEST, + buf, 1, rbuf, &rlen); + + buf[0] = 0x93; + memset(buf+1, 0, 5); + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_ANTICOLL, + buf, 6, rbuf, &rlen); + + memcpy(ph->snr, rbuf, 4); + + buf[0] = 0x93; + memcpy(buf+1, ph->snr, 4); + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_SELECT, + buf, 5, rbuf, &rlen); + + for (i = 0; i < 16; i++) { + int j; + pegoda_auth_key(ph, i, "\xff\xff\xff\xff\xff\xff"); + for (j = 0; j < 4; j++) { + pegoda_read16(ph, (i*4)+j, rbuf); + printf("read16[%u:%u] = %s\n", i,j,hexdump(rbuf, 16)); + } + } + + exit(0); +} diff --git a/librfid/pegoda/pegoda.h b/librfid/pegoda/pegoda.h new file mode 100644 index 0000000..0f250a6 --- /dev/null +++ b/librfid/pegoda/pegoda.h @@ -0,0 +1,140 @@ +#ifndef _PEGODA_H +#define _PEGODA_H +/* + * (C) 2005 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#define USB_VENDOR_PHILIPS 0x0742 +#define USB_DEVICE_PEGODA 0xff01 + +/* header of a pegoda usb command packet */ +struct pegoda_cmd_hdr { + u_int8_t seq; + u_int8_t cmd; + u_int16_t len; +}; + +enum { + PEGODA_CMD_WRITE_RC = 0x01, + PEGODA_CMD_READ_RC = 0x02, + PEGODA_CMD_EXCHANGE_BYTESTREAM = 0x03, + PEGODA_CMD_WRITE_MULTIPLE = 0x04, + PEGODA_CMD_READ_MULTIPLE = 0x05, + PEGODA_CMD_READ_WORD = 0x06, + + + PEGODA_CMD_PCD_CONFIG = 0x10, + PEGODA_CMD_PICC_REQUEST = 0x11, + PEGODA_CMD_PICC_ANTICOLL = 0x12, + PEGODA_CMD_PICC_SELECT = 0x13, + PEGODA_CMD_PICC_AUTH = 0x14, + PEGODA_CMD_PICC_AUTH_E2 = 0x15, + PEGODA_CMD_LOAD_KEY_E2 = 0x17, + PEGODA_CMD_PICC_AUTH_KEY = 0x18, + PEGODA_CMD_PICC_READ = 0x19, + PEGODA_CMD_PICC_WRITE = 0x1a, + PEGODA_CMD_PICC_VALUE = 0x1b, + PEGODA_CMD_PICC_VALUE_DEBIT = 0x1c, + PEGODA_CMD_PICC_HALT = 0x1d, + PEGODA_CMD_PICC_WRITE4 = 0x1e, + PEGODA_CMD_PICC_COMMON_WRITE = 0x1f, + + PEGODA_CMD_PCD_RF_RESET = 0x20, + PEGODA_CMD_PCD_RESET = 0x21, + PEGODA_CMD_PCD_GET_SNR = 0x22, + PEGODA_CMD_PCD_READ_E2 = 0x23, + PEGODA_CMD_PCD_SET_TMO = 0x27, + PEGODA_CMD_PICC_COMMON_READ = 0x28, + PEGODA_CMD_PCD_INITIALIZE_E2 = 0x29, + PEGODA_CMD_ACTIVE_ANTENNA_MASTER = 0x2a, + PEGODA_CMD_ACTIVE_ANTENNA_SLAVE = 0x2b, + + PEGODA_CMD_HOST_TRANS_TMR_START = 0x30, + PEGODA_CMD_HOST_TRANS_TMR_STOP = 0x31, + PEGODA_CMD_HOST_GET_EXEC_TIME = 0x32, + + PEGODA_CMD_PICC_COMMON_REQUEST = 0x40, + PEGODA_CMD_PICC_CASC_ANTICOLL = 0x41, + PEGODA_CMD_PICC_CASC_SELECT = 0x42, + PEGODA_CMD_PICC_ACTIVATE_IDLE = 0x43, + PEGODA_CMD_PICC_ACTIVATE_WAKEUP = 0x44, + PEGODA_CMD_PCD_SET_DEFAULT_ATTRIB = 0x45, + PEGODA_CMD_PCD_SET_ATTRIB = 0x46, + PEGODA_CMD_PCD_GET_ATTRIB = 0x47, + PEGODA_CMD_PICC_EXCHANGE_BLOCK = 0x48, + PEGODA_CMD_PICC_ACTIVATE_IDLE_LOOP = 0x49, + PEGODA_CMD_PICC_ACTTIVATION = 0x4a, + PEGODA_CMD_PCD_ENABLE_HIGH_BAUD_RATES = 0x4b, + + PEGODA_CMD_SWITCH_LED = 0x60, + PEGODA_CMD_TEST_FLASH_NR = 0x61, + PEGODA_CMD_START_DOWNLOAD = 0x62, + PEGODA_CMD_GET_FW_VERSION = 0x63, + PEGODA_CMD_GET_RIC_VERSION = 0x64, + PEGODA_CMD_ENABLE_DEBUG_PINS = 0x65, + PEGODA_CMD_MIRROR_DATA = 0x66, + PEGODA_CMD_TEST_CMDS = 0x67, + + PEGODA_CMD_TEST_PCD = 0x70, + PEGODA_CMD_TEST_PICC = 0x71, + PEGODA_CMD_GET_ONLINE_STATUS = 0x72, + + PEGODA_CMD_I1_PCD_CONFIG = 0x80, + PEGODA_CMD_I1_INIT_STD_MODE = 0x81, + PEGODA_CMD_I1_CALC_TSE_HASH = 0x82, + PEGODA_CMD_I1_INIT_FAST_MODE = 0x83, + PEGODA_CMD_I1_OUTPUT_READ = 0x85, + PEGODA_CMD_I1_OUTPUT_ANTICOL_SELECT = 0x86, + PEGODA_CMD_I1_OUTPUT_WRITE = 0x87, + PEGODA_CMD_I1_OUTPUT_HALT = 0x88, + PEGODA_CMD_I1_OUTPUT_EAS = 0x89, + PEGODA_CMD_I1_RESET_QUIET = 0x8a, + PEGODA_CMD_I1_PCD_RF_RESET = 0x8b, + PEGODA_CMD_I1_SET_BIT_PHASE = 0x8c, + + PEGODA_CMD_I2_INIT_STD_MODE = 0x90, + PEGODA_CMD_I2_INIT_FAST_MODE = 0x91, + PEGODA_CMD_15693_READ_SM = 0x92, + PEGODA_CMD_15693_INVENTORY = 0x93, + PEGODA_CMD_15693_WRITE_SM = 0x94, + PEGODA_CMD_15693_STAY_QUIET = 0x95, + PEGODA_CMD_15693_LOCK_BLOCK = 0x96, + PEGODA_CMD_15693_SELECT = 0x97, + PEGODA_CMD_15693_RESET_TO_READY = 0x98, + PEGODA_CMD_15693_WRITE_AFI = 0x99, + PEGODA_CMD_15693_LOCK_AFI = 0x9a, + PEGODA_CMD_15693_WRITE_DSFID = 0x9b, + PEGODA_CMD_15693_LOCK_DSFID = 0x9c, + PEGODA_CMD_15693_GET_SYSTEM_INFO = 0x9d, + PEGODA_CMD_15693_GET_MULTI_BLOCK_SEC = 0x9e, + PEGODA_CMD_15693_INVENTORY_READ = 0x9f, + PEGODA_CMD_15693_FAST_INVENTORY_READ = 0xa0, + PEGODA_CMD_15693_SET_EAS = 0xa1, + PEGODA_CMD_15693_RESET_EAS = 0xa2, + PEGODA_CMD_15693_LOCK_EAS = 0xa3, + PEGODA_CMD_15693_EAS_ALARM = 0xa4, + + PEGODA_CMD_PC_PCD_CONFIG = 0xb0, + PEGODA_CMD_PC_BEGIN_ROUND = 0xb1, + PEGODA_CMD_PC_WRITE = 0xb3, + + PEGODA_CMD_UID_PCD_CONFIG = 0xb8, + PEGODA_CMD_UID_BEGIN_ROUND = 0xb9, + PEGODA_CMD_UID_WRITE = 0xba, + PEGODA_CMD_UID_DESTROY = 0xbb, +}; + +#endif diff --git a/librfid/python/Makefile b/librfid/python/Makefile new file mode 100644 index 0000000..93a4fe9 --- /dev/null +++ b/librfid/python/Makefile @@ -0,0 +1,51 @@ +# Makefile for Python bindings +# (C) 2007-2008 by Kushal Das + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# as published by the Free Software Foundation + +# 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 + + + +CC=gcc +PYTHON=python +PREFIX=/usr +PYTHON_VER=2.5 +PYTHON_INC=$(PREFIX)/include/python$(PYTHON_VER) +PYTHON_LIB=$(PREFIX)/lib/python$(PYTHON_VER)/site-packages/ +LIBRFID_DIR=../src/.libs + +SOURCE_MAIN=pyrfid.c +SOURCES=$(SOURCE_MAIN) openpcd.c +INCLUDES=-I$(PYTHON_INC) -I../include/ -I../utils/ +CFLAGS=-O3 -Wall $(INCLUDES) +LDFLAGS=-shared -L$(LIBRFID_DIR) -lrfid -lusb -Wl,--rpath -Wl,/usr/local/lib $(LIBS) +TARGET=$(SOURCE_MAIN:.c=.so) +OBJECTS=$(SOURCES:.c=.o) + +all: $(SOURCE_MAIN) $(TARGET) + +test: + $(PYTHON) $@.py + +install: $(TARGET) + install $(TARGET) $(PYTHON_LIB) + +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $(OBJECTS) + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJECTS) $(TARGET) + diff --git a/librfid/python/openpcd.c b/librfid/python/openpcd.c new file mode 100644 index 0000000..94962ab --- /dev/null +++ b/librfid/python/openpcd.c @@ -0,0 +1,345 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define BUILD_DLL +#include "openpcd.h" + +#define LIBMIFARE_MAGIC 0xDEADBEEF + +struct openpcd_state +{ + unsigned int magic; + unsigned int cl_auth; + struct rfid_reader_handle *rh; + struct rfid_layer2_handle *l2h; + struct rfid_protocol_handle *ph; + unsigned char key[MIFARE_CL_KEY_LEN]; + unsigned int uid; +} openpcd_state; + +int openpcd_cl_auth(struct openpcd_state* state ,int page) +{ + int rc; + + if(!state || page<=0 || page>MIFARE_CL_PAGE_MAX ) + return PCDERROR_INVALID_PARAMETER; + + if(!state->ph) + return PCDERROR_CLOSED; + + rc = mfcl_set_key(state->ph, state->key); + if (rc < 0) + return PCDERROR_KEY_FORMAT; + + rc = mfcl_auth(state->ph, state->cl_auth, page); + + return rc<0 ? PCDERROR_KEY_AUTH : PCDERROR_NONE; +} + +void Sleep(unsigned int ms ) { + usleep(ms*1000); +} + +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + switch(key_id) + { + case PCDAUTH_KEYID_1A: + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + break; + case PCDAUTH_KEYID_1B: + state->cl_auth=RFID_CMD_MIFARE_AUTH1B; + break; + default: + return PCDERROR_INVALID_PARAMETER; + } + + memcpy(state->key,key,MIFARE_CL_KEY_LEN); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle) +{ + int res; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + state->l2h = rfid_layer2_init(state->rh,RFID_LAYER2_ISO14443A); + if(!state->l2h) + res=PCDERROR_LAYER2_INIT; + else + { + if( rfid_layer2_open(state->l2h)>=0 ) + { + state->ph = rfid_protocol_init(state->l2h,RFID_PROTOCOL_MIFARE_CLASSIC); + + if(state->ph) + { + if(rfid_protocol_open(state->ph)>=0) + return PCDERROR_NONE; + + rfid_protocol_fini(state->ph); + state->ph=NULL; + + res=PCDERROR_LAYER3_OPEN; + } + else + res=PCDERROR_LAYER3_INIT; + + rfid_layer2_close(state->l2h); + } + else + res=PCDERROR_LAYER2_OPEN; + } + + rfid_layer2_fini(state->l2h); + state->l2h=NULL; + + return res; +} + +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + rfid_protocol_close(state->ph); + rfid_protocol_fini(state->ph); + rfid_layer2_close(state->l2h); + rfid_layer2_fini(state->l2h); + + state->ph=NULL; + state->l2h=NULL; + state->uid=0; + + return PCDERROR_NONE; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid) +{ + unsigned int uid_len; + struct openpcd_state *state; + + if(!handle || !uid) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + uid_len=sizeof(*uid); + if(rfid_layer2_getopt(state->l2h,RFID_OPT_LAYER2_UID,uid,&uid_len)) + return PCDERROR_INVALID_PARAMETER; + else + return uid_len==4 ? PCDERROR_NONE:PCDERROR_READ_FAILED; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle) +{ + struct rfid_reader_handle *rh; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if(!rh) + return PCDERROR_NO_READER; + + state=(struct openpcd_state*)malloc(sizeof(*state)); + if(state) + { + memset(state,0,sizeof(*state)); + state->magic=LIBMIFARE_MAGIC; + state->rh=rh; + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + memset(state->key,0xFF,sizeof(state->key)); + + // do initial reset + openpcd_reset_reader((MIFARE_HANDLE)state); + Sleep(1500); + // reopen + state->rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + + *handle=(MIFARE_HANDLE)state; + + return PCDERROR_NONE; + } + else + { + rfid_reader_close(rh); + return PCDERROR_OUT_OF_MEMORY; + } +} + +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + openpcd_deselect_card(handle); + + openpcd_reset_reader(handle); + Sleep(500); + + state->magic=0; + rfid_reader_close(state->rh); + free(state); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len) +{ + int res; + unsigned int count; + unsigned char buf[MIFARE_CL_PAGE_SIZE]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + count = sizeof(buf); + res = rfid_protocol_read(state->ph, page, buf, &count); + if(res>=0) + memcpy(data,buf,len); + + if ( res<0 ) + return PCDERROR_READ_FAILED; + else + return count; +} + +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len) +{ + int res; + unsigned char buf[16]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + memcpy(buf,data,len); + memset(&buf[len],0,sizeof(buf)-len); + + res = rfid_protocol_write(state->ph, page, buf, sizeof(buf)); + + return (res<0 && res!=-101) ? PCDERROR_WRITE_FAILED : len; +} + + +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->reset(state->rh)<0) ? PCDERROR_WRITE_FAILED : PCDERROR_NONE; +} + + +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error) +{ + const static char* msg[]={ + "PCDERROR_NONE", // 0 + "PCDERROR_INVALID_PARAMETER", // -1 + "PCDERROR_KEY_FORMAT", // -2 + "PCDERROR_KEY_AUTH", // -3 + "PCDERROR_NO_CARD_FOUND", // -4 + "PCDERROR_LAYER2_INIT", // -5 + "PCDERROR_LAYER2_OPEN", // -6 + "PCDERROR_LAYER3_INIT", // -7 + "PCDERROR_LAYER3_OPEN", // -8 + "PCDERROR_SELECT", // -9 + "PCDERROR_READ_FAILED", // -10 + "PCDERROR_WRITE_FAILED", // -11 + "PCDERROR_CLOSED", // -12 + "PCDERROR_NO_READER", // -13 + "PCDERROR_OUT_OF_MEMORY", // -14 + "PCDERROR_READER_VERSION" // -15 + }; + const int count=sizeof(msg)/sizeof(msg[0]); + + if(error>0) + error=0; + else + error=-error; + + return (error>=count) ? "PCDERROR_UNKNOWN" : (char*)msg[error]; +} diff --git a/librfid/python/openpcd.h b/librfid/python/openpcd.h new file mode 100644 index 0000000..8f17dc0 --- /dev/null +++ b/librfid/python/openpcd.h @@ -0,0 +1,141 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#ifndef __OPENPCD_H__ +#define __OPENPCD_H__ + +#ifdef __cplusplus +extern "C" { +#endif/*__cplusplus*/ +#define EXPORT extern +#define EXPORT_CONVENTION + +#define PCDERROR_NONE 0 +#define PCDERROR_INVALID_PARAMETER -1 +#define PCDERROR_KEY_FORMAT -2 +#define PCDERROR_KEY_AUTH -3 +#define PCDERROR_NO_CARD_FOUND -4 +#define PCDERROR_LAYER2_INIT -5 +#define PCDERROR_LAYER2_OPEN -6 +#define PCDERROR_LAYER3_INIT -7 +#define PCDERROR_LAYER3_OPEN -8 +#define PCDERROR_SELECT -9 +#define PCDERROR_READ_FAILED -10 +#define PCDERROR_WRITE_FAILED -11 +#define PCDERROR_CLOSED -12 +#define PCDERROR_NO_READER -13 +#define PCDERROR_OUT_OF_MEMORY -14 +#define PCDERROR_READER_VERSION -15 + +#define PCDAUTH_KEY_LENGTH 6 +#define PCDAUTH_KEYID_1A 0 +#define PCDAUTH_KEYID_1B 1 + +typedef void* MIFARE_HANDLE; + +/*************************************************************************/ +/* */ +/* Six steps for reading/writing to MIFARE cards */ +/* */ +/*************************************************************************/ + +/* Step 1. open reader + + supply the address of your handle variable to retrieve a handle + to the current reader. + */ +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle); + +/* Step 2. set MIFARE classic key + + if your key differs from the default Infineon key (6*0xFF), you can + supply a different key here. The key size is PCDAUTH_KEY_LENGTH bytes. + You can chose to set key_id to PCDAUTH_KEYID_1A or *_1B. + */ +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key); + +/* Step 3. select card + + start the anticollosion to select a card in the reader field - retry if + it fails. Currently supports only on card in the readerv field. + */ +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle); + +/* Step 4. read/write card + + read, write from the selected card - specify the page and supply up to + 16 bytes of payload + */ +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len); +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len); + +/* Step 5. deselect card when done + */ +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle); + +/* Step 6. close reader after deselected card + */ +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle); + + +/*************************************************************************/ +/* */ +/* Support functions */ +/* */ +/*************************************************************************/ + +/* openpcd_get_error_text: + + Used for converting the error code into a string + */ +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error); + + +/* openpcd_get_card_id: + + Get the card id of a selected RFID card + */ +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid); + + +/* openpcd_reset_reader: + + Reset the attached reader + */ +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle); + +#ifdef __cplusplus +} +#endif/*__cplusplus*/ +#endif/*__OPENPCD_H__*/ diff --git a/librfid/python/pyrfid.c b/librfid/python/pyrfid.c new file mode 100644 index 0000000..f1feacd --- /dev/null +++ b/librfid/python/pyrfid.c @@ -0,0 +1,128 @@ +/* Python bindings for librfid + * (C) 2007-2008 by Kushal Das + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +/*#include */ +#include "openpcd.h" +#include +static PyObject *pyi_open(PyObject *self, PyObject *args); +static PyObject *pyi_close(PyObject *self, PyObject *args); +static PyObject *pyi_select_card(PyObject *self, PyObject *args); +static PyObject *pyi_deselect_card(PyObject *self, PyObject *args); +static PyObject *pyi_get_card_id(PyObject *self, PyObject *args); +static PyObject *pyi_openpcd_read(PyObject *self, PyObject *args); +static PyObject *pyi_openpcd_write(PyObject *self, PyObject *args); +static PyObject *pyi_set_key(PyObject *self, PyObject *args); + +static PyObject *pyi_Error; +MIFARE_HANDLE handle; + +static PyMethodDef pyi_Methods[] = { + {"open_reader", pyi_open, METH_VARARGS, + "This will initialise the RFID reader"}, + {"close_reader", pyi_close, METH_VARARGS, + "This will close the RFID reader"}, + {"select_card", pyi_select_card, METH_VARARGS, + "This will select any card"}, + {"read",pyi_openpcd_read, METH_VARARGS, + "This will read the card with given page number"}, + {"write",pyi_openpcd_write, METH_VARARGS, + "This will write the card with given page number"}, + {"set_key",pyi_set_key, METH_VARARGS, + "This will set the key with given key"}, + {"deselect_card", pyi_deselect_card, METH_VARARGS, + "This will deselect any card"}, + {"get_card_id", pyi_get_card_id, METH_VARARGS, + "This will get the card id"}, + {NULL, NULL, 0, NULL} +}; + +PyMODINIT_FUNC initpyrfid() { + PyObject *m; + + m = Py_InitModule("pyrfid", pyi_Methods); + pyi_Error = PyErr_NewException("pyrfid.error", NULL, NULL); + Py_INCREF(pyi_Error); + PyModule_AddObject(m, "error", pyi_Error); + return; +} + +static PyObject *pyi_open(PyObject *self, PyObject *args) { + return Py_BuildValue("i",openpcd_open_reader(&handle)); +} + +static PyObject *pyi_close(PyObject *self, PyObject *args) { + return Py_BuildValue("i", openpcd_close_reader(handle)); +} + +static PyObject *pyi_select_card(PyObject *self, PyObject *args) { + return Py_BuildValue("i", openpcd_select_card(handle)); +} + +static PyObject *pyi_deselect_card(PyObject *self, PyObject *args) { + return Py_BuildValue("i", openpcd_deselect_card(handle)); +} + +static PyObject *pyi_openpcd_read(PyObject *self, PyObject *args) { + int ok, page; + char s[16]; + ok = PyArg_ParseTuple(args, "i", &page); + openpcd_read(handle, page, s, 16); + return Py_BuildValue("s", s); +} + + +static PyObject *pyi_openpcd_write(PyObject *self, PyObject *args) { + int ok, page, result; + char *s = "indianindianindi"; + ok = PyArg_ParseTuple(args, "is", &page, &s); + result = openpcd_write(handle, page, s, 16); + return Py_BuildValue("i", result); +} + +static PyObject *pyi_set_key(PyObject *self, PyObject *args) { + int ok, key, result; + char *s = "keykeykey"; + ok = PyArg_ParseTuple(args, "is", &key, &s); + result = openpcd_set_key(handle, key, s); + return Py_BuildValue("i", result); +} + +static PyObject *pyi_get_card_id(PyObject *self, PyObject *args) { + unsigned int uid; + int result; + result = openpcd_get_card_id(handle, &uid); + if (result == 0) + return Py_BuildValue("I", uid); + else + return Py_BuildValue("i", result); +} + diff --git a/librfid/python/test.py b/librfid/python/test.py new file mode 100644 index 0000000..447417a --- /dev/null +++ b/librfid/python/test.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + #Python bindings test file + #(C) 2007-2008 by Kushal Das + + #This program is free software; you can redistribute it and/or modify + #it under the terms of the GNU General Public License version 2 + #as published by the Free Software Foundation + + #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 + +import pyrfid + +pyrfid.open_reader() +pyrfid.select_card() +print "%08X" % (pyrfid.get_card_id()) +pyrfid.deselect_card() +pyrfid.close_reader() \ No newline at end of file diff --git a/librfid/src/.deps/ccid-driver.Plo b/librfid/src/.deps/ccid-driver.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/ccid-driver.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/libusb_dyn.Plo b/librfid/src/.deps/libusb_dyn.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/libusb_dyn.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid.Plo b/librfid/src/.deps/rfid.Plo new file mode 100644 index 0000000..87bb7a1 --- /dev/null +++ b/librfid/src/.deps/rfid.Plo @@ -0,0 +1,61 @@ +rfid.lo: rfid.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: diff --git a/librfid/src/.deps/rfid_access_mifare_classic.Plo b/librfid/src/.deps/rfid_access_mifare_classic.Plo new file mode 100644 index 0000000..1db2045 --- /dev/null +++ b/librfid/src/.deps/rfid_access_mifare_classic.Plo @@ -0,0 +1,30 @@ +rfid_access_mifare_classic.lo: rfid_access_mifare_classic.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_access_mifare_classic.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_access_mifare_classic.h: diff --git a/librfid/src/.deps/rfid_asic_rc632.Plo b/librfid/src/.deps/rfid_asic_rc632.Plo new file mode 100644 index 0000000..d4f1265 --- /dev/null +++ b/librfid/src/.deps/rfid_asic_rc632.Plo @@ -0,0 +1,92 @@ +rfid_asic_rc632.lo: rfid_asic_rc632.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/limits.h \ + ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_reader_cm5121.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_tagit.h rfid_iso14443_common.h rc632.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/limits.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader_cm5121.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_tagit.h: + +rfid_iso14443_common.h: + +rc632.h: diff --git a/librfid/src/.deps/rfid_iso14443_common.Plo b/librfid/src/.deps/rfid_iso14443_common.Plo new file mode 100644 index 0000000..d055a3f --- /dev/null +++ b/librfid/src/.deps/rfid_iso14443_common.Plo @@ -0,0 +1 @@ +rfid_iso14443_common.lo: rfid_iso14443_common.c diff --git a/librfid/src/.deps/rfid_layer2.Plo b/librfid/src/.deps/rfid_layer2.Plo new file mode 100644 index 0000000..7750781 --- /dev/null +++ b/librfid/src/.deps/rfid_layer2.Plo @@ -0,0 +1,45 @@ +rfid_layer2.lo: rfid_layer2.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: diff --git a/librfid/src/.deps/rfid_layer2_iso14443a.Plo b/librfid/src/.deps/rfid_layer2_iso14443a.Plo new file mode 100644 index 0000000..0a5be1d --- /dev/null +++ b/librfid/src/.deps/rfid_layer2_iso14443a.Plo @@ -0,0 +1,229 @@ +rfid_layer2_iso14443a.lo: rfid_layer2_iso14443a.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winerror.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/basetsd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/pshpack4.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/poppack.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wincon.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winbase.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wingdi.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winuser.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnls.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winver.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnetwk.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winreg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsvc.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/cderr.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/dde.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ddeml.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/dlgs.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/imm.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/lzexpand.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/mmsystem.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/nb30.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpc.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcdce.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/basetyps.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcdcep.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnsi.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnterr.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/shellapi.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/pshpack2.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winperf.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/commdlg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winspool.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ole2.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objbase.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcndr.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnsip.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objfwd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wtypes.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unknwn.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objidl.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/cguid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/olectlid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleauto.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleidl.h \ + ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winerror.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/basetsd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/pshpack4.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/poppack.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wincon.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winbase.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wingdi.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winuser.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnls.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winver.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winnetwk.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winreg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsvc.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/cderr.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/dde.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ddeml.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/dlgs.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/imm.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/lzexpand.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/mmsystem.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/nb30.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpc.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcdce.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/basetyps.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcdcep.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnsi.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnterr.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/shellapi.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/pshpack2.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winperf.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/commdlg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winspool.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ole2.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objbase.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcndr.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/rpcnsip.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objfwd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wtypes.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unknwn.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objidl.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/cguid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/olectlid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleauto.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleidl.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: diff --git a/librfid/src/.deps/rfid_layer2_iso14443b.Plo b/librfid/src/.deps/rfid_layer2_iso14443b.Plo new file mode 100644 index 0000000..a87d134 --- /dev/null +++ b/librfid/src/.deps/rfid_layer2_iso14443b.Plo @@ -0,0 +1,84 @@ +rfid_layer2_iso14443b.lo: rfid_layer2_iso14443b.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h rfid_iso14443_common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: + +rfid_iso14443_common.h: diff --git a/librfid/src/.deps/rfid_layer2_iso15693.Plo b/librfid/src/.deps/rfid_layer2_iso15693.Plo new file mode 100644 index 0000000..50d9895 --- /dev/null +++ b/librfid/src/.deps/rfid_layer2_iso15693.Plo @@ -0,0 +1,67 @@ +rfid_layer2_iso15693.lo: rfid_layer2_iso15693.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: diff --git a/librfid/src/.deps/rfid_proto_icode.Plo b/librfid/src/.deps/rfid_proto_icode.Plo new file mode 100644 index 0000000..d7cf1a9 --- /dev/null +++ b/librfid/src/.deps/rfid_proto_icode.Plo @@ -0,0 +1,77 @@ +rfid_proto_icode.lo: rfid_proto_icode.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_protocol.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h \ + ../include/librfid/rfid_protocol_icode.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: + +../include/librfid/rfid_protocol_icode.h: diff --git a/librfid/src/.deps/rfid_proto_mifare_classic.Plo b/librfid/src/.deps/rfid_proto_mifare_classic.Plo new file mode 100644 index 0000000..2231dd0 --- /dev/null +++ b/librfid/src/.deps/rfid_proto_mifare_classic.Plo @@ -0,0 +1,84 @@ +rfid_proto_mifare_classic.lo: rfid_proto_mifare_classic.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_protocol.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h rfid_iso14443_common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +rfid_iso14443_common.h: diff --git a/librfid/src/.deps/rfid_proto_mifare_ul.Plo b/librfid/src/.deps/rfid_proto_mifare_ul.Plo new file mode 100644 index 0000000..6e35920 --- /dev/null +++ b/librfid/src/.deps/rfid_proto_mifare_ul.Plo @@ -0,0 +1,76 @@ +rfid_proto_mifare_ul.lo: rfid_proto_mifare_ul.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_protocol.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h rfid_iso14443_common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: + +rfid_iso14443_common.h: diff --git a/librfid/src/.deps/rfid_proto_tagit.Plo b/librfid/src/.deps/rfid_proto_tagit.Plo new file mode 100644 index 0000000..d1daea6 --- /dev/null +++ b/librfid/src/.deps/rfid_proto_tagit.Plo @@ -0,0 +1,74 @@ +rfid_proto_tagit.lo: rfid_proto_tagit.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_protocol.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: diff --git a/librfid/src/.deps/rfid_proto_tcl.Plo b/librfid/src/.deps/rfid_proto_tcl.Plo new file mode 100644 index 0000000..3f5495d --- /dev/null +++ b/librfid/src/.deps/rfid_proto_tcl.Plo @@ -0,0 +1,84 @@ +rfid_proto_tcl.lo: rfid_proto_tcl.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_reader.h \ + rfid_iso14443_common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_reader.h: + +rfid_iso14443_common.h: diff --git a/librfid/src/.deps/rfid_protocol.Plo b/librfid/src/.deps/rfid_protocol.Plo new file mode 100644 index 0000000..ca76489 --- /dev/null +++ b/librfid/src/.deps/rfid_protocol.Plo @@ -0,0 +1,72 @@ +rfid_protocol.lo: rfid_protocol.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid_layer2.h ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: diff --git a/librfid/src/.deps/rfid_reader.Plo b/librfid/src/.deps/rfid_reader.Plo new file mode 100644 index 0000000..45b48b7 --- /dev/null +++ b/librfid/src/.deps/rfid_reader.Plo @@ -0,0 +1,55 @@ +rfid_reader.lo: rfid_reader.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_system.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h \ + ../include/librfid/rfid_reader_cm5121.h \ + ../include/librfid/rfid_reader_openpcd.h \ + ../include/librfid/rfid_reader_spidev.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader_cm5121.h: + +../include/librfid/rfid_reader_openpcd.h: + +../include/librfid/rfid_reader_spidev.h: diff --git a/librfid/src/.deps/rfid_reader_cm5121.Plo b/librfid/src/.deps/rfid_reader_cm5121.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/rfid_reader_cm5121.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid_reader_cm5121_ccid_direct.Plo b/librfid/src/.deps/rfid_reader_cm5121_ccid_direct.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/rfid_reader_cm5121_ccid_direct.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid_reader_cm5121_openct.Plo b/librfid/src/.deps/rfid_reader_cm5121_openct.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/rfid_reader_cm5121_openct.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid_reader_openpcd.Plo b/librfid/src/.deps/rfid_reader_openpcd.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/rfid_reader_openpcd.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid_reader_rc632_common.Plo b/librfid/src/.deps/rfid_reader_rc632_common.Plo new file mode 100644 index 0000000..47af2bf --- /dev/null +++ b/librfid/src/.deps/rfid_reader_rc632_common.Plo @@ -0,0 +1,49 @@ +rfid_reader_rc632_common.lo: rfid_reader_rc632_common.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \ + ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h rfid_reader_rc632_common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +rfid_reader_rc632_common.h: diff --git a/librfid/src/.deps/rfid_reader_spidev.Plo b/librfid/src/.deps/rfid_reader_spidev.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/rfid_reader_spidev.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/.deps/rfid_scan.Plo b/librfid/src/.deps/rfid_scan.Plo new file mode 100644 index 0000000..64cba1a --- /dev/null +++ b/librfid/src/.deps/rfid_scan.Plo @@ -0,0 +1,57 @@ +rfid_scan.lo: rfid_scan.c ../include/librfid/rfid.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + ../include/librfid/rfid_system.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso14443b.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_layer2_icode1.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_tcl.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_tagit.h + +../include/librfid/rfid.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +../include/librfid/rfid_system.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso14443b.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_layer2_icode1.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_tcl.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_tagit.h: diff --git a/librfid/src/.deps/usleep.Plo b/librfid/src/.deps/usleep.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/librfid/src/.deps/usleep.Plo @@ -0,0 +1 @@ +# dummy diff --git a/librfid/src/Makefile b/librfid/src/Makefile new file mode 100644 index 0000000..4babb40 --- /dev/null +++ b/librfid/src/Makefile @@ -0,0 +1,668 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# src/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/librfid.pc.in \ + $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +#am__append_5 = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include +#am__append_6 = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__ +am__append_7 = -DLIBRFID_STATIC +#am__append_8 = -DENABLE_OPENPCD +#am__append_9 = -DENABLE_SPIDEV +#am__append_10 = -DENABLE_CM5121 +#am__append_11 = -DENABLE_CM5121 +subdir = src +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 = librfid.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +librfid_la_DEPENDENCIES = +am__librfid_la_SOURCES_DIST = rfid.c rfid_layer2.c rfid_protocol.c \ + rfid_reader.c rfid_scan.c rfid_layer2_iso14443a.c \ + rfid_layer2_iso14443b.c rfid_iso14443_common.c \ + rfid_layer2_iso15693.c rfid_proto_tcl.c rfid_proto_mifare_ul.c \ + rfid_proto_mifare_classic.c rfid_proto_icode.c \ + rfid_proto_tagit.c rfid_asic_rc632.c \ + rfid_reader_rc632_common.c rfid_access_mifare_classic.c \ + usleep.c libusb_dyn.c rfid_reader_openpcd.c \ + rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c \ + ccid/ccid-driver.c ccid/ccid-driver.h \ + rfid_reader_cm5121_openct.c rfid_reader_spidev.c +am__objects_1 = rfid.lo rfid_layer2.lo rfid_protocol.lo rfid_reader.lo \ + rfid_scan.lo +am__objects_2 = rfid_layer2_iso14443a.lo rfid_layer2_iso14443b.lo \ + rfid_iso14443_common.lo rfid_layer2_iso15693.lo +am__objects_3 = rfid_proto_tcl.lo rfid_proto_mifare_ul.lo \ + rfid_proto_mifare_classic.lo rfid_proto_icode.lo \ + rfid_proto_tagit.lo +am__objects_4 = rfid_asic_rc632.lo rfid_reader_rc632_common.lo +am__objects_5 = rfid_access_mifare_classic.lo +#am__objects_6 = usleep.lo libusb_dyn.lo +#am__objects_7 = rfid_reader_openpcd.lo +#am__objects_8 = \ +# rfid_reader_cm5121.lo \ +# rfid_reader_cm5121_openct.lo +#am__objects_8 = rfid_reader_cm5121.lo \ +# rfid_reader_cm5121_ccid_direct.lo \ +# ccid-driver.lo +#am__objects_9 = rfid_reader_spidev.lo +am_librfid_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) $(am__objects_8) \ + $(am__objects_9) +librfid_la_OBJECTS = $(am_librfid_la_OBJECTS) +librfid_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_la_SOURCES) +DIST_SOURCES = $(am__librfid_la_SOURCES_DIST) +DATA = $(pkgconfig_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/src +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/src +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) \ + -D__LIBRFID__ $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_9) $(am__append_10) $(am__append_11) +INCLUDES = $(all_includes) -I$(top_srcdir)/include \ + $(am__append_5) +#AM_LDFLAGS = -mno-cygwin +noinst_HEADERS = rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h cm5121_source.h \ + rfid_reader_rc632_common.h + +CORE = rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c +L2 = rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_iso14443_common.c \ + rfid_layer2_iso15693.c + +PROTO = rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c \ + rfid_proto_icode.c rfid_proto_tagit.c + +ASIC = rfid_asic_rc632.c rfid_reader_rc632_common.c +MISC = rfid_access_mifare_classic.c +#WIN32 = usleep.c libusb_dyn.c +#AM_LDFLAGS_WIN32 = -mno-cygwin -lwinmm +#AM_CFLAGS_WIN32 = -mno-cygwin +#librfid_la_LIBADD = -lwinmm +#READER_OPENPCD = rfid_reader_openpcd.c +#READER_SPIDEV = rfid_reader_spidev.c +#READER_CM5121 = rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c ccid/ccid-driver.h +#READER_CM5121 = rfid_reader_cm5121.c rfid_reader_cm5121_openct.c +lib_LTLIBRARIES = librfid.la +librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) +librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) $(WIN32) \ + $(READER_OPENPCD) $(READER_CM5121) $(READER_SPIDEV) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = librfid.pc +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +librfid.pc: $(top_builddir)/config.status $(srcdir)/librfid.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +librfid.la: $(librfid_la_OBJECTS) $(librfid_la_DEPENDENCIES) + $(librfid_la_LINK) -rpath $(libdir) $(librfid_la_OBJECTS) $(librfid_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/ccid-driver.Plo +include ./$(DEPDIR)/libusb_dyn.Plo +include ./$(DEPDIR)/rfid.Plo +include ./$(DEPDIR)/rfid_access_mifare_classic.Plo +include ./$(DEPDIR)/rfid_asic_rc632.Plo +include ./$(DEPDIR)/rfid_iso14443_common.Plo +include ./$(DEPDIR)/rfid_layer2.Plo +include ./$(DEPDIR)/rfid_layer2_iso14443a.Plo +include ./$(DEPDIR)/rfid_layer2_iso14443b.Plo +include ./$(DEPDIR)/rfid_layer2_iso15693.Plo +include ./$(DEPDIR)/rfid_proto_icode.Plo +include ./$(DEPDIR)/rfid_proto_mifare_classic.Plo +include ./$(DEPDIR)/rfid_proto_mifare_ul.Plo +include ./$(DEPDIR)/rfid_proto_tagit.Plo +include ./$(DEPDIR)/rfid_proto_tcl.Plo +include ./$(DEPDIR)/rfid_protocol.Plo +include ./$(DEPDIR)/rfid_reader.Plo +include ./$(DEPDIR)/rfid_reader_cm5121.Plo +include ./$(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo +include ./$(DEPDIR)/rfid_reader_cm5121_openct.Plo +include ./$(DEPDIR)/rfid_reader_openpcd.Plo +include ./$(DEPDIR)/rfid_reader_rc632_common.Plo +include ./$(DEPDIR)/rfid_reader_spidev.Plo +include ./$(DEPDIR)/rfid_scan.Plo +include ./$(DEPDIR)/usleep.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +rfid_reader_cm5121_ccid_direct.lo: ccid/rfid_reader_cm5121_ccid_direct.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfid_reader_cm5121_ccid_direct.lo -MD -MP -MF $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c + $(am__mv) $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo +# source='ccid/rfid_reader_cm5121_ccid_direct.c' object='rfid_reader_cm5121_ccid_direct.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c + +ccid-driver.lo: ccid/ccid-driver.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ccid-driver.lo -MD -MP -MF $(DEPDIR)/ccid-driver.Tpo -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c + $(am__mv) $(DEPDIR)/ccid-driver.Tpo $(DEPDIR)/ccid-driver.Plo +# source='ccid/ccid-driver.c' object='ccid-driver.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES 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-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am 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-libLTLIBRARIES \ + uninstall-pkgconfigDATA + + +# 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: diff --git a/librfid/src/Makefile.am b/librfid/src/Makefile.am new file mode 100644 index 0000000..935fb4a --- /dev/null +++ b/librfid/src/Makefile.am @@ -0,0 +1,60 @@ +include $(top_srcdir)/Makefile.flags.am + +AM_CFLAGS += -D__LIBRFID__ +INCLUDES += @OPENCT_CFLAGS@ + +if ENABLE_FIRMWARE +INCLUDES += -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include +AM_CFLAGS += -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__ +endif + +if ENABLE_STATIC +AM_CFLAGS += -DLIBRFID_STATIC +endif + +noinst_HEADERS = rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h cm5121_source.h \ + rfid_reader_rc632_common.h + +CORE = rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c +L2 = rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_iso14443_common.c \ + rfid_layer2_iso15693.c +PROTO = rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c \ + rfid_proto_icode.c rfid_proto_tagit.c +ASIC = rfid_asic_rc632.c rfid_reader_rc632_common.c +MISC = rfid_access_mifare_classic.c + +if ENABLE_WIN32 +WIN32=usleep.c libusb_dyn.c +AM_LDFLAGS_WIN32=-mno-cygwin -lwinmm +AM_CFLAGS_WIN32=-mno-cygwin +librfid_la_LIBADD = -lwinmm +endif + +if HAVE_LIBUSB +READER_OPENPCD=rfid_reader_openpcd.c +AM_CFLAGS += -DENABLE_OPENPCD +endif + +if ENABLE_SPIDEV +READER_SPIDEV=rfid_reader_spidev.c +AM_CFLAGS += -DENABLE_SPIDEV +endif + +if ENABLE_CCID +READER_CM5121=rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c ccid/ccid-driver.h +AM_CFLAGS += -DENABLE_CM5121 +endif + +if HAVE_OPENCT +READER_CM5121=rfid_reader_cm5121.c rfid_reader_cm5121_openct.c +AM_CFLAGS += -DENABLE_CM5121 +endif + + +lib_LTLIBRARIES = librfid.la +librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@ +librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) $(WIN32) \ + $(READER_OPENPCD) $(READER_CM5121) $(READER_SPIDEV) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = librfid.pc diff --git a/librfid/src/Makefile.in b/librfid/src/Makefile.in new file mode 100644 index 0000000..6fb301a --- /dev/null +++ b/librfid/src/Makefile.in @@ -0,0 +1,668 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/librfid.pc.in \ + $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +@ENABLE_FIRMWARE_TRUE@am__append_5 = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include +@ENABLE_FIRMWARE_TRUE@am__append_6 = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__ +@ENABLE_STATIC_TRUE@am__append_7 = -DLIBRFID_STATIC +@HAVE_LIBUSB_TRUE@am__append_8 = -DENABLE_OPENPCD +@ENABLE_SPIDEV_TRUE@am__append_9 = -DENABLE_SPIDEV +@ENABLE_CCID_TRUE@am__append_10 = -DENABLE_CM5121 +@HAVE_OPENCT_TRUE@am__append_11 = -DENABLE_CM5121 +subdir = src +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 = librfid.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +librfid_la_DEPENDENCIES = +am__librfid_la_SOURCES_DIST = rfid.c rfid_layer2.c rfid_protocol.c \ + rfid_reader.c rfid_scan.c rfid_layer2_iso14443a.c \ + rfid_layer2_iso14443b.c rfid_iso14443_common.c \ + rfid_layer2_iso15693.c rfid_proto_tcl.c rfid_proto_mifare_ul.c \ + rfid_proto_mifare_classic.c rfid_proto_icode.c \ + rfid_proto_tagit.c rfid_asic_rc632.c \ + rfid_reader_rc632_common.c rfid_access_mifare_classic.c \ + usleep.c libusb_dyn.c rfid_reader_openpcd.c \ + rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c \ + ccid/ccid-driver.c ccid/ccid-driver.h \ + rfid_reader_cm5121_openct.c rfid_reader_spidev.c +am__objects_1 = rfid.lo rfid_layer2.lo rfid_protocol.lo rfid_reader.lo \ + rfid_scan.lo +am__objects_2 = rfid_layer2_iso14443a.lo rfid_layer2_iso14443b.lo \ + rfid_iso14443_common.lo rfid_layer2_iso15693.lo +am__objects_3 = rfid_proto_tcl.lo rfid_proto_mifare_ul.lo \ + rfid_proto_mifare_classic.lo rfid_proto_icode.lo \ + rfid_proto_tagit.lo +am__objects_4 = rfid_asic_rc632.lo rfid_reader_rc632_common.lo +am__objects_5 = rfid_access_mifare_classic.lo +@ENABLE_WIN32_TRUE@am__objects_6 = usleep.lo libusb_dyn.lo +@HAVE_LIBUSB_TRUE@am__objects_7 = rfid_reader_openpcd.lo +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@am__objects_8 = \ +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@ rfid_reader_cm5121.lo \ +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@ rfid_reader_cm5121_openct.lo +@ENABLE_CCID_TRUE@am__objects_8 = rfid_reader_cm5121.lo \ +@ENABLE_CCID_TRUE@ rfid_reader_cm5121_ccid_direct.lo \ +@ENABLE_CCID_TRUE@ ccid-driver.lo +@ENABLE_SPIDEV_TRUE@am__objects_9 = rfid_reader_spidev.lo +am_librfid_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) $(am__objects_8) \ + $(am__objects_9) +librfid_la_OBJECTS = $(am_librfid_la_OBJECTS) +librfid_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_la_SOURCES) +DIST_SOURCES = $(am__librfid_la_SOURCES_DIST) +DATA = $(pkgconfig_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) \ + -D__LIBRFID__ $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_9) $(am__append_10) $(am__append_11) +INCLUDES = $(all_includes) -I$(top_srcdir)/include @OPENCT_CFLAGS@ \ + $(am__append_5) +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +noinst_HEADERS = rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h cm5121_source.h \ + rfid_reader_rc632_common.h + +CORE = rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c +L2 = rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_iso14443_common.c \ + rfid_layer2_iso15693.c + +PROTO = rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c \ + rfid_proto_icode.c rfid_proto_tagit.c + +ASIC = rfid_asic_rc632.c rfid_reader_rc632_common.c +MISC = rfid_access_mifare_classic.c +@ENABLE_WIN32_TRUE@WIN32 = usleep.c libusb_dyn.c +@ENABLE_WIN32_TRUE@AM_LDFLAGS_WIN32 = -mno-cygwin -lwinmm +@ENABLE_WIN32_TRUE@AM_CFLAGS_WIN32 = -mno-cygwin +@ENABLE_WIN32_TRUE@librfid_la_LIBADD = -lwinmm +@HAVE_LIBUSB_TRUE@READER_OPENPCD = rfid_reader_openpcd.c +@ENABLE_SPIDEV_TRUE@READER_SPIDEV = rfid_reader_spidev.c +@ENABLE_CCID_TRUE@READER_CM5121 = rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c ccid/ccid-driver.h +@HAVE_OPENCT_TRUE@READER_CM5121 = rfid_reader_cm5121.c rfid_reader_cm5121_openct.c +lib_LTLIBRARIES = librfid.la +librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@ +librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) $(WIN32) \ + $(READER_OPENPCD) $(READER_CM5121) $(READER_SPIDEV) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = librfid.pc +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +librfid.pc: $(top_builddir)/config.status $(srcdir)/librfid.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +librfid.la: $(librfid_la_OBJECTS) $(librfid_la_DEPENDENCIES) + $(librfid_la_LINK) -rpath $(libdir) $(librfid_la_OBJECTS) $(librfid_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccid-driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_dyn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_access_mifare_classic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_asic_rc632.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_iso14443_common.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso14443a.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso14443b.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso15693.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_icode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_mifare_classic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_mifare_ul.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_tagit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_tcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_protocol.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121_openct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_openpcd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_rc632_common.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_spidev.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_scan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usleep.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +rfid_reader_cm5121_ccid_direct.lo: ccid/rfid_reader_cm5121_ccid_direct.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfid_reader_cm5121_ccid_direct.lo -MD -MP -MF $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccid/rfid_reader_cm5121_ccid_direct.c' object='rfid_reader_cm5121_ccid_direct.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c + +ccid-driver.lo: ccid/ccid-driver.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ccid-driver.lo -MD -MP -MF $(DEPDIR)/ccid-driver.Tpo -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ccid-driver.Tpo $(DEPDIR)/ccid-driver.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccid/ccid-driver.c' object='ccid-driver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES 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-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am 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-libLTLIBRARIES \ + uninstall-pkgconfigDATA + + +# 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: diff --git a/librfid/src/ccid/ccid-driver.c b/librfid/src/ccid/ccid-driver.c new file mode 100644 index 0000000..e440167 --- /dev/null +++ b/librfid/src/ccid/ccid-driver.c @@ -0,0 +1,2454 @@ +/* ccid-driver.c - USB ChipCardInterfaceDevices driver + * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + * Written by Werner Koch. + * + * This file is part of GnuPG. + * + * GnuPG 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. + * + * GnuPG 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. + * + * ALTERNATIVELY, this file may be distributed under the terms of the + * following license, in which case the provisions of this license are + * required INSTEAD OF the GNU General Public License. If you wish to + * allow use of your version of this file only under the terms of the + * GNU General Public License, and not to allow others to use your + * version of this file under the terms of the following license, + * indicate your decision by deleting this paragraph and the license + * below. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Date: 2005-09-09 13:18:08 +0200 (Fri, 09 Sep 2005) $ + */ + + +/* CCID (ChipCardInterfaceDevices) is a specification for accessing + smartcard via a reader connected to the USB. + + This is a limited driver allowing to use some CCID drivers directly + without any other specila drivers. This is a fallback driver to be + used when nothing else works or the system should be kept minimal + for security reasons. It makes use of the libusb library to gain + portable access to USB. + + This driver has been tested with the SCM SCR335 and SPR532 + smartcard readers and requires that a reader implements the TPDU + level exchange and does fully automatic initialization. +*/ + +#include + +#ifndef LIBRFID_FIRMWARE + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined(HAVE_LIBUSB) || defined(TEST) + +#include +#include +#include +#include +#include + +#include + +#include "ccid-driver.h" + +#define DRVNAME "ccid-driver: " + + +/* Depending on how this source is used we either define our error + output to go to stderr or to the jnlib based logging functions. We + use the latter when GNUPG_MAJOR_VERSION is defines or when both, + GNUPG_SCD_MAIN_HEADER and HAVE_JNLIB_LOGGING are defined. +*/ +#if defined(GNUPG_MAJOR_VERSION) \ + || (defined(GNUPG_SCD_MAIN_HEADER) && defined(HAVE_JNLIB_LOGGING)) + +#if defined(GNUPG_SCD_MAIN_HEADER) +# include GNUPG_SCD_MAIN_HEADER +#elif GNUPG_MAJOR_VERSION == 1 /* GnuPG Version is < 1.9. */ +# include "options.h" +# include "util.h" +# include "memory.h" +# include "cardglue.h" +# else /* This is the modularized GnuPG 1.9 or later. */ +# include "scdaemon.h" +#endif + + +# define DEBUGOUT(t) do { if (debug_level) \ + log_debug (DRVNAME t); } while (0) +# define DEBUGOUT_1(t,a) do { if (debug_level) \ + log_debug (DRVNAME t,(a)); } while (0) +# define DEBUGOUT_2(t,a,b) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b)); } while (0) +# define DEBUGOUT_3(t,a,b,c) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b),(c));} while (0) +# define DEBUGOUT_4(t,a,b,c,d) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b),(c),(d));} while (0) +# define DEBUGOUT_CONT(t) do { if (debug_level) \ + log_printf (t); } while (0) +# define DEBUGOUT_CONT_1(t,a) do { if (debug_level) \ + log_printf (t,(a)); } while (0) +# define DEBUGOUT_CONT_2(t,a,b) do { if (debug_level) \ + log_printf (t,(a),(b)); } while (0) +# define DEBUGOUT_CONT_3(t,a,b,c) do { if (debug_level) \ + log_printf (t,(a),(b),(c)); } while (0) +# define DEBUGOUT_LF() do { if (debug_level) \ + log_printf ("\n"); } while (0) + +#else /* Other usage of this source - don't use gnupg specifics. */ + +# define DEBUGOUT(t) do { if (debug_level) \ + fprintf (stderr, DRVNAME t); } while (0) +# define DEBUGOUT_1(t,a) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a)); } while (0) +# define DEBUGOUT_2(t,a,b) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b)); } while (0) +# define DEBUGOUT_3(t,a,b,c) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b), (c)); } while (0) +# define DEBUGOUT_4(t,a,b,c,d) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b), (c), (d));} while(0) +# define DEBUGOUT_CONT(t) do { if (debug_level) \ + fprintf (stderr, t); } while (0) +# define DEBUGOUT_CONT_1(t,a) do { if (debug_level) \ + fprintf (stderr, t, (a)); } while (0) +# define DEBUGOUT_CONT_2(t,a,b) do { if (debug_level) \ + fprintf (stderr, t, (a), (b)); } while (0) +# define DEBUGOUT_CONT_3(t,a,b,c) do { if (debug_level) \ + fprintf (stderr, t, (a), (b), (c)); } while (0) +# define DEBUGOUT_LF() do { if (debug_level) \ + putc ('\n', stderr); } while (0) + +#endif /* This source not used by scdaemon. */ + + + +enum { + RDR_to_PC_NotifySlotChange= 0x50, + RDR_to_PC_HardwareError = 0x51, + + PC_to_RDR_SetParameters = 0x61, + PC_to_RDR_IccPowerOn = 0x62, + PC_to_RDR_IccPowerOff = 0x63, + PC_to_RDR_GetSlotStatus = 0x65, + PC_to_RDR_Secure = 0x69, + PC_to_RDR_T0APDU = 0x6a, + PC_to_RDR_Escape = 0x6b, + PC_to_RDR_GetParameters = 0x6c, + PC_to_RDR_ResetParameters = 0x6d, + PC_to_RDR_IccClock = 0x6e, + PC_to_RDR_XfrBlock = 0x6f, + PC_to_RDR_Mechanical = 0x71, + PC_to_RDR_Abort = 0x72, + PC_to_RDR_SetDataRate = 0x73, + + RDR_to_PC_DataBlock = 0x80, + RDR_to_PC_SlotStatus = 0x81, + RDR_to_PC_Parameters = 0x82, + RDR_to_PC_Escape = 0x83, + RDR_to_PC_DataRate = 0x84 +}; + + +/* Two macro to detect whether a CCID command has failed and to get + the error code. These macros assume that we can access the + mandatory first 10 bytes of a CCID message in BUF. */ +#define CCID_COMMAND_FAILED(buf) ((buf)[7] & 0x40) +#define CCID_ERROR_CODE(buf) (((unsigned char *)(buf))[8]) + + +/* We need to know the vendor to do some hacks. */ +enum { + VENDOR_SCM = 0x04e6, + VENDOR_CHERRY = 0x046a, + VENDOR_OMNIKEY= 0x076b, + VENDOR_GEMPC = 0x08e6 +}; + + +/* Store information on the driver's state. A pointer to such a + structure is used as handle for most functions. */ +struct ccid_driver_s +{ + usb_dev_handle *idev; + char *rid; + unsigned short id_vendor; + unsigned short id_product; + unsigned short bcd_device; + int ifc_no; + int ep_bulk_out; + int ep_bulk_in; + int ep_intr; + int seqno; + unsigned char t1_ns; + unsigned char t1_nr; + int nonnull_nad; + int auto_ifsd; + int max_ifsd; + int ifsd; + int powered_off; + int has_pinpad; + int apdu_level; /* Reader supports short APDU level exchange. */ +}; + + +static int initialized_usb; /* Tracks whether USB has been initialized. */ +static int debug_level; /* Flag to control the debug output. + 0 = No debugging + 1 = USB I/O info + 2 = T=1 protocol tracing + */ + + +static unsigned int compute_edc (const unsigned char *data, size_t datalen, + int use_crc); +static int bulk_out (ccid_driver_t handle, unsigned char *msg, size_t msglen); +static int bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length, + size_t *nread, int expected_type, int seqno, int timeout, + int no_debug); + +/* Convert a little endian stored 4 byte value into an unsigned + integer. */ +static unsigned int +convert_le_u32 (const unsigned char *buf) +{ + return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); +} + +static void +set_msg_len (unsigned char *msg, unsigned int length) +{ + msg[1] = length; + msg[2] = length >> 8; + msg[3] = length >> 16; + msg[4] = length >> 24; +} + + +/* Pint an error message for a failed CCID command including a textual + error code. MSG is shall be the CCID message of at least 10 bytes. */ +static void +print_command_failed (const unsigned char *msg) +{ + const char *t; + char buffer[100]; + int ec; + + if (!debug_level) + return; + + ec = CCID_ERROR_CODE (msg); + switch (ec) + { + case 0x00: t = "Command not supported"; break; + + case 0xE0: t = "Slot busy"; break; + case 0xEF: t = "PIN cancelled"; break; + case 0xF0: t = "PIN timeout"; break; + + case 0xF2: t = "Automatic sequence ongoing"; break; + case 0xF3: t = "Deactivated Protocol"; break; + case 0xF4: t = "Procedure byte conflict"; break; + case 0xF5: t = "ICC class not supported"; break; + case 0xF6: t = "ICC protocol not supported"; break; + case 0xF7: t = "Bad checksum in ATR"; break; + case 0xF8: t = "Bad TS in ATR"; break; + + case 0xFB: t = "An all inclusive hardware error occurred"; break; + case 0xFC: t = "Overrun error while talking to the ICC"; break; + case 0xFD: t = "Parity error while talking to the ICC"; break; + case 0xFE: t = "CCID timed out while talking to the ICC"; break; + case 0xFF: t = "Host aborted the current activity"; break; + + default: + if (ec > 0 && ec < 128) + sprintf (buffer, "Parameter error at offset %d", ec); + else + sprintf (buffer, "Error code %02X", ec); + t = buffer; + break; + } + DEBUGOUT_1 ("CCID command failed: %s\n", t); +} + + + + +/* Parse a CCID descriptor, optionally print all available features + and test whether this reader is usable by this driver. Returns 0 + if it is usable. + + Note, that this code is based on the one in lsusb.c of the + usb-utils package, I wrote on 2003-09-01. -wk. */ +static int +parse_ccid_descriptor (ccid_driver_t handle, + const unsigned char *buf, size_t buflen) +{ + unsigned int i; + unsigned int us; + int have_t1 = 0, have_tpdu=0, have_auto_conf = 0; + + + handle->nonnull_nad = 0; + handle->auto_ifsd = 0; + handle->max_ifsd = 32; + handle->ifsd = 0; + handle->has_pinpad = 0; + handle->apdu_level = 0; + DEBUGOUT_3 ("idVendor: %04X idProduct: %04X bcdDevice: %04X\n", + handle->id_vendor, handle->id_product, handle->bcd_device); + if (buflen < 54 || buf[0] < 54) + { + DEBUGOUT ("CCID device descriptor is too short\n"); + return -1; + } + + DEBUGOUT ("ChipCard Interface Descriptor:\n"); + DEBUGOUT_1 (" bLength %5u\n", buf[0]); + DEBUGOUT_1 (" bDescriptorType %5u\n", buf[1]); + DEBUGOUT_2 (" bcdCCID %2x.%02x", buf[3], buf[2]); + if (buf[3] != 1 || buf[2] != 0) + DEBUGOUT_CONT(" (Warning: Only accurate for version 1.0)"); + DEBUGOUT_LF (); + + DEBUGOUT_1 (" nMaxSlotIndex %5u\n", buf[4]); + DEBUGOUT_2 (" bVoltageSupport %5u %s\n", + buf[5], (buf[5] == 1? "5.0V" : buf[5] == 2? "3.0V" + : buf[5] == 3? "1.8V":"?")); + + us = convert_le_u32 (buf+6); + DEBUGOUT_1 (" dwProtocols %5u ", us); + if ((us & 1)) + DEBUGOUT_CONT (" T=0"); + if ((us & 2)) + { + DEBUGOUT_CONT (" T=1"); + have_t1 = 1; + } + if ((us & ~3)) + DEBUGOUT_CONT (" (Invalid values detected)"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+10); + DEBUGOUT_1 (" dwDefaultClock %5u\n", us); + us = convert_le_u32(buf+14); + DEBUGOUT_1 (" dwMaxiumumClock %5u\n", us); + DEBUGOUT_1 (" bNumClockSupported %5u\n", buf[18]); + us = convert_le_u32(buf+19); + DEBUGOUT_1 (" dwDataRate %7u bps\n", us); + us = convert_le_u32(buf+23); + DEBUGOUT_1 (" dwMaxDataRate %7u bps\n", us); + DEBUGOUT_1 (" bNumDataRatesSupp. %5u\n", buf[27]); + + us = convert_le_u32(buf+28); + DEBUGOUT_1 (" dwMaxIFSD %5u\n", us); + handle->max_ifsd = us; + + us = convert_le_u32(buf+32); + DEBUGOUT_1 (" dwSyncProtocols %08X ", us); + if ((us&1)) + DEBUGOUT_CONT ( " 2-wire"); + if ((us&2)) + DEBUGOUT_CONT ( " 3-wire"); + if ((us&4)) + DEBUGOUT_CONT ( " I2C"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+36); + DEBUGOUT_1 (" dwMechanical %08X ", us); + if ((us & 1)) + DEBUGOUT_CONT (" accept"); + if ((us & 2)) + DEBUGOUT_CONT (" eject"); + if ((us & 4)) + DEBUGOUT_CONT (" capture"); + if ((us & 8)) + DEBUGOUT_CONT (" lock"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+40); + DEBUGOUT_1 (" dwFeatures %08X\n", us); + if ((us & 0x0002)) + { + DEBUGOUT (" Auto configuration based on ATR\n"); + have_auto_conf = 1; + } + if ((us & 0x0004)) + DEBUGOUT (" Auto activation on insert\n"); + if ((us & 0x0008)) + DEBUGOUT (" Auto voltage selection\n"); + if ((us & 0x0010)) + DEBUGOUT (" Auto clock change\n"); + if ((us & 0x0020)) + DEBUGOUT (" Auto baud rate change\n"); + if ((us & 0x0040)) + DEBUGOUT (" Auto parameter negotation made by CCID\n"); + else if ((us & 0x0080)) + DEBUGOUT (" Auto PPS made by CCID\n"); + else if ((us & (0x0040 | 0x0080))) + DEBUGOUT (" WARNING: conflicting negotation features\n"); + + if ((us & 0x0100)) + DEBUGOUT (" CCID can set ICC in clock stop mode\n"); + if ((us & 0x0200)) + { + DEBUGOUT (" NAD value other than 0x00 accepted\n"); + handle->nonnull_nad = 1; + } + if ((us & 0x0400)) + { + DEBUGOUT (" Auto IFSD exchange\n"); + handle->auto_ifsd = 1; + } + + if ((us & 0x00010000)) + { + DEBUGOUT (" TPDU level exchange\n"); + have_tpdu = 1; + } + else if ((us & 0x00020000)) + { + DEBUGOUT (" Short APDU level exchange\n"); + handle->apdu_level = 1; + } + else if ((us & 0x00040000)) + { + DEBUGOUT (" Short and extended APDU level exchange\n"); + handle->apdu_level = 1; + } + else if ((us & 0x00070000)) + DEBUGOUT (" WARNING: conflicting exchange levels\n"); + + us = convert_le_u32(buf+44); + DEBUGOUT_1 (" dwMaxCCIDMsgLen %5u\n", us); + + DEBUGOUT ( " bClassGetResponse "); + if (buf[48] == 0xff) + DEBUGOUT_CONT ("echo\n"); + else + DEBUGOUT_CONT_1 (" %02X\n", buf[48]); + + DEBUGOUT ( " bClassEnvelope "); + if (buf[49] == 0xff) + DEBUGOUT_CONT ("echo\n"); + else + DEBUGOUT_CONT_1 (" %02X\n", buf[48]); + + DEBUGOUT ( " wlcdLayout "); + if (!buf[50] && !buf[51]) + DEBUGOUT_CONT ("none\n"); + else + DEBUGOUT_CONT_2 ("%u cols %u lines\n", buf[50], buf[51]); + + DEBUGOUT_1 (" bPINSupport %5u ", buf[52]); + if ((buf[52] & 1)) + { + DEBUGOUT_CONT ( " verification"); + handle->has_pinpad |= 1; + } + if ((buf[52] & 2)) + { + DEBUGOUT_CONT ( " modification"); + handle->has_pinpad |= 2; + } + DEBUGOUT_LF (); + + DEBUGOUT_1 (" bMaxCCIDBusySlots %5u\n", buf[53]); + + if (buf[0] > 54) { + DEBUGOUT (" junk "); + for (i=54; i < buf[0]-54; i++) + DEBUGOUT_CONT_1 (" %02X", buf[i]); + DEBUGOUT_LF (); + } + + if (!have_t1 || !(have_tpdu || handle->apdu_level) || !have_auto_conf) + { + DEBUGOUT ("this drivers requires that the reader supports T=1, " + "TPDU or APDU level exchange and auto configuration - " + "this is not available\n"); + return -1; + } + + + /* SCM drivers get stuck in their internal USB stack if they try to + send a frame of n*wMaxPacketSize back to us. Given that + wMaxPacketSize is 64 for these readers we set the IFSD to a value + lower than that: + 64 - 10 CCID header - 4 T1frame - 2 reserved = 48 + Product Ids: + 0xe001 - SCR 331 + 0x5111 - SCR 331-DI + 0x5115 - SCR 335 + 0xe003 - SPR 532 + */ + if (handle->id_vendor == VENDOR_SCM + && handle->max_ifsd > 48 + && ( (handle->id_product == 0xe001 && handle->bcd_device < 0x0516) + ||(handle->id_product == 0x5111 && handle->bcd_device < 0x0620) + ||(handle->id_product == 0x5115 && handle->bcd_device < 0x0514) + ||(handle->id_product == 0xe003 && handle->bcd_device < 0x0504) + )) + { + DEBUGOUT ("enabling workaround for buggy SCM readers\n"); + handle->max_ifsd = 48; + } + + + return 0; +} + + +static char * +get_escaped_usb_string (usb_dev_handle *idev, int idx, + const char *prefix, const char *suffix) +{ + int rc; + unsigned char buf[280]; + unsigned char *s; + unsigned int langid; + size_t i, n, len; + char *result; + + if (!idx) + return NULL; + + /* Fixme: The next line is for the current Valgrid without support + for USB IOCTLs. */ + memset (buf, 0, sizeof buf); + + /* First get the list of supported languages and use the first one. + If we do don't find it we try to use English. Note that this is + all in a 2 bute Unicode encoding using little endian. */ + rc = usb_control_msg (idev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8), 0, + (char*)buf, sizeof buf, 1000 /* ms timeout */); + if (rc < 4) + langid = 0x0409; /* English. */ + else + langid = (buf[3] << 8) | buf[2]; + + rc = usb_control_msg (idev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8) + idx, langid, + (char*)buf, sizeof buf, 1000 /* ms timeout */); + if (rc < 2 || buf[1] != USB_DT_STRING) + return NULL; /* Error or not a string. */ + len = buf[0]; + if (len > rc) + return NULL; /* Larger than our buffer. */ + + for (s=buf+2, i=2, n=0; i+1 < len; i += 2, s += 2) + { + if (s[1]) + n++; /* High byte set. */ + else if (*s <= 0x20 || *s >= 0x7f || *s == '%' || *s == ':') + n += 3 ; + else + n++; + } + + result = malloc (strlen (prefix) + n + strlen (suffix) + 1); + if (!result) + return NULL; + + strcpy (result, prefix); + n = strlen (prefix); + for (s=buf+2, i=2; i+1 < len; i += 2, s += 2) + { + if (s[1]) + result[n++] = '\xff'; /* High byte set. */ + else if (*s <= 0x20 || *s >= 0x7f || *s == '%' || *s == ':') + { + sprintf (result+n, "%%%02X", *s); + n += 3; + } + else + result[n++] = *s; + } + strcpy (result+n, suffix); + + return result; +} + +/* This function creates an reader id to be used to find the same + physical reader after a reset. It returns an allocated and possibly + percent escaped string or NULL if not enough memory is available. */ +static char * +make_reader_id (usb_dev_handle *idev, + unsigned int vendor, unsigned int product, + unsigned char serialno_index) +{ + char *rid; + char prefix[20]; + + sprintf (prefix, "%04X:%04X:", (vendor & 0xfff), (product & 0xffff)); + rid = get_escaped_usb_string (idev, serialno_index, prefix, ":0"); + if (!rid) + { + rid = malloc (strlen (prefix) + 3 + 1); + if (!rid) + return NULL; + strcpy (rid, prefix); + strcat (rid, "X:0"); + } + return rid; +} + + +/* Helper to find the endpoint from an interface descriptor. */ +static int +find_endpoint (struct usb_interface_descriptor *ifcdesc, int mode) +{ + int no; + int want_bulk_in = 0; + + if (mode == 1) + want_bulk_in = 0x80; + for (no=0; no < ifcdesc->bNumEndpoints; no++) + { + struct usb_endpoint_descriptor *ep = ifcdesc->endpoint + no; + if (ep->bDescriptorType != USB_DT_ENDPOINT) + ; + else if (mode == 2 + && ((ep->bmAttributes & USB_ENDPOINT_TYPE_MASK) + == USB_ENDPOINT_TYPE_INTERRUPT) + && (ep->bEndpointAddress & 0x80)) + return (ep->bEndpointAddress & 0x0f); + else if (((ep->bmAttributes & USB_ENDPOINT_TYPE_MASK) + == USB_ENDPOINT_TYPE_BULK) + && (ep->bEndpointAddress & 0x80) == want_bulk_in) + return (ep->bEndpointAddress & 0x0f); + } + /* Should never happen. */ + return mode == 2? 0x83 : mode == 1? 0x82 :1; +} + + + +/* Combination function to either scan all CCID devices or to find and + open one specific device. + + With READERNO = -1 and READERID is NULL, scan mode is used and + R_RID should be the address where to store the list of reader_ids + we found. If on return this list is empty, no CCID device has been + found; otherwise it points to an allocated linked list of reader + IDs. Note that in this mode the function always returns NULL. + + With READERNO >= 0 or READERID is not NULL find mode is used. This + uses the same algorithm as the scan mode but stops and returns at + the entry number READERNO and return the handle for the the opened + USB device. If R_ID is not NULL it will receive the reader ID of + that device. If R_DEV is not NULL it will the device pointer of + that device. If IFCDESC_EXTRA is NOT NULL it will receive a + malloced copy of the interfaces "extra: data filed; + IFCDESC_EXTRA_LEN receive the lengtyh of this field. If there is + no reader with number READERNO or that reader is not usable by our + implementation NULL will be returned. The caller must close a + returned USB device handle and free (if not passed as NULL) the + returned reader ID info as well as the IFCDESC_EXTRA. On error + NULL will get stored at R_RID, R_DEV, IFCDESC_EXTRA and + IFCDESC_EXTRA_LEN. With READERID being -1 the function stops if + the READERID was found. + + Note that the first entry of the returned reader ID list in scan mode + corresponds with a READERNO of 0 in find mode. +*/ +static usb_dev_handle * +scan_or_find_devices (int readerno, const char *readerid, + char **r_rid, + struct usb_device **r_dev, + unsigned char **ifcdesc_extra, + size_t *ifcdesc_extra_len, + int *interface_number, + int *ep_bulk_out, int *ep_bulk_in, int *ep_intr) +{ + char *rid_list = NULL; + int count = 0; + struct usb_bus *busses, *bus; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + int scan_mode = (readerno == -1 && !readerid); + + /* Set return values to a default. */ + if (r_rid) + *r_rid = NULL; + if (r_dev) + *r_dev = NULL; + if (ifcdesc_extra) + *ifcdesc_extra = NULL; + if (ifcdesc_extra_len) + *ifcdesc_extra_len = 0; + if (interface_number) + *interface_number = 0; + + /* See whether we want scan or find mode. */ + if (scan_mode) + { + assert (r_rid); + } + + usb_find_busses(); + usb_find_devices(); + +#ifdef HAVE_USB_GET_BUSSES + busses = usb_get_busses(); +#else + busses = usb_busses; +#endif + + for (bus = busses; bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + int cfg_no; + + for (cfg_no=0; cfg_no < dev->descriptor.bNumConfigurations; cfg_no++) + { + struct usb_config_descriptor *config = dev->config + cfg_no; + int ifc_no; + + if(!config) + continue; + + for (ifc_no=0; ifc_no < config->bNumInterfaces; ifc_no++) + { + struct usb_interface *interface + = config->interface + ifc_no; + int set_no; + + if (!interface) + continue; + + for (set_no=0; set_no < interface->num_altsetting; set_no++) + { + struct usb_interface_descriptor *ifcdesc + = interface->altsetting + set_no; + char *rid; + + /* The second condition is for some SCM Micro + SPR 532 which does not know about the + assigned CCID class. Instead of trying to + interpret the strings we simply look at the + product ID. */ + if (ifcdesc && ifcdesc->extra + && ( (ifcdesc->bInterfaceClass == 11 + && ifcdesc->bInterfaceSubClass == 0 + && ifcdesc->bInterfaceProtocol == 0) + || (ifcdesc->bInterfaceClass == 255 + && dev->descriptor.idVendor == 0x04e6 + && dev->descriptor.idProduct == 0xe003))) + { + idev = usb_open (dev); + if (!idev) + { + DEBUGOUT_1 ("usb_open failed: %s\n", + strerror (errno)); + continue; + } + + rid = make_reader_id (idev, + dev->descriptor.idVendor, + dev->descriptor.idProduct, + dev->descriptor.iSerialNumber); + if (rid) + { + if (scan_mode) + { + char *p; + + /* We are collecting infos about all + available CCID readers. Store + them and continue. */ + DEBUGOUT_2 ("found CCID reader %d " + "(ID=%s)\n", + count, rid ); + if ((p = malloc ((rid_list? + strlen (rid_list):0) + + 1 + strlen (rid) + + 1))) + { + *p = 0; + if (rid_list) + { + strcat (p, rid_list); + free (rid_list); + } + strcat (p, rid); + strcat (p, "\n"); + rid_list = p; + } + else /* Out of memory. */ + free (rid); + rid = NULL; + count++; + } + else if (!readerno + || (readerno < 0 + && readerid + && !strcmp (readerid, rid))) + { + /* We found the requested reader. */ + if (ifcdesc_extra && ifcdesc_extra_len) + { + *ifcdesc_extra = malloc (ifcdesc + ->extralen); + if (!*ifcdesc_extra) + { + usb_close (idev); + free (rid); + return NULL; /* Out of core. */ + } + memcpy (*ifcdesc_extra, ifcdesc->extra, + ifcdesc->extralen); + *ifcdesc_extra_len = ifcdesc->extralen; + } + if (interface_number) + *interface_number = (ifcdesc-> + bInterfaceNumber); + if (ep_bulk_out) + *ep_bulk_out = find_endpoint (ifcdesc, 0); + if (ep_bulk_in) + *ep_bulk_in = find_endpoint (ifcdesc, 1); + if (ep_intr) + *ep_intr = find_endpoint (ifcdesc, 2); + + + if (r_dev) + *r_dev = dev; + if (r_rid) + { + *r_rid = rid; + rid = NULL; + } + else + free (rid); + return idev; /* READY. */ + } + else + { + /* This is not yet the reader we + want. fixme: We could avoid the + extra usb_open in this case. */ + if (readerno >= 0) + readerno--; + } + free (rid); + } + + usb_close (idev); + idev = NULL; + goto next_device; + } + } + } + } + next_device: + ; + } + } + + if (scan_mode) + *r_rid = rid_list; + + return NULL; +} + + +/* Set the level of debugging to to usea dn return the old level. -1 + just returns the old level. A level of 0 disables debugging, 1 + enables debugging, 2 enables additional tracing of the T=1 + protocol, other values are not yet defined. */ +int +ccid_set_debug_level (int level) +{ + int old = debug_level; + if (level != -1) + debug_level = level; + return old; +} + + +char * +ccid_get_reader_list (void) +{ + char *reader_list; + + if (!initialized_usb) + { + usb_init (); + initialized_usb = 1; + } + + scan_or_find_devices (-1, NULL, &reader_list, NULL, NULL, NULL, NULL, + NULL, NULL, NULL); + return reader_list; +} + + +/* Open the reader with the internal number READERNO and return a + pointer to be used as handle in HANDLE. Returns 0 on success. */ +int +ccid_open_reader (ccid_driver_t *handle, const char *readerid) +{ + int rc = 0; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + char *rid = NULL; + unsigned char *ifcdesc_extra = NULL; + size_t ifcdesc_extra_len; + int readerno; + int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr; + + *handle = NULL; + + if (!initialized_usb) + { + usb_init (); + initialized_usb = 1; + } + + /* See whether we want to use the reader ID string or a reader + number. A readerno of -1 indicates that the reader ID string is + to be used. */ + if (readerid && strchr (readerid, ':')) + readerno = -1; /* We want to use the readerid. */ + else if (readerid) + { + readerno = atoi (readerid); + if (readerno < 0) + { + DEBUGOUT ("no CCID readers found\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + } + else + readerno = 0; /* Default. */ + + idev = scan_or_find_devices (readerno, readerid, &rid, &dev, + &ifcdesc_extra, &ifcdesc_extra_len, + &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr); + if (!idev) + { + if (readerno == -1) + DEBUGOUT_1 ("no CCID reader with ID %s\n", readerid ); + else + DEBUGOUT_1 ("no CCID reader with number %d\n", readerno ); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + /* Okay, this is a CCID reader. */ + *handle = calloc (1, sizeof **handle); + if (!*handle) + { + DEBUGOUT ("out of memory\n"); + rc = CCID_DRIVER_ERR_OUT_OF_CORE; + goto leave; + } + (*handle)->idev = idev; + (*handle)->rid = rid; + (*handle)->id_vendor = dev->descriptor.idVendor; + (*handle)->id_product = dev->descriptor.idProduct; + (*handle)->bcd_device = dev->descriptor.bcdDevice; + (*handle)->ifc_no = ifc_no; + (*handle)->ep_bulk_out = ep_bulk_out; + (*handle)->ep_bulk_in = ep_bulk_in; + (*handle)->ep_intr = ep_intr; + + DEBUGOUT_2 ("using CCID reader %d (ID=%s)\n", readerno, rid ); + + + if (parse_ccid_descriptor (*handle, ifcdesc_extra, ifcdesc_extra_len)) + { + DEBUGOUT ("device not supported\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + rc = usb_claim_interface (idev, ifc_no); + if (rc) + { + DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc); + rc = CCID_DRIVER_ERR_CARD_IO_ERROR; + goto leave; + } + + leave: + free (ifcdesc_extra); + if (rc) + { + free (rid); + if (idev) + usb_close (idev); + free (*handle); + *handle = NULL; + } + + return rc; +} + + +static void +do_close_reader (ccid_driver_t handle) +{ + int rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + + if (!handle->powered_off) + { + msg[0] = PC_to_RDR_IccPowerOff; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + msglen = 10; + + rc = bulk_out (handle, msg, msglen); + if (!rc) + bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_SlotStatus, + seqno, 2000, 0); + handle->powered_off = 1; + } + if (handle->idev) + { + usb_release_interface (handle->idev, handle->ifc_no); + usb_close (handle->idev); + handle->idev = NULL; + } +} + + +/* Reset a reader on HANDLE. This is useful in case a reader has been + plugged of and inserted at a different port. By resetting the + handle, the same reader will be get used. Note, that on error the + handle won't get released. + + This does not return an ATR, so ccid_get_atr should be called right + after this one. +*/ +int +ccid_shutdown_reader (ccid_driver_t handle) +{ + int rc = 0; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + unsigned char *ifcdesc_extra = NULL; + size_t ifcdesc_extra_len; + int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr; + + if (!handle || !handle->rid) + return CCID_DRIVER_ERR_INV_VALUE; + + do_close_reader (handle); + + idev = scan_or_find_devices (-1, handle->rid, NULL, &dev, + &ifcdesc_extra, &ifcdesc_extra_len, + &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr); + if (!idev) + { + DEBUGOUT_1 ("no CCID reader with ID %s\n", handle->rid); + return CCID_DRIVER_ERR_NO_READER; + } + + + handle->idev = idev; + handle->ifc_no = ifc_no; + handle->ep_bulk_out = ep_bulk_out; + handle->ep_bulk_in = ep_bulk_in; + handle->ep_intr = ep_intr; + + if (parse_ccid_descriptor (handle, ifcdesc_extra, ifcdesc_extra_len)) + { + DEBUGOUT ("device not supported\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + rc = usb_claim_interface (idev, ifc_no); + if (rc) + { + DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc); + rc = CCID_DRIVER_ERR_CARD_IO_ERROR; + goto leave; + } + + leave: + free (ifcdesc_extra); + if (rc) + { + usb_close (handle->idev); + handle->idev = NULL; + } + + return rc; + +} + + +/* Close the reader HANDLE. */ +int +ccid_close_reader (ccid_driver_t handle) +{ + if (!handle || !handle->idev) + return 0; + + do_close_reader (handle); + free (handle->rid); + free (handle); + return 0; +} + + +/* Return False if a card is present and powered. */ +int +ccid_check_card_presence (ccid_driver_t handle) +{ + + return -1; +} + + +/* Write a MSG of length MSGLEN to the designated bulk out endpoint. + Returns 0 on success. */ +static int +bulk_out (ccid_driver_t handle, unsigned char *msg, size_t msglen) +{ + int rc; + + rc = usb_bulk_write (handle->idev, + handle->ep_bulk_out, + (char*)msg, msglen, + 1000 /* ms timeout */); + if (rc == msglen) + return 0; + + if (rc == -1) + DEBUGOUT_1 ("usb_bulk_write error: %s\n", strerror (errno)); + else + DEBUGOUT_1 ("usb_bulk_write failed: %d\n", rc); + return CCID_DRIVER_ERR_CARD_IO_ERROR; +} + + +/* Read a maximum of LENGTH bytes from the bulk in endpoint into + BUFFER and return the actual read number if bytes in NREAD. SEQNO + is the sequence number used to send the request and EXPECTED_TYPE + the type of message we expect. Does checks on the ccid + header. TIMEOUT is the timeout value in ms. NO_DEBUG may be set to + avoid debug messages in case of no error. Returns 0 on success. */ +static int +bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length, + size_t *nread, int expected_type, int seqno, int timeout, + int no_debug) +{ + int i, rc; + size_t msglen; + + /* Fixme: The next line for the current Valgrind without support + for USB IOCTLs. */ + memset (buffer, 0, length); + retry: + rc = usb_bulk_read (handle->idev, + handle->ep_bulk_in, + (char*)buffer, length, + timeout); + if (rc < 0) + { + DEBUGOUT_1 ("usb_bulk_read error: %s\n", strerror (errno)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + *nread = msglen = rc; + + if (msglen < 10) + { + DEBUGOUT_1 ("bulk-in msg too short (%u)\n", (unsigned int)msglen); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[0] != expected_type) + { + DEBUGOUT_1 ("unexpected bulk-in msg type (%02x)\n", buffer[0]); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[5] != 0) + { + DEBUGOUT_1 ("unexpected bulk-in slot (%d)\n", buffer[5]); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[6] != seqno) + { + DEBUGOUT_2 ("bulk-in seqno does not match (%d/%d)\n", + seqno, buffer[6]); + return CCID_DRIVER_ERR_INV_VALUE; + } + + if ( !(buffer[7] & 0x03) && (buffer[7] & 0xC0) == 0x80) + { + /* Card present and active, time extension requested. */ + DEBUGOUT_2 ("time extension requested (%02X,%02X)\n", + buffer[7], buffer[8]); + goto retry; + } + + if (!no_debug) + { + DEBUGOUT_3 ("status: %02X error: %02X octet[9]: %02X\n" + " data:", buffer[7], buffer[8], buffer[9] ); + for (i=10; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", buffer[i]); + DEBUGOUT_LF (); + } + if (CCID_COMMAND_FAILED (buffer)) + print_command_failed (buffer); + + /* Check whether a card is at all available. Note: If you add new + error codes here, check whether they need to be ignored in + send_escape_cmd. */ + switch ((buffer[7] & 0x03)) + { + case 0: /* no error */ break; + case 1: return CCID_DRIVER_ERR_CARD_INACTIVE; + case 2: return CCID_DRIVER_ERR_NO_CARD; + case 3: /* RFU */ break; + } + return 0; +} + + +/* Note that this function won't return the error codes NO_CARD or + CARD_INACTIVE. IF RESULT is not NULL, the result from the + operation will get returned in RESULT and its length in RESULTLEN. + If the response is larger than RESULTMAX, an error is returned and + the required buffer length returned in RESULTLEN. */ +static int +send_escape_cmd (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *result, size_t resultmax, size_t *resultlen) +{ + int i, rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + + if (resultlen) + *resultlen = 0; + + if (datalen > sizeof msg - 10) + return CCID_DRIVER_ERR_INV_VALUE; /* Escape data too large. */ + + msg[0] = PC_to_RDR_Escape; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + memcpy (msg+10, data, datalen); + msglen = 10 + datalen; + set_msg_len (msg, datalen); + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_Escape, + seqno, 5000, 0); + if (result) + switch (rc) + { + /* We need to ignore certain errorcode here. */ + case 0: + case CCID_DRIVER_ERR_CARD_INACTIVE: + case CCID_DRIVER_ERR_NO_CARD: + { + if (msglen < 10 || (msglen-10) > resultmax ) + rc = CCID_DRIVER_ERR_INV_VALUE; /* Invalid length of response. */ + else + { + memcpy (result, msg+10, msglen-10); + *resultlen = msglen-10; + } + rc = 0; + } + break; + default: + break; + } + + return rc; +} + + +int +ccid_transceive_escape (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + return send_escape_cmd (handle, data, datalen, resp, maxresplen, nresp); +} + + + +/* experimental */ +int +ccid_poll (ccid_driver_t handle) +{ + int rc; + unsigned char msg[10]; + size_t msglen; + int i, j; + + rc = usb_bulk_read (handle->idev, + handle->ep_intr, + (char*)msg, sizeof msg, + 0 /* ms timeout */ ); + if (rc < 0 && errno == ETIMEDOUT) + return 0; + + if (rc < 0) + { + DEBUGOUT_1 ("usb_intr_read error: %s\n", strerror (errno)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + msglen = rc; + rc = 0; + + if (msglen < 1) + { + DEBUGOUT ("intr-in msg too short\n"); + return CCID_DRIVER_ERR_INV_VALUE; + } + + if (msg[0] == RDR_to_PC_NotifySlotChange) + { + DEBUGOUT ("notify slot change:"); + for (i=1; i < msglen; i++) + for (j=0; j < 4; j++) + DEBUGOUT_CONT_3 (" %d:%c%c", + (i-1)*4+j, + (msg[i] & (1<<(j*2)))? 'p':'-', + (msg[i] & (2<<(j*2)))? '*':' '); + DEBUGOUT_LF (); + } + else if (msg[0] == RDR_to_PC_HardwareError) + { + DEBUGOUT ("hardware error occured\n"); + } + else + { + DEBUGOUT_1 ("unknown intr-in msg of type %02X\n", msg[0]); + } + + return 0; +} + + +/* Note that this fucntion won't return the error codes NO_CARD or + CARD_INACTIVE */ +int +ccid_slot_status (ccid_driver_t handle, int *statusbits) +{ + int rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + int retries = 0; + + retry: + msg[0] = PC_to_RDR_GetSlotStatus; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + + rc = bulk_out (handle, msg, 10); + if (rc) + return rc; + /* Note that we set the NO_DEBUG flag here, so that the logs won't + get cluttered up by a ticker function checking for the slot + status and debugging enabled. */ + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_SlotStatus, + seqno, retries? 1000 : 200, 1); + if (rc == CCID_DRIVER_ERR_CARD_IO_ERROR && retries < 3) + { + if (!retries) + { + DEBUGOUT ("USB: CALLING USB_CLEAR_HALT\n"); + usb_clear_halt (handle->idev, handle->ep_bulk_in); + usb_clear_halt (handle->idev, handle->ep_bulk_out); + } + else + DEBUGOUT ("USB: RETRYING bulk_in AGAIN\n"); + retries++; + goto retry; + } + if (rc && rc != CCID_DRIVER_ERR_NO_CARD + && rc != CCID_DRIVER_ERR_CARD_INACTIVE) + return rc; + *statusbits = (msg[7] & 3); + + return 0; +} + + +int +ccid_get_atr (ccid_driver_t handle, + unsigned char *atr, size_t maxatrlen, size_t *atrlen) +{ + int rc; + int statusbits; + unsigned char msg[100]; + unsigned char *tpdu; + size_t msglen, tpdulen; + unsigned char seqno; + int use_crc = 0; + unsigned int edc; + int i; + int tried_iso = 0; + + /* First check whether a card is available. */ + rc = ccid_slot_status (handle, &statusbits); + if (rc) + return rc; + if (statusbits == 2) + return CCID_DRIVER_ERR_NO_CARD; + + /* For an inactive and also for an active card, issue the PowerOn + command to get the ATR. */ + again: + msg[0] = PC_to_RDR_IccPowerOn; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* power select (0=auto, 1=5V, 2=3V, 3=1.8V) */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + msglen = 10; + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_DataBlock, + seqno, 5000, 0); + if (rc) + return rc; + if (!tried_iso && CCID_COMMAND_FAILED (msg) && CCID_ERROR_CODE (msg) == 0xbb + && ((handle->id_vendor == VENDOR_CHERRY + && handle->id_product == 0x0005) + || (handle->id_vendor == VENDOR_GEMPC + && handle->id_product == 0x4433) + )) + { + tried_iso = 1; + /* Try switching to ISO mode. */ + if (!send_escape_cmd (handle, (const unsigned char*)"\xF1\x01", 2, + NULL, 0, NULL)) + goto again; + } + else if (CCID_COMMAND_FAILED (msg)) + return CCID_DRIVER_ERR_CARD_IO_ERROR; + + + handle->powered_off = 0; + + if (atr) + { + size_t n = msglen - 10; + + if (n > maxatrlen) + n = maxatrlen; + memcpy (atr, msg+10, n); + *atrlen = n; + } + + /* Setup parameters to select T=1. */ + msg[0] = PC_to_RDR_SetParameters; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 1; /* Select T=1. */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + + /* FIXME: Get those values from the ATR. */ + msg[10]= 0x01; /* Fi/Di */ + msg[11]= 0x10; /* LRC, direct convention. */ + msg[12]= 0; /* Extra guardtime. */ + msg[13]= 0x41; /* BWI/CWI */ + msg[14]= 0; /* No clock stoppping. */ + msg[15]= 254; /* IFSC */ + msg[16]= 0; /* Does not support non default NAD values. */ + set_msg_len (msg, 7); + msglen = 10 + 7; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + /* Note that we ignore the error code on purpose. */ + bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_Parameters, + seqno, 5000, 0); + + handle->t1_ns = 0; + handle->t1_nr = 0; + + /* Send an S-Block with our maximun IFSD to the CCID. */ + if (!handle->auto_ifsd) + { + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0xc0 | 0 | 1); /* S-block request: change IFSD */ + tpdu[2] = 1; + tpdu[3] = handle->max_ifsd? handle->max_ifsd : 32; + tpdulen = 4; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, tpdulen); + msglen = 10 + tpdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + if (debug_level > 1) + DEBUGOUT_3 ("T=1: put %c-block seq=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + + rc = bulk_in (handle, msg, sizeof msg, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + return CCID_DRIVER_ERR_ABORTED; + + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if ((tpdu[1] & 0xe0) != 0xe0 || tpdu[2] != 1) + { + DEBUGOUT ("invalid response for S-block (Change-IFSD)\n"); + return -1; + } + DEBUGOUT_1 ("IFSD has been set to %d\n", tpdu[3]); + } + + return 0; +} + + + + +static unsigned int +compute_edc (const unsigned char *data, size_t datalen, int use_crc) +{ + if (use_crc) + { + return 0x42; /* Not yet implemented. */ + } + else + { + unsigned char crc = 0; + + for (; datalen; datalen--) + crc ^= *data++; + return crc; + } +} + + +/* Helper for ccid_transceive used for APDU level exchanges. */ +static int +ccid_transceive_apdu_level (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + unsigned char *resp, size_t maxresplen, + size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + const unsigned char *apdu; + size_t apdulen; + unsigned char *msg; + size_t msglen; + unsigned char seqno; + int i; + + msg = send_buffer; + + apdu = apdu_buf; + apdulen = apdu_buflen; + assert (apdulen); + + if (apdulen > 254) + return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + memcpy (msg+10, apdu, apdulen); + set_msg_len (msg, apdulen); + msglen = 10 + apdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + apdu = msg + 10; + apdulen = msglen - 10; + + if (resp) + { + if (apdulen > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)apdulen, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, apdu, apdulen); + *nresp = apdulen; + } + + return 0; +} + + + +/* + Protocol T=1 overview + + Block Structure: + Prologue Field: + 1 byte Node Address (NAD) + 1 byte Protocol Control Byte (PCB) + 1 byte Length (LEN) + Information Field: + 0-254 byte APDU or Control Information (INF) + Epilogue Field: + 1 byte Error Detection Code (EDC) + + NAD: + bit 7 unused + bit 4..6 Destination Node Address (DAD) + bit 3 unused + bit 2..0 Source Node Address (SAD) + + If node adresses are not used, SAD and DAD should be set to 0 on + the first block sent to the card. If they are used they should + have different values (0 for one is okay); that first block sets up + the addresses of the nodes. + + PCB: + Information Block (I-Block): + bit 7 0 + bit 6 Sequence number (yep, that is modulo 2) + bit 5 Chaining flag + bit 4..0 reserved + Received-Ready Block (R-Block): + bit 7 1 + bit 6 0 + bit 5 0 + bit 4 Sequence number + bit 3..0 0 = no error + 1 = EDC or parity error + 2 = other error + other values are reserved + Supervisory Block (S-Block): + bit 7 1 + bit 6 1 + bit 5 clear=request,set=response + bit 4..0 0 = resyncronisation request + 1 = information field size request + 2 = abort request + 3 = extension of BWT request + 4 = VPP error + other values are reserved + +*/ + +int +ccid_transceive (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + const unsigned char *apdu; + size_t apdulen; + unsigned char *msg, *tpdu, *p; + size_t msglen, tpdulen, last_tpdulen, n; + unsigned char seqno; + int i; + unsigned int edc; + int use_crc = 0; + size_t dummy_nresp; + int next_chunk = 1; + int sending = 1; + int retries = 0; + + if (!nresp) + nresp = &dummy_nresp; + *nresp = 0; + + /* Smarter readers allow to send APDUs directly; divert here. */ + if (handle->apdu_level) + return ccid_transceive_apdu_level (handle, apdu_buf, apdu_buflen, + resp, maxresplen, nresp); + + /* The other readers we support require sending TPDUs. */ + + tpdulen = 0; /* Avoid compiler warning about no initialization. */ + msg = send_buffer; + for (;;) + { + if (next_chunk) + { + next_chunk = 0; + + apdu = apdu_buf; + apdulen = apdu_buflen; + assert (apdulen); + + /* Construct an I-Block. */ + if (apdulen > 254) + return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ + + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = ((handle->t1_ns & 1) << 6); /* I-block */ + if (apdulen > 128 /* fixme: replace by ifsc */) + { + apdulen = 128; + apdu_buf += 128; + apdu_buflen -= 128; + tpdu[1] |= (1 << 5); /* Set more bit. */ + } + tpdu[2] = apdulen; + memcpy (tpdu+3, apdu, apdulen); + tpdulen = 3 + apdulen; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + } + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, tpdulen); + msglen = 10 + tpdulen; + last_tpdulen = tpdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + if (debug_level > 1) + DEBUGOUT_3 ("T=1: put %c-block seq=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + { + usb_clear_halt (handle->idev, handle->ep_bulk_in); + return CCID_DRIVER_ERR_ABORTED; + } + + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if (!(tpdu[1] & 0x80)) + { /* This is an I-block. */ + retries = 0; + if (sending) + { /* last block sent was successful. */ + handle->t1_ns ^= 1; + sending = 0; + } + + if (!!(tpdu[1] & 0x40) != handle->t1_nr) + { /* Reponse does not match our sequence number. */ + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0x80 | (handle->t1_nr & 1) << 4 | 2); /* R-block */ + tpdu[2] = 0; + tpdulen = 3; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + + continue; + } + + handle->t1_nr ^= 1; + + p = tpdu + 3; /* Skip the prologue field. */ + n = tpdulen - 3 - 1; /* Strip the epilogue field. */ + /* fixme: verify the checksum. */ + if (resp) + { + if (n > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)n, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, p, n); + resp += n; + *nresp += n; + maxresplen -= n; + } + + if (!(tpdu[1] & 0x20)) + return 0; /* No chaining requested - ready. */ + + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0x80 | (handle->t1_nr & 1) << 4); /* R-block */ + tpdu[2] = 0; + tpdulen = 3; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + } + else if ((tpdu[1] & 0xc0) == 0x80) + { /* This is a R-block. */ + if ( (tpdu[1] & 0x0f)) + { /* Error: repeat last block */ + if (++retries > 3) + { + DEBUGOUT ("3 failed retries\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + msg = send_buffer; + tpdulen = last_tpdulen; + } + else if (sending && !!(tpdu[1] & 0x10) == handle->t1_ns) + { /* Response does not match our sequence number. */ + DEBUGOUT ("R-block with wrong seqno received on more bit\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if (sending) + { /* Send next chunk. */ + retries = 0; + msg = send_buffer; + next_chunk = 1; + handle->t1_ns ^= 1; + } + else + { + DEBUGOUT ("unexpected ACK R-block received\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } + else + { /* This is a S-block. */ + retries = 0; + DEBUGOUT_2 ("T=1 S-block %s received cmd=%d\n", + (tpdu[1] & 0x20)? "response": "request", + (tpdu[1] & 0x1f)); + if ( !(tpdu[1] & 0x20) && (tpdu[1] & 0x1f) == 3 && tpdu[2]) + { /* Wait time extension request. */ + unsigned char bwi = tpdu[3]; + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0xc0 | 0x20 | 3); /* S-block response */ + tpdu[2] = 1; + tpdu[3] = bwi; + tpdulen = 4; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + DEBUGOUT_1 ("T=1 waittime extension of bwi=%d\n", bwi); + } + else + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } /* end T=1 protocol loop. */ + + return 0; +} + + +/* Send the CCID Secure command to the reader. APDU_BUF should + contain the APDU template. PIN_MODE defines how the pin gets + formatted: + + 1 := The PIN is ASCII encoded and of variable length. The + length of the PIN entered will be put into Lc by the reader. + The APDU should me made up of 4 bytes without Lc. + + PINLEN_MIN and PINLEN_MAX define the limits for the pin length. 0 + may be used t enable reasonable defaults. PIN_PADLEN should be 0. + + When called with RESP and NRESP set to NULL, the function will + merely check whether the reader supports the secure command for the + given APDU and PIN_MODE. */ +int +ccid_transceive_secure (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + int pin_mode, int pinlen_min, int pinlen_max, + int pin_padlen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + unsigned char *msg, *tpdu, *p; + size_t msglen, tpdulen, n; + unsigned char seqno; + int i; + size_t dummy_nresp; + int testmode; + + testmode = !resp && !nresp; + + if (!nresp) + nresp = &dummy_nresp; + *nresp = 0; + + if (apdu_buflen >= 4 && apdu_buf[1] == 0x20 && (handle->has_pinpad & 1)) + ; + else if (apdu_buflen >= 4 && apdu_buf[1] == 0x24 && (handle->has_pinpad & 2)) + return CCID_DRIVER_ERR_NOT_SUPPORTED; /* Not yet by our code. */ + else + return CCID_DRIVER_ERR_NO_KEYPAD; + + if (pin_mode != 1) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (pin_padlen != 0) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (!pinlen_min) + pinlen_min = 1; + if (!pinlen_max) + pinlen_max = 25; + + /* Note that the 25 is the maximum value the SPR532 allows. */ + if (pinlen_min < 1 || pinlen_min > 25 + || pinlen_max < 1 || pinlen_max > 25 + || pinlen_min > pinlen_max) + return CCID_DRIVER_ERR_INV_VALUE; + + /* We have only tested this with an SCM reader so better don't risk + anything and do not allow the use with other readers. */ + if (handle->id_vendor != VENDOR_SCM) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (testmode) + return 0; /* Success */ + + msg = send_buffer; + if (handle->id_vendor == VENDOR_SCM) + { + DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n"); + rc = send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3, + NULL, 0, NULL); + if (rc) + return rc; + } + + msg[0] = PC_to_RDR_Secure; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + msg[10] = 0; /* Perform PIN verification. */ + msg[11] = 0; /* Timeout in seconds. */ + msg[12] = 0x82; /* bmFormatString: Byte, pos=0, left, ASCII. */ + if (handle->id_vendor == VENDOR_SCM) + { + /* For the SPR532 the next 2 bytes need to be zero. We do this + for all SCM product. Kudos to Martin Paljak for this + hint. */ + msg[13] = msg[14] = 0; + } + else + { + msg[13] = 0x00; /* bmPINBlockString: + 0 bits of pin length to insert. + 0 bytes of PIN block size. */ + msg[14] = 0x00; /* bmPINLengthFormat: + Units are bytes, position is 0. */ + } + msg[15] = pinlen_min; /* wPINMaxExtraDigit-Minimum. */ + msg[16] = pinlen_max; /* wPINMaxExtraDigit-Maximum. */ + msg[17] = 0x02; /* bEntryValidationCondition: + Validation key pressed */ + if (pinlen_min && pinlen_max && pinlen_min == pinlen_max) + msg[17] |= 0x01; /* Max size reached. */ + msg[18] = 0xff; /* bNumberMessage: Default. */ + msg[19] = 0x04; /* wLangId-High. */ + msg[20] = 0x09; /* wLangId-Low: English FIXME: use the first entry. */ + msg[21] = 0; /* bMsgIndex. */ + /* bTeoProlog follows: */ + msg[22] = handle->nonnull_nad? ((1 << 4) | 0): 0; + msg[23] = ((handle->t1_ns & 1) << 6); /* I-block */ + msg[24] = 4; /* apdulen. */ + /* APDU follows: */ + msg[25] = apdu_buf[0]; /* CLA */ + msg[26] = apdu_buf[1]; /* INS */ + msg[27] = apdu_buf[2]; /* P1 */ + msg[28] = apdu_buf[3]; /* P2 */ + msglen = 29; + set_msg_len (msg, msglen - 10); + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + { + usb_clear_halt (handle->idev, handle->ep_bulk_in); + return CCID_DRIVER_ERR_ABORTED; + } + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if (!(tpdu[1] & 0x80)) + { /* This is an I-block. */ + /* Last block sent was successful. */ + handle->t1_ns ^= 1; + + if (!!(tpdu[1] & 0x40) != handle->t1_nr) + { /* Reponse does not match our sequence number. */ + DEBUGOUT ("I-block with wrong seqno received\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + handle->t1_nr ^= 1; + + p = tpdu + 3; /* Skip the prologue field. */ + n = tpdulen - 3 - 1; /* Strip the epilogue field. */ + /* fixme: verify the checksum. */ + if (resp) + { + if (n > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)n, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, p, n); + resp += n; + *nresp += n; + maxresplen -= n; + } + + if (!(tpdu[1] & 0x20)) + return 0; /* No chaining requested - ready. */ + + DEBUGOUT ("chaining requested but not supported for Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if ((tpdu[1] & 0xc0) == 0x80) + { /* This is a R-block. */ + if ( (tpdu[1] & 0x0f)) + { /* Error: repeat last block */ + DEBUGOUT ("No retries supported for Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if (!!(tpdu[1] & 0x10) == handle->t1_ns) + { /* Reponse does not match our sequence number. */ + DEBUGOUT ("R-block with wrong seqno received on more bit\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else + { /* Send next chunk. */ + DEBUGOUT ("chaining not supported on Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } + else + { /* This is a S-block. */ + DEBUGOUT_2 ("T=1 S-block %s received cmd=%d for Secure operation\n", + (tpdu[1] & 0x20)? "response": "request", + (tpdu[1] & 0x1f)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + return 0; +} + + + + +#ifdef TEST + + +static void +print_error (int err) +{ + const char *p; + char buf[50]; + + switch (err) + { + case 0: p = "success"; + case CCID_DRIVER_ERR_OUT_OF_CORE: p = "out of core"; break; + case CCID_DRIVER_ERR_INV_VALUE: p = "invalid value"; break; + case CCID_DRIVER_ERR_NO_DRIVER: p = "no driver"; break; + case CCID_DRIVER_ERR_NOT_SUPPORTED: p = "not supported"; break; + case CCID_DRIVER_ERR_LOCKING_FAILED: p = "locking failed"; break; + case CCID_DRIVER_ERR_BUSY: p = "busy"; break; + case CCID_DRIVER_ERR_NO_CARD: p = "no card"; break; + case CCID_DRIVER_ERR_CARD_INACTIVE: p = "card inactive"; break; + case CCID_DRIVER_ERR_CARD_IO_ERROR: p = "card I/O error"; break; + case CCID_DRIVER_ERR_GENERAL_ERROR: p = "general error"; break; + case CCID_DRIVER_ERR_NO_READER: p = "no reader"; break; + case CCID_DRIVER_ERR_ABORTED: p = "aborted"; break; + default: sprintf (buf, "0x%05x", err); p = buf; break; + } + fprintf (stderr, "operation failed: %s\n", p); +} + +static void +print_data (const unsigned char *data, size_t length) +{ + if (length >= 2) + { + fprintf (stderr, "operation status: %02X%02X\n", + data[length-2], data[length-1]); + length -= 2; + } + if (length) + { + fputs (" returned data:", stderr); + for (; length; length--, data++) + fprintf (stderr, " %02X", *data); + putc ('\n', stderr); + } +} + +static void +print_result (int rc, const unsigned char *data, size_t length) +{ + if (rc) + print_error (rc); + else if (data) + print_data (data, length); +} + +int +main (int argc, char **argv) +{ + int rc; + ccid_driver_t ccid; + unsigned int slotstat; + unsigned char result[512]; + size_t resultlen; + int no_pinpad = 0; + int verify_123456 = 0; + int did_verify = 0; + int no_poll = 0; + + if (argc) + { + argc--; + argv++; + } + + while (argc) + { + if ( !strcmp (*argv, "--list")) + { + char *p; + p = ccid_get_reader_list (); + if (!p) + return 1; + fputs (p, stderr); + free (p); + return 0; + } + else if ( !strcmp (*argv, "--debug")) + { + ccid_set_debug_level (1); + argc--; argv++; + } + else if ( !strcmp (*argv, "--no-poll")) + { + no_poll = 1; + argc--; argv++; + } + else if ( !strcmp (*argv, "--no-pinpad")) + { + no_pinpad = 1; + argc--; argv++; + } + else if ( !strcmp (*argv, "--verify-123456")) + { + verify_123456 = 1; + argc--; argv++; + } + else + break; + } + + rc = ccid_open_reader (&ccid, argc? *argv:NULL); + if (rc) + return 1; + + if (!no_poll) + ccid_poll (ccid); + fputs ("getting ATR ...\n", stderr); + rc = ccid_get_atr (ccid, NULL, 0, NULL); + if (rc) + { + print_error (rc); + return 1; + } + + if (!no_poll) + ccid_poll (ccid); + fputs ("getting slot status ...\n", stderr); + rc = ccid_slot_status (ccid, &slotstat); + if (rc) + { + print_error (rc); + return 1; + } + + if (!no_poll) + ccid_poll (ccid); + + fputs ("selecting application OpenPGP ....\n", stderr); + { + static unsigned char apdu[] = { + 0, 0xA4, 4, 0, 6, 0xD2, 0x76, 0x00, 0x01, 0x24, 0x01}; + rc = ccid_transceive (ccid, + apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + + + if (!no_poll) + ccid_poll (ccid); + + fputs ("getting OpenPGP DO 0x65 ....\n", stderr); + { + static unsigned char apdu[] = { 0, 0xCA, 0, 0x65, 254 }; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + + if (!no_pinpad) + { + } + + if (!no_pinpad) + { + static unsigned char apdu[] = { 0, 0x20, 0, 0x81 }; + + + if (ccid_transceive_secure (ccid, + apdu, sizeof apdu, + 1, 0, 0, 0, + NULL, 0, NULL)) + fputs ("can't verify using a PIN-Pad reader\n", stderr); + else + { + fputs ("verifying CHV1 using the PINPad ....\n", stderr); + + rc = ccid_transceive_secure (ccid, + apdu, sizeof apdu, + 1, 0, 0, 0, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + did_verify = 1; + } + } + + if (verify_123456 && !did_verify) + { + fputs ("verifying that CHV1 is 123456....\n", stderr); + { + static unsigned char apdu[] = {0, 0x20, 0, 0x81, + 6, '1','2','3','4','5','6'}; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + } + + if (!rc) + { + fputs ("getting OpenPGP DO 0x5E ....\n", stderr); + { + static unsigned char apdu[] = { 0, 0xCA, 0, 0x5E, 254 }; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + } + + ccid_close_reader (ccid); + + return 0; +} + +/* + * Local Variables: + * compile-command: "gcc -DTEST -Wall -I/usr/local/include -lusb -g ccid-driver.c" + * End: + */ +#endif /*TEST*/ +#endif /*HAVE_LIBUSB*/ + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid/src/ccid/ccid-driver.h b/librfid/src/ccid/ccid-driver.h new file mode 100644 index 0000000..ae6b7fd --- /dev/null +++ b/librfid/src/ccid/ccid-driver.h @@ -0,0 +1,108 @@ +/* ccid-driver.c - USB ChipCardInterfaceDevices driver + * Copyright (C) 2003 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG 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. + * + * GnuPG 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. + * + * ALTERNATIVELY, this file may be distributed under the terms of the + * following license, in which case the provisions of this license are + * required INSTEAD OF the GNU General Public License. If you wish to + * allow use of your version of this file only under the terms of the + * GNU General Public License, and not to allow others to use your + * version of this file under the terms of the following license, + * indicate your decision by deleting this paragraph and the license + * below. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Id: ccid-driver.h 3887 2005-09-09 11:18:08Z wk $ + */ + +#ifndef CCID_DRIVER_H +#define CCID_DRIVER_H + +/* The CID driver returns the same error codes as the status words + used by GnuPG's apdu.h. For ease of maintenance they should always + match. */ +#define CCID_DRIVER_ERR_OUT_OF_CORE 0x10001 +#define CCID_DRIVER_ERR_INV_VALUE 0x10002 +#define CCID_DRIVER_ERR_INCOMPLETE_CARD_RESPONSE = 0x10003 +#define CCID_DRIVER_ERR_NO_DRIVER 0x10004 +#define CCID_DRIVER_ERR_NOT_SUPPORTED 0x10005 +#define CCID_DRIVER_ERR_LOCKING_FAILED 0x10006 +#define CCID_DRIVER_ERR_BUSY 0x10007 +#define CCID_DRIVER_ERR_NO_CARD 0x10008 +#define CCID_DRIVER_ERR_CARD_INACTIVE 0x10009 +#define CCID_DRIVER_ERR_CARD_IO_ERROR 0x1000a +#define CCID_DRIVER_ERR_GENERAL_ERROR 0x1000b +#define CCID_DRIVER_ERR_NO_READER 0x1000c +#define CCID_DRIVER_ERR_ABORTED 0x1000d +#define CCID_DRIVER_ERR_NO_KEYPAD 0x1000e + +struct ccid_driver_s; +typedef struct ccid_driver_s *ccid_driver_t; + +int ccid_set_debug_level (int level); +char *ccid_get_reader_list (void); +int ccid_open_reader (ccid_driver_t *handle, const char *readerid); +int ccid_shutdown_reader (ccid_driver_t handle); +int ccid_close_reader (ccid_driver_t handle); +int ccid_get_atr (ccid_driver_t handle, + unsigned char *atr, size_t maxatrlen, size_t *atrlen); +int ccid_slot_status (ccid_driver_t handle, int *statusbits); +int ccid_transceive (ccid_driver_t handle, + const unsigned char *apdu, size_t apdulen, + unsigned char *resp, size_t maxresplen, size_t *nresp); +int ccid_transceive_secure (ccid_driver_t handle, + const unsigned char *apdu, size_t apdulen, + int pin_mode, + int pinlen_min, int pinlen_max, int pin_padlen, + unsigned char *resp, size_t maxresplen, size_t *nresp); +int ccid_transceive_escape (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *resp, size_t maxresplen, + size_t *nresp); + + + +#endif /*CCID_DRIVER_H*/ + + + diff --git a/librfid/src/ccid/rfid_reader_cm5121_ccid_direct.c b/librfid/src/ccid/rfid_reader_cm5121_ccid_direct.c new file mode 100644 index 0000000..9879ccf --- /dev/null +++ b/librfid/src/ccid/rfid_reader_cm5121_ccid_direct.c @@ -0,0 +1,42 @@ +/* CM5121 backend for 'internal' CCID driver */ +#include +#include +#include + +#include + +#ifndef LIBRFID_FIRMWARE + +#include + +#include "ccid-driver.h" + +/* this is the sole function required by rfid_reader_cm5121.c */ +int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len) +{ + int rc; + ccid_driver_t ch = handle; + size_t maxrxlen = *rx_len; + + rc = ccid_transceive_escape (ch, tx_buf, tx_len, + rx_buf, maxrxlen, rx_len); + + return rc; +} + +int cm5121_source_init(struct rfid_asic_transport_handle *rath) +{ + int rc; + + rc = ccid_open_reader(&rath->data, NULL); + if (rc) { + fprintf (stderr, "failed to open CCID reader: %#x\n", rc); + return -1; + } + return 0; +} + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid/src/cm5121_source.h b/librfid/src/cm5121_source.h new file mode 100644 index 0000000..8646703 --- /dev/null +++ b/librfid/src/cm5121_source.h @@ -0,0 +1,2 @@ + +extern int cm5121_source_init(struct rfid_asic_transport_handle *rath); diff --git a/librfid/src/librfid.pc b/librfid/src/librfid.pc new file mode 100644 index 0000000..65ffebc --- /dev/null +++ b/librfid/src/librfid.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +sysincludedir=@sysincludedir@ + +Name: librfid +Description: librfid +Version: 0.2.0 +Libs: -L${libdir} -lrfid +Cflags: -I${sysincludedir} -I${includedir} diff --git a/librfid/src/librfid.pc.in b/librfid/src/librfid.pc.in new file mode 100644 index 0000000..6c64c00 --- /dev/null +++ b/librfid/src/librfid.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +sysincludedir=@sysincludedir@ + +Name: librfid +Description: librfid +Version: @VERSION@ +Libs: -L${libdir} @LIBS@ -lrfid +Cflags: -I${sysincludedir} -I${includedir} diff --git a/librfid/src/libusb_dyn.c b/librfid/src/libusb_dyn.c new file mode 100644 index 0000000..d65d909 --- /dev/null +++ b/librfid/src/libusb_dyn.c @@ -0,0 +1,484 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include +#include + +#include "libusb_dyn.h" + +#define LIBUSB_DLL_NAME "libusb0.dll" + +typedef usb_dev_handle * (*usb_open_t)(struct usb_device *dev); +typedef int (*usb_close_t)(usb_dev_handle *dev); +typedef int (*usb_get_string_t)(usb_dev_handle *dev, int index, int langid, + char *buf, size_t buflen); +typedef int (*usb_get_string_simple_t)(usb_dev_handle *dev, int index, + char *buf, size_t buflen); +typedef int (*usb_get_descriptor_by_endpoint_t)(usb_dev_handle *udev, int ep, + unsigned char type, + unsigned char index, + void *buf, int size); +typedef int (*usb_get_descriptor_t)(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); +typedef int (*usb_bulk_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_bulk_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_control_msg_t)(usb_dev_handle *dev, int requesttype, + int request, int value, int index, + char *bytes, int size, int timeout); +typedef int (*usb_set_configuration_t)(usb_dev_handle *dev, int configuration); +typedef int (*usb_claim_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_release_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_set_altinterface_t)(usb_dev_handle *dev, int alternate); +typedef int (*usb_resetep_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_clear_halt_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_reset_t)(usb_dev_handle *dev); +typedef char * (*usb_strerror_t)(void); +typedef void (*usb_init_t)(void); +typedef void (*usb_set_debug_t)(int level); +typedef int (*usb_find_busses_t)(void); +typedef int (*usb_find_devices_t)(void); +typedef struct usb_device * (*usb_device_t)(usb_dev_handle *dev); +typedef struct usb_bus * (*usb_get_busses_t)(void); +typedef int (*usb_install_service_np_t)(void); +typedef int (*usb_uninstall_service_np_t)(void); +typedef int (*usb_install_driver_np_t)(const char *inf_file); +typedef const struct usb_version * (*usb_get_version_t)(void); +typedef int (*usb_isochronous_setup_async_t)(usb_dev_handle *dev, + void **context, + unsigned char ep, int pktsize); +typedef int (*usb_bulk_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_interrupt_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_submit_async_t)(void *context, char *bytes, int size); +typedef int (*usb_reap_async_t)(void *context, int timeout); +typedef int (*usb_free_async_t)(void **context); + + +static usb_open_t _usb_open = NULL; +static usb_close_t _usb_close = NULL; +static usb_get_string_t _usb_get_string = NULL; +static usb_get_string_simple_t _usb_get_string_simple = NULL; +static usb_get_descriptor_by_endpoint_t _usb_get_descriptor_by_endpoint = NULL; +static usb_get_descriptor_t _usb_get_descriptor = NULL; +static usb_bulk_write_t _usb_bulk_write = NULL; +static usb_bulk_read_t _usb_bulk_read = NULL; +static usb_interrupt_write_t _usb_interrupt_write = NULL; +static usb_interrupt_read_t _usb_interrupt_read = NULL; +static usb_control_msg_t _usb_control_msg = NULL; +static usb_set_configuration_t _usb_set_configuration = NULL; +static usb_claim_interface_t _usb_claim_interface = NULL; +static usb_release_interface_t _usb_release_interface = NULL; +static usb_set_altinterface_t _usb_set_altinterface = NULL; +static usb_resetep_t _usb_resetep = NULL; +static usb_clear_halt_t _usb_clear_halt = NULL; +static usb_reset_t _usb_reset = NULL; +static usb_strerror_t _usb_strerror = NULL; +static usb_init_t _usb_init = NULL; +static usb_set_debug_t _usb_set_debug = NULL; +static usb_find_busses_t _usb_find_busses = NULL; +static usb_find_devices_t _usb_find_devices = NULL; +static usb_device_t _usb_device = NULL; +static usb_get_busses_t _usb_get_busses = NULL; +static usb_install_service_np_t _usb_install_service_np = NULL; +static usb_uninstall_service_np_t _usb_uninstall_service_np = NULL; +static usb_install_driver_np_t _usb_install_driver_np = NULL; +static usb_get_version_t _usb_get_version = NULL; +static usb_isochronous_setup_async_t _usb_isochronous_setup_async = NULL; +static usb_bulk_setup_async_t _usb_bulk_setup_async = NULL; +static usb_interrupt_setup_async_t _usb_interrupt_setup_async = NULL; +static usb_submit_async_t _usb_submit_async = NULL; +static usb_reap_async_t _usb_reap_async = NULL; +static usb_free_async_t _usb_free_async = NULL; + + +void usb_init(void) +{ + HINSTANCE libusb_dll = LoadLibrary(LIBUSB_DLL_NAME); + + if(!libusb_dll) + return; + + timeBeginPeriod(1); + + _usb_open = (usb_open_t) + GetProcAddress(libusb_dll, "usb_open"); + _usb_close = (usb_close_t) + GetProcAddress(libusb_dll, "usb_close"); + _usb_get_string = (usb_get_string_t) + GetProcAddress(libusb_dll, "usb_get_string"); + _usb_get_string_simple = (usb_get_string_simple_t) + GetProcAddress(libusb_dll, "usb_get_string_simple"); + _usb_get_descriptor_by_endpoint = (usb_get_descriptor_by_endpoint_t) + GetProcAddress(libusb_dll, "usb_get_descriptor_by_endpoint"); + _usb_get_descriptor = (usb_get_descriptor_t) + GetProcAddress(libusb_dll, "usb_get_descriptor"); + _usb_bulk_write = (usb_bulk_write_t) + GetProcAddress(libusb_dll, "usb_bulk_write"); + _usb_bulk_read = (usb_bulk_read_t) + GetProcAddress(libusb_dll, "usb_bulk_read"); + _usb_interrupt_write = (usb_interrupt_write_t) + GetProcAddress(libusb_dll, "usb_interrupt_write"); + _usb_interrupt_read = (usb_interrupt_read_t) + GetProcAddress(libusb_dll, "usb_interrupt_read"); + _usb_control_msg = (usb_control_msg_t) + GetProcAddress(libusb_dll, "usb_control_msg"); + _usb_set_configuration = (usb_set_configuration_t) + GetProcAddress(libusb_dll, "usb_set_configuration"); + _usb_claim_interface = (usb_claim_interface_t) + GetProcAddress(libusb_dll, "usb_claim_interface"); + _usb_release_interface = (usb_release_interface_t) + GetProcAddress(libusb_dll, "usb_release_interface"); + _usb_set_altinterface = (usb_set_altinterface_t) + GetProcAddress(libusb_dll, "usb_set_altinterface"); + _usb_resetep = (usb_resetep_t) + GetProcAddress(libusb_dll, "usb_resetep"); + _usb_clear_halt = (usb_clear_halt_t) + GetProcAddress(libusb_dll, "usb_clear_halt"); + _usb_reset = (usb_reset_t) + GetProcAddress(libusb_dll, "usb_reset"); + _usb_strerror = (usb_strerror_t) + GetProcAddress(libusb_dll, "usb_strerror"); + _usb_init = (usb_init_t) + GetProcAddress(libusb_dll, "usb_init"); + _usb_set_debug = (usb_set_debug_t) + GetProcAddress(libusb_dll, "usb_set_debug"); + _usb_find_busses = (usb_find_busses_t) + GetProcAddress(libusb_dll, "usb_find_busses"); + _usb_find_devices = (usb_find_devices_t) + GetProcAddress(libusb_dll, "usb_find_devices"); + _usb_device = (usb_device_t) + GetProcAddress(libusb_dll, "usb_device"); + _usb_get_busses = (usb_get_busses_t) + GetProcAddress(libusb_dll, "usb_get_busses"); + _usb_install_service_np = (usb_install_service_np_t) + GetProcAddress(libusb_dll, "usb_install_service_np"); + _usb_uninstall_service_np = (usb_uninstall_service_np_t) + GetProcAddress(libusb_dll, "usb_uninstall_service_np"); + _usb_install_driver_np = (usb_install_driver_np_t) + GetProcAddress(libusb_dll, "usb_install_driver_np"); + _usb_get_version = (usb_get_version_t) + GetProcAddress(libusb_dll, "usb_get_version"); + _usb_isochronous_setup_async = (usb_isochronous_setup_async_t) + GetProcAddress(libusb_dll, "usb_isochronous_setup_async"); + _usb_bulk_setup_async = (usb_bulk_setup_async_t) + GetProcAddress(libusb_dll, "usb_bulk_setup_async"); + _usb_interrupt_setup_async = (usb_interrupt_setup_async_t) + GetProcAddress(libusb_dll, "usb_interrupt_setup_async"); + _usb_submit_async = (usb_submit_async_t) + GetProcAddress(libusb_dll, "usb_submit_async"); + _usb_reap_async = (usb_reap_async_t) + GetProcAddress(libusb_dll, "usb_reap_async"); + _usb_free_async = (usb_free_async_t) + GetProcAddress(libusb_dll, "usb_free_async"); + + if(_usb_init) + _usb_init(); +} + +usb_dev_handle *usb_open(struct usb_device *dev) +{ + if(_usb_open) + return _usb_open(dev); + else + return NULL; +} + +int usb_close(usb_dev_handle *dev) +{ + if(_usb_close) + return _usb_close(dev); + else + return -ENOFILE; +} + +int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen) +{ + if(_usb_get_string) + return _usb_get_string(dev, index, langid, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen) +{ + if(_usb_get_string_simple) + return _usb_get_string_simple(dev, index, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size) +{ + if(_usb_get_descriptor_by_endpoint) + return _usb_get_descriptor_by_endpoint(udev, ep, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size) +{ + if(_usb_get_descriptor) + return _usb_get_descriptor(udev, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_bulk_write) + return _usb_bulk_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_bulk_read) + return _usb_bulk_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_interrupt_write) + return _usb_interrupt_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_interrupt_read) + return _usb_interrupt_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout) +{ + if(_usb_control_msg) + return _usb_control_msg(dev, requesttype, request, value, index, bytes, + size, timeout); + else + return -ENOFILE; +} + +int usb_set_configuration(usb_dev_handle *dev, int configuration) +{ + if(_usb_set_configuration) + return _usb_set_configuration(dev, configuration); + else + return -ENOFILE; +} + +int usb_claim_interface(usb_dev_handle *dev, int interface) +{ + if(_usb_claim_interface) + return _usb_claim_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_release_interface(usb_dev_handle *dev, int interface) +{ + if(_usb_release_interface) + return _usb_release_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_set_altinterface(usb_dev_handle *dev, int alternate) +{ + if(_usb_set_altinterface) + return _usb_set_altinterface(dev, alternate); + else + return -ENOFILE; +} + +int usb_resetep(usb_dev_handle *dev, unsigned int ep) +{ + if(_usb_resetep) + return _usb_resetep(dev, ep); + else + return -ENOFILE; +} + +int usb_clear_halt(usb_dev_handle *dev, unsigned int ep) +{ + if(_usb_clear_halt) + return _usb_clear_halt(dev, ep); + else + return -ENOFILE; +} + +int usb_reset(usb_dev_handle *dev) +{ + if(_usb_reset) + return _usb_reset(dev); + else + return -ENOFILE; +} + +char *usb_strerror(void) +{ + if(_usb_strerror) + return _usb_strerror(); + else + return NULL; +} + +void usb_set_debug(int level) +{ + if(_usb_set_debug) + return _usb_set_debug(level); +} + +int usb_find_busses(void) +{ + if(_usb_find_busses) + return _usb_find_busses(); + else + return -ENOFILE; +} + +int usb_find_devices(void) +{ + if(_usb_find_devices) + return _usb_find_devices(); + else + return -ENOFILE; +} + +struct usb_device *usb_device(usb_dev_handle *dev) +{ + if(_usb_device) + return _usb_device(dev); + else + return NULL; +} + +struct usb_bus *usb_get_busses(void) +{ + if(_usb_get_busses) + return _usb_get_busses(); + else + return NULL; +} + +int usb_install_service_np(void) +{ + if(_usb_install_service_np) + return _usb_install_service_np(); + else + return -ENOFILE; +} + +int usb_uninstall_service_np(void) +{ + if(_usb_uninstall_service_np) + return _usb_uninstall_service_np(); + else + return -ENOFILE; +} + +int usb_install_driver_np(const char *inf_file) +{ + if(_usb_install_driver_np) + return _usb_install_driver_np(inf_file); + else + return -ENOFILE; +} + +const struct usb_version *usb_get_version(void) +{ + if(_usb_get_version) + return _usb_get_version(); + else + return NULL; +} + +int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize) +{ + if(_usb_isochronous_setup_async) + return _usb_isochronous_setup_async(dev, context, ep, pktsize); + else + return -ENOFILE; +} + +int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if(_usb_bulk_setup_async) + return _usb_bulk_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if(_usb_interrupt_setup_async) + return _usb_interrupt_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_submit_async(void *context, char *bytes, int size) +{ + if(_usb_submit_async) + return _usb_submit_async(context, bytes, size); + else + return -ENOFILE; +} + +int usb_reap_async(void *context, int timeout) +{ + if(_usb_reap_async) + return _usb_reap_async(context, timeout); + else + return -ENOFILE; +} + +int usb_free_async(void **context) +{ + if(_usb_free_async) + return _usb_free_async(context); + else + return -ENOFILE; +} diff --git a/librfid/src/libusb_dyn.h b/librfid/src/libusb_dyn.h new file mode 100644 index 0000000..9fc43d4 --- /dev/null +++ b/librfid/src/libusb_dyn.h @@ -0,0 +1,394 @@ +#ifndef __USB_H__ +#define __USB_H__ + +#include +#include + +/* + * 'interface' is defined somewhere in the Windows header files. This macro + * is deleted here to avoid conflicts and compile errors. + */ + +#ifdef interface +#undef interface +#endif + +/* + * PATH_MAX from limits.h can't be used on Windows if the dll and + * import libraries are build/used by different compilers + */ + +#define LIBUSB_PATH_MAX 512 + + +/* + * USB spec information + * + * This is all stuff grabbed from various USB specs and is pretty much + * not subject to change + */ + +/* + * Device and/or Interface Class codes + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* + * Descriptor types + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* + * Descriptor sizes per descriptor type + */ +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define USB_DT_HUB_NONVAR_SIZE 7 + + +/* ensure byte-packed structures */ +#include + + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header { + unsigned char bLength; + unsigned char bDescriptorType; +}; + +/* String descriptor */ +struct usb_string_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wData[1]; +}; + +/* HID descriptor */ +struct usb_hid_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdHID; + unsigned char bCountryCode; + unsigned char bNumDescriptors; +}; + +/* Endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; + unsigned char bRefresh; + unsigned char bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +/* Interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; + + struct usb_endpoint_descriptor *endpoint; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ + +struct usb_interface { + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* Configuration descriptor information.. */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; + + struct usb_interface *interface; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +/* Device descriptor */ +struct usb_device_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct usb_ctrl_setup { + unsigned char bRequestType; + unsigned char bRequest; + unsigned short wValue; + unsigned short wIndex; + unsigned short wLength; +}; + +/* + * Standard requests + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +/* 0x02 is reserved */ +#define USB_REQ_SET_FEATURE 0x03 +/* 0x04 is reserved */ +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Various libusb API related stuff + */ + +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* + * This is supposed to look weird. This file is generated from autoconf + * and I didn't want to make this too complicated. + */ +#define USB_LE16_TO_CPU(x) + +/* Data types */ +/* struct usb_device; */ +/* struct usb_bus; */ + +struct usb_device { + struct usb_device *next, *prev; + + char filename[LIBUSB_PATH_MAX]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; /* Darwin support */ + + unsigned char devnum; + + unsigned char num_children; + struct usb_device **children; +}; + +struct usb_bus { + struct usb_bus *next, *prev; + + char dirname[LIBUSB_PATH_MAX]; + + struct usb_device *devices; + unsigned long location; + + struct usb_device *root_dev; +}; + +/* Version information, Windows specific */ +struct usb_version { + struct { + int major; + int minor; + int micro; + int nano; + } dll; + struct { + int major; + int minor; + int micro; + int nano; + } driver; +}; + + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +#ifndef __USB_C__ +#define usb_busses usb_get_busses() +#endif + + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + /* Function prototypes */ + + /* usb.c */ + usb_dev_handle *usb_open(struct usb_device *dev); + int usb_close(usb_dev_handle *dev); + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ + int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size); + int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout); + int usb_set_configuration(usb_dev_handle *dev, int configuration); + int usb_claim_interface(usb_dev_handle *dev, int interface); + int usb_release_interface(usb_dev_handle *dev, int interface); + int usb_set_altinterface(usb_dev_handle *dev, int alternate); + int usb_resetep(usb_dev_handle *dev, unsigned int ep); + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); + int usb_reset(usb_dev_handle *dev); + + char *usb_strerror(void); + + void usb_init(void); + void usb_set_debug(int level); + int usb_find_busses(void); + int usb_find_devices(void); + struct usb_device *usb_device(usb_dev_handle *dev); + struct usb_bus *usb_get_busses(void); + + + /* Windows specific functions */ + + #define LIBUSB_HAS_INSTALL_SERVICE_NP 1 + int usb_install_service_np(void); + void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 + int usb_uninstall_service_np(void); + void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_INSTALL_DRIVER_NP 1 + int usb_install_driver_np(const char *inf_file); + void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 + int usb_touch_inf_file_np(const char *inf_file); + void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 + int usb_install_needs_restart_np(void); + + const struct usb_version *usb_get_version(void); + + int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize); + int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + + int usb_submit_async(void *context, char *bytes, int size); + int usb_reap_async(void *context, int timeout); + int usb_reap_async_nocancel(void *context, int timeout); + int usb_cancel_async(void *context); + int usb_free_async(void **context); + + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_H__ */ + diff --git a/librfid/src/rc632.h b/librfid/src/rc632.h new file mode 100644 index 0000000..49e1c4d --- /dev/null +++ b/librfid/src/rc632.h @@ -0,0 +1,272 @@ +/* Register definitions for Philips CL RC632 RFID Reader IC + * + * (C) 2005 Harald Welte + * + * Licensed under GNU General Public License, Version 2 + */ + +enum rc632_registers { + RC632_REG_PAGE0 = 0x00, + RC632_REG_COMMAND = 0x01, + RC632_REG_FIFO_DATA = 0x02, + RC632_REG_PRIMARY_STATUS = 0x03, + RC632_REG_FIFO_LENGTH = 0x04, + RC632_REG_SECONDARY_STATUS = 0x05, + RC632_REG_INTERRUPT_EN = 0x06, + RC632_REG_INTERRUPT_RQ = 0x07, + + RC632_REG_PAGE1 = 0x08, + RC632_REG_CONTROL = 0x09, + RC632_REG_ERROR_FLAG = 0x0a, + RC632_REG_COLL_POS = 0x0b, + RC632_REG_TIMER_VALUE = 0x0c, + RC632_REG_CRC_RESULT_LSB = 0x0d, + RC632_REG_CRC_RESULT_MSB = 0x0e, + RC632_REG_BIT_FRAMING = 0x0f, + + RC632_REG_PAGE2 = 0x10, + RC632_REG_TX_CONTROL = 0x11, + RC632_REG_CW_CONDUCTANCE = 0x12, + RC632_REG_MOD_CONDUCTANCE = 0x13, + RC632_REG_CODER_CONTROL = 0x14, + RC632_REG_MOD_WIDTH = 0x15, + RC632_REG_MOD_WIDTH_SOF = 0x16, + RC632_REG_TYPE_B_FRAMING = 0x17, + + RC632_REG_PAGE3 = 0x18, + RC632_REG_RX_CONTROL1 = 0x19, + RC632_REG_DECODER_CONTROL = 0x1a, + RC632_REG_BIT_PHASE = 0x1b, + RC632_REG_RX_THRESHOLD = 0x1c, + RC632_REG_BPSK_DEM_CONTROL = 0x1d, + RC632_REG_RX_CONTROL2 = 0x1e, + RC632_REG_CLOCK_Q_CONTROL = 0x1f, + + RC632_REG_PAGE4 = 0x20, + RC632_REG_RX_WAIT = 0x21, + RC632_REG_CHANNEL_REDUNDANCY = 0x22, + RC632_REG_CRC_PRESET_LSB = 0x23, + RC632_REG_CRC_PRESET_MSB = 0x24, + RC632_REG_TIME_SLOT_PERIOD = 0x25, + RC632_REG_MFOUT_SELECT = 0x26, + RC632_REG_PRESET_27 = 0x27, + + RC632_REG_PAGE5 = 0x28, + RC632_REG_FIFO_LEVEL = 0x29, + RC632_REG_TIMER_CLOCK = 0x2a, + RC632_REG_TIMER_CONTROL = 0x2b, + RC632_REG_TIMER_RELOAD = 0x2c, + RC632_REG_IRQ_PIN_CONFIG = 0x2d, + RC632_REG_PRESET_2E = 0x2e, + RC632_REG_PRESET_2F = 0x2f, + + RC632_REG_PAGE6 = 0x30, + + RC632_REG_PAGE7 = 0x38, + RC632_REG_TEST_ANA_SELECT = 0x3a, + RC632_REG_TEST_DIGI_SELECT = 0x3d, +}; + +enum rc632_reg_status { + RC632_STAT_LOALERT = 0x01, + RC632_STAT_HIALERT = 0x02, + RC632_STAT_ERR = 0x04, + RC632_STAT_IRQ = 0x08, +#define RC632_STAT_MODEM_MASK 0x70 + RC632_STAT_MODEM_IDLE = 0x00, + RC632_STAT_MODEM_TXSOF = 0x10, + RC632_STAT_MODEM_TXDATA = 0x20, + RC632_STAT_MODEM_TXEOF = 0x30, + RC632_STAT_MODEM_GOTORX = 0x40, + RC632_STAT_MODEM_PREPARERX = 0x50, + RC632_STAT_MODEM_AWAITINGRX = 0x60, + RC632_STAT_MODEM_RECV = 0x70, +}; + +enum rc632_reg_command { + RC632_CMD_IDLE = 0x00, + RC632_CMD_WRITE_E2 = 0x01, + RC632_CMD_READ_E2 = 0x03, + RC632_CMD_LOAD_CONFIG = 0x07, + RC632_CMD_LOAD_KEY_E2 = 0x0b, + RC632_CMD_AUTHENT1 = 0x0c, + RC632_CMD_CALC_CRC = 0x12, + RC632_CMD_AUTHENT2 = 0x14, + RC632_CMD_RECEIVE = 0x16, + RC632_CMD_LOAD_KEY = 0x19, + RC632_CMD_TRANSMIT = 0x1a, + RC632_CMD_TRANSCEIVE = 0x1e, + RC632_CMD_STARTUP = 0x3f, +}; + +enum rc632_reg_interrupt { + RC632_INT_LOALERT = 0x01, + RC632_INT_HIALERT = 0x02, + RC632_INT_IDLE = 0x04, + RC632_INT_RX = 0x08, + RC632_INT_TX = 0x10, + RC632_INT_TIMER = 0x20, + RC632_INT_SET = 0x80, +}; + +enum rc632_reg_control { + RC632_CONTROL_FIFO_FLUSH = 0x01, + RC632_CONTROL_TIMER_START = 0x02, + RC632_CONTROL_TIMER_STOP = 0x04, + RC632_CONTROL_CRYPTO1_ON = 0x08, + RC632_CONTROL_POWERDOWN = 0x10, + RC632_CONTROL_STANDBY = 0x20, +}; + +enum rc632_reg_error_flag { + RC632_ERR_FLAG_COL_ERR = 0x01, + RC632_ERR_FLAG_PARITY_ERR = 0x02, + RC632_ERR_FLAG_FRAMING_ERR = 0x04, + RC632_ERR_FLAG_CRC_ERR = 0x08, + RC632_ERR_FLAG_FIFO_OVERFLOW = 0x10, + RC632_ERR_FLAG_ACCESS_ERR = 0x20, + RC632_ERR_FLAG_KEY_ERR = 0x40, +}; + +enum rc632_reg_tx_control { + RC632_TXCTRL_TX1_RF_EN = 0x01, + RC632_TXCTRL_TX2_RF_EN = 0x02, + RC632_TXCTRL_TX2_CW = 0x04, + RC632_TXCTRL_TX2_INV = 0x08, + RC632_TXCTRL_FORCE_100_ASK = 0x10, + + RC632_TXCTRL_MOD_SRC_LOW = 0x00, + RC632_TXCTRL_MOD_SRC_HIGH = 0x20, + RC632_TXCTRL_MOD_SRC_INT = 0x40, + RC632_TXCTRL_MOD_SRC_MFIN = 0x60, +}; + +enum rc632_reg_coder_control { + /* bit 2-0 TXCoding */ +#define RC632_CDRCTRL_TXCD_MASK 0x07 + RC632_CDRCTRL_TXCD_NRZ = 0x00, + RC632_CDRCTRL_TXCD_14443A = 0x01, + RC632_CDRCTRL_TXCD_ICODE_STD = 0x04, + RC632_CDRCTRL_TXCD_ICODE_FAST = 0x05, + RC632_CDRCTRL_TXCD_15693_STD = 0x06, + RC632_CDRCTRL_TXCD_15693_FAST = 0x07, + + /* bit5-3 CoderRate*/ +#define RC632_CDRCTRL_RATE_MASK 0x38 + RC632_CDRCTRL_RATE_848K = 0x00, + RC632_CDRCTRL_RATE_424K = 0x08, + RC632_CDRCTRL_RATE_212K = 0x10, + RC632_CDRCTRL_RATE_106K = 0x18, + RC632_CDRCTRL_RATE_14443B = 0x20, + RC632_CDRCTRL_RATE_15693 = 0x28, + RC632_CDRCTRL_RATE_ICODE_FAST = 0x30, + + /* bit 7 SendOnePuls */ + RC632_CDRCTRL_15693_EOF_PULSE = 0x80, +}; + +enum rc632_erg_type_b_framing { + RC632_TBFRAMING_SOF_10L_2H = 0x00, + RC632_TBFRAMING_SOF_10L_3H = 0x01, + RC632_TBFRAMING_SOF_11L_2H = 0x02, + RC632_TBFRAMING_SOF_11L_3H = 0x03, + + RC632_TBFRAMING_EOF_10 = 0x00, + RC632_TBFRAMING_EOF_11 = 0x20, + + RC632_TBFRAMING_NO_TX_SOF = 0x80, + RC632_TBFRAMING_NO_TX_EOF = 0x40, +}; +#define RC632_TBFRAMING_SPACE_SHIFT 2 +#define RC632_TBFRAMING_SPACE_MASK 7 + +enum rc632_reg_rx_control1 { + RC632_RXCTRL1_GAIN_20DB = 0x00, + RC632_RXCTRL1_GAIN_24DB = 0x01, + RC632_RXCTRL1_GAIN_31DB = 0x02, + RC632_RXCTRL1_GAIN_35DB = 0x03, + + RC632_RXCTRL1_LP_OFF = 0x04, + RC632_RXCTRL1_ISO15693 = 0x08, + RC632_RXCTRL1_ISO14443 = 0x10, + +#define RC632_RXCTRL1_SUBCP_MASK 0xe0 + RC632_RXCTRL1_SUBCP_1 = 0x00, + RC632_RXCTRL1_SUBCP_2 = 0x20, + RC632_RXCTRL1_SUBCP_4 = 0x40, + RC632_RXCTRL1_SUBCP_8 = 0x60, + RC632_RXCTRL1_SUBCP_16 = 0x80, +}; + +enum rc632_reg_decoder_control { + RC632_DECCTRL_MANCHESTER = 0x00, + RC632_DECCTRL_BPSK = 0x01, + + RC632_DECCTRL_RX_INVERT = 0x04, + + RC632_DECCTRL_RXFR_ICODE = 0x00, + RC632_DECCTRL_RXFR_14443A = 0x08, + RC632_DECCTRL_RXFR_15693 = 0x10, + RC632_DECCTRL_RXFR_14443B = 0x18, + + RC632_DECCTRL_ZEROAFTERCOL = 0x20, + + RC632_DECCTRL_RX_MULTIPLE = 0x40, +}; + +enum rc632_reg_bpsk_dem_control { + RC632_BPSKD_TAUB_SHIFT = 0x00, + RC632_BPSKD_TAUB_MASK = 0x03, + + RC632_BPSKD_TAUD_SHIFT = 0x02, + RC632_BPSKD_TAUD_MASK = 0x03, + + RC632_BPSKD_FILTER_AMP_DETECT = 0x10, + RC632_BPSKD_NO_RX_EOF = 0x20, + RC632_BPSKD_NO_RX_EGT = 0x40, + RC632_BPSKD_NO_RX_SOF = 0x80, +}; + +enum rc632_reg_rx_control2 { + RC632_RXCTRL2_DECSRC_LOW = 0x00, + RC632_RXCTRL2_DECSRC_INT = 0x01, + RC632_RXCTRL2_DECSRC_SUBC_MFIN = 0x10, + RC632_RXCTRL2_DECSRC_BASE_MFIN = 0x11, + + RC632_RXCTRL2_AUTO_PD = 0x40, + RC632_RXCTRL2_CLK_I = 0x80, + RC632_RXCTRL2_CLK_Q = 0x00, +}; + +enum rc632_reg_channel_redundancy { + RC632_CR_PARITY_ENABLE = 0x01, + RC632_CR_PARITY_ODD = 0x02, + RC632_CR_TX_CRC_ENABLE = 0x04, + RC632_CR_RX_CRC_ENABLE = 0x08, + RC632_CR_CRC8 = 0x10, + RC632_CR_CRC3309 = 0x20, +}; + +enum rc632_reg_timer_control { + RC632_TMR_START_TX_BEGIN = 0x01, + RC632_TMR_START_TX_END = 0x02, + RC632_TMR_STOP_RX_BEGIN = 0x04, + RC632_TMR_STOP_RX_END = 0x08, +}; + +enum rc632_reg_timer_irq { + RC632_IRQ_LO_ALERT = 0x01, + RC632_IRQ_HI_ALERT = 0x02, + RC632_IRQ_IDLE = 0x04, + RC632_IRQ_RX = 0x08, + RC632_IRQ_TX = 0x10, + RC632_IRQ_TIMER = 0x20, + + RC632_IRQ_SET = 0x80, +}; + +enum rc632_reg_secondary_status { + RC632_SEC_ST_TMR_RUNNING = 0x80, + RC632_SEC_ST_E2_READY = 0x40, + RC632_SEC_ST_CRC_READY = 0x20, +}; diff --git a/librfid/src/rfid.c b/librfid/src/rfid.c new file mode 100644 index 0000000..fb5b9c3 --- /dev/null +++ b/librfid/src/rfid.c @@ -0,0 +1,112 @@ +/* librfid core + * (C) 2005-2006 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef LIBRFID_STATIC +struct rfid_asic_handle rfid_ah; +struct rfid_layer2_handle rfid_l2h; +struct rfid_protocol_handle rfid_ph; +struct rfid_asic_transport_handle rfid_ath; +struct rfid_reader_handle rfid_rh; +#endif + +#ifndef LIBRFID_FIRMWARE +const char * +rfid_hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} +#else +#define rfid_hexdump(x, y) hexdump(x, y) +#endif + +#if 0 +int rfid_setopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + const void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_READER: + return rfid_reader_setopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_setopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_setopt(optname, opt, optlen); + break; + case RFID_LEVEL_ASIC: + default: + return -EINVAL; + break; + } + + return 0; +} + +int rfid_getopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_READER: + return rfid_reader_getopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_getopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_getopt(optname, opt, optlen); + break; + case RFID_LEVEL_ASIC: + default: + return -EINVAL; + break; + } + + return 0; +} +#endif + +int rfid_init() +{ + return 0; +} + +void rfid_fini() +{ + /* FIXME: implementation */ +} diff --git a/librfid/src/rfid_access_mifare_classic.c b/librfid/src/rfid_access_mifare_classic.c new file mode 100644 index 0000000..03cb1e5 --- /dev/null +++ b/librfid/src/rfid_access_mifare_classic.c @@ -0,0 +1,230 @@ +#include +#include +#include + +#include +#include + +/* parse encoded data structure into c1/c2/c3 */ +int mfcl_compile_access(u_int8_t *encoded, + const struct mfcl_access_sect *ac) +{ + int b; + u_int8_t c1, c2, c3; + + c1 = c2 = c3 = 0; + + for (b = 0; b < 4; b++) { + if (ac->block[b] & 0x01) + c1 |= (1 << b); + if (ac->block[b] & 0x02) + c2 |= (1 << b); + if (ac->block[b] & 0x04) + c3 |= (1 << b); + } + + DEBUGP("compile: c1=%u c2=%u c3=%u\n", c1, c2, c3); + + encoded[3] = 0x00; + encoded[2] = c2 | (c3 << 4); + encoded[1] = (~c3 & 0xf) | (c1 << 4); + encoded[0] = (~c1 & 0xf) | ((~c2 & 0xf) << 4); + + return 0; +} + +/* parse mifare classic access conditions from card */ +int mfcl_parse_access(struct mfcl_access_sect *ac, u_int8_t *encoded) +{ + int b; + + u_int8_t c1, c2, c3; + + DEBUGP("encoded: %s\n", rfid_hexdump(encoded, 4)); + + c1 = encoded[1] >> 4; + c2 = encoded[2] & 0xf; + c3 = encoded[2] >> 4; + + DEBUGP("c1=0x%x, c2=0x%x, c3=0x%x\n", c1, c2, c3); + + memset(ac, 0, sizeof(*ac)); + for (b = 0; b < 4; b++) { + if (c1 & (1 << b)) + ac->block[b] = 0x1; + if (c2 & (1 << b)) + ac->block[b] |= 0x2; + if (c3 & (1 << b)) + ac->block[b] |= 0x4; + }; + + /* FIXME: verify the inverted access bits */ + + return 0; +} + + +/* functions below here are for our own internal decoded (orthogonal) + * format of access bits */ + +/* In the order of the table 3.7.3 in MFCL Product Specification Rev. 5.1 */ +static const struct mfcl_access_exp_block mfcl_exp_data[] = { + [0] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [2] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [1] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [3] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_KEY_B, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [4] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [6] = { + .read = MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [5] = { + .read = MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [7] = { + .read = MFCL_ACCESS_NEVER, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, +}; + +static const struct mfcl_access_exp_acc mfcl_exp_trailer[] = { + [0] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_A, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_KEY_A, + }, + [2] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [1] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_B, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_KEY_B, + }, + [3] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [4] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_A, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_KEY_A, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_KEY_A, + }, + [6] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_B, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_KEY_B, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_KEY_B, + }, + [5] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_KEY_B, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [7] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, +}; + +const char *mfcl_access_str[] = { + [MFCL_ACCESS_NEVER] = "NEVER", + [MFCL_ACCESS_KEY_A] = "A", + [MFCL_ACCESS_KEY_B] = "B", + [MFCL_ACCESS_KEY_A|MFCL_ACCESS_KEY_B] = "A|B", +}; + +void mfcl_access_to_exp(struct mfcl_access_exp_sect *exp, + const struct mfcl_access_sect *sect) +{ + int b; + for (b = 0; b < 3; b++) + exp->block[b] = mfcl_exp_data[sect->block[b]]; + exp->acc = mfcl_exp_trailer[sect->block[3]]; +} + +char *mfcl_access_exp_stringify(const struct mfcl_access_exp_block *exp) +{ + static char buf[80]; + + sprintf(buf, "READ: %s, WRITE: %s, INC: %s, DEC: %s", + mfcl_access_str[exp->read], + mfcl_access_str[exp->write], + mfcl_access_str[exp->inc], + mfcl_access_str[exp->dec]); + return buf; +} + +char *mfcl_access_exp_acc_stringify(const struct mfcl_access_exp_acc *acc) +{ + static char buf[80]; + + sprintf(buf, "KEY_A_RD: %s, KEY_A_WR: %s, ACC_RD: %s, ACC_WR: %s, " + "KEY_B_RD: %s, KEY_B_WR: %s", + mfcl_access_str[acc->key_a_rd], + mfcl_access_str[acc->key_a_wr], + mfcl_access_str[acc->acc_rd], + mfcl_access_str[acc->acc_wr], + mfcl_access_str[acc->key_b_rd], + mfcl_access_str[acc->key_b_wr]); + return buf; +} diff --git a/librfid/src/rfid_asic_rc632.c b/librfid/src/rfid_asic_rc632.c new file mode 100644 index 0000000..8885e42 --- /dev/null +++ b/librfid/src/rfid_asic_rc632.c @@ -0,0 +1,2176 @@ +/* Generic Philips CL RC632 Routines + * + * (C) 2005-2008 Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" +#include "rc632.h" + +/*#ifdef __MINGW32__ +#include "usleep.h" +#endif/*__MINGW32__*/ + +#define RC632_TMO_AUTH1 140 + +#define TIMER_RELAX_FACTOR 10 + +#define ENTER() DEBUGP("entering\n") +const struct rfid_asic rc632; + +struct register_file { + u_int8_t reg; + u_int8_t val; +}; + +/* Register and FIFO Access functions */ +static int +rc632_reg_write(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + return handle->rath->rat->priv.rc632.fn.reg_write(handle->rath, reg, val); +} + +static int +rc632_reg_read(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t *val) +{ + return handle->rath->rat->priv.rc632.fn.reg_read(handle->rath, reg, val); +} + +static int +rc632_fifo_write(struct rfid_asic_handle *handle, + u_int8_t len, + const u_int8_t *buf, + u_int8_t flags) +{ + return handle->rath->rat->priv.rc632.fn.fifo_write(handle->rath, + len, buf, flags); +} + +static int +rc632_fifo_read(struct rfid_asic_handle *handle, + u_int8_t len, + u_int8_t *buf) +{ + return handle->rath->rat->priv.rc632.fn.fifo_read(handle->rath, len, buf); +} + + +static int +rc632_set_bits(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) + return -1; + + /* if bits are already set, no need to set them again */ + if ((tmp & val) == val) + return 0; + + return rc632_reg_write(handle, reg, (tmp|val)&0xff); +} +static int +rc632_set_bit_mask(struct rfid_asic_handle *handle, + u_int8_t reg, u_int8_t mask, u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) + return ret; + + /* if bits are already like we want them, abort */ + if ((tmp & mask) == val) + return 0; + + return rc632_reg_write(handle, reg, (tmp & ~mask)|(val & mask)); +} + +static int +rc632_clear_bits(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) { + DEBUGP("error during reg_read(%p, %d):%d\n", + handle, reg, ret); + return -1; + } + /* if bits are already cleared, no need to clear them again */ + if ((tmp & val) == 0) + return 0; + + return rc632_reg_write(handle, reg, (tmp & ~val)&0xff); +} + +static int +rc632_clear_irqs(struct rfid_asic_handle *handle, u_int8_t bits) +{ + return rc632_reg_write(handle, RC632_REG_INTERRUPT_RQ, (~RC632_INT_SET)&bits); +} + +static int +rc632_rf_power(struct rfid_asic_handle *handle, int on) +{ + ENTER(); + if (on) + return rc632_set_bits(handle, RC632_REG_TX_CONTROL, + RC632_TXCTRL_TX1_RF_EN| + RC632_TXCTRL_TX2_RF_EN); + else + return rc632_clear_bits(handle, RC632_REG_TX_CONTROL, + RC632_TXCTRL_TX1_RF_EN| + RC632_TXCTRL_TX2_RF_EN); +} + +static int +rc632_power(struct rfid_asic_handle *handle, int on) +{ + ENTER(); + if (on) + return rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); + else + return rc632_set_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); +} + +static int +rc632_execute_script(struct rfid_asic_handle *h, struct register_file *f, + int len) +{ + int i, ret; + + for (i = 0; i < len; i++) { + ret = rc632_reg_write(h, f[i].reg, f[i].val); + if (ret < 0) + return ret; + } + + return 0; +} + +/* calculate best 8bit prescaler and divisor for given usec timeout */ +static int best_prescaler(u_int64_t timeout, u_int8_t *prescaler, + u_int8_t *divisor) +{ + u_int8_t best_prescaler, best_divisor, i; + int64_t smallest_diff; + + smallest_diff = LLONG_MAX; + best_prescaler = 0; + + for (i = 0; i < 21; i++) { + u_int64_t clk, tmp_div, res; + int64_t diff; + clk = 13560000 / (1 << i); + tmp_div = (clk * timeout) / 1000000; + tmp_div++; + + if ((tmp_div > 0xff) || (tmp_div > clk)) + continue; + + res = 1000000 / (clk / tmp_div); + diff = res - timeout; + + if (diff < 0) + continue; + + if (diff < smallest_diff) { + best_prescaler = i; + best_divisor = tmp_div; + smallest_diff = diff; + } + } + + *prescaler = best_prescaler; + *divisor = best_divisor; + + DEBUGP("timeout %u usec, prescaler = %u, divisor = %u\n", + timeout, best_prescaler, best_divisor); + + return 0; +} + +static int +rc632_timer_set(struct rfid_asic_handle *handle, + u_int64_t timeout) +{ + int ret; + u_int8_t prescaler, divisor, irq; + + timeout *= TIMER_RELAX_FACTOR; + + ret = best_prescaler(timeout, &prescaler, &divisor); + + ret = rc632_reg_write(handle, RC632_REG_TIMER_CLOCK, + prescaler & 0x1f); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_TIMER_CONTROL, + RC632_TMR_START_TX_END|RC632_TMR_STOP_RX_BEGIN); + + /* clear timer irq bit */ + ret = rc632_clear_irqs(handle, RC632_IRQ_TIMER); + + /* enable timer IRQ */ + ret |= rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET | RC632_IRQ_TIMER); + + ret |= rc632_reg_write(handle, RC632_REG_TIMER_RELOAD, divisor); + + return ret; +} + +/* Wait until RC632 is idle or TIMER IRQ has happened */ +static int rc632_wait_idle_timer(struct rfid_asic_handle *handle) +{ + int ret; + u_int8_t stat, irq, cmd; + + ret = rc632_reg_read(handle, RC632_REG_INTERRUPT_EN, &irq); + if (ret < 0) + return ret; + DEBUGP_INTERRUPT_FLAG("irq_en",irq); + + ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_EN, RC632_IRQ_SET + | RC632_IRQ_TIMER + | RC632_IRQ_IDLE + | RC632_IRQ_RX ); + if (ret < 0) + return ret; + + while (1) { + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &stat); + DEBUGP_STATUS_FLAG(stat); + if (stat & RC632_STAT_ERR) { + u_int8_t err; + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err); + if (ret < 0) + return ret; + DEBUGP_ERROR_FLAG(err); + if (err & (RC632_ERR_FLAG_COL_ERR | + RC632_ERR_FLAG_PARITY_ERR | + RC632_ERR_FLAG_FRAMING_ERR | + /* FIXME: why get we CRC errors in CL2 anticol at iso14443a operation with mifare UL? */ + /* RC632_ERR_FLAG_CRC_ERR | */ + 0)) + return -EIO; + } + if (stat & RC632_STAT_IRQ) { + ret = rc632_reg_read(handle, RC632_REG_INTERRUPT_RQ, &irq); + if (ret < 0) + return ret; + DEBUGP_INTERRUPT_FLAG("irq_rq",irq); + + if (irq & RC632_IRQ_TIMER && !(irq & RC632_IRQ_RX)) { + DEBUGP("timer expired before RX!!\n"); + rc632_clear_irqs(handle, RC632_IRQ_TIMER); + return -ETIMEDOUT; + } + } + + ret = rc632_reg_read(handle, RC632_REG_COMMAND, &cmd); + if (ret < 0) + return ret; + + if (cmd == 0) { + rc632_clear_irqs(handle, RC632_IRQ_RX); + return 0; + } + + /* poll every millisecond */ + usleep(1000); + } +} + +/* Stupid RC632 implementations don't evaluate interrupts but poll the + * command register for "status idle" */ +static int +rc632_wait_idle(struct rfid_asic_handle *handle, u_int64_t timeout) +{ + u_int8_t cmd = 0xff; + int ret, cycles = 0; +#define USLEEP_PER_CYCLE 128 + + timeout *= TIMER_RELAX_FACTOR; + + while (cmd != 0) { + ret = rc632_reg_read(handle, RC632_REG_COMMAND, &cmd); + if (ret < 0) + return ret; + + { + u_int8_t foo; + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &foo); + DEBUGP_STATUS_FLAG(foo); + /* check if Error has occured (ERR flag set) */ + if (foo & RC632_STAT_ERR) { + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &foo); + DEBUGP_ERROR_FLAG(foo); + } + /* check if IRQ has occurred (IRQ flag set)*/ + if (foo & RC632_STAT_IRQ) { + ret = rc632_reg_read(handle, RC632_REG_INTERRUPT_RQ, &foo); + DEBUGP_INTERRUPT_FLAG("irq_rq",foo); + /* clear all interrupts */ + ret = rc632_clear_irqs(handle, 0xff); + if (ret < 0) + return ret; + } + } + if (cmd == 0) { + /* FIXME: read second time ?? */ + DEBUGP("cmd == 0 (IDLE)\n"); + return 0; + } + + /* Abort after some timeout */ + if (cycles > timeout/USLEEP_PER_CYCLE) { + DEBUGP("timeout...\n"); + return -ETIMEDOUT; + } + + cycles++; + usleep(USLEEP_PER_CYCLE); + } + + return 0; +} + +static int +rc632_transmit(struct rfid_asic_handle *handle, + const u_int8_t *buf, + u_int8_t len, + u_int64_t timeout) +{ + int ret, cur_len; + const u_int8_t *cur_buf = buf; + + DEBUGP("timeout=%u, tx_len=%u\n", timeout, len); + + if (len > 64) + cur_len = 64; + else + cur_len = len; + + do { + ret = rc632_fifo_write(handle, cur_len, cur_buf, 0x03); + if (ret < 0) + return ret; + + if (cur_buf == buf) { + /* only start transmit first time */ + ret = rc632_reg_write(handle, RC632_REG_COMMAND, + RC632_CMD_TRANSMIT); + if (ret < 0) + return ret; + } + + cur_buf += cur_len; + if (cur_buf < buf + len) { + cur_len = buf - cur_buf; + if (cur_len > 64) + cur_len = 64; + } else + cur_len = 0; + + } while (cur_len); + + return rc632_wait_idle(handle, timeout); +} + +static int +tcl_toggle_pcb(struct rfid_asic_handle *handle) +{ + /* FIXME: toggle something between 0x0a and 0x0b */ + return 0; +} + +static int +rc632_transceive(struct rfid_asic_handle *handle, + const u_int8_t *tx_buf, + u_int8_t tx_len, + u_int8_t *rx_buf, + u_int8_t *rx_len, + u_int64_t timer, + unsigned int toggle) +{ + int ret, cur_tx_len, i; + u_int8_t rx_avail; + const u_int8_t *cur_tx_buf = tx_buf; + + DEBUGP("timeout=%u, rx_len=%u, tx_len=%u\n", timer, *rx_len, tx_len); + + if (tx_len > 64) + cur_tx_len = 64; + else + cur_tx_len = tx_len; + + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + /* clear all interrupts */ + ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_RQ, 0x7f); + + { u_int8_t tmp; + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp); + DEBUGP_STATUS_FLAG(tmp); + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &tmp); + DEBUGP_ERROR_FLAG(tmp); + } + + ret = rc632_timer_set(handle, timer); + if (ret < 0) + return ret; + + do { + ret = rc632_fifo_write(handle, cur_tx_len, cur_tx_buf, 0x03); + if (ret < 0) + return ret; + + if (cur_tx_buf == tx_buf) { + ret = rc632_reg_write(handle, RC632_REG_COMMAND, + RC632_CMD_TRANSCEIVE); + if (ret < 0) + return ret; + } + + cur_tx_buf += cur_tx_len; + if (cur_tx_buf < tx_buf + tx_len) { + u_int8_t fifo_fill; + ret = rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, + &fifo_fill); + if (ret < 0) + return ret; + + cur_tx_len = 64 - fifo_fill; + } else + cur_tx_len = 0; + + } while (cur_tx_len); + + if (toggle == 1) + tcl_toggle_pcb(handle); + + ret = rc632_wait_idle_timer(handle); + //ret = rc632_wait_idle(handle, timer); + + DEBUGP("rc632_wait_idle >> ret=%d %s\n",ret,(ret==-ETIMEDOUT)?"ETIMEDOUT":""); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &rx_avail); + if (ret < 0) + return ret; + + if (rx_avail > *rx_len) + DEBUGP("rx_avail(%d) > rx_len(%d), JFYI\n", rx_avail, *rx_len); + else if (*rx_len > rx_avail) + *rx_len = rx_avail; + + DEBUGP("rx_len == %d\n",*rx_len); + + if (rx_avail == 0) { + u_int8_t tmp; + + for (i = 0; i < 1; i++){ + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp); + DEBUGP_STATUS_FLAG(tmp); + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &tmp); + DEBUGP_ERROR_FLAG(tmp); + } + rc632_reg_read(handle, RC632_REG_CHANNEL_REDUNDANCY, &tmp); + + //return 0; + return -EIO; + } + + return rc632_fifo_read(handle, *rx_len, rx_buf); + /* FIXME: discard addidional bytes in FIFO */ +} + + +static int +rc632_receive(struct rfid_asic_handle *handle, + u_int8_t *rx_buf, + u_int8_t *rx_len, + u_int64_t timer) +{ + int ret, cur_tx_len, i; + u_int8_t rx_avail; + + DEBUGP("timeout=%u, rx_len=%u\n", timer, *rx_len); + ret = rc632_reg_write(handle, RC632_REG_COMMAND, 0x00); /* IDLE */ + /* clear all interrupts */ + ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_RQ, 0x7f); + + ret = rc632_timer_set(handle, timer); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND,RC632_CMD_RECEIVE); + if (ret < 0) + return ret; + + /* the timer cannot start in hardware based on the command we just + * sent. this means that our timing will always be quite a bit more lax, + * i.e. we'll always wait for a bit longer than the specs ask us to. */ + ret = rc632_set_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_TIMER_START); + if (ret < 0) + return ret; + + //ret = rc632_wait_idle(handle, timer); + ret = rc632_wait_idle_timer(handle); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &rx_avail); + if (ret < 0) + return ret; + + if (rx_avail > *rx_len) { + //DEBUGP("rx_avail(%d) > rx_len(%d), JFYI\n", rx_avail, *rx_len); + } else if (*rx_len > rx_avail) + *rx_len = rx_avail; + + if (rx_avail == 0) { + u_int8_t tmp; + + DEBUGP("rx_len == 0\n"); + + for (i = 0; i < 1; i++) { + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp); + DEBUGP_STATUS_FLAG(tmp); + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &tmp); + DEBUGP_ERROR_FLAG(tmp); + } + + rc632_reg_read(handle, RC632_REG_CHANNEL_REDUNDANCY, &tmp); + return -1; + } + + return rc632_fifo_read(handle, *rx_len, rx_buf); + /* FIXME: discard additional bytes in FIFO */ +} + +#define MAX_WRITE_LEN 16 /* see Sec. 18.6.1.2 of RC632 Spec Rev. 3.2. */ + +static int +rc632_write_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, + u_int8_t *data, u_int8_t len) +{ + u_int8_t sndbuf[MAX_WRITE_LEN + 2]; + u_int8_t reg; + int ret; + + if (len > MAX_WRITE_LEN) + return -EINVAL; + if (addr < 0x10) + return -EPERM; + if (addr > 0x1ff) + return -EINVAL; + + sndbuf[0] = addr & 0x00ff; /* LSB */ + sndbuf[1] = addr >> 8; /* MSB */ + memcpy(&sndbuf[2], data, len); + + ret = rc632_fifo_write(handle, len + 2, sndbuf, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_WRITE_E2); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_ACCESS_ERR) + return -EPERM; + + while (1) { + u_int8_t reg; + ret = rc632_reg_read(handle, RC632_REG_SECONDARY_STATUS, ®); + if (ret < 0) + return ret; + + if (reg & RC632_SEC_ST_E2_READY) { + /* the E2Write command must be terminated, See sec. 18.6.1.3 */ + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE); + break; + } + } + + return ret; +} + +static int +rc632_read_eeprom(struct rfid_asic_handle *handle, u_int16_t addr, + u_int8_t *buf, u_int8_t len) +{ + u_int8_t sndbuf[3]; + u_int8_t reg; + int ret; + + sndbuf[0] = addr & 0xff; + sndbuf[1] = addr >> 8; + sndbuf[2] = len; + + ret = rc632_fifo_write(handle, 3, sndbuf, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_READ_E2); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_ACCESS_ERR) + return -EPERM; + + usleep(20000); + + return rc632_fifo_read(handle, len, buf); +} + +static int +rc632_calc_crc16_from(struct rfid_asic_handle *handle) +{ + u_int8_t sndbuf[2] = { 0x01, 0x02 }; + u_int8_t crc_lsb = 0x00 , crc_msb = 0x00; + int ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_LSB, 0x12); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_MSB, 0xe0); + if (ret < 0) + return ret; + + ret = rc632_fifo_write(handle, sizeof(sndbuf), sndbuf, 3); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_CALC_CRC); + if (ret < 0) + return ret; + + usleep(10000); /* FIXME: no checking for cmd completion? * + + ret = rc632_reg_read(handle, RC632_REG_CRC_RESULT_LSB, &crc_lsb); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_CRC_RESULT_MSB, &crc_msb); + if (ret < 0) + return ret; + + /* FIXME: what to do with crc result? */ + return ret; +} + + +int +rc632_register_dump(struct rfid_asic_handle *handle, u_int8_t *buf) +{ + int ret = 0; + u_int8_t i; + + for (i = 0; i <= 0x3f; i++) + ret |= rc632_reg_read(handle, i, &buf[i]); + + return ret; +} + +/* generic FIFO access functions (if no more efficient ones provided by + * transport driver) */ + +static int +generic_fifo_write() +{ + /* FIXME: implementation (not needed for CM 5121) */ + return -1; +} + +static int +generic_fifo_read() +{ + /* FIXME: implementation (not neded for CM 5121) */ + return -1; +} + +static int +rc632_init(struct rfid_asic_handle *ah) +{ + int ret; + + /* switch off rf (make sure PICCs are reset at init time) */ + ret = rc632_power(ah, 0); + if (ret < 0) + return ret; + + usleep(10000); + + /* switch on rf */ + ret = rc632_power(ah, 1); + if (ret < 0) + return ret; + + /* disable register paging */ + ret = rc632_reg_write(ah, 0x00, 0x00); + if (ret < 0) + return ret; + + /* set some sane default values */ + ret = rc632_reg_write(ah, 0x11, 0x5b); + if (ret < 0) + return ret; + + /* switch off rf */ + ret = rc632_rf_power(ah, 0); + if (ret < 0) + return ret; + + usleep(100000); + + /* switch on rf */ + ret = rc632_rf_power(ah, 1); + if (ret < 0) + return ret; + + return 0; +} + +static int +rc632_fini(struct rfid_asic_handle *ah) +{ + int ret; + + /* switch off rf */ + ret = rc632_rf_power(ah, 0); + if (ret < 0) + return ret; + + ret = rc632_power(ah, 0); + if (ret < 0) + return ret; + + return 0; +} + +struct rfid_asic_handle * +rc632_open(struct rfid_asic_transport_handle *th) +{ + struct rfid_asic_handle *h; + + h = malloc_asic_handle(sizeof(*h)); + if (!h) + return NULL; + memset(h, 0, sizeof(*h)); + + h->asic = (void*)&rc632; + h->rath = th; + h->fc = h->asic->fc; + /* FIXME: this is only cm5121 specific, since the latency + * down to the RC632 FIFO is too long to refill during TX/RX */ + h->mtu = h->mru = 64; + + if (rc632_init(h) < 0) { + free_asic_handle(h); + return NULL; + } + + return h; +} + +void +rc632_close(struct rfid_asic_handle *h) +{ + rc632_fini(h); + free_asic_handle(h); +} + +/* + * ISO14443A + */ + +/* Register file for ISO14443A standard */ +static struct register_file iso14443a_script[] = { + { + .reg = RC632_REG_TX_CONTROL, + .val = RC632_TXCTRL_MOD_SRC_INT | + RC632_TXCTRL_TX2_INV | + RC632_TXCTRL_FORCE_100_ASK | + RC632_TXCTRL_TX2_RF_EN | + RC632_TXCTRL_TX1_RF_EN, + }, { + .reg = RC632_REG_CW_CONDUCTANCE, + .val = CM5121_CW_CONDUCTANCE, + }, { + .reg = RC632_REG_MOD_CONDUCTANCE, + .val = CM5121_MOD_CONDUCTANCE, + }, { + .reg = RC632_REG_CODER_CONTROL, + .val = (RC632_CDRCTRL_TXCD_14443A | + RC632_CDRCTRL_RATE_106K), + }, { + .reg = RC632_REG_MOD_WIDTH, + .val = 0x13, + }, { + .reg = RC632_REG_MOD_WIDTH_SOF, + .val = 0x3f, + }, { + .reg = RC632_REG_TYPE_B_FRAMING, + .val = 0x00, + }, { + .reg = RC632_REG_RX_CONTROL1, + .val = (RC632_RXCTRL1_GAIN_35DB | + RC632_RXCTRL1_ISO14443 | + RC632_RXCTRL1_SUBCP_8), + }, { + .reg = RC632_REG_DECODER_CONTROL, + .val = (RC632_DECCTRL_MANCHESTER | + RC632_DECCTRL_RXFR_14443A), + }, { + .reg = RC632_REG_BIT_PHASE, + .val = CM5121_14443A_BITPHASE, + }, { + .reg = RC632_REG_RX_THRESHOLD, + .val = CM5121_14443A_THRESHOLD, + }, { + .reg = RC632_REG_BPSK_DEM_CONTROL, + .val = 0x00, + }, { + .reg = RC632_REG_RX_CONTROL2, + .val = (RC632_RXCTRL2_DECSRC_INT | + RC632_RXCTRL2_CLK_Q), + }, { + .reg = RC632_REG_RX_WAIT, + //.val = 0x03, /* default value */ + .val = 0x06, /* omnikey */ + }, { + .reg = RC632_REG_CHANNEL_REDUNDANCY, + .val = (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD), + }, { + .reg = RC632_REG_CRC_PRESET_LSB, + .val = 0x63, + }, { + .reg = RC632_REG_CRC_PRESET_MSB, + .val = 0x63, + }, +}; + +static int +rc632_iso14443a_init(struct rfid_asic_handle *handle) +{ + int ret; + + /* flush fifo (our way) */ + ret = rc632_reg_write(handle, RC632_REG_CONTROL, + RC632_CONTROL_FIFO_FLUSH); + + ret = rc632_execute_script(handle, iso14443a_script, + ARRAY_SIZE(iso14443a_script)); + if (ret < 0) + return ret; + + return 0; +} + +static int +rc632_iso14443a_fini(struct iso14443a_handle *handle_14443) +{ + +#if 0 + ret = rc632_rf_power(handle, 0); + if (ret < 0) + return ret; +#endif + + + return 0; +} + + +/* issue a 14443-3 A PCD -> PICC command in a short frame, such as REQA, WUPA */ +static int +rc632_iso14443a_transceive_sf(struct rfid_asic_handle *handle, + u_int8_t cmd, + struct iso14443a_atqa *atqa) +{ + int ret; + u_int8_t tx_buf[1]; + u_int8_t rx_len = 2; + u_int8_t error_flag; + + memset(atqa, 0, sizeof(*atqa)); + + tx_buf[0] = cmd; + + /* transfer only 7 bits of last byte in frame */ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, 0x07); + if (ret < 0) + return ret; + + ret = rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_CRYPTO1_ON); + if (ret < 0) + return ret; + +#if 0 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); + +#endif + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, tx_buf, sizeof(tx_buf), + (u_int8_t *)atqa, &rx_len, + ISO14443A_FDT_ANTICOL_LAST1, 0); + if (ret < 0) { + DEBUGP("error during rc632_transceive()\n"); + return ret; + } + + /* switch back to normal 8bit last byte */ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, 0x00); + if (ret < 0) + return ret; + + /* determine whether there was a collission */ + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &error_flag); + if (ret < 0) + return ret; + + if (error_flag & RC632_ERR_FLAG_COL_ERR) { + u_int8_t boc; + /* retrieve bit of collission */ + ret = rc632_reg_read(handle, RC632_REG_COLL_POS, &boc); + if (ret < 0) + return ret; + DEBUGP("collision detected in xcv_sf: bit_of_col=%u\n", boc); + /* FIXME: how to signal this up the stack */ + } + + if (rx_len != 2) { + DEBUGP("rx_len(%d) != 2\n", rx_len); + return -1; + } + + return 0; +} + +/* transceive regular frame */ +static int +rc632_iso14443ab_transceive(struct rfid_asic_handle *handle, + unsigned int frametype, + const u_int8_t *tx_buf, unsigned int tx_len, + u_int8_t *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + int ret; + u_int8_t rxl; + u_int8_t channel_red; + + if (*rx_len > 0xff) + rxl = 0xff; + else + rxl = *rx_len; + + memset(rx_buf, 0, *rx_len); + + switch (frametype) { + case RFID_14443A_FRAME_REGULAR: + case RFID_MIFARE_FRAME: + channel_red = RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE + |RC632_CR_PARITY_ENABLE|RC632_CR_PARITY_ODD; + break; + case RFID_14443B_FRAME_REGULAR: + channel_red = RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE + |RC632_CR_CRC3309; + break; +#if 0 + case RFID_MIFARE_FRAME: + channel_red = RC632_CR_PARITY_ENABLE|RC632_CR_PARITY_ODD; + break; +#endif + case RFID_15693_FRAME: + channel_red = RC632_CR_CRC3309 | RC632_CR_RX_CRC_ENABLE + | RC632_CR_TX_CRC_ENABLE; + break; + case RFID_15693_FRAME_ICODE1: + /* FIXME: implement */ + default: + return -EINVAL; + break; + } + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + channel_red); + if (ret < 0) + return ret; + DEBUGP("tx_len=%u\n",tx_len); + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, timeout, 0); + *rx_len = rxl; + if (ret < 0) + return ret; + + + return 0; +} + +/* transceive anti collission bitframe */ +static int +rc632_iso14443a_transceive_acf(struct rfid_asic_handle *handle, + struct iso14443a_anticol_cmd *acf, + unsigned int *bit_of_col) +{ + int ret; + u_int8_t rx_buf[64]; + u_int8_t rx_len = sizeof(rx_buf); + u_int8_t rx_align = 0, tx_last_bits, tx_bytes, tx_bytes_total; + u_int8_t boc; + u_int8_t error_flag; + *bit_of_col = ISO14443A_BITOFCOL_NONE; + memset(rx_buf, 0, sizeof(rx_buf)); + + /* disable mifare cryto */ + ret = rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_CRYPTO1_ON); + if (ret < 0) + return ret; + + /* disable CRC summing */ +#if 0 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); +#endif + if (ret < 0) + return ret; + + tx_last_bits = acf->nvb & 0x07; /* lower nibble indicates bits */ + tx_bytes = ( acf->nvb >> 4 ) & 0x07; + if (tx_last_bits) { + tx_bytes_total = tx_bytes+1; + rx_align = tx_last_bits & 0x07; /* rx frame complements tx */ + } + else + tx_bytes_total = tx_bytes; + + /* set RxAlign and TxLastBits*/ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, + (rx_align << 4) | (tx_last_bits)); + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, (u_int8_t *)acf, tx_bytes_total, + rx_buf, &rx_len, 0x32, 0); + if (ret < 0) + return ret; + + /* bitwise-OR the two halves of the split byte */ + acf->uid_bits[tx_bytes-2] = ( + (acf->uid_bits[tx_bytes-2] & (0xff >> (8-tx_last_bits))) + | rx_buf[0]); + + /* copy the rest */ + if (rx_len) + memcpy(&acf->uid_bits[tx_bytes-1], &rx_buf[1], rx_len-1); + + /* determine whether there was a collission */ + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &error_flag); + if (ret < 0) + return ret; + + if (error_flag & RC632_ERR_FLAG_COL_ERR) { + /* retrieve bit of collission */ + ret = rc632_reg_read(handle, RC632_REG_COLL_POS, &boc); + if (ret < 0) + return ret; + + /* bit of collission relative to start of part 1 of + * anticollision frame (!) */ + *bit_of_col = 2*8 + boc; + } + + return 0; +} + +enum rc632_rate { + RC632_RATE_106 = 0x00, + RC632_RATE_212 = 0x01, + RC632_RATE_424 = 0x02, + RC632_RATE_848 = 0x03, +}; + +struct rx_config { + u_int8_t subc_pulses; + u_int8_t rx_coding; + u_int8_t rx_threshold; + u_int8_t bpsk_dem_ctrl; +}; + +struct tx_config { + u_int8_t rate; + u_int8_t mod_width; +}; + +static struct rx_config rx_configs[] = { + { + .subc_pulses = RC632_RXCTRL1_SUBCP_8, + .rx_coding = RC632_DECCTRL_MANCHESTER, + .rx_threshold = 0x88, + .bpsk_dem_ctrl = 0x00, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_4, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_2, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_1, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, +}; + +static struct tx_config tx_configs[] = { + { + .rate = RC632_CDRCTRL_RATE_106K, + .mod_width = 0x13, + }, + { + .rate = RC632_CDRCTRL_RATE_212K, + .mod_width = 0x07, + }, + { + .rate = RC632_CDRCTRL_RATE_424K, + .mod_width = 0x03, + }, + { + .rate = RC632_CDRCTRL_RATE_848K, + .mod_width = 0x01, + }, +}; + +static int rc632_iso14443a_set_speed(struct rfid_asic_handle *handle, + unsigned int tx, unsigned int rate) +{ + int rc; + u_int8_t reg; + + + if (!tx) { + /* Rx */ + if (rate > ARRAY_SIZE(rx_configs)) + return -EINVAL; + + rc = rc632_set_bit_mask(handle, RC632_REG_RX_CONTROL1, + RC632_RXCTRL1_SUBCP_MASK, + rx_configs[rate].subc_pulses); + if (rc < 0) + return rc; + + rc = rc632_set_bit_mask(handle, RC632_REG_DECODER_CONTROL, + RC632_DECCTRL_BPSK, + rx_configs[rate].rx_coding); + if (rc < 0) + return rc; + + rc = rc632_reg_write(handle, RC632_REG_RX_THRESHOLD, + rx_configs[rate].rx_threshold); + if (rc < 0) + return rc; + + if (rx_configs[rate].rx_coding == RC632_DECCTRL_BPSK) { + rc = rc632_reg_write(handle, + RC632_REG_BPSK_DEM_CONTROL, + rx_configs[rate].bpsk_dem_ctrl); + if (rc < 0) + return rc; + } + } else { + /* Tx */ + if (rate > ARRAY_SIZE(tx_configs)) + return -EINVAL; + + rc = rc632_set_bit_mask(handle, RC632_REG_CODER_CONTROL, + RC632_CDRCTRL_RATE_MASK, + tx_configs[rate].rate); + if (rc < 0) + return rc; + + rc = rc632_reg_write(handle, RC632_REG_MOD_WIDTH, + tx_configs[rate].mod_width); + if (rc < 0) + return rc; + } + + return 0; +} + +#if 0 +static struct register_file iso14443b_script[] = { + { + .reg = RC632_REG_TX_CONTROL, + .val = (RC632_TXCTRL_TX1_RF_EN | + RC632_TXCTRL_TX2_RF_EN | + RC632_TXCTRL_TX2_INV | + RC632_TXCTRL_MOD_SRC_INT), + }, { + .reg = RC632_REG_CW_CONDUCTANCE, + .val = 0x3f, + }, { + .reg = RC632_REG_MOD_CONDUCTANCE, + .val = 0x04, + }, { + .reg = RC632_REG_CODER_CONTROL, + .val = (RC632_CDRCTRL_TXCD_NRZ | + RC632_CDRCTRL_RATE_14443B), + }, { + .reg = RC632_REG_MOD_WIDTH, + .val = 0x13, + }, { + .reg = RC632_REG_MOD_WIDTH_SOF, + .val = 0x3f, + }, { + .reg = RC632_REG_TYPE_B_FRAMING, + .val = (RC632_TBFRAMING_SOF_11L_3H | + (6 << RC632_TBFRAMING_SPACE_SHIFT) | + RC632_TBFRAMING_EOF_11); + }, { + .reg = RC632_REG_RX_CONTROL1, + .val = (RC632_RXCTRL1_GAIN_35DB | + RC632_RXCTRL1_ISO14443, + RC632_RXCTRL1_SUBCP_8), + }, { + .reg = RC632_REG_DECODER_CONTROL, + .val = (RC632_DECCTRL_BPSK | + RC632_DECCTRL_RXFR_14443B), + }, { + .reg = RC632_REG_BIT_PHASE, + .val = CM5121_14443B_BITPHASE, + }, { + .reg = RC632_REG_RX_THRESHOLD, + .val = CM5121_14443B_THRESHOLD, + }, { + .reg = RC632_REG_BPSK_DEM_CONTROL, + .val = ((0x2 & RC632_BPSKD_TAUB_MASK)< 0) { + out[i] = in[len]; + len--; + i++; + } +} + +static int +rc632_iso15693_transceive_ac(struct rfid_asic_handle *handle, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *rx_len, unsigned char *bit_of_col) +{ + u_int8_t error_flag, boc; + //u_int8_t rx_len; + + int ret, tx_len, mask_len_bytes; + unsigned int rate = ISO15693_T_SLOW; + + if (acf->req.flags & RFID_15693_F_RATE_HIGH) + rate = ISO15693_T_FAST; + + DEBUGP("acf = %s\n", rfid_hexdump(acf, acf_len)); + + ret = rc632_transceive(handle, (u_int8_t *)acf, acf_len, + (u_int8_t *) resp, rx_len, + iso15693_timing[rate][ISO15693_T1], 0); + if (ret == -ETIMEDOUT || ret == -EIO) + return ret; + + /* determine whether there was a collission */ + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &error_flag); + if (ret < 0) + return ret; + DEBUGP_ERROR_FLAG(error_flag); + + //FIXME: check for framing and crc errors... + if (error_flag & RC632_ERR_FLAG_COL_ERR) { + /* retrieve bit of collission */ + ret = rc632_reg_read(handle, RC632_REG_COLL_POS, &boc); + if (ret < 0) + return ret; + *bit_of_col = boc; + } else { + *bit_of_col = 0; + if (error_flag & RC632_ERR_FLAG_CRC_ERR) + return -EIO; + } + + return 0; + +#if 0 + *bit_of_col = 0; + + mask_len_bytes = (acf->mask_len % 8) ? acf->mask_len/8+1 : acf->mask_len/8; + + if (acf->current_slot == 0) { + /* first call: transmit Inventory frame */ + DEBUGP("first_frame\n"); + + tx_len = sizeof(struct iso15693_request) + 1 + mask_len_bytes; + + ret = rc632_transceive(handle, (u_int8_t *)&req, tx_len, + (u_int8_t *)&rx_buf, &rx_len, ISO15693_T1, 0); + acf->current_slot = 1; + DEBUGP("rc632_transceive ret: %d rx_len: %d\n",ret,rx_len); + /* if ((ret < 0)&&(ret != -ETIMEDOUT)) + return ret; */ + + } else { + /* second++ call: end timeslot with EOFpulse and read */ + DEBUGP("second++_frame\n"); + if ((acf->current_slot > 16) || + ((acf->flags & RFID_15693_F5_NSLOTS_1 == 0) + && (acf->current_slot > 1))) { + + memset(uuid, 0, ISO15693_UID_LEN); + return -1; + } + + /* reset EOF-pulse-bit to 0 */ + ret = rc632_clear_bits(handle, RC632_REG_CODER_CONTROL, + RC632_CDRCTRL_15693_EOF_PULSE); + usleep(50); + /* generate EOF pulse */ + ret = rc632_set_bits(handle, RC632_REG_CODER_CONTROL, + RC632_CDRCTRL_15693_EOF_PULSE); + if (ret < 0) + return ret; + // DEBUGP("waiting for EOF pulse\n"); + // ret = rc632_wait_idle(handle, 10); //wait for idle + + rx_len = sizeof(rx_buf); + ret = rc632_receive(handle, (u_int8_t*)&rx_buf, &rx_len, ISO15693_T3); + DEBUGP("rc632_receive ret: %d rx_len: %d\n", ret, rx_len); + acf->current_slot++; + + /* if ((ret < 0)&&(ret != -ETIMEDOUT)) + return ret; */ + } + + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp); + DEBUGP_STATUS_FLAG(tmp); + + if (ret == -ETIMEDOUT) { + /* no VICC answer in this timeslot*/ + memset(uuid, 0, ISO15693_UID_LEN); + return -ETIMEDOUT; + } else { + /* determine whether there was a collission */ + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &error_flag); + DEBUGP_ERROR_FLAG(error_flag); + if (ret < 0) + return ret; + + if (error_flag & RC632_ERR_FLAG_COL_ERR) { + /* retrieve bit of collission */ + ret = rc632_reg_read(handle, RC632_REG_COLL_POS, &boc); + if (ret < 0) + return ret; + *bit_of_col = boc; + memcpy(uuid, rx_buf.uuid, ISO15693_UID_LEN); + // uuid_reversecpy(uuid, rx_buf.uuid, ISO15693_UID_LEN); + DEBUGP("Collision in slot %d bit %d\n", + acf->current_slot,boc); + return -ECOLLISION; + } else { + /* no collision-> retrieve uuid */ + DEBUGP("no collision in slot %d\n", acf->current_slot); + memcpy(uuid, rx_buf.uuid, ISO15693_UID_LEN); + //uuid_reversecpy(uuid, rx_buf.uuid, ISO15693_UID_LEN); + } + } + + return 0; +#endif +} + +struct mifare_authcmd { + u_int8_t auth_cmd; + u_int8_t block_address; + u_int32_t serno; /* lsb 1 2 msb */ +} __attribute__ ((packed)); + + +#define RFID_MIFARE_KEY_LEN 6 +#define RFID_MIFARE_KEY_CODED_LEN 12 + +/* Transform crypto1 key from generic 6byte into rc632 specific 12byte */ +static int +rc632_mifare_transform_key(const u_int8_t *key6, u_int8_t *key12) +{ + int i; + u_int8_t ln; + u_int8_t hn; + + for (i = 0; i < RFID_MIFARE_KEY_LEN; i++) { + ln = key6[i] & 0x0f; + hn = key6[i] >> 4; + key12[i * 2 + 1] = (~ln << 4) | ln; + key12[i * 2] = (~hn << 4) | hn; + } + return 0; +} + +static int +rc632_mifare_set_key(struct rfid_asic_handle *h, const u_int8_t *key) +{ + u_int8_t coded_key[RFID_MIFARE_KEY_CODED_LEN]; + u_int8_t reg; + int ret; + + ret = rc632_mifare_transform_key(key, coded_key); + if (ret < 0) + return ret; + + /* Terminate probably running command */ + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_IDLE); + if (ret < 0) + return ret; + + ret = rc632_fifo_write(h, RFID_MIFARE_KEY_CODED_LEN, coded_key, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_LOAD_KEY); + if (ret < 0) + return ret; + + ret = rc632_timer_set(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + //ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + ret = rc632_wait_idle_timer(h); + if (ret < 0) + return ret; + + ret = rc632_reg_read(h, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_KEY_ERR) + return -EINVAL; + + return 0; +} + +static int +rc632_mifare_set_key_ee(struct rfid_asic_handle *h, unsigned int addr) +{ + int ret; + u_int8_t cmd_addr[2]; + u_int8_t reg; + + if (addr > 0xffff - RFID_MIFARE_KEY_CODED_LEN) + return -EINVAL; + + cmd_addr[0] = addr & 0xff; /* LSB */ + cmd_addr[1] = (addr >> 8) & 0xff; /* MSB */ + + /* Terminate probably running command */ + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_IDLE); + if (ret < 0) + return ret; + + /* Write the key address to the FIFO */ + ret = rc632_fifo_write(h, 2, cmd_addr, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_LOAD_KEY_E2); + if (ret < 0) + return ret; + + ret = rc632_timer_set(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + //ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + ret = rc632_wait_idle_timer(h); + if (ret < 0) + return ret; + + ret = rc632_reg_read(h, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_KEY_ERR) + return -EINVAL; + + return 0; +} + +static int +rc632_mifare_auth(struct rfid_asic_handle *h, u_int8_t cmd, u_int32_t serno, + u_int8_t block) +{ + int ret; + struct mifare_authcmd acmd; + u_int8_t reg; + + if (cmd != RFID_CMD_MIFARE_AUTH1A && cmd != RFID_CMD_MIFARE_AUTH1B) { + DEBUGP("invalid auth command\n"); + return -EINVAL; + } + + /* Initialize acmd */ + acmd.block_address = block & 0xff; + acmd.auth_cmd = cmd; + //acmd.serno = htonl(serno); + acmd.serno = serno; + +#if 1 + /* Clear Rx CRC */ + ret = rc632_clear_bits(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE); +#else + /* Clear Rx CRC, Set Tx CRC and Odd Parity */ + ret = rc632_reg_write(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE | RC632_CR_PARITY_ODD | + RC632_CR_PARITY_ENABLE); +#endif + if (ret < 0) + return ret; + + /* Send Authent1 Command */ + ret = rc632_fifo_write(h, sizeof(acmd), (unsigned char *)&acmd, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_AUTHENT1); + if (ret < 0) { + DEBUGP("error during AUTHENT1"); + return ret; + } + + /* Wait until transmitter is idle */ + ret = rc632_timer_set(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + //ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + ret = rc632_wait_idle_timer(h); + if (ret < 0) + return ret; + + ret = rc632_reg_read(h, RC632_REG_SECONDARY_STATUS, ®); + if (ret < 0) + return ret; + if (reg & 0x07) { + DEBUGP("bitframe?"); + return -EIO; + } + + /* Clear Tx CRC */ + ret = rc632_clear_bits(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE); + if (ret < 0) + return ret; + + /* Wait until transmitter is idle */ + ret = rc632_timer_set(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + /* Send Authent2 Command */ + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_AUTHENT2); + if (ret < 0) + return ret; + + /* Wait until transmitter is idle */ + //ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + ret = rc632_wait_idle_timer(h); + if (ret < 0) + return ret; + + /* Check whether authentication was successful */ + ret = rc632_reg_read(h, RC632_REG_CONTROL, ®); + if (ret < 0) + return ret; + + if (!(reg & RC632_CONTROL_CRYPTO1_ON)) { + DEBUGP("authentication not successful"); + return -EACCES; + } + + return 0; +} + +/* transceive regular frame */ +static int +rc632_mifare_transceive(struct rfid_asic_handle *handle, + const u_int8_t *tx_buf, unsigned int tx_len, + u_int8_t *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + int ret; + u_int8_t rxl = *rx_len & 0xff; + + DEBUGP("entered\n"); + memset(rx_buf, 0, *rx_len); + +#if 1 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD | + RC632_CR_TX_CRC_ENABLE | + RC632_CR_RX_CRC_ENABLE)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); +#endif + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); + *rx_len = rxl; + if (ret < 0) + return ret; + + + return 0; +} + + +static int +rc632_layer2_init(struct rfid_asic_handle *h, enum rfid_layer2_id l2) +{ + switch (l2) { + case RFID_LAYER2_ISO14443A: + return rc632_iso14443a_init(h); + case RFID_LAYER2_ISO14443B: + return rc632_iso14443b_init(h); + case RFID_LAYER2_ISO15693: + return rc632_iso15693_init(h); + case RFID_LAYER2_ICODE1: + return rc632_iso15693_icode1_init(h); + default: + return -EINVAL; + } +} + +const struct rfid_asic rc632 = { + .name = "Philips CL RC632", + .fc = ISO14443_FREQ_CARRIER, + .priv.rc632 = { + .fn = { + .power = &rc632_power, + .rf_power = &rc632_rf_power, + .transceive = &rc632_iso14443ab_transceive, + .init = &rc632_layer2_init, + .iso14443a = { + .transceive_sf = &rc632_iso14443a_transceive_sf, + .transceive_acf = &rc632_iso14443a_transceive_acf, + .set_speed = &rc632_iso14443a_set_speed, + }, + .iso15693 = { + .transceive_ac = &rc632_iso15693_transceive_ac, + }, + .mifare_classic = { + .setkey = &rc632_mifare_set_key, + .setkey_ee = &rc632_mifare_set_key_ee, + .auth = &rc632_mifare_auth, + }, + }, + }, +}; diff --git a/librfid/src/rfid_iso14443_common.c b/librfid/src/rfid_iso14443_common.c new file mode 100644 index 0000000..f72d44c --- /dev/null +++ b/librfid/src/rfid_iso14443_common.c @@ -0,0 +1,58 @@ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + + +static unsigned int fsdi_table[] = { 16, 24, 32, 40, 48, 64, 96, 128, 256 }; + +int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi) +{ + /* ISO 14443-4:2000(E) Section 5.1. */ + if (fsdi > sizeof(fsdi_table)/sizeof(unsigned int)) + return -1; + + *fsd = fsdi_table[fsdi]; + return 0; +} + +int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd) +{ + int i; + + for (i = 0; i < sizeof(fsdi_table)/sizeof(unsigned int); i++) { + if (fsdi_table[i] == fsd) { + *fsdi = i; + return 0; + } + } + + return -1; +} + +/* calculate the fsd that is equal or the closest smaller value + * that can be coded as fsd */ +unsigned int iso14443_fsd_approx(unsigned int fsd) +{ + unsigned int tbl_size = sizeof(fsdi_table)/sizeof(unsigned int); + int i; + + for (i = tbl_size-1; i >= 0; i--) { + if (fsdi_table[i] <= fsd) + return fsdi_table[i]; + } + /* not reached: return smallest possible FSD */ + return fsdi_table[0]; +} + diff --git a/librfid/src/rfid_iso14443_common.h b/librfid/src/rfid_iso14443_common.h new file mode 100644 index 0000000..848d983 --- /dev/null +++ b/librfid/src/rfid_iso14443_common.h @@ -0,0 +1,11 @@ +#ifndef __RFID_ISO14443_COMMON_H +#define __RFID_ISO14443_COMMON_H + +int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi); +int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd); +unsigned int iso14443_fsd_approx(unsigned int fsd); + +#define ISO14443_FREQ_CARRIER 13560000 +#define ISO14443_FREQ_SUBCARRIER (ISO14443_FREQ_CARRIER/16) + +#endif diff --git a/librfid/src/rfid_layer2.c b/librfid/src/rfid_layer2.c new file mode 100644 index 0000000..4cad6c3 --- /dev/null +++ b/librfid/src/rfid_layer2.c @@ -0,0 +1,145 @@ +/* librfid - layer 2 protocol handler + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include /* for memcpy */ + +#include +#include + +static const struct rfid_layer2 *rfid_layer2s[] = { + [RFID_LAYER2_ISO14443A] = &rfid_layer2_iso14443a, + [RFID_LAYER2_ISO14443B] = &rfid_layer2_iso14443b, + [RFID_LAYER2_ISO15693] = &rfid_layer2_iso15693, +}; + +struct rfid_layer2_handle * +rfid_layer2_init(struct rfid_reader_handle *rh, unsigned int id) +{ + struct rfid_layer2 *p; + + if (id >= ARRAY_SIZE(rfid_layer2s)) { + DEBUGP("unable to find matching layer2 protocol\n"); + return NULL; + } + + p = rfid_layer2s[id]; + return p->fn.init(rh); +} + +int +rfid_layer2_open(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.open) + return 0; + + return ph->l2->fn.open(ph); +} + +int +rfid_layer2_transceive(struct rfid_layer2_handle *ph, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + if (!ph->l2->fn.transceive) + return -EIO; + + return ph->l2->fn.transceive(ph, frametype, tx_buf, len, rx_buf, + rx_len, timeout, flags); +} + +int rfid_layer2_fini(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.fini) + return 0; + + return ph->l2->fn.fini(ph); +} + +int +rfid_layer2_close(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.close) + return 0; + + return ph->l2->fn.close(ph); +} + +int +rfid_layer2_getopt(struct rfid_layer2_handle *ph, int optname, + void *optval, unsigned int *optlen) +{ + if (optname >> 16 == 0) { + unsigned char *optchar = optval; + + switch (optname) { + case RFID_OPT_LAYER2_UID: + if (ph->uid_len < *optlen) + *optlen = ph->uid_len; + memcpy(optchar, ph->uid, *optlen); + break; + default: + return -EINVAL; + break; + } + } else { + if (!ph->l2->fn.getopt) + return -EINVAL; + + return ph->l2->fn.getopt(ph, optname, optval, optlen); + } + return 0; +} + +int +rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname, + const void *optval, unsigned int optlen) +{ + if (optname >> 16 == 0) { + switch (optname) { + case RFID_OPT_LAYER2_UID: + printf("----> sizeof(ph->uid): %d\n",sizeof(ph->uid)); + if ((ph->uid_len < sizeof(ph->uid)) && (optlen<=sizeof(ph->uid))) { + //(ph->uid_lenuid_len = optlen; + memcpy(ph->uid, optval, optlen); + } else + return -EINVAL; + break; + default: + return -EINVAL; + break; + } + } else { + if (!ph->l2->fn.setopt) + return -EINVAL; + + return ph->l2->fn.setopt(ph, optname, optval, optlen); + } + return 0; +} + +char *rfid_layer2_name(struct rfid_layer2_handle *l2h) +{ + return l2h->l2->name; +} diff --git a/librfid/src/rfid_layer2_iso14443a.c b/librfid/src/rfid_layer2_iso14443a.c new file mode 100644 index 0000000..98722f5 --- /dev/null +++ b/librfid/src/rfid_layer2_iso14443a.c @@ -0,0 +1,405 @@ +/* ISO 14443-3 A anticollision implementation + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#ifdef __MINGW32__ +#include +#endif/*__MINGW32__*/ + +#include +#include +#include +#include +#include + +#define TIMEOUT 1236 + +unsigned long randctx[4]={0x22d4a017,0x773a1f44,0xc39e1460,0x9cde8801}; + +/* Transceive a 7-bit short frame */ +int +iso14443a_transceive_sf(struct rfid_layer2_handle *handle, + unsigned char cmd, + struct iso14443a_atqa *atqa) +{ + const struct rfid_reader *rdr = handle->rh->reader; + + return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa); +} + +/* Transmit an anticollission bit frame */ +static int +iso14443a_transceive_acf(struct rfid_layer2_handle *handle, + struct iso14443a_anticol_cmd *acf, + unsigned int *bit_of_col) +{ + const struct rfid_reader *rdr = handle->rh->reader; + + return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col); +} + +/* Transmit a regular frame */ +static int +iso14443a_transceive(struct rfid_layer2_handle *handle, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return handle->rh->reader->transceive(handle->rh, frametype, tx_buf, + tx_len, rx_buf, rx_len, timeout, flags); +} + +static int +iso14443a_code_nvb_bits(unsigned char *nvb, unsigned int bits) +{ + unsigned int byte_count = bits / 8; + unsigned int bit_count = bits % 8; + + if (byte_count < 2 || byte_count > 7) + return -1; + + *nvb = ((byte_count & 0xf) << 4) | bit_count; + + return 0; +} + +static int random_bit(void) +{ + unsigned long e; + + e = randctx[0]; + randctx[0] = randctx[1]; + randctx[1] = (randctx[2]<<19) + (randctx[2]>>13) + randctx[3]; + randctx[2] = randctx[3] ^ randctx[0]; + randctx[3] = e+randctx[1]; + + return randctx[1]&1; +} + +/* first bit is '1', second bit '2' */ +static void +rnd_toggle_bit_in_field(unsigned char *bitfield, unsigned int size, unsigned int bit) +{ + unsigned int byte,rnd; + + if (bit && (bit <= (size*8))) { + rnd = random_bit(); + + DEBUGP("xor'ing bit %u with %u\n",bit,rnd); + bit--; + byte = bit/8; + bit = rnd << (bit % 8); + bitfield[byte] ^= bit; + } +} + + +static int +iso14443a_anticol(struct rfid_layer2_handle *handle) +{ + int ret; + unsigned int uid_size; + struct iso14443a_handle *h = &handle->priv.iso14443a; + struct iso14443a_atqa *atqa = &h->atqa; + struct iso14443a_anticol_cmd acf; + unsigned int bit_of_col; + unsigned char sak[3]; + unsigned int rx_len = sizeof(sak); + char *aqptr = (char *) atqa; + + memset(handle->uid, 0, sizeof(handle->uid)); + memset(sak, 0, sizeof(sak)); + memset(atqa, 0, sizeof(&atqa)); + memset(&acf, 0, sizeof(acf)); + + if (handle->flags & RFID_OPT_LAYER2_WUP) + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_WUPA, atqa); + else + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, atqa); + if (ret < 0) { + h->state = ISO14443A_STATE_REQA_SENT; + DEBUGP("error during transceive_sf: %d\n", ret); + return ret; + } + h->state = ISO14443A_STATE_ATQA_RCVD; + + DEBUGP("ATQA: 0x%02x 0x%02x\n", *aqptr, *(aqptr+1)); + + if (!atqa->bf_anticol) { + h->state = ISO14443A_STATE_NO_BITFRAME_ANTICOL; + DEBUGP("no bitframe anticollission bits set, aborting\n"); + return -1; + } + + if (atqa->uid_size == 2 || atqa->uid_size == 3) + uid_size = 3; + else if (atqa->uid_size == 1) + uid_size = 2; + else + uid_size = 1; + + acf.sel_code = ISO14443A_AC_SEL_CODE_CL1; + + h->state = ISO14443A_STATE_ANTICOL_RUNNING; + h->level = ISO14443A_LEVEL_CL1; + +cascade: + rx_len = sizeof(sak); + iso14443a_code_nvb_bits(&acf.nvb, 16); + + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); + DEBUGP("tran_acf->%d boc: %d\n",ret,bit_of_col); + if (ret < 0) + return ret; + + while (bit_of_col != ISO14443A_BITOFCOL_NONE) { + DEBUGP("collision at pos %u\n", bit_of_col); + + iso14443a_code_nvb_bits(&acf.nvb, bit_of_col); + rnd_toggle_bit_in_field(acf.uid_bits, sizeof(acf.uid_bits), bit_of_col); + DEBUGP("acf: nvb=0x%02X uid_bits=%s\n",acf.nvb,rfid_hexdump(acf.uid_bits,sizeof(acf.uid_bits))); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); + if (ret < 0) + return ret; + } + + iso14443a_code_nvb_bits(&acf.nvb, 7*8); + + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, + (unsigned char *)&acf, 7, + (unsigned char *) &sak, &rx_len, + TIMEOUT, 0); + if (ret < 0) + return ret; + + if (sak[0] & 0x04) { + /* Cascade bit set, UID not complete */ + switch (acf.sel_code) { + case ISO14443A_AC_SEL_CODE_CL1: + /* cascading from CL1 to CL2 */ + DEBUGP("cascading from CL1 to CL2\n"); + if (acf.uid_bits[0] != 0x88) { + DEBUGP("Cascade bit set, but UID0 != 0x88\n"); + return -1; + } + memcpy(&handle->uid[0], &acf.uid_bits[1], 3); + acf.sel_code = ISO14443A_AC_SEL_CODE_CL2; + h->level = ISO14443A_LEVEL_CL2; + break; + case ISO14443A_AC_SEL_CODE_CL2: + /* cascading from CL2 to CL3 */ + DEBUGP("cascading from CL2 to CL3\n"); + memcpy(&handle->uid[3], &acf.uid_bits[1], 3); + acf.sel_code = ISO14443A_AC_SEL_CODE_CL3; + h->level = ISO14443A_LEVEL_CL3; + break; + default: + DEBUGP("cannot cascade any further than CL3\n"); + h->state = ISO14443A_STATE_ERROR; + return -1; + break; + } + goto cascade; + + } else { + switch (acf.sel_code) { + case ISO14443A_AC_SEL_CODE_CL1: + /* single size UID (4 bytes) */ + memcpy(&handle->uid[0], &acf.uid_bits[0], 4); + break; + case ISO14443A_AC_SEL_CODE_CL2: + /* double size UID (7 bytes) */ + memcpy(&handle->uid[3], &acf.uid_bits[0], 4); + break; + case ISO14443A_AC_SEL_CODE_CL3: + /* triple size UID (10 bytes) */ + memcpy(&handle->uid[6], &acf.uid_bits[0], 4); + break; + } + } + + { + if (h->level == ISO14443A_LEVEL_CL1) + handle->uid_len = 4; + else if (h->level == ISO14443A_LEVEL_CL2) + handle->uid_len = 7; + else + handle->uid_len = 10; + + DEBUGP("UID %s\n", rfid_hexdump(handle->uid, handle->uid_len)); + } + + h->level = ISO14443A_LEVEL_NONE; + h->state = ISO14443A_STATE_SELECTED; + h->sak = sak[0]; + + if (sak[0] & 0x20) { + DEBUGP("we have a T=CL compliant PICC\n"); + handle->proto_supported = 1 << RFID_PROTOCOL_TCL; + h->tcl_capable = 1; + } else { + DEBUGP("we have a T!=CL PICC\n"); + handle->proto_supported = (1 << RFID_PROTOCOL_MIFARE_UL)| + (1 << RFID_PROTOCOL_MIFARE_CLASSIC); + h->tcl_capable = 0; + } + + return 0; +} + +static int +iso14443a_hlta(struct rfid_layer2_handle *handle) +{ + int ret; + unsigned char tx_buf[2] = { 0x50, 0x00 }; + unsigned char rx_buf[10]; + unsigned int rx_len = sizeof(rx_buf); + + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, + tx_buf, sizeof(tx_buf), + rx_buf, &rx_len, 1000 /* 1ms */, 0); + if (ret < 0) { + /* "error" case: we don't get somethng back from the card */ + return 0; + } + return -1; +} + +static int +iso14443a_setopt(struct rfid_layer2_handle *handle, int optname, + const void *optval, unsigned int optlen) +{ + int ret = -EINVAL; + const struct rfid_reader *rdr = handle->rh->reader; + unsigned int speed; + + switch (optname) { + case RFID_OPT_14443A_SPEED_RX: + if (!rdr->iso14443a.set_speed) + return -ENOTSUP; + speed = *(unsigned int *)optval; + ret = rdr->iso14443a.set_speed(handle->rh, 0, speed); + break; + case RFID_OPT_14443A_SPEED_TX: + if (!rdr->iso14443a.set_speed) + return -ENOTSUP; + speed = *(unsigned int *)optval; + ret = rdr->iso14443a.set_speed(handle->rh, 1, speed); + break; + case RFID_OPT_14443A_WUPA: + if((unsigned int*)optval) + handle->flags |= RFID_OPT_LAYER2_WUP; + else + handle->flags &= ~RFID_OPT_LAYER2_WUP; + ret = 0; + break; + }; + + return ret; +} + +static int +iso14443a_getopt(struct rfid_layer2_handle *handle, int optname, + void *optval, unsigned int *optlen) +{ + int ret = -EINVAL; + struct iso14443a_handle *h = &handle->priv.iso14443a; + struct iso14443a_atqa *atqa = optval; + u_int8_t *opt_u8 = optval; + int *wupa = optval; + + switch (optname) { + case RFID_OPT_14443A_SAK: + *opt_u8 = h->sak; + *optlen = sizeof(*opt_u8); + break; + case RFID_OPT_14443A_ATQA: + *atqa = h->atqa; + *optlen = sizeof(*atqa); + ret = 0; + break; + case RFID_OPT_14443A_WUPA: + *wupa = ((handle->flags & RFID_OPT_LAYER2_WUP) != 0); + *optlen = sizeof(*wupa); + ret = 0; + break; + }; + + return ret; +} + + +static struct rfid_layer2_handle * +iso14443a_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + memset(h, 0, sizeof(*h)); + +#ifdef __MINGW32__ + randctx[0] ^= GetTickCount(); +#endif/*__MINGW32__*/ + for(ret=0;ret<23;ret++) + random_bit(); + + h->l2 = &rfid_layer2_iso14443a; + h->rh = rh; + h->priv.iso14443a.state = ISO14443A_STATE_NONE; + h->priv.iso14443a.level = ISO14443A_LEVEL_NONE; + + ret = h->rh->reader->init(h->rh, RFID_LAYER2_ISO14443A); + if (ret < 0) { + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso14443a_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso14443a = { + .id = RFID_LAYER2_ISO14443A, + .name = "ISO 14443-3 A", + .fn = { + .init = &iso14443a_init, + .open = &iso14443a_anticol, + .transceive = &iso14443a_transceive, + .close = &iso14443a_hlta, + .fini = &iso14443a_fini, + .setopt = &iso14443a_setopt, + .getopt = &iso14443a_getopt, + }, +}; + diff --git a/librfid/src/rfid_layer2_iso14443b.c b/librfid/src/rfid_layer2_iso14443b.c new file mode 100644 index 0000000..df2f95d --- /dev/null +++ b/librfid/src/rfid_layer2_iso14443b.c @@ -0,0 +1,400 @@ +/* ISO 14443-3 B anticollision implementation + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" + +#define ATQB_TIMEOUT ((256*10e6/ISO14443_FREQ_SUBCARRIER) \ + +(200*10e6/ISO14443_FREQ_SUBCARRIER)) + +#undef ATQB_TIMEOUT +#define ATQB_TIMEOUT 1 + +static inline int +fwi_to_fwt(struct rfid_layer2_handle *h, unsigned int *fwt, unsigned int fwi) +{ + unsigned int multiplier, tmp; + + /* 15 is RFU */ + if (fwi > 14) + return -1; + + /* According to ISO 14443-3:200(E), Chapter 7.9.4.3, the forumala is + * (256 * 16 / fC) * 2^fwi We avoid floating point computations by + * shifting everything into the microsecond range. In integer + * calculations 1000000*256*16/13560000 evaluates to 302 (instead of + * 302.064897), which provides sufficient precision, IMHO. The max + * result is 302 * 16384 (4947968), which fits well within the 31/32 + * bit range of an integer */ + + multiplier = 1 << fwi; /* 2 to the power of fwi */ + + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->rh->ah->asic->fc) * multiplier; +} + +static int +parse_atqb(struct rfid_layer2_handle *h, struct iso14443b_atqb *atqb) +{ + int ret; + + if (atqb->fifty != 0x50) + return -1; + + if (atqb->protocol_info.fo & 0x01) + h->priv.iso14443b.flags |= ISO14443B_CID_SUPPORTED; + if (atqb->protocol_info.fo & 0x02) + h->priv.iso14443b.flags |= ISO14443B_NAD_SUPPORTED; + + ret = fwi_to_fwt(h, &h->priv.iso14443b.fwt, atqb->protocol_info.fwi); + if (ret < 0) { + DEBUGP("invalid fwi %u\n", atqb->protocol_info.fwi); + return ret; + } + + if (atqb->protocol_info.protocol_type == 0x1) { + DEBUGP("we have a T=CL compliant PICC\n"); + h->priv.iso14443b.tcl_capable = 1; + h->proto_supported = (1 << RFID_PROTOCOL_TCL); + } else { + DEBUGP("we have a T!=CL PICC\n"); + h->priv.iso14443b.tcl_capable = 0; + /* FIXME: what protocols do we support? */ + } + + iso14443_fsdi_to_fsd(&h->priv.iso14443b.fsc, + atqb->protocol_info.max_frame_size); + + /* FIXME: speed capability */ + + memcpy(h->uid, atqb->pupi, sizeof(atqb->pupi)); + h->uid_len = sizeof(atqb->pupi); + + return 0; +} + +static int +send_reqb(struct rfid_layer2_handle *h, unsigned char afi, + unsigned int is_wup, unsigned int num_initial_slots) +{ + int ret; + unsigned char reqb[3]; + struct iso14443b_atqb atqb; + unsigned int atqb_len = sizeof(atqb); + unsigned int num_slot_idx = num_initial_slots; + + reqb[0] = 0x05; + reqb[1] = afi; + + for (num_slot_idx = num_initial_slots; num_slot_idx <= 4; + num_slot_idx++) { + reqb[2] = num_slot_idx & 0x07; + if (is_wup) + reqb[2] |= 0x08; + + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + reqb, sizeof(reqb), + (unsigned char *)&atqb, + &atqb_len, ATQB_TIMEOUT, 0); + h->priv.iso14443b.state = ISO14443B_STATE_REQB_SENT; + if (ret < 0) { + DEBUGP("error during transceive of REQB/WUBP\n"); + continue; + } + + /* FIXME: send N-1 slot marker frames */ + + if (atqb_len != sizeof(atqb)) { + DEBUGP("error: atqb_len = %u instead of %Zu\n", + atqb_len, sizeof(atqb)); + continue; + } + + /* FIXME: how to detect a collission at 14443B ? I guess we + * can only rely on the CRC checking (CRCErr in ErrorFlag + * register?) */ + + if (parse_atqb(h, &atqb) >= 0) { + h->priv.iso14443b.state = ISO14443B_STATE_ATQB_RCVD; + return 0; + } + } + + return -1; +} + +static inline unsigned int mbli_to_mbl(struct rfid_layer2_handle *h, + unsigned int mbli) +{ + return (h->priv.iso14443b.fsc * 2 ^ (mbli-1)); +} + +static int +transceive_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, + unsigned int inf_len, unsigned char *rx_data, unsigned int *rx_len) +{ + struct { + struct iso14443b_attrib_hdr attrib; + char buf[256-3]; + } _attrib_buf; + + struct iso14443b_attrib_hdr *attrib = &_attrib_buf.attrib; + unsigned char rx_buf[256]; + unsigned char fsdi; + int ret = 0; + + DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd); + if (rx_len >= rx_len-1) + return -EINVAL; + + /* initialize attrib frame */ + memset(&_attrib_buf, 0, sizeof(_attrib_buf)); + if (inf_len) + memcpy((unsigned char *)attrib+sizeof(*attrib), inf, inf_len); + + attrib->one_d = 0x1d; + memcpy(attrib->identifier, h->uid, 4); + + /* FIXME: do we want to change TR0/TR1 from its default ? */ + /* FIXME: do we want to change SOF/EOF from its default ? */ + + ret = iso14443_fsd_to_fsdi(&fsdi, h->priv.iso14443b.fsd); + if (ret < 0) { + DEBUGP("unable to map FSD(%u) to FSDI\n", + h->priv.iso14443b.fsd); + goto out_rx; + } + attrib->param2.fsdi = fsdi; + + /* FIXME: spd_in / spd_out */ + if (h->priv.iso14443b.tcl_capable == 1) + attrib->param3.protocol_type = 0x1; + + attrib->param4.cid = h->priv.iso14443b.cid & 0xf; + + *rx_len = *rx_len + 1; + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + (unsigned char *) attrib, + sizeof(*attrib)+inf_len, + rx_buf, rx_len, h->priv.iso14443b.fwt, + 0); + h->priv.iso14443b.state = ISO14443B_STATE_ATTRIB_SENT; + if (ret < 0) { + DEBUGP("transceive problem\n"); + goto out_rx; + } + + if ((rx_buf[0] & 0x0f) != h->priv.iso14443b.cid) { + DEBUGP("ATTRIB response with invalid CID %u (should be %u)\n", + rx_buf[0] & 0x0f, h->priv.iso14443b.cid); + ret = -1; + goto out_rx; + } + + h->priv.iso14443b.state = ISO14443B_STATE_SELECTED; + + h->priv.iso14443b.mbl = mbli_to_mbl(h, (rx_data[0] & 0xf0) >> 4); + + *rx_len = *rx_len - 1; + memcpy(rx_data, rx_buf+1, *rx_len); + +out_rx: +out_attrib: + + return ret; +} + +static int +iso14443b_hltb(struct rfid_layer2_handle *h) +{ + int ret; + unsigned char hltb[5]; + unsigned char hltb_resp[1]; + unsigned int hltb_len = 1; + + hltb[0] = 0x50; + memcpy(hltb+1, h->uid, 4); + + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + hltb, 5, + hltb_resp, &hltb_len, + h->priv.iso14443b.fwt, 0); + h->priv.iso14443b.state = ISO14443B_STATE_HLTB_SENT; + if (ret < 0) { + DEBUGP("transceive problem\n"); + return ret; + } + + if (hltb_len != 1 || hltb_resp[0] != 0x00) { + DEBUGP("bad HLTB response\n"); + return -1; + } + h->priv.iso14443b.state = ISO14443B_STATE_HALTED; + + return 0; +} + +static int +iso14443b_anticol(struct rfid_layer2_handle *handle) +{ + unsigned char afi = 0; /* FIXME */ + int ret; + unsigned char buf[255]; + unsigned int buf_len = sizeof(buf); + + ret = send_reqb(handle, afi, 0, 0); + if (ret < 0) + return ret; + + ret = transceive_attrib(handle, NULL, 0, buf, &buf_len); + if (ret < 0) + return ret; + + return 0; +} + +static struct rfid_layer2_handle * +iso14443b_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + h->l2 = &rfid_layer2_iso14443b; + h->rh = rh; + h->priv.iso14443b.state = ISO14443B_STATE_NONE; + + /* FIXME: if we want to support multiple PICC's, we need some + * fancy allocation scheme for CID's */ + h->priv.iso14443b.cid = 0; + + h->priv.iso14443b.fsd = iso14443_fsd_approx(rh->ah->mru); + DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd); + + /* 14443-3 Section 7.1.6 */ + h->priv.iso14443b.tr0 = (256/ISO14443_FREQ_SUBCARRIER)*10e6; + h->priv.iso14443b.tr1 = (200/ISO14443_FREQ_SUBCARRIER)*10e6; + + ret = h->rh->reader->init(h->rh, RFID_LAYER2_ISO14443B); + if (ret < 0) { + DEBUGP("error during reader 14443b init\n"); + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso14443b_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + +static int +iso14443b_transceive(struct rfid_layer2_handle *handle, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + DEBUGP("transcieving %u bytes, expecting max %u\n", tx_len, *rx_len); + return handle->rh->reader->transceive(handle->rh, frametype, + tx_buf, tx_len, + rx_buf, rx_len, timeout, flags); +} + +static int +iso14443b_getopt(struct rfid_layer2_handle *handle, + int optname, void *optval, unsigned int *optlen) +{ + unsigned int *opt_ui = optval; + + switch (optname) { + case RFID_OPT_14443B_CID: + *opt_ui = handle->priv.iso14443b.cid; + break; + case RFID_OPT_14443B_FSC: + *opt_ui = handle->priv.iso14443b.fsc; + break; + case RFID_OPT_14443B_FSD: + *opt_ui = handle->priv.iso14443b.fsd; + break; + case RFID_OPT_14443B_FWT: + *opt_ui = handle->priv.iso14443b.fwt; + break; + case RFID_OPT_14443B_TR0: + *opt_ui = handle->priv.iso14443b.tr0; + break; + case RFID_OPT_14443B_TR1: + *opt_ui = handle->priv.iso14443b.tr1; + break; + default: + return -EINVAL; + break; + } + return 0; +} + +static int +iso14443b_setopt(struct rfid_layer2_handle *handle, + int optname, const void *optval, unsigned int optlen) +{ + const unsigned int *opt_ui = optval; + + switch (optname) { + case RFID_OPT_14443B_CID: + handle->priv.iso14443b.cid = (*opt_ui & 0xf); + break; + defaukt: + return -EINVAL; + break; + } + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso14443b = { + .id = RFID_LAYER2_ISO14443B, + .name = "ISO 14443-3 B", + .fn = { + .init = &iso14443b_init, + .open = &iso14443b_anticol, + .transceive = &iso14443b_transceive, + .close = &iso14443b_hltb, + .fini = &iso14443b_fini, + .getopt = &iso14443b_getopt, + .setopt = &iso14443b_setopt, + }, +}; diff --git a/librfid/src/rfid_layer2_iso15693.c b/librfid/src/rfid_layer2_iso15693.c new file mode 100644 index 0000000..a4829cc --- /dev/null +++ b/librfid/src/rfid_layer2_iso15693.c @@ -0,0 +1,814 @@ +/* ISO 15693 anticollision implementation + * + * (C) 2005-2008 by Harald Welte + * (C) 2007 by Bjoern Riemer + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +//#define DEBUG_LIBRFID + +#include +#include +#include +#include + +#include +#include +#include +#include + +/*struct iso15693_request_read { + struct iso15693_request head; + u_int64_t uid; + u_int8_t blocknum; +} __attribute__ ((packed));*/ + +struct iso15693_request_adressed { + struct iso15693_request head; + u_int64_t uid; +} __attribute__ ((packed)); + +struct iso15693_request_block_addressed { + struct iso15693_request head; + u_int64_t uid; + u_int8_t blocknum; + u_int8_t data[0]; +} __attribute__ ((packed)); + +struct iso15693_request_block_selected { + struct iso15693_request head; + u_int8_t blocknum; + u_int8_t data[0]; +} __attribute__ ((packed)); + +struct iso15693_err_resp { + struct iso15693_response head; + u_int8_t error; + unsigned char crc[2]; +} __attribute__ ((packed)); + +struct iso15693_response_sec { + struct iso15693_response head; + u_int8_t block_sec; + u_int8_t data[]; +} __attribute__ ((packed)); + +#define ISO15693_BLOCK_SIZE_MAX (256/8) +#define ISO15693_RESP_SIZE_MAX (4+ISO15693_BLOCK_SIZE_MAX) + +const unsigned int iso15693_timing[2][5] = { + [ISO15693_T_SLOW] = { + [ISO15693_T1] = 1216, /* max time after VCD EOF before VICC SOF */ + [ISO15693_T2] = 1200, /* min time before VCD EOF after VICC response */ + [ISO15693_T3] = 1502, /* min time after VCD EOF before next EOF if no VICC response */ + [ISO15693_T4] = 1216, /* time after wich VICC transmits after VCD EOF */ + [ISO15693_T4_WRITE]=20000, /* time after wich VICC transmits after VCD EOF */ + }, + [ISO15693_T_FAST] = { + [ISO15693_T1] = 304, /* max time after VCD EOF before VICC SOF */ + [ISO15693_T2] = 300, /* min time before VCD EOF after VICC response */ + [ISO15693_T3] = 602, /* min time after VCD EOF before next EOF if no VICC response */ + [ISO15693_T4] = 304, /* time after wich VICC transmits after VCD EOF */ + [ISO15693_T4_WRITE]=20000, /* time after wich VICC transmits after VCD EOF */ + }, +}; + +char * +iso15693_get_response_error_name(u_int8_t error){ + switch (error){ + case RFID_15693_ERR_NOTSUPP: + return "ERR_NOTSUPP"; + case RFID_15693_ERR_INVALID: /* command not recognized */ + return "ERR_INVALID"; + case RFID_15693_ERR_UNKNOWN: /* unknown error */ + return "ERR_UNKNOWN"; + case RFID_15693_ERR_NOTSUPP_OPTION: + return "ERR_NotSuppOpt"; + case RFID_15693_ERR_BLOCK_NA: /* block not available */ + return "ERR_BLOCK_N"; + case RFID_15693_ERR_BLOCK_LOCKED: + return "ERR_BLOCK_LOCKE"; + case RFID_15693_ERR_BLOCK_LOCKED_CH: + return "ERR_BLOCK_LOCKED_CH"; + case RFID_15693_ERR_BLOCK_NOTPROG: + return "ERR_BLOCK_NOTPROG"; + case RFID_15693_ERR_BLOCK_NOTLOCK: + return "ERR_BLOCK_NOTLOCK"; + case 0xA0: /* until 0xDF*/ + return "Custom Command error Code"; + case 0xE0: + default: + return "Undef."; + } +} + +static int iso15693_transceive(struct rfid_layer2_handle *handle, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return handle->rh->reader->transceive(handle->rh, frametype, tx_buf, + tx_len, rx_buf, rx_len, timeout, flags); +} + +/* Transmit an anticollission frame */ +static int +iso15693_transceive_acf(struct rfid_layer2_handle *handle, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *rx_len, char *bit_of_col) +{ + const struct rfid_reader *rdr = handle->rh->reader; + if (!rdr->iso15693.transceive_ac) + return -1; + return rdr->iso15693.transceive_ac(handle->rh, acf, acf_len, resp, rx_len, bit_of_col); +} + + +int +iso15693_read_block(struct rfid_layer2_handle *handle, + u_int8_t blocknr, u_int32_t *data, unsigned int len, + unsigned char *block_sec_out) +{ + union { + struct iso15693_request_block_selected sel; + struct iso15693_request_block_addressed addr; + } tx_req; + + int ret; + unsigned char *errstr; + unsigned int rx_len, tx_len,timeout; + u_int8_t resp[ISO15693_RESP_SIZE_MAX]; + struct iso15693_err_resp *rx_err; + struct iso15693_response *rx_pkt; + struct iso15693_response_sec *rx_pkt_sec; + + rx_pkt_sec = (struct iso15693_response_sec *)&resp[0]; + rx_pkt = (struct iso15693_response *)&resp[0]; + rx_err = (struct iso15693_err_resp *)&resp[0]; + + memset(&tx_req,0,sizeof(tx_req)); + + rx_len = sizeof(resp); + + tx_req.sel.head.command = ISO15693_CMD_READ_BLOCK_SINGLE; + + if (handle->priv.iso15693.vicc_fast){ + tx_req.sel.head.flags |= RFID_15693_F_RATE_HIGH; + timeout=iso15693_timing[ISO15693_T_FAST][ISO15693_T4]; + }else + timeout=iso15693_timing[ISO15693_T_SLOW][ISO15693_T4]; + + if (handle->priv.iso15693.vicc_two_subc) + tx_req.sel.head.flags |= RFID_15693_F_SUBC_TWO; + + if (block_sec_out!=NULL) + tx_req.sel.head.flags |= RFID_15693_F4_CUSTOM; + + if (handle->priv.iso15693.state==RFID_15693_STATE_SELECTED) { + tx_len = sizeof(struct iso15693_request_block_selected); + tx_req.sel.blocknum = blocknr; + tx_req.sel.head.flags |= RFID_15693_F4_SELECTED; + } else { + tx_len = sizeof(struct iso15693_request_block_addressed); + memcpy(&tx_req.addr.uid, handle->uid, ISO15693_UID_LEN); + tx_req.addr.head.flags |= RFID_15693_F4_ADDRESS; + tx_req.addr.blocknum = blocknr; + } + + //DEBUGP("sizeof: addr: %d sel:%d\n",sizeof(struct iso15693_request_read_addressed),sizeof(struct iso15693_request_read_selected)); + DEBUGP("tx_len=%u", tx_len); DEBUGPC(" rx_len=%u\n",rx_len); + + ret = iso15693_transceive(handle, RFID_15693_FRAME, (u_int8_t*)&tx_req, + tx_len, resp, &rx_len, timeout, 0); + + if (ret==-ETIMEDOUT) + errstr="(TIMEOUT)"; + else if (ret==-EIO) + errstr="(EIO)"; + else + errstr=""; + DEBUGP("length: %d rx_len: %d ret: %d%s\n",len,rx_len,ret,errstr); + + if (ret < 0) + return ret; + + if (rx_len > len+1) + return -1; + DEBUGP("error_flag: %d", rx_pkt->flags&RFID_15693_RF_ERROR); + if (rx_pkt->flags & RFID_15693_RF_ERROR) { + DEBUGPC(" -> error: %02x '%s'\n", rx_err->error, + iso15693_get_response_error_name(rx_err->error)); + return -1; + } else if (block_sec_out != NULL) { + DEBUGPC(" block_sec_stat: 0x%02x\n",rx_pkt_sec->block_sec); + memcpy(data, rx_pkt_sec->data, rx_len-2); + return rx_len-2; + } else { + memcpy(data, rx_pkt->data, rx_len-1); /* FIXME rc-3 in case of CRC */ + return rx_len-1; + } +} + +int +iso15693_write_block(struct rfid_layer2_handle *handle, + u_int8_t blocknr, u_int32_t *data, unsigned int len) +{ + int ret; + unsigned char *errstr; + unsigned int rx_len, tx_len,timeout; + + union{ + struct iso15693_request_block_selected sel; + struct iso15693_request_block_addressed addr; + u_int32_t buf[sizeof(struct iso15693_request_block_addressed)+ISO15693_BLOCK_SIZE_MAX]; + } tx_req; + + u_int8_t resp[ISO15693_RESP_SIZE_MAX]; + struct iso15693_response *rx_pkt; + struct iso15693_err_resp *rx_err; + + rx_pkt = (struct iso15693_response *)&resp[0]; + rx_err = (struct iso15693_err_resp *)&resp[0]; + rx_len = sizeof(resp); + + if (len > ISO15693_BLOCK_SIZE_MAX) + return -1; + + //return -1; + + memset(&tx_req,0,sizeof(tx_req)); + tx_req.sel.head.command = ISO15693_CMD_WRITE_BLOCK_SINGLE; + + if (handle->priv.iso15693.vicc_fast) { + tx_req.sel.head.flags |= RFID_15693_F_RATE_HIGH; + timeout = iso15693_timing[ISO15693_T_FAST][ISO15693_T4_WRITE]; + } else + timeout = iso15693_timing[ISO15693_T_SLOW][ISO15693_T4_WRITE]; + + if (handle->priv.iso15693.vicc_two_subc) + tx_req.sel.head.flags |= RFID_15693_F_SUBC_TWO; + + if (handle->priv.iso15693.state == RFID_15693_STATE_SELECTED) { + tx_len=sizeof(struct iso15693_request_block_selected)+len; + tx_req.sel.head.flags |= RFID_15693_F4_SELECTED; + tx_req.sel.blocknum = blocknr; + memcpy(&tx_req.sel.data,data,len); + } else { + memcpy(&tx_req.addr.uid, handle->uid, ISO15693_UID_LEN); + tx_len=sizeof(struct iso15693_request_block_addressed)+len; + tx_req.addr.head.flags |= RFID_15693_F4_ADDRESS; + tx_req.addr.blocknum = blocknr; + memcpy(&tx_req.addr.data,data,len); + } + + //DEBUGP("sizeof: addr: %d sel:%d\n",sizeof(struct iso15693_request_read_addressed),sizeof(struct iso15693_request_read_selected)); + DEBUGP("tx_len=%u", tx_len); DEBUGPC(" rx_len=%u\n",rx_len); + + ret = iso15693_transceive(handle, RFID_15693_FRAME, (u_int8_t*)&tx_req, + tx_len, resp, &rx_len, timeout, 0); + + if (ret == -ETIMEDOUT) + errstr = "(TIMEOUT)"; + else if (ret == -EIO) + errstr = "(EIO)"; + else + errstr = ""; + DEBUGP("length: %d rx_len: %d ret: %d%s\n",len,rx_len,ret,errstr); + + if (ret < 0) + return ret; + + if (rx_len > len+1) + return -1; + DEBUGP("error_flag: %d", rx_pkt->flags & RFID_15693_RF_ERROR); + if (rx_pkt->flags & RFID_15693_RF_ERROR) { + DEBUGPC(" -> error: %02x '%s'\n", rx_err->error, + iso15693_get_response_error_name(rx_err->error)); + return -1; + } else { + //DEBUGPC(" block_sec_stat: 0x%02x\n",rx_pkt->data[0]); + //memcpy(data, rx_pkt->data, rx_len-1); /* FIXME rc-3 in case of CRC */ + //return rx_len-1; + return 0; + } + +} + + +#if 0 + +static int +iso15693_lock_block() +{ +} + +#endif + +/* Helper function to build an ISO 15693 anti collision frame */ +static int +iso15693_build_acf(u_int8_t *target, u_int8_t flags, u_int8_t afi, + u_int8_t mask_len, u_int8_t *mask) +{ + struct iso15693_request *req = (struct iso15693_request *) target; + int i = 0, j, mask_bytes; + u_int8_t byte=0; + void* mask_p; + + req->flags = flags; + req->command = ISO15693_CMD_INVENTORY; + if (flags & RFID_15693_F5_AFI_PRES) + req->data[i++] = afi; + req->data[i++] = mask_len; + + mask_bytes = mask_len/8 + (mask_len%8)?1:0; + mask_p = &req->data[i]; + + for (j = 0; j < mask_bytes; j++) + req->data[i++] = mask[j]; + + byte = 0xFF >> (8-mask_len%8); + req->data[i-1] &= byte; + + DEBUGP("mask_len: %d mask_bytes: %d i: %d return: %d mask:%s\n", + mask_len,mask_bytes,i,i + sizeof(*req),rfid_hexdump(mask_p,mask_bytes)); + return i + sizeof(*req); +} + +static int +iso15693_anticol(struct rfid_layer2_handle *handle) +{ + int i, ret, mask_len; + int tx_len, rx_len; + int num_valid = 0; + union { + struct iso15693_anticol_cmd_afi w_afi; + struct iso15693_anticol_cmd no_afi; + } acf; + + struct iso15693_anticol_resp resp; + + u_int8_t boc; +#define MAX_SLOTS 16 + int num_slots = MAX_SLOTS; + + u_int8_t uuid_list[MAX_SLOTS][ISO15693_UID_LEN]; + int uuid_list_valid[MAX_SLOTS]; + + u_int8_t flags; + +#define MY_NONE 0 +#define MY_COLL 1 +#define MY_UUID 2 + + memset(uuid_list_valid, MY_NONE, sizeof(uuid_list_valid)); + memset(uuid_list, 0, sizeof(uuid_list)); + + //memset(&acf, 0, sizeof(acf)); + + /* FIXME: we can't use multiple slots at this point, since the RC632 + * with librfid on the host PC has too much latency between 'EOF pulse + * to mark start of next slot' and 'receive data' commands :( */ + + flags = RFID_15693_F_INV_TABLE_5; + if (handle->priv.iso15693.vicc_fast) + flags |= RFID_15693_F_RATE_HIGH; + if (handle->priv.iso15693.vicc_two_subc) + flags |= RFID_15693_F_SUBC_TWO; + if (handle->priv.iso15693.single_slot) { + flags |= RFID_15693_F5_NSLOTS_1; + num_slots = 1; + } + if (handle->priv.iso15693.use_afi) + flags |= RFID_15693_F5_AFI_PRES; +#if 1 + tx_len = iso15693_build_acf((u_int8_t *)&acf, flags, + handle->priv.iso15693.afi, 0, NULL); +#else + /*FIXME: testcode*/ + u_int8_t uid[8]={0x1f, 0x1e, 0x95, 0x01, 0x00, 0x01, 0x04, 0xe0}; + //u_int8_t uid[8]={0xe3, 0xe8, 0xf1, 0x01, 0x00, 0x00, 0x07, 0xe0}; + tx_len = iso15693_build_acf((u_int8_t *)&acf, flags, + handle->priv.iso15693.afi, 2, uid); +#endif +start_of_ac_loop: + for (i = 0; i < num_slots; i++) { + rx_len = sizeof(resp); + memset(&resp, 0, rx_len); + ret = iso15693_transceive_acf(handle, + (struct iso15693_anticol_cmd *) &acf, + tx_len, &resp, &rx_len, &boc); + + if (ret == -ETIMEDOUT) { + //DEBUGP("no answer from vicc in slot %d\n", i); + DEBUGP("slot[%d]: timeout\n",i); + uuid_list_valid[i] = MY_NONE; + } else if (ret < 0) { + DEBUGP("slot[%d]: ERROR ret: %d\n", i, ret); + uuid_list_valid[i] = MY_NONE; + } else { + if (ret) + DEBUGP("iso15693_transceive_acf() ret: %d\n",ret); + if (boc) { + DEBUGP("slot[%d]: Collision! bit:%d byte:%d,%d (UID bit:%d byte:%d,%d)\n", + i, boc,boc/8,boc%8, + boc-16,(boc-16)/8,(boc-16)%8); + DEBUGP("Slot[%d]: ret: %d DSFID: %02x UUID: %s\n", i, ret, + resp.dsfid, rfid_hexdump(resp.uuid, ISO15693_UID_LEN)); + + uuid_list_valid[i]=-boc; + memcpy(uuid_list[i], resp.uuid, ISO15693_UID_LEN); + } else { + DEBUGP("Slot[%d]: ret: %d DSFID: %02x UUID: %s\n", i, ret, + resp.dsfid, rfid_hexdump(resp.uuid, ISO15693_UID_LEN)); + uuid_list_valid[i] = MY_UUID; + memcpy(&uuid_list[i][0], resp.uuid, ISO15693_UID_LEN); + + memcpy(handle->uid,resp.uuid, ISO15693_UID_LEN); + /* FIXME: move to init_iso15693 */ + handle->uid_len = ISO15693_UID_LEN; + return 1; + } + } + } + + + for (i = 0; i < num_slots; i++) { + if (uuid_list_valid[i] < 0) { + boc=uuid_list_valid[i]*-1; + if (boc>16){ + boc=boc-16; + } + else + DEBUGP("slot[%d]:boc is smaller than 2 bytes (collision before uid)!!!!\n",i); + + if (boc<65){ + tx_len = iso15693_build_acf((u_int8_t *)&acf, flags, + handle->priv.iso15693.afi, boc+1, resp.uuid); + boc=0; + // FIXME: dont use goto + goto start_of_ac_loop; + }else{ + DEBUGP("slot[%d]:boc is bigger than 64 (uid size)(collision after uid)\n",i); + memcpy(handle->uid,uuid_list[i],ISO15693_UID_LEN); + + /* FIXME: move to init_iso15693 */ + handle->uid_len = ISO15693_UID_LEN; + return 1; + } + } + } +#if 0 + for (i = 0; i < num_slots; i++) { + if (uuid_list_valid[i] == MY_NONE) { + DEBUGP("slot[%d]: timeout\n",i); + } else if (uuid_list_valid[i] == MY_UUID) { + DEBUGP("slot[%d]: VALID uuid: %s\n", i, + rfid_hexdump(uuid_list[i], ISO15693_UID_LEN)); + memcpy(handle->uid, uuid_list[i], ISO15693_UID_LEN); + /* FIXME: move to init_iso15693 */ + handle->uid_len = ISO15693_UID_LEN; + num_valid++; + } else if (uuid_list_valid[i] < 0) { + if (boc>16){ + boc=boc-16; + } + else + DEBUGP("boc is smaller than 2 bytes (collision before uid)!!!!\n"); + + uuid_list_valid[i] = -boc; + if (boc<65){ + tx_len = iso15693_build_acf((u_int8_t *)&acf, flags, + handle->priv.iso15693.afi, boc+1, resp.uuid); + boc=0; + // FIXME: dont use goto + goto start_of_ac_loop; + }else{ + DEBUGP("boc is bigger than 64 (uid size)\n"); + uuid_list_valid[i] = MY_UUID; + } + } + } +#endif + if (num_valid == 0) + return -1; + + return num_valid; +} + +int +iso15693_select(struct rfid_layer2_handle *l2h) +{ + struct iso15693_request_adressed tx_req; + int ret; + unsigned int rx_len, tx_len, timeout; + + struct { + struct iso15693_response head; + u_int8_t error; + unsigned char crc[2]; + } rx_buf; + rx_len = sizeof(rx_buf); + + if (l2h->priv.iso15693.vicc_fast) { + tx_req.head.flags |= RFID_15693_F_RATE_HIGH; + timeout = iso15693_timing[ISO15693_T_FAST][ISO15693_T4]; + } else + timeout = iso15693_timing[ISO15693_T_SLOW][ISO15693_T4]; + + tx_req.head.command = ISO15693_CMD_SELECT; + tx_req.head.flags = RFID_15693_F4_ADDRESS; + + if (l2h->priv.iso15693.vicc_fast) + tx_req.head.flags |= RFID_15693_F_RATE_HIGH; + if (l2h->priv.iso15693.vicc_two_subc) + tx_req.head.flags |= RFID_15693_F_SUBC_TWO; + + memcpy(&tx_req.uid, l2h->uid, ISO15693_UID_LEN); + tx_len = sizeof(tx_req); + + DEBUGP("tx_len=%u, rx_len=%u\n", tx_len,rx_len); + + ret = iso15693_transceive(l2h, RFID_15693_FRAME, (u_int8_t*)&tx_req, + tx_len, (u_int8_t*)&rx_buf, &rx_len,timeout ,0); + + DEBUGP("ret: %d%s, rx_len: %d, error_flag: %d", ret, + (ret==-ETIMEDOUT)?"(TIMEOUT)":"", rx_len, + rx_buf.head.flags&RFID_15693_RF_ERROR); + if (rx_buf.head.flags & RFID_15693_RF_ERROR) { + DEBUGPC(" -> error: %02x '%s'\n", rx_buf.error, + iso15693_get_response_error_name(rx_buf.error)); + return -1; + } else { + DEBUGPC(" SELECTED\n"); + l2h->priv.iso15693.state = RFID_15693_STATE_SELECTED; + return 0; + } +} + +static int +iso15693_stay_quiet(struct rfid_layer2_handle *l2h) +{ + struct iso15693_request_adressed tx_req; + int ret; + unsigned int rx_len, tx_len; + + struct { + struct iso15693_response head; + u_int8_t error; + unsigned char crc[2]; + } rx_buf; + rx_len = sizeof(rx_buf); + + tx_req.head.command = ISO15693_CMD_STAY_QUIET; + + tx_req.head.flags = RFID_15693_F4_ADDRESS; + if (l2h->priv.iso15693.vicc_fast) + tx_req.head.flags |= RFID_15693_F_RATE_HIGH; + if (l2h->priv.iso15693.vicc_two_subc) + tx_req.head.flags |= RFID_15693_F_SUBC_TWO; + memcpy(&tx_req.uid, l2h->uid, ISO15693_UID_LEN); + tx_len = sizeof(tx_req); + + DEBUGP("tx_len=%u", tx_len); DEBUGPC(" rx_len=%u\n",rx_len); + + ret = iso15693_transceive(l2h, RFID_15693_FRAME, (u_int8_t*)&tx_req, + tx_len, (u_int8_t*)&rx_buf, &rx_len, 30,0); + + l2h->priv.iso15693.state = RFID_15693_STATE_QUIET; + + DEBUGP("ret: %d%s, error_flag: %d", ret,(ret==-ETIMEDOUT)?"(TIMEOUT)":"", + rx_buf.head.flags&RFID_15693_RF_ERROR); + if (rx_buf.head.flags&RFID_15693_RF_ERROR) + DEBUGPC(" -> error: %02x\n", rx_buf.error); + else + DEBUGPC("\n"); + + return 0; +} + +static int +iso15693_getopt(struct rfid_layer2_handle *handle, + int optname, void *optval, unsigned int *optlen) +{ + unsigned int *val = optval; + u_int8_t *val_u8 = optval; + + if (!optlen || !optval || *optlen < sizeof(unsigned int)) + return -EINVAL; + + *optlen = sizeof(unsigned int); + + switch (optname) { + case RFID_OPT_15693_MOD_DEPTH: + if (handle->priv.iso15693.vcd_ask100) + *val = RFID_15693_MOD_100ASK; + else + *val = RFID_15693_MOD_10ASK; + break; + case RFID_OPT_15693_VCD_CODING: + if (handle->priv.iso15693.vcd_out256) + *val = RFID_15693_VCD_CODING_1OUT256; + else + *val = RFID_15693_VCD_CODING_1OUT4; + break; + case RFID_OPT_15693_VICC_SUBC: + if (handle->priv.iso15693.vicc_two_subc) + *val = RFID_15693_VICC_SUBC_DUAL; + else + *val = RFID_15693_VICC_SUBC_SINGLE; + break; + case RFID_OPT_15693_VICC_SPEED: + if (handle->priv.iso15693.vicc_fast) + *val = RFID_15693_VICC_SPEED_FAST; + else + *val = RFID_15693_VICC_SPEED_SLOW; + break; + case RFID_OPT_15693_VCD_SLOTS: + if (handle->priv.iso15693.single_slot) + *val = 1; + else + *val = 16; + break; + case RFID_OPT_15693_USE_AFI: + if (handle->priv.iso15693.use_afi) + *val = 1; + else + *val = 0; + break; + case RFID_OPT_15693_AFI: + *val_u8 = handle->priv.iso15693.afi; + *optlen = sizeof(u_int8_t); + break; + default: + return -EINVAL; + break; + } + + return 0; +} + +static int +iso15693_setopt(struct rfid_layer2_handle *handle, int optname, + const void *optval, unsigned int optlen) +{ + unsigned int val; + + if (optlen < sizeof(u_int8_t) || !optval) + return -EINVAL; + + if (optlen == sizeof(u_int8_t)) + val = *((u_int8_t *) optval); + if (optlen == sizeof(u_int16_t)) + val = *((u_int16_t *) optval); + if (optlen == sizeof(unsigned int)) + val = *((unsigned int *) optval); + + switch (optname) { + case RFID_OPT_15693_MOD_DEPTH: + switch (val) { + case RFID_15693_MOD_10ASK: + handle->priv.iso15693.vcd_ask100 = 0; + break; + case RFID_15693_MOD_100ASK: + handle->priv.iso15693.vcd_ask100 = 1; + break; + default: + return -EINVAL; + } + break; + case RFID_OPT_15693_VCD_CODING: + switch (val) { + case RFID_15693_VCD_CODING_1OUT256: + handle->priv.iso15693.vcd_out256 = 1; + break; + case RFID_15693_VCD_CODING_1OUT4: + handle->priv.iso15693.vcd_out256 = 0; + break; + default: + return -EINVAL; + } + break; + case RFID_OPT_15693_VICC_SUBC: + switch (val) { + case RFID_15693_VICC_SUBC_SINGLE: + handle->priv.iso15693.vicc_two_subc = 0; + break; + case RFID_15693_VICC_SUBC_DUAL: + handle->priv.iso15693.vicc_two_subc = 1; + break; + default: + return -EINVAL; + } + break; + case RFID_OPT_15693_VICC_SPEED: + switch (val) { + case RFID_15693_VICC_SPEED_SLOW: + handle->priv.iso15693.vicc_fast = 0; + break; + case RFID_15693_VICC_SPEED_FAST: + handle->priv.iso15693.vicc_fast = 1; + break; + default: + return -EINVAL; + } + case RFID_OPT_15693_VCD_SLOTS: + switch (val) { + case 16: + handle->priv.iso15693.single_slot = 0; + break; + case 1: + handle->priv.iso15693.single_slot = 1; + break; + default: + return -EINVAL; + } + break; + case RFID_OPT_15693_USE_AFI: + if (val) + handle->priv.iso15693.use_afi = 1; + else + handle->priv.iso15693.use_afi = 0; + break; + case RFID_OPT_15693_AFI: + if (val > 0xff) + return -EINVAL; + handle->priv.iso15693.afi = val; + break; + default: + return -EINVAL; + } + return 0; +} + +static int transceive_inventory(struct rfid_layer2_handle *l2h) +{ + return -1; +} + +static struct rfid_layer2_handle * +iso15693_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + h->l2 = &rfid_layer2_iso15693; + h->rh = rh; + h->priv.iso15693.state = ISO15693_STATE_NONE; + h->priv.iso15693.vcd_ask100 = 1; /* 100ASK is easier to generate */ + h->priv.iso15693.vicc_two_subc = 0; + h->priv.iso15693.vicc_fast = 1; + h->priv.iso15693.single_slot = 1; + h->priv.iso15693.vcd_out256 = 0; + h->priv.iso15693.use_afi = 0; /* not all VICC support AFI */ + h->priv.iso15693.afi = 0; + + ret = h->rh->reader->init(h->rh, RFID_LAYER2_ISO15693); + if (ret < 0) { + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso15693_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso15693 = { + .id = RFID_LAYER2_ISO15693, + .name = "ISO 15693", + .fn = { + .init = &iso15693_init, + .open = &iso15693_anticol, + //.open = &iso15693_select, + //.transceive = &iso15693_transceive, + .close = &iso15693_stay_quiet, + .fini = &iso15693_fini, + .setopt = &iso15693_setopt, + .getopt = &iso15693_getopt, + }, +}; + diff --git a/librfid/src/rfid_proto_icode.c b/librfid/src/rfid_proto_icode.c new file mode 100644 index 0000000..f8e6cbd --- /dev/null +++ b/librfid/src/rfid_proto_icode.c @@ -0,0 +1,120 @@ + +/* Philips/NXP I*Code implementation, PCD side. + * + * (C) 2005-2008 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static int +icode_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + /* FIXME */ + return -EINVAL; +} + +static int +icode_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned int i; + unsigned char tx[6]; + unsigned char rx[10]; + unsigned int rx_len = sizeof(rx); + int ret; + + return -EINVAL; +} + +static int +icode_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + ret = 0; + /* we have to return the size in bytes, not bits */ + /* FIXME: implement this */ + *size = 12345; + break; + } + + return ret; +} + + +static struct rfid_protocol_handle * +icode_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + u_int8_t uid[6]; + int uid_len = sizeof(uid); + + if (l2h->l2->id != RFID_LAYER2_ICODE1) + return NULL; + + /* According to "SCBU002 - November 2005 */ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, + uid, &uid_len); + if (uid[5] != 0xe0 || uid[4] != 0x07) + return NULL; + if (l2h->uid_len != 6) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int icode_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_icode = { + .id = RFID_PROTOCOL_ICODE_SLI, + .name = "I*Code SLI", + .fn = { + .init = &icode_init, + .read = &icode_read, + .write = &icode_write, + .fini = &icode_fini, + .getopt = &icode_getopt, + }, +}; + +/* Functions below are not (yet? covered in the generic librfid api */ diff --git a/librfid/src/rfid_proto_mifare_classic.c b/librfid/src/rfid_proto_mifare_classic.c new file mode 100644 index 0000000..a6e2e4f --- /dev/null +++ b/librfid/src/rfid_proto_mifare_classic.c @@ -0,0 +1,237 @@ + +/* Mifare Classic implementation, PCD side. + * + * (C) 2005-2008 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "rfid_iso14443_common.h" + + +#define MIFARE_UL_CMD_WRITE 0xA2 +#define MIFARE_UL_CMD_READ 0x30 + +#define MIFARE_CL_READ_FWT 250 +#define MIFARE_CL_WRITE_FWT 600 + +static int +mfcl_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + if (page > MIFARE_CL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_CL_CMD_READ; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + sizeof(tx), rx_buf, &real_rx_len, + MIFARE_CL_READ_FWT, 0); + + if (ret < 0) + return ret; + + if (real_rx_len == 1 && *rx_buf == 0x04) + return -EPERM; + + if (real_rx_len < *rx_len) + *rx_len = real_rx_len; + + memcpy(rx_data, rx_buf, *rx_len); + + return ret; +} + +static int +mfcl_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned char tx[2]; + unsigned char rx[1]; + unsigned int rx_len = sizeof(rx); + int ret; + + if (page > MIFARE_CL_PAGE_MAX) + return -EINVAL; + + if (tx_len != 16) + return -EINVAL; + + tx[0] = MIFARE_CL_CMD_WRITE16; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, 2, rx, + &rx_len, MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx_data, + tx_len, rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + return ret; +} + +static int +mfcl_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + u_int8_t atqa[2]; + u_int8_t sak; + unsigned int atqa_size = sizeof(atqa); + unsigned int sak_size = sizeof(sak); + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + if (*optlen < sizeof(*size)) + return -EINVAL; + *optlen = sizeof(*size); + ret = 0; + rfid_layer2_getopt(ph->l2h, RFID_OPT_14443A_ATQA, + atqa, &atqa_size); + rfid_layer2_getopt(ph->l2h, RFID_OPT_14443A_SAK, + &sak, &sak_size); + if (atqa[0] == 0x04 && atqa[1] == 0x00) { + if (sak == 0x09) { + /* mifare mini */ + *size = 320; + } else + *size = 1024; + } else if (atqa[0] == 0x02 && atqa[1] == 0x00) + *size = 4096; + else + ret = -EIO; + break; + } + + return ret; +} + +static struct rfid_protocol_handle * +mfcl_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + + if (l2h->l2->id != RFID_LAYER2_ISO14443A) + return NULL; + + if (l2h->uid_len != 4) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int mfcl_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_mfcl = { + .id = RFID_PROTOCOL_MIFARE_CLASSIC, + .name = "Mifare Classic", + .fn = { + .init = &mfcl_init, + .read = &mfcl_read, + .write = &mfcl_write, + .fini = &mfcl_fini, + .getopt = &mfcl_getopt, + }, +}; + +int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key) +{ + if (!ph->l2h->rh->reader->mifare_classic.setkey) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.setkey(ph->l2h->rh, key); +} + +int mfcl_set_key_ee(struct rfid_protocol_handle *ph, unsigned int addr) +{ + if (!ph->l2h->rh->reader->mifare_classic.setkey_ee) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.setkey_ee(ph->l2h->rh, addr); +} + +int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block) +{ + u_int32_t serno = *((u_int32_t *)ph->l2h->uid); + + if (!ph->l2h->rh->reader->mifare_classic.auth) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.auth(ph->l2h->rh, cmd, + serno, block); +} + +int mfcl_block2sector(u_int8_t block) +{ + if (block < MIFARE_CL_SMALL_SECTORS * MIFARE_CL_BLOCKS_P_SECTOR_1k) + return block/MIFARE_CL_BLOCKS_P_SECTOR_1k; + else + return (block - MIFARE_CL_SMALL_SECTORS * MIFARE_CL_BLOCKS_P_SECTOR_1k) + / MIFARE_CL_BLOCKS_P_SECTOR_4k; +} + +int mfcl_sector2block(u_int8_t sector) +{ + if (sector < MIFARE_CL_SMALL_SECTORS) + return sector * MIFARE_CL_BLOCKS_P_SECTOR_1k; + else if (sector < MIFARE_CL_SMALL_SECTORS + MIFARE_CL_LARGE_SECTORS) + return MIFARE_CL_SMALL_SECTORS * MIFARE_CL_BLOCKS_P_SECTOR_1k + + (sector - MIFARE_CL_SMALL_SECTORS) * MIFARE_CL_BLOCKS_P_SECTOR_4k; + else + return -EINVAL; +} + +int mfcl_sector_blocks(u_int8_t sector) +{ + if (sector < MIFARE_CL_SMALL_SECTORS) + return MIFARE_CL_BLOCKS_P_SECTOR_1k; + else if (sector < MIFARE_CL_SMALL_SECTORS + MIFARE_CL_LARGE_SECTORS) + return MIFARE_CL_BLOCKS_P_SECTOR_4k; + else + return -EINVAL; +} diff --git a/librfid/src/rfid_proto_mifare_ul.c b/librfid/src/rfid_proto_mifare_ul.c new file mode 100644 index 0000000..d90ac63 --- /dev/null +++ b/librfid/src/rfid_proto_mifare_ul.c @@ -0,0 +1,189 @@ + +/* Mifare Ultralight implementation, PCD side. + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" + + +/* FIXME */ +#define MIFARE_UL_READ_FWT 100 +#define MIFARE_UL_WRITE_FWT 100 + +static int +mful_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + if (page > MIFARE_UL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_UL_CMD_READ; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, + tx, sizeof(tx), rx_buf, + &real_rx_len, MIFARE_UL_READ_FWT, 0); + + if (ret < 0) + return ret; + + if (real_rx_len < *rx_len) + *rx_len = real_rx_len; + + memcpy(rx_data, rx_buf, *rx_len); + + return ret; +} + +static int +mful_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned int i; + unsigned char tx[6]; + unsigned char rx[10]; + unsigned int rx_len = sizeof(rx); + int ret; + + if (tx_len != 4 || page > MIFARE_UL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_UL_CMD_WRITE; + tx[1] = page & 0xff; + + for (i = 0; i < 4; i++) + tx[2+i] = tx_data[i]; + + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, + tx, sizeof(tx), rx, &rx_len, + MIFARE_UL_WRITE_FWT, 0); + + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + return ret; +} + +static int +mful_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + ret = 0; + /* we have to return the size in bytes, not bits */ + *size = 512/8; + break; + } + + return ret; +} + + +static struct rfid_protocol_handle * +mful_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + u_int8_t atqa[2]; + unsigned int atqa_len = sizeof(atqa); + + if (l2h->l2->id != RFID_LAYER2_ISO14443A) + return NULL; + + /* According to "Type Identification Procedure Rev. 1.3" */ + rfid_layer2_getopt(l2h, RFID_OPT_14443A_ATQA, + atqa, &atqa_len); + if (atqa[0] != 0x44 || atqa[1] != 0x00) + return NULL; + + /* according to "Functional Specification Rev. 3.0 */ + if (l2h->uid_len != 7) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int mful_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_mful = { + .id = RFID_PROTOCOL_MIFARE_UL, + .name = "Mifare Ultralight", + .fn = { + .init = &mful_init, + .read = &mful_read, + .write = &mful_write, + .fini = &mful_fini, + .getopt = &mful_getopt, + }, +}; + +/* Functions below are not (yet? covered in the generic librfid api */ + + +/* lock a certain page */ +int rfid_mful_lock_page(struct rfid_protocol_handle *ph, unsigned int page) +{ + unsigned char buf[4] = { 0x00, 0x00, 0x00, 0x00 }; + + if (ph->proto != &rfid_protocol_mful) + return -EINVAL; + + if (page < 3 || page > 15) + return -EINVAL; + + if (page > 8) + buf[2] = (1 << page); + else + buf[3] = (1 << (page - 8)); + + return mful_write(ph, MIFARE_UL_PAGE_LOCK, buf, sizeof(buf)); +} + +/* convenience wrapper to lock the otp page */ +int rfid_mful_lock_otp(struct rfid_protocol_handle *ph) +{ + return rfid_mful_lock_page(ph, MIFARE_UL_PAGE_OTP); +} diff --git a/librfid/src/rfid_proto_tagit.c b/librfid/src/rfid_proto_tagit.c new file mode 100644 index 0000000..0388baa --- /dev/null +++ b/librfid/src/rfid_proto_tagit.c @@ -0,0 +1,141 @@ + +/* UNFINISHED TI Tag-it implementation, PCD side. + * + * (C) 2005-2008 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +struct tagit_version { + u_int8_t version; /* bit 47..40 (last bit masked) of uid */ + const char *name; +}; + +const struct tagit_version tagit_versions[] = { + { + .version = 0x00, + .name = "HF-I Plus Inlay", + }, { + .version = 0x80, + .name = "HF-I Plus Chip", + }, { + .version = 0xc0, + .name = "HF-I Standard Chip / Inlay", + }, { + .version = 0xc4, + .name = "HF-I Pro Chip / Inlay", + }, +}; + +static int +tagit_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + /* FIXME */ + return -EINVAL; +} + +static int +tagit_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned int i; + unsigned char tx[6]; + unsigned char rx[10]; + unsigned int rx_len = sizeof(rx); + int ret; + + return -EINVAL; +} + +static int +tagit_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + ret = 0; + /* we have to return the size in bytes, not bits */ + /* FIXME: implement this */ + *size = 12345; + break; + } + + return ret; +} + + +static struct rfid_protocol_handle * +tagit_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + u_int8_t uid[6]; + unsigned int uid_len = sizeof(uid); + + if (l2h->l2->id != RFID_LAYER2_ISO15693) + return NULL; + + /* According to "SCBU002 - November 2005 */ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, + uid, &uid_len); + if (uid[5] != 0xe0 || uid[4] != 0x07) + return NULL; + if (l2h->uid_len != 6) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int tagit_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_tagit = { + .id = RFID_PROTOCOL_TAGIT, + .name = "TI Tag-it HF", + .fn = { + .init = &tagit_init, + .read = &tagit_read, + .write = &tagit_write, + .fini = &tagit_fini, + .getopt = &tagit_getopt, + }, +}; + +/* Functions below are not (yet? covered in the generic librfid api */ diff --git a/librfid/src/rfid_proto_tcl.c b/librfid/src/rfid_proto_tcl.c new file mode 100644 index 0000000..cfde04b --- /dev/null +++ b/librfid/src/rfid_proto_tcl.c @@ -0,0 +1,819 @@ +/* ISO 14443-4 (T=CL) implementation, PCD side. + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rfid_iso14443_common.h" + +#define RFID_MAX_FRAMELEN 256 + +#define is_s_block(x) ((x & 0xc0) == 0xc0) +#define is_r_block(x) ((x & 0xc0) == 0x80) +#define is_i_block(x) ((x & 0xc0) == 0x00) + +static enum rfid_frametype l2_to_frame(unsigned int layer2) +{ + switch (layer2) { + case RFID_LAYER2_ISO14443A: + return RFID_14443A_FRAME_REGULAR; + break; + case RFID_LAYER2_ISO14443B: + return RFID_14443B_FRAME_REGULAR; + break; + } + return 0; +} + +static unsigned int sfgi_to_sfgt(struct rfid_protocol_handle *h, + unsigned char sfgi) +{ + unsigned int multiplier; + unsigned int tmp; + + if (sfgi > 14) + sfgi = 14; + + multiplier = 1 << sfgi; /* 2 to the power of sfgi */ + + /* ISO 14443-4:2000(E) Section 5.2.5: + * (256 * 16 / h->l2h->rh->ah->fc) * (2 ^ sfgi) */ + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->l2h->rh->ah->fc) * multiplier; +} + +static unsigned int fwi_to_fwt(struct rfid_protocol_handle *h, + unsigned char fwi) +{ + unsigned int multiplier, tmp; + + if (fwi > 14) + fwi = 14; + + multiplier = 1 << fwi; /* 2 to the power of fwi */ + + /* ISO 14443-4:2000(E) Section 7.2.: + * (256*16 / h->l2h->rh->ah->fc) * (2 ^ fwi) */ + + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->l2h->rh->ah->fc) * multiplier; +} + +/* 4.9seconds as microseconds (4.9 billion seconds) exceeds 2^32 */ +#define activation_fwt(x) (((u_int64_t)1000000 * 65536 / x->l2h->rh->ah->fc)) +#define deactivation_fwt(x) activation_fwt(x) + +static int +tcl_parse_ats(struct rfid_protocol_handle *h, + unsigned char *ats, unsigned int size) +{ + unsigned char len = ats[0]; + unsigned char t0; + unsigned char *cur; + + if (len == 0 || size == 0) + return -1; + + if (size < len) + len = size; + + h->priv.tcl.ta = 0; + + if (len == 1) { + /* FIXME: assume some default values */ + h->priv.tcl.fsc = 32; + h->priv.tcl.ta = 0x80; /* 0x80 (same d for both dirs) */ + h->priv.tcl.sfgt = sfgi_to_sfgt(h, 0); + if (h->l2h->l2->id == RFID_LAYER2_ISO14443A) { + /* Section 7.2: fwi default for type A is 4 */ + h->priv.tcl.fwt = fwi_to_fwt(h, 4); + } else { + /* Section 7.2: fwi for type B is always in ATQB */ + /* Value is assigned in tcl_connect() */ + /* This function is never called for Type B, + * since Type B has no (R)ATS */ + } + return 0; + } + + /* guarateed to be at least 2 bytes in size */ + + t0 = ats[1]; + cur = &ats[2]; + + iso14443_fsdi_to_fsd(&h->priv.tcl.fsc, t0 & 0x0f); + if (h->priv.tcl.fsc > h->l2h->rh->ah->mtu) + h->priv.tcl.fsc = h->l2h->rh->ah->mtu; + + if (t0 & (1 << 4)) { + /* TA is transmitted */ + h->priv.tcl.ta = *cur++; + } + + if (t0 & (1 << 5)) { + /* TB is transmitted */ + h->priv.tcl.sfgt = sfgi_to_sfgt(h, *cur & 0x0f); + h->priv.tcl.fwt = fwi_to_fwt(h, (*cur & 0xf0) >> 4); + cur++; + } + + if (t0 & (1 << 6)) { + /* TC is transmitted */ + if (*cur & 0x01) { + h->priv.tcl.flags |= TCL_HANDLE_F_NAD_SUPPORTED; + DEBUGP("This PICC supports NAD\n"); + } + if (*cur & 0x02) { + h->priv.tcl.flags |= TCL_HANDLE_F_CID_SUPPORTED; + DEBUGP("This PICC supports CID\n"); + } + cur++; + } + + h->priv.tcl.historical_len = (ats+len) - cur; + h->priv.tcl.historical_bytes = cur; + + DEBUGP("ATS parsed: %s\n", rfid_hexdump(ats, size)); + + return 0; +} + + +/* request an ATS from the PICC */ +static int +tcl_request_ats(struct rfid_protocol_handle *h) +{ + int ret; + unsigned char rats[2]; + unsigned char fsdi; + + if (h->priv.tcl.state != TCL_STATE_INITIAL) + return -1; + + ret = iso14443_fsd_to_fsdi(&fsdi, h->priv.tcl.fsd); + if (ret < 0) { + DEBUGP("unable to encode FSD of %u as FSDI\n", h->priv.tcl.fsd); + return ret; + } + + rats[0] = 0xe0; + rats[1] = (h->priv.tcl.cid & 0x0f) | ((fsdi << 4) & 0xf0); + + /* transceive (with CRC) */ + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + rats, 2, h->priv.tcl.ats, + &h->priv.tcl.ats_len, activation_fwt(h), + TCL_TRANSP_F_TX_CRC); + if (ret < 0) { + DEBUGP("transceive of rats failed\n"); + h->priv.tcl.state = TCL_STATE_RATS_SENT; + /* FIXME: retransmit */ + return ret; + } + h->priv.tcl.state = TCL_STATE_ATS_RCVD; + + ret = tcl_parse_ats(h, h->priv.tcl.ats, h->priv.tcl.ats_len); + if (ret < 0) { + DEBUGP("parsing of ats failed\n"); + return ret; + } + + return 0; +} + +#define ATS_TA_DIV_2 1 +#define ATS_TA_DIV_4 2 +#define ATS_TA_DIV_8 4 + +#define PPS_DIV_8 3 +#define PPS_DIV_4 2 +#define PPS_DIV_2 1 +#define PPS_DIV_1 0 +static unsigned char d_to_di(struct rfid_protocol_handle *h, unsigned char D) +{ + static char DI; + unsigned int speed = h->l2h->rh->reader->iso14443a.speed; + + if ((D & ATS_TA_DIV_8) && (speed & RFID_14443A_SPEED_848K)) + DI = PPS_DIV_8; + else if ((D & ATS_TA_DIV_4) && (speed & RFID_14443A_SPEED_424K)) + DI = PPS_DIV_4; + else if ((D & ATS_TA_DIV_2) && (speed & RFID_14443A_SPEED_212K)) + DI = PPS_DIV_2; + else + DI = PPS_DIV_1; + + return DI; +} + +static unsigned int di_to_speed(unsigned char DI) +{ + switch (DI) { + case PPS_DIV_8: + return RFID_14443A_SPEED_848K; + break; + case PPS_DIV_4: + return RFID_14443A_SPEED_424K; + break; + case PPS_DIV_2: + return RFID_14443A_SPEED_212K; + break; + case PPS_DIV_1: + return RFID_14443A_SPEED_106K; + break; + } +} + +/* start a PPS run (autimatically configure highest possible speed */ +static int +tcl_do_pps(struct rfid_protocol_handle *h) +{ + int ret; + unsigned char ppss[3]; + /* FIXME: this stinks like hell. IF we reduce pps_response size to one, + we'll get stack corruption! */ + unsigned char pps_response[10]; + unsigned int rx_len = 1; + unsigned char Dr, Ds, DrI, DsI; + unsigned int speed; + + if (h->priv.tcl.state != TCL_STATE_ATS_RCVD) + return -1; + + Dr = h->priv.tcl.ta & 0x07; + Ds = h->priv.tcl.ta & 0x70 >> 4; + DEBUGP("Dr = 0x%x, Ds = 0x%x\n", Dr, Ds); + + if (Dr != Ds && !(h->priv.tcl.ta & 0x80)) { + /* device supports different divisors for rx and tx, but not + * really ?!? */ + DEBUGP("PICC has contradictory TA, aborting PPS\n"); + return -1; + }; + + /* ISO 14443-4:2000(E) Section 5.3. */ + + ppss[0] = 0xd0 | (h->priv.tcl.cid & 0x0f); + ppss[1] = 0x11; + ppss[2] = 0x00; + + /* FIXME: deal with different speed for each direction */ + DrI = d_to_di(h, Dr); + DsI = d_to_di(h, Ds); + DEBUGP("DrI = 0x%x, DsI = 0x%x\n", DrI, DsI); + + ppss[2] = (ppss[2] & 0xf0) | (DrI | DsI << 2); + + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + ppss, 3, pps_response, &rx_len, + h->priv.tcl.fwt, TCL_TRANSP_F_TX_CRC); + if (ret < 0) + return ret; + + if (pps_response[0] != ppss[0]) { + DEBUGP("PPS Response != PPSS\n"); + return -1; + } + + speed = di_to_speed(DrI); + + ret = rfid_layer2_setopt(h->l2h, RFID_OPT_14443A_SPEED_RX, + &speed, sizeof(speed)); + if (ret < 0) + return ret; + + ret = rfid_layer2_setopt(h->l2h, RFID_OPT_14443A_SPEED_TX, + &speed, sizeof(speed)); + if (ret < 0) + return ret; + + return 0; +} + + +static int +tcl_build_prologue2(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len, + unsigned char pcb) +{ + *prlg_len = 1; + + *prlg = pcb; + + if (!is_s_block(pcb)) { + if (th->toggle) { + /* we've sent a toggle bit last time */ + th->toggle = 0; + } else { + /* we've not sent a toggle last time: send one */ + th->toggle = 1; + *prlg |= 0x01; + } + } + + if (th->flags & TCL_HANDLE_F_CID_USED) { + /* ISO 14443-4:2000(E) Section 7.1.1.2 */ + *prlg |= TCL_PCB_CID_FOLLOWING; + (*prlg_len)++; + prlg[*prlg_len] = th->cid & 0x0f; + } + + /* nad only for I-block */ + if ((th->flags & TCL_HANDLE_F_NAD_USED) && is_i_block(pcb)) { + /* ISO 14443-4:2000(E) Section 7.1.1.3 */ + /* FIXME: in case of chaining only for first frame */ + *prlg |= TCL_PCB_NAD_FOLLOWING; + prlg[*prlg_len] = th->nad; + (*prlg_len)++; + } + + return 0; +} + +static int +tcl_build_prologue_i(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len) +{ + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + return tcl_build_prologue2(th, prlg, prlg_len, 0x02); +} + +static int +tcl_build_prologue_r(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len, + unsigned int nak) +{ + unsigned char pcb = 0xa2; + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + + if (nak) + pcb |= 0x10; + + return tcl_build_prologue2(th, prlg, prlg_len, pcb); +} + +static int +tcl_build_prologue_s(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len) +{ + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + + /* the only S-block from PCD->PICC is DESELECT, + * well, actually there is the S(WTX) response. */ + return tcl_build_prologue2(th, prlg, prlg_len, 0xc2); +} + +/* FIXME: WTXM implementation */ + +static int tcl_prlg_len(struct tcl_handle *th) +{ + int prlg_len = 1; + + if (th->flags & TCL_HANDLE_F_CID_USED) + prlg_len++; + + if (th->flags & TCL_HANDLE_F_NAD_USED) + prlg_len++; + + return prlg_len; +} + +#define max_net_tx_framesize(x) (x->fsc - tcl_prlg_len(x)) + +static int +tcl_connect(struct rfid_protocol_handle *h) +{ + int ret; + + if (h->priv.tcl.state != TCL_STATE_DESELECTED && + h->priv.tcl.state != TCL_STATE_INITIAL) + return -1; + + switch (h->l2h->l2->id) { + case RFID_LAYER2_ISO14443A: + /* Start Type A T=CL Activation Sequence */ + ret = tcl_request_ats(h); + if (ret < 0) + return ret; + + /* Only do PPS if any non-default divisors supported */ + if (h->priv.tcl.ta & 0x77) { + ret = tcl_do_pps(h); + if (ret < 0) + return ret; + } + break; + case RFID_LAYER2_ISO14443B: + /* initialized T=CL state from Type B Activation Data */ + h->priv.tcl.cid = h->l2h->priv.iso14443b.cid; + h->priv.tcl.fsc = h->l2h->priv.iso14443b.fsc; + h->priv.tcl.fsd = h->l2h->priv.iso14443b.fsd; + h->priv.tcl.fwt = h->l2h->priv.iso14443b.fwt; + + /* what about ta? sfgt? */ + + if (h->l2h->priv.iso14443b.flags & ISO14443B_CID_SUPPORTED) + h->priv.tcl.flags |= TCL_HANDLE_F_CID_SUPPORTED; + if (h->l2h->priv.iso14443b.flags & ISO14443B_NAD_SUPPORTED) + h->priv.tcl.flags |= TCL_HANDLE_F_NAD_SUPPORTED; + + switch (h->l2h->priv.iso14443b.state) { + case ISO14443B_STATE_SELECTED: + h->priv.tcl.state = TCL_STATE_ATS_RCVD; + break; + case ISO14443B_STATE_ATTRIB_SENT: + h->priv.tcl.state = TCL_STATE_RATS_SENT; + break; + } + + /* PUPI will be presented as ATS/historical bytes */ + memcpy(h->priv.tcl.ats, h->l2h->uid, 4); + h->priv.tcl.ats_len = 4; + h->priv.tcl.historical_bytes = h->priv.tcl.ats; + + break; + default: + DEBUGP("unsupported l2: %u\n", h->l2h->l2->id); + return -1; + break; + } + + h->priv.tcl.state = TCL_STATE_ESTABLISHED; + + return 0; +} + +static int +tcl_deselect(struct rfid_protocol_handle *h) +{ + /* ISO 14443-4:2000(E) Section 8 */ + int ret; + unsigned char frame[3]; /* 3 bytes prologue, no information */ + unsigned char rx[3]; + unsigned int rx_len = sizeof(rx); + unsigned int prlg_len; + struct tcl_handle *th = &h->priv.tcl; + + if (th->state != TCL_STATE_ESTABLISHED) { + /* FIXME: not sure whether deselect is possible here, + * probably better send a HLTA? */ + } + + /* build DESELECT S-block */ + ret = tcl_build_prologue_s(th, frame, &prlg_len); + if (ret < 0) + return ret; + + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + frame, prlg_len, rx, + &rx_len, deactivation_fwt(h), + TCL_TRANSP_F_TX_CRC); + if (ret < 0) { + /* FIXME: retransmit, HLT(A|B) */ + return ret; + } + + th->state = TCL_STATE_DESELECTED; + + return 0; +} + +struct fr_buff { + unsigned int frame_len; /* length of frame */ + unsigned int hdr_len; /* length of header within frame */ + unsigned char data[RFID_MAX_FRAMELEN]; +}; + +#define frb_payload(x) (x.data + x.hdr_len) + + +/* RFID transceive buffer. */ +struct rfid_xcvb { + struct rfix_xcvb *next; /* next in queue of buffers */ + + u_int64_t timeout; /* timeout to wait for reply */ + struct fr_buff tx; + struct fr_buff rx; + + //struct rfid_protocol_handle *h; /* connection to which we belong */ +}; + +struct tcl_tx_context { + const unsigned char *tx; + unsigned char *rx; + const unsigned char *next_tx_byte; + unsigned char *next_rx_byte; + unsigned int rx_len; + unsigned int tx_len; + struct rfid_protocol_handle *h; +}; + +#define tcl_ctx_todo(ctx) (ctx->tx_len - (ctx->next_tx_byte - ctx->tx)) + +static int +tcl_refill_xcvb(struct rfid_xcvb *xcvb, struct tcl_tx_context *ctx) +{ + struct tcl_handle *th = &ctx->h->priv.tcl; + + if (ctx->next_tx_byte >= ctx->tx + ctx->tx_len) { + DEBUGP("tyring to refill tx xcvb but no data left!\n"); + return -1; + } + + if (tcl_build_prologue_i(th, xcvb->tx.data, + &xcvb->tx.hdr_len) < 0) + return -1; + + if (tcl_ctx_todo(ctx) > th->fsc - xcvb->tx.hdr_len) + xcvb->tx.frame_len = max_net_tx_framesize(th); + else + xcvb->tx.frame_len = tcl_ctx_todo(ctx); + + memcpy(frb_payload(xcvb->tx), ctx->next_tx_byte, + xcvb->tx.frame_len); + + ctx->next_tx_byte += xcvb->tx.frame_len; + + /* check whether we need to set the chaining bit */ + if (ctx->next_tx_byte < ctx->tx + ctx->tx_len) + xcvb->tx.data[0] |= 0x10; + + /* add hdr_len after copying the net payload */ + xcvb->tx.frame_len += xcvb->tx.hdr_len; + + xcvb->timeout = th->fwt; + + return 0; +} + +static void fill_xcvb_wtxm(struct tcl_handle *th, struct rfid_xcvb *xcvb, + unsigned char inf) +{ + /* Acknowledge WTXM */ + tcl_build_prologue_s(th, xcvb->tx.data, &xcvb->tx.hdr_len); + /* set two bits that make this block a wtx */ + xcvb->tx.data[0] |= 0x30; + xcvb->tx.data[xcvb->tx.hdr_len] = inf; + xcvb->tx.frame_len = xcvb->tx.hdr_len+1; + xcvb->timeout = th->fwt * inf; +} + +static int check_cid(struct tcl_handle *th, struct rfid_xcvb *xcvb) +{ + if (xcvb->rx.data[0] & TCL_PCB_CID_FOLLOWING) { + if (xcvb->rx.data[1] != th->cid) { + DEBUGP("CID %u is not valid, we expected %u\n", + xcvb->rx.data[1], th->cid); + return 0; + } + } + return 1; +} + +static int +tcl_transceive(struct rfid_protocol_handle *h, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + unsigned int timeout, unsigned int flags) +{ + int ret; + + struct rfid_xcvb xcvb; + struct tcl_tx_context tcl_ctx; + struct tcl_handle *th = &h->priv.tcl; + + unsigned char ack[10]; + unsigned int ack_len; + + /* initialize context */ + tcl_ctx.next_tx_byte = tcl_ctx.tx = tx_data; + tcl_ctx.next_rx_byte = tcl_ctx.rx = rx_data; + tcl_ctx.rx_len = *rx_len; + tcl_ctx.tx_len = tx_len; + tcl_ctx.h = h; + + /* initialize xcvb */ + xcvb.timeout = th->fwt; + +tx_refill: + if (tcl_refill_xcvb(&xcvb, &tcl_ctx) < 0) { + ret = -1; + goto out; + } + +do_tx: + xcvb.rx.frame_len = sizeof(xcvb.rx.data); + ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id), + xcvb.tx.data, xcvb.tx.frame_len, + xcvb.rx.data, &xcvb.rx.frame_len, + xcvb.timeout, 0); + + DEBUGP("l2 transceive finished\n"); + if (ret < 0) + goto out; + + if (is_r_block(xcvb.rx.data[0])) { + DEBUGP("R-Block\n"); + + if ((xcvb.rx.data[0] & 0x01) != h->priv.tcl.toggle) { + DEBUGP("response with wrong toggle bit\n"); + goto out; + } + + /* Handle ACK frame in case of chaining */ + if (!check_cid(th, &xcvb)) + goto out; + + goto tx_refill; + } else if (is_s_block(xcvb.rx.data[0])) { + unsigned char inf; + unsigned int prlg_len; + + DEBUGP("S-Block\n"); + /* Handle Wait Time Extension */ + + if (!check_cid(th, &xcvb)) + goto out; + + if (xcvb.rx.data[0] & TCL_PCB_CID_FOLLOWING) { + if (xcvb.rx.frame_len < 3) { + DEBUGP("S-Block with CID but short len\n"); + ret = -1; + goto out; + } + inf = xcvb.rx.data[2]; + } else + inf = xcvb.rx.data[1]; + + if ((xcvb.rx.data[0] & 0x30) != 0x30) { + DEBUGP("S-Block but not WTX?\n"); + ret = -1; + goto out; + } + inf &= 0x3f; /* only lower 6 bits code WTXM */ + if (inf == 0 || (inf >= 60 && inf <= 63)) { + DEBUGP("WTXM %u is RFU!\n", inf); + ret = -1; + goto out; + } + + fill_xcvb_wtxm(th, &xcvb, inf); + /* start over with next transceive */ + goto do_tx; + } else if (is_i_block(xcvb.rx.data[0])) { + unsigned int net_payload_len; + /* we're actually receiving payload data */ + + DEBUGP("I-Block: "); + + if ((xcvb.rx.data[0] & 0x01) != h->priv.tcl.toggle) { + DEBUGP("response with wrong toggle bit\n"); + goto out; + } + + xcvb.rx.hdr_len = 1; + + if (!check_cid(th, &xcvb)) + goto out; + + if (xcvb.rx.data[0] & TCL_PCB_CID_FOLLOWING) + xcvb.rx.hdr_len++; + if (xcvb.rx.data[0] & TCL_PCB_NAD_FOLLOWING) + xcvb.rx.hdr_len++; + + net_payload_len = xcvb.rx.frame_len - xcvb.rx.hdr_len; + DEBUGPC("%u bytes\n", net_payload_len); + memcpy(tcl_ctx.next_rx_byte, &xcvb.rx.data[xcvb.rx.hdr_len], + net_payload_len); + tcl_ctx.next_rx_byte += net_payload_len; + + if (xcvb.rx.data[0] & 0x10) { + /* we're not the last frame in the chain, continue rx */ + DEBUGP("not the last frame in the chain, continue\n"); + ack_len = sizeof(ack); + tcl_build_prologue_r(th, xcvb.tx.data, &xcvb.tx.frame_len, 0); + xcvb.timeout = th->fwt; + goto do_tx; + } + } + +out: + *rx_len = tcl_ctx.next_rx_byte - tcl_ctx.rx; + return ret; +} + +static struct rfid_protocol_handle * +tcl_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *th; + unsigned int mru = l2h->rh->ah->mru; + + th = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + if (!th) + return NULL; + + /* FIXME: mru should be attribute of layer2 (in case it adds/removes + * some overhead */ + memset(th, 0, sizeof(struct rfid_protocol_handle)); + + /* maximum received ats length equals mru of asic/reader */ + th->priv.tcl.state = TCL_STATE_INITIAL; + th->priv.tcl.ats_len = mru; + th->priv.tcl.toggle = 1; + + th->priv.tcl.fsd = iso14443_fsd_approx(mru); + + return th; +} + +static int +tcl_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +int +tcl_getopt(struct rfid_protocol_handle *h, int optname, void *optval, + unsigned int *optlen) +{ + u_int8_t *opt_str = optval; + + switch (optname) { + case RFID_OPT_P_TCL_ATS: + if (h->priv.tcl.ats_len < *optlen) + *optlen = h->priv.tcl.ats_len; + memcpy(opt_str, h->priv.tcl.ats, *optlen); + break; + case RFID_OPT_P_TCL_ATS_LEN: + if (*optlen < sizeof(u_int8_t)) + return -E2BIG; + *optlen = sizeof(u_int8_t); + *opt_str = h->priv.tcl.ats_len & 0xff; + break; + default: + return -EINVAL; + } + + return 0; +} + +int +tcl_setopt(struct rfid_protocol_handle *h, int optname, const void *optval, + unsigned int optlen) +{ + int ret = -EINVAL; + + switch (optname) { + default: + break; + } + + return ret; +} + +const struct rfid_protocol rfid_protocol_tcl = { + .id = RFID_PROTOCOL_TCL, + .name = "ISO 14443-4 / T=CL", + .fn = { + .init = &tcl_init, + .open = &tcl_connect, + .transceive = &tcl_transceive, + .close = &tcl_deselect, + .fini = &tcl_fini, + .getopt = &tcl_getopt, + .setopt = &tcl_setopt, + }, +}; diff --git a/librfid/src/rfid_protocol.c b/librfid/src/rfid_protocol.c new file mode 100644 index 0000000..71c52ff --- /dev/null +++ b/librfid/src/rfid_protocol.c @@ -0,0 +1,153 @@ +/* librfid - layer 4 protocol handler + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include + +#include +#include + +static const struct rfid_protocol *rfid_protocols[] = { + [RFID_PROTOCOL_MIFARE_CLASSIC] = &rfid_protocol_mfcl, + [RFID_PROTOCOL_MIFARE_UL] = &rfid_protocol_mful, + [RFID_PROTOCOL_TCL] = &rfid_protocol_tcl, + [RFID_PROTOCOL_TAGIT] = &rfid_protocol_tagit, +}; + +struct rfid_protocol_handle * +rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id) +{ + const struct rfid_protocol *p; + struct rfid_protocol_handle *ph = NULL; + + if (id >= ARRAY_SIZE(rfid_protocols)) + return NULL; + + p = rfid_protocols[id]; + + ph = p->fn.init(l2h); + if (!ph) + return NULL; + + ph->proto = p; + ph->l2h = l2h; + + return ph; +} + +int +rfid_protocol_open(struct rfid_protocol_handle *ph) +{ + if (ph->proto->fn.open) + return ph->proto->fn.open(ph); + return 0; +} + +int +rfid_protocol_transceive(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + unsigned int timeout, unsigned int flags) +{ + return ph->proto->fn.transceive(ph, tx_buf, len, rx_buf, rx_len, + timeout, flags); +} + +int +rfid_protocol_read(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len) +{ + if (ph->proto->fn.read) + return ph->proto->fn.read(ph, page, rx_data, rx_len); + else + return -EINVAL; +} + +int +rfid_protocol_write(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len) +{ + if (ph->proto->fn.write) + return ph->proto->fn.write(ph, page, tx_data, tx_len); + else + return -EINVAL; +} + +int rfid_protocol_fini(struct rfid_protocol_handle *ph) +{ + return ph->proto->fn.fini(ph); +} + +int +rfid_protocol_close(struct rfid_protocol_handle *ph) +{ + if (ph->proto->fn.close) + return ph->proto->fn.close(ph); + return 0; +} + +int +rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname, + void *optval, unsigned int *optlen) +{ + if (optname >> 16 == 0) { + unsigned char *optchar = optval; + + switch (optname) { + default: + return -EINVAL; + break; + } + } else { + if (!ph->proto->fn.getopt) + return -EINVAL; + + return ph->proto->fn.getopt(ph, optname, optval, optlen); + } + return 0; +} + +int +rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname, + const void *optval, unsigned int optlen) +{ + if (optname >> 16 == 0) { + switch (optname) { + default: + return -EINVAL; + break; + } + } else { + if (!ph->proto->fn.setopt) + return -EINVAL; + + return ph->proto->fn.setopt(ph, optname, optval, optlen); + } + return 0; +} + +char *rfid_protocol_name(struct rfid_protocol_handle *ph) +{ + return ph->proto->name; +} diff --git a/librfid/src/rfid_reader.c b/librfid/src/rfid_reader.c new file mode 100644 index 0000000..31264eb --- /dev/null +++ b/librfid/src/rfid_reader.c @@ -0,0 +1,86 @@ +/* librfid - core reader handling + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include + +#include +#include +#include +#include +#include + +static const struct rfid_reader *rfid_readers[] = { +#ifdef HAVE_LIBUSB +#ifdef ENABLE_CM5121 + [RFID_READER_CM5121] = &rfid_reader_cm5121, +#endif + [RFID_READER_OPENPCD] = &rfid_reader_openpcd, +#endif +#ifdef ENABLE_SPIDEV + [RFID_READER_SPIDEV] = &rfid_reader_spidev, +#endif +}; + +struct rfid_reader_handle * +rfid_reader_open(void *data, unsigned int id) +{ + const struct rfid_reader *p; + + if (id >= ARRAY_SIZE(rfid_readers)) { + DEBUGP("unable to find matching reader\n"); + return NULL; + } + + p = rfid_readers[id]; + if (!p) + return NULL; + + return p->open(data); +} + +int +rfid_reader_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return rh->reader->transceive(rh, frametype, tx_buf, len, rx_buf, + rx_len, timeout, flags); +} + +void +rfid_reader_close(struct rfid_reader_handle *rh) +{ + rh->reader->close(rh); +} + +int +rfid_reader_getopt(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen) +{ + return rh->reader->getopt(rh, optname, optval, optlen); +} + +int rfid_reader_setopt(struct rfid_reader_handle *rh, int optname, + const void *optval, unsigned int optlen) +{ + return rh->reader->setopt(rh, optname, optval, optlen); +} diff --git a/librfid/src/rfid_reader_cm5121.c b/librfid/src/rfid_reader_cm5121.c new file mode 100644 index 0000000..12bc358 --- /dev/null +++ b/librfid/src/rfid_reader_cm5121.c @@ -0,0 +1,283 @@ +/* Omnikey CardMan 5121 specific RC632 transport layer + * + * (C) 2005-2008 by Harald Welte + * + * The 5121 is an Atmel AT89C5122 based USB CCID reader (probably the same + * design like the 3121). It's CL RC632 is connected via address/data bus, + * not via SPI. + * + * The vendor-supplied reader firmware provides some undocumented extensions + * to CCID (via PC_to_RDR_Escape) that allow access to registers and FIFO of + * the RC632. + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include + +#include + +#ifndef LIBRFID_FIRMWARE + + +#include +#include +#include +#include +#include +#include + +#include "rfid_reader_rc632_common.h" + +#include "cm5121_source.h" + +/* FIXME */ +#include "rc632.h" + +#define SENDBUF_LEN 256+7+10 /* 256bytes max FSD/FSC, plus 7 bytes header, + plus 10 bytes reserve */ +#define RECVBUF_LEN SENDBUF_LEN + +#ifdef DEBUG_REGISTER +#define DEBUGRC DEBUGPC +#define DEBUGR DEBUGP +#else +#define DEBUGRC(x, args ...) do {} while(0) +#define DEBUGR(x, args ...) do {} while(0) +#endif + +static +int Write1ByteToReg(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char rcvbuf[RECVBUF_LEN]; + size_t retlen = RECVBUF_LEN; + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x01; + sndbuf[3] = 0x00; + sndbuf[4] = 0x00; + sndbuf[5] = 0x00; + sndbuf[6] = reg; + sndbuf[7] = value; + + DEBUGR("reg=0x%02x, val=%02x: ", reg, value); + + if (PC_to_RDR_Escape(rath->data, sndbuf, 8, rcvbuf, + &retlen) == 0) { + DEBUGRC("OK\n"); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int Read1ByteFromReg(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[RECVBUF_LEN]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x00; + sndbuf[3] = 0x00; + sndbuf[4] = 0x01; + sndbuf[5] = 0x00; + sndbuf[6] = reg; + + if (PC_to_RDR_Escape(rath->data, sndbuf, 7, recvbuf, + &retlen) == 0) { + *value = recvbuf[1]; + DEBUGR("reg=0x%02x, val=%02x: ", reg, *value); + DEBUGRC("OK\n"); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int ReadNBytesFromFIFO(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[0x7f]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x00; + sndbuf[3] = 0x00; + sndbuf[4] = num_bytes; + sndbuf[5] = 0x00; + sndbuf[6] = 0x02; + + DEBUGR("num_bytes=%u: ", num_bytes); + if (PC_to_RDR_Escape(rath->data, sndbuf, 7, recvbuf, &retlen) == 0) { + DEBUGRC("%u [%s]\n", retlen, + rfid_hexdump(recvbuf+1, num_bytes)); + memcpy(buf, recvbuf+1, num_bytes); // len == 0x7f + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int WriteNBytesToFIFO(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[0x7f]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = len; + sndbuf[3] = 0x00; + sndbuf[4] = 0x00; + sndbuf[5] = flags; + sndbuf[6] = 0x02; + + DEBUGR("%u [%s]: ", len, rfid_hexdump(bytes, len)); + + memcpy(sndbuf+7, bytes, len); + + if (PC_to_RDR_Escape(rath->data, sndbuf, len+7, recvbuf, &retlen) == 0) { + DEBUGRC("OK (%u [%s])\n", retlen, rfid_hexdump(recvbuf, retlen)); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +struct rfid_asic_transport cm5121_ccid = { + .name = "CM5121 OpenCT", + .priv.rc632 = { + .fn = { + .reg_write = &Write1ByteToReg, + .reg_read = &Read1ByteFromReg, + .fifo_write = &WriteNBytesToFIFO, + .fifo_read = &ReadNBytesFromFIFO, + }, + }, +}; + +static int cm5121_enable_rc632(struct rfid_asic_transport_handle *rath) +{ + unsigned char tx_buf[1] = { 0x01 }; + unsigned char rx_buf[64]; + size_t rx_len = sizeof(rx_buf); + + PC_to_RDR_Escape(rath->data, tx_buf, 1, rx_buf, &rx_len); + + return 0; +} + +static struct rfid_reader_handle * +cm5121_open(void *data) +{ + struct rfid_reader_handle *rh; + struct rfid_asic_transport_handle *rath; + + rh = malloc_reader_handle(sizeof(*rh)); + if (!rh) + return NULL; + memset(rh, 0, sizeof(*rh)); + + rath = malloc_rat_handle(sizeof(*rath)); + if (!rath) + goto out_rh; + memset(rath, 0, sizeof(*rath)); + + rath->rat = &cm5121_ccid; + rh->reader = &rfid_reader_cm5121; + + if (cm5121_source_init(rath) < 0) + goto out_rath; + + if (cm5121_enable_rc632(rath) < 0) + goto out_rath; + + rh->ah = rc632_open(rath); + if (!rh->ah) + goto out_rath; + + DEBUGP("returning %p\n", rh); + return rh; + +out_rath: + free_rat_handle(rath); +out_rh: + free_reader_handle(rh); + + return NULL; +} + +static void +cm5121_close(struct rfid_reader_handle *rh) +{ + struct rfid_asic_transport_handle *rath = rh->ah->rath; + rc632_close(rh->ah); + free_rat_handle(rath); + free_reader_handle(rh); +} + +const struct rfid_reader rfid_reader_cm5121 = { + .name = "Omnikey CardMan 5121 RFID", + .open = &cm5121_open, + .close = &cm5121_close, + .l2_supported = (1 << RFID_LAYER2_ISO14443A) | + (1 << RFID_LAYER2_ISO14443B) | + (1 << RFID_LAYER2_ISO15693), + .proto_supported = (1 << RFID_PROTOCOL_TCL) | + (1 << RFID_PROTOCOL_MIFARE_UL) | + (1 << RFID_PROTOCOL_MIFARE_CLASSIC), + .getopt = &_rdr_rc632_getopt, + .setopt = &_rdr_rc632_setopt, + .transceive = &_rdr_rc632_transceive, + .init = &_rdr_rc632_l2_init, + .iso14443a = { + .transceive_sf = &_rdr_rc632_transceive_sf, + .transceive_acf = &_rdr_rc632_transceive_acf, + .speed = RFID_14443A_SPEED_106K | RFID_14443A_SPEED_212K | + RFID_14443A_SPEED_424K, //| RFID_14443A_SPEED_848K, + .set_speed = &_rdr_rc632_14443a_set_speed, + }, + .iso15693 = { + .transceive_ac = &_rdr_rc632_iso15693_transceive_ac, + }, + .mifare_classic = { + .setkey = &_rdr_rc632_mifare_setkey, + .setkey_ee = &_rdr_rc632_mifare_setkey_ee, + .auth = &_rdr_rc632_mifare_auth, + }, +}; + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid/src/rfid_reader_cm5121_openct.c b/librfid/src/rfid_reader_cm5121_openct.c new file mode 100644 index 0000000..244ecee --- /dev/null +++ b/librfid/src/rfid_reader_cm5121_openct.c @@ -0,0 +1,54 @@ +/* CM5121 backend for OpenCT virtual slot */ + +#include + +#include +#include + +/* FIXME: get rid of this global crap. In fact this needs to become part of + * struct rfid_reader_handle */ +static ct_lock_handle lock; +static int slot = 1; + +/* this is the sole function required by rfid_reader_cm5121.c */ +int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len) +{ + int rc; + ct_handle *h = (ct_handle *) handle; + + rc = ct_card_transact(h, 1, tx_buf, tx_len, rx_buf, *rx_len); + if (rc >= 0) { + *rx_len = rc; + return 0; + } + + return rc; +} + + +int cm5121_source_init(struct rfid_asic_transport_handle *rath) +{ + struct ct_handle *h; + int rc; + unsigned char atr[64]; + + h = ct_reader_connect(0); + if (!h) + return -1; + + rc = ct_card_lock(h, slot, IFD_LOCK_EXCLUSIVE, &lock); + if (rc < 0) + return -1; + + rc = ct_card_reset(h, slot, atr, sizeof(atr)); + if (rc < 0) + return -1; + + rath->data = h; + + return 0; +} + diff --git a/librfid/src/rfid_reader_openpcd.c b/librfid/src/rfid_reader_openpcd.c new file mode 100644 index 0000000..d81a7dd --- /dev/null +++ b/librfid/src/rfid_reader_openpcd.c @@ -0,0 +1,491 @@ +/* OpenPCD specific RC632 transport layer + * + * (C) 2006 by Harald Welte + * + * The OpenPCD is an Atmel AT91SAM7Sxx based USB RFID reader. + * It's CL RC632 is connected via SPI. OpenPCD has multiple firmware + * images. This driver is for the "main_dumbreader" firmware. + * + * TODO: + * - put hdl from static variable into asic transport or reader handle + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "rfid_reader_rc632_common.h" + +/* FIXME */ +#include "rc632.h" + +#define SENDBUF_LEN (256+4+10) /* 256bytes max FSD/FSC, plus 4 bytes header, + plus 10 bytes reserve */ +#define RECVBUF_LEN SENDBUF_LEN + +static char snd_buf[SENDBUF_LEN]; +static char rcv_buf[RECVBUF_LEN]; +static struct openpcd_hdr *snd_hdr; +static struct openpcd_hdr *rcv_hdr; + +#ifndef LIBRFID_FIRMWARE + +#ifdef __MINGW32__ +#include "libusb_dyn.h" +#else /*__MINGW32__*/ +#include +#endif/*__MINGW32__*/ + +#ifdef DEBUG_REGISTER +#define DEBUGRC DEBUGPC +#define DEBUGR DEBUGP +#else +#define DEBUGRC(x, args ...) do {} while(0) +#define DEBUGR(x, args ...) do {} while(0) +#endif + +static struct usb_device *dev; +static struct usb_dev_handle *hdl; + +static int openpcd_send_command(u_int8_t cmd, u_int8_t reg, u_int8_t val, + u_int16_t len, const unsigned char *data) +{ + int ret; + u_int16_t cur; + + snd_hdr->cmd = cmd; + snd_hdr->reg = reg; + snd_hdr->val = val; + snd_hdr->flags = OPENPCD_FLAG_RESPOND; + if (data && len) + memcpy(snd_hdr->data, data, len); + + cur = sizeof(*snd_hdr) + len; + + return usb_bulk_write(hdl, OPENPCD_OUT_EP, (char *)snd_hdr, cur, 1000); +} + +static int openpcd_recv_reply(void) +{ + int ret; + + ret = usb_bulk_read(hdl, OPENPCD_IN_EP, rcv_buf, sizeof(rcv_buf), 1000); + + return ret; +} + +static int openpcd_xcv(u_int8_t cmd, u_int8_t reg, u_int8_t val, + u_int16_t len, const unsigned char *data) +{ + int ret; + + ret = openpcd_send_command(cmd, reg, val, len, data); + if (ret < 0) + return ret; + if (ret < sizeof(struct openpcd_hdr)) + return -EINVAL; + + return openpcd_recv_reply(); +} + +struct usb_id { + u_int16_t vid; + u_int16_t pid; +}; + +static const struct usb_id opcd_usb_ids[] = { + { .vid = 0x2342, .pid = 0x0001 }, /* prototypes */ + { .vid = 0x16c0, .pid = 0x076b }, /* first official device id */ +}; + +static struct usb_device *find_opcd_device(void) +{ + struct usb_bus *bus; + + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + for (dev = bus->devices; dev; dev = dev->next) { + int i; + for (i = 0; i < ARRAY_SIZE(opcd_usb_ids); i++) { + const struct usb_id *id = &opcd_usb_ids[i]; + if (dev->descriptor.idVendor == id->vid && + dev->descriptor.idProduct == id->pid) + return dev; + } + } + } + return NULL; +} + +/* RC632 access primitives for librfid inside reader firmware */ + +static int openpcd_reg_write(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + int ret; + + DEBUGR("reg=0x%02x, val=%02x: ", reg, value); + + ret = openpcd_xcv(OPENPCD_CMD_WRITE_REG, reg, value, 0, NULL); + if (ret < 0) + DEBUGRC("ERROR sending command\n"); + else + DEBUGRC("OK\n"); + + return ret; +} + +static int openpcd_reg_read(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + int ret; + + DEBUGR("reg=0x%02x, ", reg); + + ret = openpcd_xcv(OPENPCD_CMD_READ_REG, reg, 0, 0, NULL); + if (ret < 0) { + DEBUGRC("ERROR sending command\n"); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGRC("ERROR: short packet\n"); + return ret; + } + + *value = rcv_hdr->val; + DEBUGRC("val=%02x: OK\n", *value); + + return ret; +} + +static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + int ret; + + DEBUGR(" "); + + ret = openpcd_xcv(OPENPCD_CMD_READ_FIFO, 0x00, num_bytes, 0, NULL); + if (ret < 0) { + DEBUGRC("ERROR sending command\n"); + return ret; + } + DEBUGRC("ret = %d\n", ret); + + memcpy(buf, rcv_hdr->data, ret - sizeof(struct openpcd_hdr)); + DEBUGRC("len=%d val=%s: OK\n", ret - sizeof(struct openpcd_hdr), + rfid_hexdump(rcv_hdr->data, ret - sizeof(struct openpcd_hdr))); + + return ret; +} + +static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + int ret; + + DEBUGR("len=%u, data=%s\n", len, rfid_hexdump(bytes, len)); + ret = openpcd_xcv(OPENPCD_CMD_WRITE_FIFO, 0, 0, len, bytes); + + return ret; +} + +const struct rfid_asic_transport openpcd_rat = { + .name = "OpenPCD Dumb USB Protocol", + .priv.rc632 = { + .fn = { + .reg_write = &openpcd_reg_write, + .reg_read = &openpcd_reg_read, + .fifo_write = &openpcd_fifo_write, + .fifo_read = &openpcd_fifo_read, + }, + }, +}; + +static int openpcd_get_api_version(struct rfid_reader_handle *rh, u_int8_t *version) +{ + int ret; + + // preset version result to zero + rcv_hdr->val=0; + + ret = openpcd_xcv(OPENPCD_CMD_GET_API_VERSION, 0, 0, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n", ret); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGPC("ERROR: short packet [%i]\n", ret); + return -EINVAL; + } + + *version = rcv_hdr->val; + + return ret; +} + +static int openpcd_get_environment(struct rfid_reader_handle *rh, + unsigned char num_bytes, + unsigned char *buf) +{ + int ret; + + DEBUGP(" "); + + ret = openpcd_xcv(OPENPCD_CMD_GET_ENVIRONMENT, 0x00, num_bytes, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n",ret); + return ret; + } + DEBUGPC("ret = %d\n", ret); + + memcpy(buf, rcv_hdr->data, ret - sizeof(struct openpcd_hdr)); + DEBUGPC("len=%d val=%s: OK\n", ret - sizeof(struct openpcd_hdr), + rfid_hexdump(rcv_hdr->data, ret - sizeof(struct openpcd_hdr))); + + return ret; +} + +static int openpcd_set_environment(struct rfid_reader_handle *rh, + unsigned char num_bytes, + const unsigned char *buf) +{ + int ret; + + ret = openpcd_xcv(OPENPCD_CMD_SET_ENVIRONMENT, 0, 0, num_bytes, buf); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n",ret); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGPC("ERROR: short packet [%i]\n", ret); + return -EINVAL; + } + + return rcv_hdr->val; +} + +static int openpcd_reset(struct rfid_reader_handle *rh) +{ + int ret; + + DEBUGP("reset "); + ret = openpcd_xcv(OPENPCD_CMD_RESET, 0, 0, 0, 0); + + return ret; +} + +#else +/* RC632 access primitives for librfid inside reader firmware */ + +static int openpcd_reg_write(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + return opcd_rc632_reg_write(rath, reg, value); +} + +static int openpcd_reg_read(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + return opcd_rc632_reg_read(rath, reg, value); +} + + +static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + return opcd_rc632_fifo_read(rath, num_bytes, buf); +} + +static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + return opcd_rc632_fifo_write(rath, len, bytes, flags); +} + +const struct rfid_asic_transport openpcd_rat = { + .name = "OpenPCD Firmware RC632 Access", + .priv.rc632 = { + .fn = { + .reg_write = &openpcd_reg_write, + .reg_read = &openpcd_reg_read, + .fifo_write = &openpcd_fifo_write, + .fifo_read = &openpcd_fifo_read, + }, + }, +}; + +#endif /* LIBRFID_FIRMWARE */ + +static int openpcd_getopt(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen) +{ + int rc; + u_int8_t *val_u8 = (u_int8_t *) optval; + + switch (optname) { +#ifndef LIBRFID_FIRMWARE + case RFID_OPT_RDR_FW_VERSION: + return openpcd_get_api_version(rh, val_u8); +#endif + default: + return _rdr_rc632_getopt(rh, optname, optval, optlen); + } + + return 0; +} + + +static struct rfid_reader_handle * +openpcd_open(void *data) +{ + struct rfid_reader_handle *rh; + struct rfid_asic_transport_handle *rath; + + snd_hdr = (struct openpcd_hdr *)snd_buf; + rcv_hdr = (struct openpcd_hdr *)rcv_buf; + +#ifndef LIBRFID_FIRMWARE + usb_init(); + if (usb_find_busses() < 0) + return NULL; + if (usb_find_devices() < 0) + return NULL; + + dev = find_opcd_device(); + if (!dev) { + DEBUGP("No matching USB device found\n"); + return NULL; + } + + hdl = usb_open(dev); + if (!hdl) { + DEBUGP("Can't open USB device\n"); + return NULL; + } + + if(usb_set_configuration(hdl, 1 ) < 0) + { + DEBUGP("setting config failed\n"); + usb_close( hdl ); + return NULL; + } + + if (usb_claim_interface(hdl, 0) < 0) { + DEBUGP("Can't claim interface\n"); + usb_close(hdl); + return NULL; + } +#endif + + rh = malloc_reader_handle(sizeof(*rh)); + if (!rh) + return NULL; + memset(rh, 0, sizeof(*rh)); + + rath = malloc_rat_handle(sizeof(*rath)); + if (!rath) + goto out_rh; + memset(rath, 0, sizeof(*rath)); + + rath->rat = &openpcd_rat; + rh->reader = &rfid_reader_openpcd; + + rh->ah = rc632_open(rath); + if (!rh->ah) + goto out_rath; + + DEBUGP("returning %p\n", rh); + return rh; + +out_rath: + free_rat_handle(rath); +out_rh: + free_reader_handle(rh); + + return NULL; +} + +static void +openpcd_close(struct rfid_reader_handle *rh) +{ + struct rfid_asic_transport_handle *rath = rh->ah->rath; + + rc632_close(rh->ah); + free_rat_handle(rath); + free_reader_handle(rh); + +#ifndef LIBRFID_FIRMWARE + usb_close(hdl); +#endif +} + +const struct rfid_reader rfid_reader_openpcd = { + .name = "OpenPCD RFID Reader", + .id = RFID_READER_OPENPCD, + .open = &openpcd_open, + .close = &openpcd_close, + .getopt = &openpcd_getopt, +#ifndef LIBRFID_FIRMWARE + .reset = &openpcd_reset, +#endif + .setopt = &_rdr_rc632_setopt, + .init = &_rdr_rc632_l2_init, + .transceive = &_rdr_rc632_transceive, + .l2_supported = (1 << RFID_LAYER2_ISO14443A) | + (1 << RFID_LAYER2_ISO14443B) | + (1 << RFID_LAYER2_ISO15693), + .proto_supported = (1 << RFID_PROTOCOL_TCL) | + (1 << RFID_PROTOCOL_MIFARE_UL) | + (1 << RFID_PROTOCOL_MIFARE_CLASSIC), + .iso14443a = { + .transceive_sf = &_rdr_rc632_transceive_sf, + .transceive_acf = &_rdr_rc632_transceive_acf, + .speed = RFID_14443A_SPEED_106K | RFID_14443A_SPEED_212K | + RFID_14443A_SPEED_424K, //| RFID_14443A_SPEED_848K, + .set_speed = &_rdr_rc632_14443a_set_speed, + }, + .iso15693 = { + .transceive_ac = &_rdr_rc632_iso15693_transceive_ac, + }, + .mifare_classic = { + .setkey = &_rdr_rc632_mifare_setkey, + .setkey_ee = &_rdr_rc632_mifare_setkey_ee, + .auth = &_rdr_rc632_mifare_auth, + }, +}; diff --git a/librfid/src/rfid_reader_rc632_common.c b/librfid/src/rfid_reader_rc632_common.c new file mode 100644 index 0000000..101c1f8 --- /dev/null +++ b/librfid/src/rfid_reader_rc632_common.c @@ -0,0 +1,158 @@ +/* Shared/Common functions for all RC632 based readers + * + * (C) 2006-2008 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + + +#include + +#include +#include +#include +#include +#include + +#include "rfid_reader_rc632_common.h" + +int _rdr_rc632_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return rh->ah->asic->priv.rc632.fn.transceive(rh->ah, frametype, + tx_data, tx_len, + rx_data, rx_len, + timeout, flags); +} + +int _rdr_rc632_transceive_sf(struct rfid_reader_handle *rh, + unsigned char cmd, struct iso14443a_atqa *atqa) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_sf(rh->ah, + cmd, + atqa); +} + +int +_rdr_rc632_transceive_acf(struct rfid_reader_handle *rh, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_acf(rh->ah, + cmd, bit_of_col); +} + +int +_rdr_rc632_iso15693_transceive_ac(struct rfid_reader_handle *rh, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *resp_len, char *bit_of_col) +{ + return rh->ah->asic->priv.rc632.fn.iso15693.transceive_ac( + rh->ah, acf, acf_len, resp, resp_len, + bit_of_col); +} + + +int +_rdr_rc632_14443a_set_speed(struct rfid_reader_handle *rh, + unsigned int tx, unsigned int speed) +{ + u_int8_t rate; + + DEBUGP("setting rate: "); + switch (speed) { + case RFID_14443A_SPEED_106K: + rate = 0x00; + DEBUGPC("106K\n"); + break; + case RFID_14443A_SPEED_212K: + rate = 0x01; + DEBUGPC("212K\n"); + break; + case RFID_14443A_SPEED_424K: + rate = 0x02; + DEBUGPC("424K\n"); + break; + case RFID_14443A_SPEED_848K: + rate = 0x03; + DEBUGPC("848K\n"); + break; + default: + return -EINVAL; + break; + } + return rh->ah->asic->priv.rc632.fn.iso14443a.set_speed(rh->ah, + tx, rate); +} + +int +_rdr_rc632_l2_init(struct rfid_reader_handle *rh, enum rfid_layer2_id l2) +{ + return rh->ah->asic->priv.rc632.fn.init(rh->ah, l2); +} + +int +_rdr_rc632_mifare_setkey(struct rfid_reader_handle *rh, const u_int8_t *key) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.setkey(rh->ah, key); +} + +int +_rdr_rc632_mifare_setkey_ee(struct rfid_reader_handle *rh, unsigned int addr) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.setkey_ee(rh->ah, addr); +} + +int +_rdr_rc632_mifare_auth(struct rfid_reader_handle *rh, u_int8_t cmd, + u_int32_t serno, u_int8_t block) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.auth(rh->ah, + cmd, serno, block); +} + +int +_rdr_rc632_getopt(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen) +{ + return -EINVAL; +} + +int +_rdr_rc632_setopt(struct rfid_reader_handle *rh, int optname, + const void *optval, unsigned int optlen) +{ + unsigned int *val = (unsigned int *)optval; + + if (!optval || optlen < sizeof(*val)) + return -EINVAL; + + switch (optname) { + case RFID_OPT_RDR_RF_KILL: + if (*val) + return rh->ah->asic->priv.rc632.fn.rf_power(rh->ah, 0); + else + return rh->ah->asic->priv.rc632.fn.rf_power(rh->ah, 1); + default: + return -EINVAL; + } +} diff --git a/librfid/src/rfid_reader_rc632_common.h b/librfid/src/rfid_reader_rc632_common.h new file mode 100644 index 0000000..999dfa3 --- /dev/null +++ b/librfid/src/rfid_reader_rc632_common.h @@ -0,0 +1,31 @@ +#ifndef _RDR_RC632_COMMON +#define _RDR_RC632_COMMON + +int _rdr_rc632_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags); +int _rdr_rc632_transceive_sf(struct rfid_reader_handle *rh, + unsigned char cmd, struct iso14443a_atqa *atqa); +int _rdr_rc632_transceive_acf(struct rfid_reader_handle *rh, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col); +int _rdr_rc632_iso15693_transceive_ac(struct rfid_reader_handle *rh, + const struct iso15693_anticol_cmd *acf, + unsigned int acf_len, + struct iso15693_anticol_resp *resp, + unsigned int *resp_len, char *bit_of_col); +int _rdr_rc632_14443a_set_speed(struct rfid_reader_handle *rh, unsigned int tx, + unsigned int speed); +int _rdr_rc632_l2_init(struct rfid_reader_handle *rh, enum rfid_layer2_id l2); +int _rdr_rc632_mifare_setkey(struct rfid_reader_handle *rh, const u_int8_t *key); +int _rdr_rc632_mifare_setkey_ee(struct rfid_reader_handle *rh, const unsigned int addr); +int _rdr_rc632_mifare_auth(struct rfid_reader_handle *rh, u_int8_t cmd, + u_int32_t serno, u_int8_t block); +int _rdr_rc632_getopt(struct rfid_reader_handle *rh, int optname, + void *optval, unsigned int *optlen); +int _rdr_rc632_setopt(struct rfid_reader_handle *rh, int optname, + const void *optval, unsigned int optlen); + +#endif diff --git a/librfid/src/rfid_reader_spidev.c b/librfid/src/rfid_reader_spidev.c new file mode 100644 index 0000000..0eee241 --- /dev/null +++ b/librfid/src/rfid_reader_spidev.c @@ -0,0 +1,301 @@ +/* Direct spi for RC632 transport layer + * (based on openpcd reader) + * + * (C) 2007 by Frederic RODO + * + * This reader use the Linux's spidev interface, so it need a least + * kernel 2.6.22 + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "rfid_reader_rc632_common.h" + +/* FIXME */ +#include "rc632.h" +static int spidev_fd; + +struct spi_ioc_transfer xfer[1]; + +/* 256bytes max FSD/FSC, plus 1 bytes header, plus 10 bytes reserve */ +#define SENDBUF_LEN (256+1+10) +#define RECVBUF_LEN SENDBUF_LEN +static char snd_buf[SENDBUF_LEN]; +static char rcv_buf[RECVBUF_LEN]; + +static int spidev_read(unsigned char reg, unsigned char len, + unsigned char *buf) +{ + int ret; + + if (!len) + return -EINVAL; + + snd_buf[0] = (reg<<1) | 0x80; + if (len > 1) + memset(&snd_buf[1], reg<<1 , len-1); + snd_buf[len] = 0; + + /* prepare spi buffer */ + xfer[0].tx_buf = (__u64) snd_buf; + xfer[0].rx_buf = (__u64) rcv_buf; + xfer[0].len = len + 1; + + ret = ioctl(spidev_fd, SPI_IOC_MESSAGE(1), xfer); + if (ret < 0) { + DEBUGPC("ERROR sending command\n"); + return ret; + } else if (ret != (len + 1)) { + DEBUGPC("ERROR sending command bad length\n"); + return -EINVAL; + } + + memcpy(buf, &rcv_buf[1], len); + + return len; +} + +static int spidev_write(unsigned char reg, unsigned char len, + const unsigned char *buf) +{ + int ret; + + if (!len) + return -EINVAL; + + snd_buf[0] = (reg << 1) & 0x7E; + memcpy(&snd_buf[1], buf, len); + + /* prepare spi buffer */ + xfer[0].tx_buf = (__u64) snd_buf; + xfer[0].rx_buf = (__u64) NULL; + xfer[0].len = len + 1; + + ret = ioctl(spidev_fd, SPI_IOC_MESSAGE(1), xfer); + if (ret < 0) { + DEBUGPC("ERROR sending command\n"); + return ret; + } + else if (ret != len+1) + return -EINVAL; + + return len; +} + +static int spidev_reg_read(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char *value) +{ + int ret; + + ret = spidev_read(reg, 1, value); + if (ret < 0) + return ret; + DEBUGP("%s reg = 0x%02x, val = 0x%02x\n", __FUNCTION__, reg, *value); + + return 1; +} + +static int spidev_reg_write(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + int ret; + + ret = spidev_write(reg, 1, &value); + if (ret < 0) + return ret; + + DEBUGP("%s reg = 0x%02x, val = 0x%02x\n", __FUNCTION__, reg, value); + + return 1; +} + +static int spidev_fifo_read(struct rfid_asic_transport_handle *rath, + unsigned char len, unsigned char *buf) +{ + int ret; + + ret = spidev_read(2, len, buf); + if (ret < 0) + return ret; + + DEBUGP("%s len=%u, val=%s\n", __FUNCTION__, len, + rfid_hexdump(buf, len)); + + return len; +} + +static int spidev_fifo_write(struct rfid_asic_transport_handle *rath, + unsigned char len, const unsigned char *buf, + unsigned char flags) +{ + int ret; + + ret = spidev_write(2, len, buf); + if (ret < 0) + return ret; + + DEBUGP("%s len=%u, data=%s\n", __FUNCTION__, len, + rfid_hexdump(buf, len)); + + return len; +} + +struct rfid_asic_transport spidev_spi = { + .name = "spidev", + .priv.rc632 = { + .fn = { + .reg_write = &spidev_reg_write, + .reg_read = &spidev_reg_read, + .fifo_write = &spidev_fifo_write, + .fifo_read = &spidev_fifo_read, + }, + }, +}; + +static struct rfid_reader_handle *spidev_open(void *data) +{ + struct rfid_reader_handle *rh; + struct rfid_asic_transport_handle *rath; + __u32 tmp; + + /* open spi device */ + if (!data) { + DEBUGP("No device name\n"); + return NULL; + } + if ((spidev_fd = open(data, O_RDWR)) < 0) { + DEBUGP("Unable to open:\n"); + return NULL; + } + + rh = malloc(sizeof(*rh)); + if (!rh) + goto out_close_spi; + + memset(rh, 0, sizeof(*rh)); + + rath = malloc(sizeof(*rath)); + if (!rath) + goto out_rh; + memset(rath, 0, sizeof(*rath)); + + rath->rat = &spidev_spi; + rh->reader = &rfid_reader_spidev; + + /* Configure spi device, MODE 0 */ + tmp = SPI_MODE_0; + if (ioctl(spidev_fd, SPI_IOC_WR_MODE, &tmp) < 0) + goto out_rath; + + /* MSB First */ + tmp = 0; + if (ioctl(spidev_fd, SPI_IOC_WR_LSB_FIRST, &tmp) < 0) + goto out_rath; + + /* 8 bits per word */ + tmp = 8; + if (ioctl(spidev_fd, SPI_IOC_WR_BITS_PER_WORD, &tmp) < 0) + goto out_rath; + + /* 1 MHz */ + tmp = 1e6; + if (ioctl(spidev_fd, SPI_IOC_WR_MAX_SPEED_HZ, &tmp) < 0) + goto out_rath; + + /* turn on rc632 */ + rh->ah = rc632_open(rath); + if (!rh->ah) + goto out_rath; + + /* everything is ok, returning reader handler */ + return rh; +out_rath: + free(rath); +out_rh: + free(rh); +out_close_spi: + close(spidev_fd); + return NULL; +} + +static void spidev_close(struct rfid_reader_handle *rh) +{ + struct rfid_asic_transport_handle *rath = rh->ah->rath; + + if (rh->ah) + rc632_close(rh->ah); + + if (spidev_fd > 0) + close(spidev_fd); + + if (rath) + free(rath); + + if (rh) + free(rh); +} + +struct rfid_reader rfid_reader_spidev = { + .name = "spidev reader", + .id = RFID_READER_SPIDEV, + .open = &spidev_open, + .close = &spidev_close, + .l2_supported = (1 << RFID_LAYER2_ISO14443A) | + (1 << RFID_LAYER2_ISO14443B) | + (1 << RFID_LAYER2_ISO15693), + .proto_supported = (1 << RFID_PROTOCOL_TCL) | + (1 << RFID_PROTOCOL_MIFARE_UL) | + (1 << RFID_PROTOCOL_MIFARE_CLASSIC), + .getopt = &_rdr_rc632_getopt, + .setopt = &_rdr_rc632_setopt, + .init = &_rdr_rc632_l2_init, + .transceive = &_rdr_rc632_transceive, + .iso14443a = { + .transceive_sf = &_rdr_rc632_transceive_sf, + .transceive_acf = &_rdr_rc632_transceive_acf, + .speed = RFID_14443A_SPEED_106K | + RFID_14443A_SPEED_212K | + RFID_14443A_SPEED_424K, + .set_speed = &_rdr_rc632_14443a_set_speed, + }, + .iso15693 = { + .transceive_ac = &_rdr_rc632_iso15693_transceive_ac, + }, + .mifare_classic = { + .setkey = &_rdr_rc632_mifare_setkey, + .setkey_ee = &_rdr_rc632_mifare_setkey_ee, + .auth = &_rdr_rc632_mifare_auth, + }, +}; + diff --git a/librfid/src/rfid_scan.c b/librfid/src/rfid_scan.c new file mode 100644 index 0000000..477265a --- /dev/null +++ b/librfid/src/rfid_scan.c @@ -0,0 +1,115 @@ +/* RFID scanning implementation + * + * (C) 2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +static struct rfid_layer2_handle * +rfid_layer2_scan1(struct rfid_reader_handle *rh, int l2) +{ + struct rfid_layer2_handle *l2h; + + if (rh->reader->l2_supported & (1 << l2)) { + l2h = rfid_layer2_init(rh, l2); + if (!l2h) + return NULL; + if (rfid_layer2_open(l2h) < 0) { + rfid_layer2_fini(l2h); + return NULL; + } else + return l2h; + } + + return NULL; +} + +struct rfid_layer2_handle * +rfid_layer2_scan(struct rfid_reader_handle *rh) +{ + struct rfid_layer2_handle *l2h; + int i; + +#define RFID_LAYER2_MAX 16 + for (i = 0; i < RFID_LAYER2_MAX; i++) { + DEBUGP("testing l2 %u\n", i); + l2h = rfid_layer2_scan1(rh, i); + if (l2h) + return l2h; + } + + return NULL; +} + +static struct rfid_protocol_handle * +rfid_protocol_scan1(struct rfid_layer2_handle *l2h, int proto) +{ + struct rfid_protocol_handle *ph; + + if (l2h->rh->reader->proto_supported & (1 << proto) && + l2h->proto_supported & (1 << proto)) { + ph = rfid_protocol_init(l2h, proto); + if (!ph) + return NULL; + if (rfid_protocol_open(ph) < 0) { + rfid_protocol_fini(ph); + return NULL; + } else + return ph; + } + + return NULL; +} + +struct rfid_protocol_handle * +rfid_protocol_scan(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + int i; + +#define RFID_PROTOCOL_MAX 16 + for (i = 0; i < RFID_PROTOCOL_MAX; i++) { + DEBUGP("testing proto %u\n", i); + ph = rfid_protocol_scan1(l2h, i); + if (ph) + return ph; + } + + return NULL; +} + +/* Scan for any RFID transponder within range of the given reader. + * Abort after the first successfully found transponder. */ +int rfid_scan(struct rfid_reader_handle *rh, + struct rfid_layer2_handle **l2h, + struct rfid_protocol_handle **ph) +{ + *l2h = rfid_layer2_scan(rh); + if (!*l2h) + return 0; + + *ph = rfid_protocol_scan(*l2h); + if (!*ph) + return 2; + + return 3; +} diff --git a/librfid/src/usleep.c b/librfid/src/usleep.c new file mode 100644 index 0000000..9f76bcb --- /dev/null +++ b/librfid/src/usleep.c @@ -0,0 +1,30 @@ +#include +#include + +void usleep(unsigned long usec) +{ + int msec; + + msec=usec/1000; + usec=usec%1000; + + if(msec) + { + if(usec) + msec++; + } + else + { + LARGE_INTEGER current,freq,end; + + QueryPerformanceFrequency(&freq); + QueryPerformanceCounter(&end); + + end.QuadPart+=(freq.QuadPart*usec)/1000000; + while(QueryPerformanceCounter(¤t) && (current.QuadPart<=end.QuadPart)) + { + } + } + + Sleep(msec); +} diff --git a/librfid/src/usleep.h b/librfid/src/usleep.h new file mode 100644 index 0000000..c23bae0 --- /dev/null +++ b/librfid/src/usleep.h @@ -0,0 +1,6 @@ +#ifndef __USLEEP_H__ +#define __USLEEP_H__ + +void usleep(unsigned long usec); + +#endif/*__USLEEP_H__*/ diff --git a/librfid/utils/.deps/common.Po b/librfid/utils/.deps/common.Po new file mode 100644 index 0000000..eba76fe --- /dev/null +++ b/librfid/utils/.deps/common.Po @@ -0,0 +1,74 @@ +common.o: common.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_scan.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_mifare_ul.h librfid-tool.h common.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_scan.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +librfid-tool.h: + +common.h: diff --git a/librfid/utils/.deps/librfid-tool.Po b/librfid/utils/.deps/librfid-tool.Po new file mode 100644 index 0000000..c4e2f54 --- /dev/null +++ b/librfid/utils/.deps/librfid-tool.Po @@ -0,0 +1,81 @@ +librfid-tool.o: librfid-tool.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_scan.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_protocol_tagit.h \ + ../include/librfid/rfid_protocol_icode.h \ + ../include/librfid/rfid_protocol_tcl.h librfid-tool.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_scan.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_protocol_tagit.h: + +../include/librfid/rfid_protocol_icode.h: + +../include/librfid/rfid_protocol_tcl.h: + +librfid-tool.h: diff --git a/librfid/utils/.deps/mifare-tool.Po b/librfid/utils/.deps/mifare-tool.Po new file mode 100644 index 0000000..1918a54 --- /dev/null +++ b/librfid/utils/.deps/mifare-tool.Po @@ -0,0 +1,75 @@ +mifare-tool.o: mifare-tool.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_scan.h \ + ../include/librfid/rfid_reader.h ../include/librfid/rfid_asic.h \ + ../include/librfid/rfid_asic_rc632.h ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_mifare_ul.h \ + ../include/librfid/rfid_access_mifare_classic.h librfid-tool.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_scan.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_mifare_ul.h: + +../include/librfid/rfid_access_mifare_classic.h: + +librfid-tool.h: diff --git a/librfid/utils/.deps/send_script.Po b/librfid/utils/.deps/send_script.Po new file mode 100644 index 0000000..4d2496c --- /dev/null +++ b/librfid/utils/.deps/send_script.Po @@ -0,0 +1,71 @@ +send_script.o: send_script.c \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h \ + e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ctype.h \ + ../include/librfid/rfid.h ../include/librfid/rfid_reader.h \ + ../include/librfid/rfid_asic.h ../include/librfid/rfid_asic_rc632.h \ + ../include/librfid/rfid_layer2.h \ + ../include/librfid/rfid_layer2_iso14443a.h \ + ../include/librfid/rfid_layer2_iso15693.h \ + ../include/librfid/rfid_protocol.h \ + ../include/librfid/rfid_protocol_mifare_classic.h \ + ../include/librfid/rfid_protocol_mifare_ul.h + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/_mingw.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stddef.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/include/stdarg.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/sys/types.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/unistd.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/io.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/process.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/getopt.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdlib.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/string.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/errno.h: + +e:\programme\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ctype.h: + +../include/librfid/rfid.h: + +../include/librfid/rfid_reader.h: + +../include/librfid/rfid_asic.h: + +../include/librfid/rfid_asic_rc632.h: + +../include/librfid/rfid_layer2.h: + +../include/librfid/rfid_layer2_iso14443a.h: + +../include/librfid/rfid_layer2_iso15693.h: + +../include/librfid/rfid_protocol.h: + +../include/librfid/rfid_protocol_mifare_classic.h: + +../include/librfid/rfid_protocol_mifare_ul.h: diff --git a/librfid/utils/Makefile b/librfid/utils/Makefile new file mode 100644 index 0000000..39fc883 --- /dev/null +++ b/librfid/utils/Makefile @@ -0,0 +1,642 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# utils/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +bin_PROGRAMS = librfid-tool$(EXEEXT) mifare-tool$(EXEEXT) \ + librfid-send_script$(EXEEXT) +subdir = utils +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 = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am_librfid_send_script_OBJECTS = send_script.$(OBJEXT) +librfid_send_script_OBJECTS = $(am_librfid_send_script_OBJECTS) +librfid_send_script_DEPENDENCIES = ../src/librfid.la +librfid_send_script_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_send_script_LDFLAGS) $(LDFLAGS) -o $@ +am_librfid_tool_OBJECTS = librfid-tool.$(OBJEXT) common.$(OBJEXT) +librfid_tool_OBJECTS = $(am_librfid_tool_OBJECTS) +librfid_tool_DEPENDENCIES = ../src/librfid.la +librfid_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_tool_LDFLAGS) $(LDFLAGS) -o $@ +am_mifare_tool_OBJECTS = mifare-tool.$(OBJEXT) common.$(OBJEXT) +mifare_tool_OBJECTS = $(am_mifare_tool_OBJECTS) +mifare_tool_DEPENDENCIES = ../src/librfid.la +mifare_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(mifare_tool_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \ + $(mifare_tool_SOURCES) +DIST_SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \ + $(mifare_tool_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/utils +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/utils +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1 +EXTRA_DIST = $(man_MANS) +noinst_HEADERS = librfid-tool.h common.h +librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h +librfid_tool_LDADD = ../src/librfid.la +librfid_send_script_SOURCES = send_script.c +librfid_send_script_LDADD = ../src/librfid.la +mifare_tool_SOURCES = mifare-tool.c common.c +mifare_tool_LDADD = ../src/librfid.la +#LINKOPTS = -dynamic -mno-cygwin +#librfid_send_script_LDFLAGS = $(LINKOPTS) +#librfid_tool_LDFLAGS = $(LINKOPTS) +#mifare_tool_LDFLAGS = $(LINKOPTS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu utils/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +librfid-send_script$(EXEEXT): $(librfid_send_script_OBJECTS) $(librfid_send_script_DEPENDENCIES) + @rm -f librfid-send_script$(EXEEXT) + $(librfid_send_script_LINK) $(librfid_send_script_OBJECTS) $(librfid_send_script_LDADD) $(LIBS) +librfid-tool$(EXEEXT): $(librfid_tool_OBJECTS) $(librfid_tool_DEPENDENCIES) + @rm -f librfid-tool$(EXEEXT) + $(librfid_tool_LINK) $(librfid_tool_OBJECTS) $(librfid_tool_LDADD) $(LIBS) +mifare-tool$(EXEEXT): $(mifare_tool_OBJECTS) $(mifare_tool_DEPENDENCIES) + @rm -f mifare-tool$(EXEEXT) + $(mifare_tool_LINK) $(mifare_tool_OBJECTS) $(mifare_tool_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/common.Po +include ./$(DEPDIR)/librfid-tool.Po +include ./$(DEPDIR)/mifare-tool.Po +include ./$(DEPDIR)/send_script.Po + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list=''; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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) $(MANS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am 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-man \ + uninstall-man1 + + +# 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: diff --git a/librfid/utils/Makefile.am b/librfid/utils/Makefile.am new file mode 100644 index 0000000..3cdf089 --- /dev/null +++ b/librfid/utils/Makefile.am @@ -0,0 +1,25 @@ +include $(top_srcdir)/Makefile.flags.am + +man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1 + +EXTRA_DIST = $(man_MANS) + +bin_PROGRAMS = librfid-tool mifare-tool librfid-send_script + +noinst_HEADERS = librfid-tool.h common.h + +librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h +librfid_tool_LDADD = ../src/librfid.la + +librfid_send_script_SOURCES= send_script.c +librfid_send_script_LDADD = ../src/librfid.la + +mifare_tool_SOURCES = mifare-tool.c common.c +mifare_tool_LDADD = ../src/librfid.la + +if ENABLE_WIN32 +LINKOPTS = -dynamic -mno-cygwin +librfid_send_script_LDFLAGS = $(LINKOPTS) +librfid_tool_LDFLAGS = $(LINKOPTS) +mifare_tool_LDFLAGS = $(LINKOPTS) +endif diff --git a/librfid/utils/Makefile.in b/librfid/utils/Makefile.in new file mode 100644 index 0000000..961c8c9 --- /dev/null +++ b/librfid/utils/Makefile.in @@ -0,0 +1,642 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +bin_PROGRAMS = librfid-tool$(EXEEXT) mifare-tool$(EXEEXT) \ + librfid-send_script$(EXEEXT) +subdir = utils +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 = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am_librfid_send_script_OBJECTS = send_script.$(OBJEXT) +librfid_send_script_OBJECTS = $(am_librfid_send_script_OBJECTS) +librfid_send_script_DEPENDENCIES = ../src/librfid.la +librfid_send_script_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_send_script_LDFLAGS) $(LDFLAGS) -o $@ +am_librfid_tool_OBJECTS = librfid-tool.$(OBJEXT) common.$(OBJEXT) +librfid_tool_OBJECTS = $(am_librfid_tool_OBJECTS) +librfid_tool_DEPENDENCIES = ../src/librfid.la +librfid_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_tool_LDFLAGS) $(LDFLAGS) -o $@ +am_mifare_tool_OBJECTS = mifare-tool.$(OBJEXT) common.$(OBJEXT) +mifare_tool_OBJECTS = $(am_mifare_tool_OBJECTS) +mifare_tool_DEPENDENCIES = ../src/librfid.la +mifare_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(mifare_tool_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \ + $(mifare_tool_SOURCES) +DIST_SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \ + $(mifare_tool_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1 +EXTRA_DIST = $(man_MANS) +noinst_HEADERS = librfid-tool.h common.h +librfid_tool_SOURCES = librfid-tool.c librfid-tool.h common.c common.h +librfid_tool_LDADD = ../src/librfid.la +librfid_send_script_SOURCES = send_script.c +librfid_send_script_LDADD = ../src/librfid.la +mifare_tool_SOURCES = mifare-tool.c common.c +mifare_tool_LDADD = ../src/librfid.la +@ENABLE_WIN32_TRUE@LINKOPTS = -dynamic -mno-cygwin +@ENABLE_WIN32_TRUE@librfid_send_script_LDFLAGS = $(LINKOPTS) +@ENABLE_WIN32_TRUE@librfid_tool_LDFLAGS = $(LINKOPTS) +@ENABLE_WIN32_TRUE@mifare_tool_LDFLAGS = $(LINKOPTS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu utils/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +librfid-send_script$(EXEEXT): $(librfid_send_script_OBJECTS) $(librfid_send_script_DEPENDENCIES) + @rm -f librfid-send_script$(EXEEXT) + $(librfid_send_script_LINK) $(librfid_send_script_OBJECTS) $(librfid_send_script_LDADD) $(LIBS) +librfid-tool$(EXEEXT): $(librfid_tool_OBJECTS) $(librfid_tool_DEPENDENCIES) + @rm -f librfid-tool$(EXEEXT) + $(librfid_tool_LINK) $(librfid_tool_OBJECTS) $(librfid_tool_LDADD) $(LIBS) +mifare-tool$(EXEEXT): $(mifare_tool_OBJECTS) $(mifare_tool_DEPENDENCIES) + @rm -f mifare-tool$(EXEEXT) + $(mifare_tool_LINK) $(mifare_tool_OBJECTS) $(mifare_tool_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librfid-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifare-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send_script.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list=''; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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) $(MANS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am 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-man \ + uninstall-man1 + + +# 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: diff --git a/librfid/utils/common.c b/librfid/utils/common.c new file mode 100644 index 0000000..ec7fda0 --- /dev/null +++ b/librfid/utils/common.c @@ -0,0 +1,126 @@ +#include +#include +#include +#include +#include + +#ifndef __MINGW32__ +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#include "librfid-tool.h" +#include "common.h" + +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +static char parse_hexdigit(const char hexdigit) +{ + if (hexdigit <= '9' && hexdigit >= '0') + return hexdigit - '0'; + if (hexdigit <= 'f' && hexdigit >= 'a') + return 10 + (hexdigit - 'a'); + + return 0; +} + +int +hexread(unsigned char *result, const unsigned char *in, unsigned int len) +{ + const unsigned char *pos; + char dig1, dig2; + unsigned char *res = result; + + for (pos = in; pos-in <= len-2; pos+=2) { + if (*pos == ':') + pos++; + dig1 = *pos; + dig2 = *(pos+1); + + *res++ = parse_hexdigit(dig1) << 4 | parse_hexdigit(dig2); + } + + return (res - result); +} + +struct rfid_reader_handle *rh; +struct rfid_layer2_handle *l2h; +struct rfid_protocol_handle *ph; + +int reader_init(void) +{ + printf("opening reader handle OpenPCD, CM5x21\n"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if (!rh) { + fprintf(stderr, "No OpenPCD found\n"); + rh = rfid_reader_open(NULL, RFID_READER_CM5121); + if (!rh) { + fprintf(stderr, "No Omnikey Cardman 5x21 found\n"); + return -1; + } + } + return 0; +} + +int l2_init(int layer2) +{ + int rc; + + printf("opening layer2 handle\n"); + l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + fprintf(stderr, "error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2); + return -1; + } + + printf("running layer2 anticol(_open)\n"); + rc = rfid_layer2_open(l2h); + if (rc < 0) { + fprintf(stderr, "error during layer2_open\n"); + return rc; + } + + return 0; +} + +int l3_init(int protocol) +{ + printf("running layer3 (ats)\n"); + ph = rfid_protocol_init(l2h, protocol); + if (!ph) { + fprintf(stderr, "error during protocol_init\n"); + return -1; + } + if (rfid_protocol_open(ph) < 0) { + fprintf(stderr, "error during protocol_open\n"); + return -1; + } + + printf("we now have layer3 up and running\n"); + + return 0; +} + diff --git a/librfid/utils/common.h b/librfid/utils/common.h new file mode 100644 index 0000000..3dd4cf4 --- /dev/null +++ b/librfid/utils/common.h @@ -0,0 +1,7 @@ +#ifndef __COMMON_H__ +#define __COMMON_H__ + +extern const char * hexdump(const void *data, unsigned int len); +extern int hexread(unsigned char *result, const unsigned char *in, unsigned int len); + +#endif/*__COMMON_H__*/ diff --git a/librfid/utils/librfid-send_script.1 b/librfid/utils/librfid-send_script.1 new file mode 100644 index 0000000..02fe610 --- /dev/null +++ b/librfid/utils/librfid-send_script.1 @@ -0,0 +1,23 @@ +.TH librfid-send_script 1 "January 24, 2008" +.SH NAME +librfid-send_script \- Command line tool for testing librfid +.SH SYNOPSIS +.BR librfid-send_script " scriptfile" +.SH DESCRIPTION +.B librfid-send_script +is a command line tool for testing librfid. +.SH OPTIONS +None. +.SH BUGS +Please report any bugs on the +.B librfid-devel +mailing list at +.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "." +.SH LICENCE +.B librfid-send_script +is covered by the GNU General Public License (GPL), version 2. +.SH AUTHORS +Harald Welte +.PP +This manual page was written by Uwe Hermann . +It is licensed under the terms of the GNU GPL (version 2 or later). diff --git a/librfid/utils/librfid-send_script.exe b/librfid/utils/librfid-send_script.exe new file mode 100644 index 0000000..228ff32 Binary files /dev/null and b/librfid/utils/librfid-send_script.exe differ diff --git a/librfid/utils/librfid-tool.1 b/librfid/utils/librfid-tool.1 new file mode 100644 index 0000000..f8e0e1a --- /dev/null +++ b/librfid/utils/librfid-tool.1 @@ -0,0 +1,44 @@ +.TH LIBRFID-TOOL 1 "January 24, 2008" +.SH NAME +librfid-tool \- Low-level RFID access command line tool based on librfid +.SH SYNOPSIS +.B librfid-tool \fR[\fB\-sSplh\fR] +.SH DESCRIPTION +.B librfid-tool +is a command line tool which gives you low-level RFID access using one +of the RFID reader devices supported by librfid. +.SH OPTIONS +.B "\-s, \-\-scan" +Scan for RFID tags until the first tag is found. +.TP +.B "\-S, \-\-scan-loop" +Scan for RFID tags in an endless loop. Show information on the detected +RFID tags (if any). +.TP +.B "\-p, \-\-protocol" +Specify the RFID protocol to use. Possible values are: +.BR tcl , +.BR mifare-ultralight ", and " +.BR mifare-classic "." +.TP +.B "\-l, \-\-layer2" +Specify the layer 2 protocol to use. Possible values are: +.BR iso14443a , +.BR iso14443b ", and " +.BR iso15693 "." +.TP +.B "\-h, \-\-help" +Show a help text and exit. +.SH BUGS +Please report any bugs on the +.B librfid-devel +mailing list at +.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "." +.SH LICENCE +.B librfid-tool +is covered by the GNU General Public License (GPL), version 2. +.SH AUTHORS +Harald Welte +.PP +This manual page was written by Uwe Hermann . +It is licensed under the terms of the GNU GPL (version 2 or later). diff --git a/librfid/utils/librfid-tool.c b/librfid/utils/librfid-tool.c new file mode 100644 index 0000000..3651e5d --- /dev/null +++ b/librfid/utils/librfid-tool.c @@ -0,0 +1,917 @@ +/* librfid-tool - a small command-line tool for librfid testing + * + * (C) 2005-2008 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include + +#ifndef __MINGW32__ +#include +#endif + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "librfid-tool.h" + + +static int select_mf(void) +{ + unsigned char cmd[] = { 0x00, 0xa4, 0x00, 0x00, 0x02, 0x3f, 0x00, 0x00 }; + unsigned char ret[256]; + unsigned int rlen = sizeof(ret); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%d: [%s]\n", rlen, hexdump(ret, rlen)); + + return 0; +} + + +static int iso7816_get_challenge(unsigned char len) +{ + unsigned char cmd[] = { 0x00, 0x84, 0x00, 0x00, 0x08 }; + unsigned char ret[256]; + unsigned int rlen = sizeof(ret); + + cmd[4] = len; + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%d: [%s]\n", rlen, hexdump(ret, rlen)); + + return 0; +} + +int +iso7816_select_application(void) +{ + unsigned char cmd[] = { 0x00, 0xa4, 0x04, 0x0c, 0x07, + 0xa0, 0x00, 0x00, 0x02, 0x47, 0x10, 0x01 }; + unsigned char resp[7]; + unsigned int rlen = sizeof(resp); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + /* FIXME: parse response */ + printf("%s\n", hexdump(resp, rlen)); + + return 0; +} + +int +iso7816_select_ef(u_int16_t fid) +{ + unsigned char cmd[7] = { 0x00, 0xa4, 0x02, 0x0c, 0x02, 0x00, 0x00 }; + unsigned char resp[7]; + unsigned int rlen = sizeof(resp); + + int rv; + + cmd[5] = (fid >> 8) & 0xff; + cmd[6] = fid & 0xff; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + /* FIXME: parse response */ + printf("%s\n", hexdump(resp, rlen)); + + return 0; +} + +int +iso7816_read_binary(unsigned char *buf, unsigned int *len) +{ + unsigned char cmd[] = { 0x00, 0xb0, 0x00, 0x00, 0x00 }; + unsigned char resp[256]; + unsigned int rlen = sizeof(resp); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%s\n", hexdump(resp, rlen)); + + /* FIXME: parse response, determine whether we need additional reads */ + + /* FIXME: copy 'len' number of response bytes to 'buf' */ + return 0; +} + +/* wrapper function around SELECT EF and READ BINARY */ +int +iso7816_read_ef(u_int16_t fid, unsigned char *buf, unsigned int *len) +{ + int rv; + + rv = iso7816_select_ef(fid); + if (rv < 0) + return rv; + + return iso7816_read_binary(buf, len); +} + +/* mifare ultralight helpers */ +int +mifare_ulight_write(struct rfid_protocol_handle *ph) +{ + unsigned char buf[4] = { 0xa1, 0xa2, 0xa3, 0xa4 }; + + return rfid_protocol_write(ph, 10, buf, 4); +} + +int +mifare_ulight_blank(struct rfid_protocol_handle *ph) +{ + unsigned char buf[4] = { 0x00, 0x00, 0x00, 0x00 }; + int i, ret; + + for (i = 4; i <= MIFARE_UL_PAGE_MAX; i++) { + ret = rfid_protocol_write(ph, i, buf, 4); + if (ret < 0) + return ret; + } + return 0; +} + +static int +mifare_ulight_read(struct rfid_protocol_handle *ph) +{ + unsigned char buf[20]; + unsigned int len = sizeof(buf); + int ret; + int i; + + for (i = 0; i <= MIFARE_UL_PAGE_MAX; i++) { + ret = rfid_protocol_read(ph, i, buf, &len); + if (ret < 0) + return ret; + + printf("Page 0x%x: %s\n", i, hexdump(buf, 4)); + } + return 0; +} + +/* mifare classic helpers */ +static int +mifare_classic_read_sector(struct rfid_protocol_handle *ph, int sector) +{ + unsigned char buf[20]; + unsigned int len = sizeof(buf); + int ret; + int block, blocks_per_sector, first_block; + + printf("Reading sector %u\n", sector); + + first_block = mfcl_sector2block(sector); + blocks_per_sector = mfcl_sector_blocks(sector); + + if (first_block < 0 || blocks_per_sector < 0) + return -EINVAL; + + for (block = first_block; block < first_block + blocks_per_sector; + block++) { + printf("Reading block %u: ", block); + ret = rfid_protocol_read(ph, block, buf, &len); + if (ret == -ETIMEDOUT) + fprintf(stderr, "TIMEOUT\n"); + if (ret < 0) { + printf("Error %d reading\n", ret); + return ret; + } + + printf("Page 0x%x: %s\n", block, hexdump(buf, len)); + } + return 0; +} + +static int +mifare_classic_dump(struct rfid_protocol_handle *ph) +{ + unsigned int size; + unsigned int size_len = sizeof(size); + int sector, num_sectors; + + if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE, + &size, &size_len) == 0) { + printf("Size: %u bytes\n", size); + } else { + printf("Size: unknown ?!?\n"); + return -EINVAL; + } + + switch (size) { + case 320: + num_sectors = 5; + break; + case 1024: + num_sectors = 16; + break; + case 4096: + num_sectors = 40; + break; + default: + return -EINVAL; + } + + for (sector = 0; sector < num_sectors; sector++) { + int rc; + + printf("Authenticating sector %u: ", sector); + fflush(stdout); + + rc = mfcl_set_key(ph, MIFARE_CL_KEYA_DEFAULT_INFINEON); + if (rc < 0) { + printf("key format error\n"); + exit(1); + } + + rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, + mfcl_sector2block(sector)); + if (rc < 0) { + printf("mifare auth error\n"); + exit(1); + } else + printf("mifare auth succeeded!\n"); + + mifare_classic_read_sector(ph, sector); + } +} + +void +iso15693_write(struct rfid_reader_handle *rh,int layer2,int sector, + unsigned char *data, unsigned int len) +{ + int rc; + unsigned char uid_buf[16]; + unsigned int uid_len = sizeof(uid_buf); + + if (rh->reader->l2_supported & (1 << layer2)) { + l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + printf("error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2); + return; + } + printf("Layer2 init ok\n"); + rc = rfid_layer2_open(l2h); + if (rc>0){ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len); + printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len)); + rc = iso15693_write_block(l2h,sector,data,len); + printf("write>>rc: %d\n",rc); + + }else { + printf("error during layer2_open\n"); + return ; + } + rfid_layer2_close(l2h); + rfid_layer2_fini(l2h); + } +} + +void iso15693_dump(struct rfid_reader_handle *rh,int layer2,int sector){ + unsigned int size; + unsigned int size_len = sizeof(size); + unsigned char buf[1024]; + int rc,i; + unsigned char uid_buf[16], block_sec; + unsigned int uid_len = sizeof(uid_buf); + + + if (rh->reader->l2_supported & (1 << layer2)) { + l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + printf("error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2); + return; + } + printf("Layer2 init ok\n"); + rc = rfid_layer2_open(l2h); + if (rc>0){ + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len); + printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len)); + + if (sector < 0){ + if (sector<=-3) + iso15693_select(l2h); + for(i=0;i<=255;i++){ + rc = iso15693_read_block(l2h,i,buf,sizeof(buf),&block_sec); + if (rc>=0) + printf("block[%3d:%02x]sec:0x%0x data(%d): %s\n",i,i,block_sec,rc,rfid_hexdump(buf,rc)); + else{ + printf("no data(read_block(%d)>> %d)\n",i,rc); + if ((sector == -1)||(sector == -3)) + break; + } + } + }else{ + if (sector>255) + sector=255; + rc = iso15693_read_block(l2h,sector,buf,sizeof(buf)); + if (rc>=0) + printf("block[%d]data(%d): %s\n",i,rc,rfid_hexdump(buf,rc)); + else + printf("no data(read_block(%d)>> %d)\n",i,rc); + } + } else { + printf("error during layer2_open\n"); + return ; + } + rfid_layer2_close(l2h); + rfid_layer2_fini(l2h); + } +} + +static char *proto_names[] = { + [RFID_PROTOCOL_TCL] = "tcl", + [RFID_PROTOCOL_MIFARE_UL] = "mifare-ultralight", + [RFID_PROTOCOL_MIFARE_CLASSIC] = "mifare-classic", + [RFID_PROTOCOL_ICODE_SLI] = "icode", + [RFID_PROTOCOL_TAGIT] = "tagit", +}; + +static int proto_by_name(const char *name) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(proto_names); i++) { + if (proto_names[i] == NULL) + continue; + if (!strcasecmp(name, proto_names[i])) + return i; + } + return -1; +} + +static char *l2_names[] = { + [RFID_LAYER2_ISO14443A] = "iso14443a", + [RFID_LAYER2_ISO14443B] = "iso14443b", + [RFID_LAYER2_ISO15693] = "iso15693", + [RFID_LAYER2_ICODE1] = "icode1", +}; + +static int l2_by_name(const char *name) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(l2_names); i++) { + if (l2_names[i] == NULL) + continue; + if (!strcasecmp(name, l2_names[i])) + return i; + } + return -1; +} + +static int do_scan(int first) +{ + int rc; + unsigned int size; + unsigned int size_len = sizeof(size); + char *data; + unsigned int data_len; + + if (first) { + unsigned int opt; + unsigned int optlen = sizeof(opt); + + /* turn off RF */ + opt = 1; + rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen); + + usleep(10*1000); + + /* turn on RF */ + opt = 0; + rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen); + } + printf("scanning for RFID token...\n"); + rc = rfid_scan(rh, &l2h, &ph); + if (rc >= 2) { + unsigned char uid_buf[16]; + unsigned int uid_len = sizeof(uid_buf); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, + &uid_len); + printf("Layer 2 success (%s): %s\n", rfid_layer2_name(l2h), + hexdump(uid_buf, uid_len)); + } + if (rc >= 3) { + printf("Protocol success (%s)\n", rfid_protocol_name(ph)); + + if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE, + &size, &size_len) == 0) + printf("Size: %u bytes\n", size); + size_len = sizeof(size); + size = 0; + if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS_LEN, + &size, &size_len) == 0) { + data_len = size + 1; + data = malloc(data_len); + if (data) { + if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS, + data, &data_len) == 0) { + printf("Got ATS of %u bytes: %s\n", size, + hexdump(data, data_len)); + } + } + } + } + + return rc; +} + +static void do_endless_scan() +{ + int rc; + int first = 1; + + while (1) { + if (first) + putc('\n', stdout); + printf("==> doing %s scan\n", first ? "first" : "successive"); + rc = do_scan(first); + if (rc >= 3) { + printf("closing proto\n"); + rfid_protocol_close(ph); + } + if (rc >= 2) { + printf("closing layer2\n"); + rfid_layer2_close(l2h); + first = 0; + } else + first = 1; + } +} + +static void do_regdump(void) +{ + u_int8_t buffer[0xff]; + int i; + + printf("dumping rc632 regs...\n"); + + rc632_register_dump(rh->ah, buffer); + + printf("\n "); + for (i=0; i<=0x0f; i++) + printf(" 0x_%01X",i); + printf("\n-----------------------------------------------------------------------------------\n"); + + for (i=0; i <= 0x3f; i++) { + if ((i % 0x10) == 0) + printf("0x%01X_:",i/0x10); + printf(" 0x%02X", buffer[i]); + if ((i% 0x10) == 0x0f) + printf("\n"); + } + + /* print regdump as c-style array*/ + printf("u_int8_t rc632_regs[] = {"); + for (i = 0; i <= 0x3f; i++) { + if (((i+1) % 0x08) == 1) { + if (i > 7) + printf("//%2d..%2d",i-8,i-1); + printf("\n\t"); + } + printf(" 0x%02X, ",buffer[i]); + } + printf("//%2d..%2d\n\t 0 };\n",i-8,i-1); + +} + +static void do_enum(int layer2) +{ + int rc; + //unsigned int size; + //unsigned int size_len = sizeof(size); + unsigned char uid_buf[16]; + unsigned int uid_len; + + printf("scanning for RFID token on layer %s...\n", l2_names[layer2]); + + if (rh->reader->l2_supported & (1 << layer2)) { + l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + printf("error during layer2(%s)_init\n", + l2_names[layer2]); + return; + } + printf("Layer2 init ok\n"); + rc = rfid_layer2_open(l2h); + } else { + printf("error during layer2_open\n"); + return ; + } + + while (rc>=0) { + if (l2h) { + uid_len = sizeof(uid_buf); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len); + printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len)); + } + + /* + ph = rfid_protocol_scan(l2h); + if (ph) { + printf("Protocol success (%s)\n", rfid_protocol_name(ph)); + + if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE, + &size, &size_len) == 0) + printf("Size: %u bytes\n", size); + } else + printf("##############\n"); + */ + + if (rc >= 0) { + rfid_layer2_close(l2h); + } + rc = rfid_layer2_open(l2h); + } +} + +static void do_enum_loop(int layer2, unsigned int delay) +{ + while (1) { + do_enum(layer2); + { + unsigned int opt; + unsigned int optlen = sizeof(opt); + + /* turn off RF */ + opt = 1; + rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen); + + usleep(10 * 1000); + + /* turn on RF */ + opt = 0; + rfid_reader_setopt(rh, RFID_OPT_RDR_RF_KILL, &opt, optlen); + } + usleep(delay * 1000); + printf("--- next run ---\n"); + } +} + +#define OPTION_OFFSET 256 + +static struct option original_opts[] = { + { "help", 0, 0, 'h' }, + { "layer2", 1, 0, 'l' }, + { "protocol", 1, 0, 'p' }, + { "scan", 0, 0, 's' }, + { "scan-loop", 0, 0, 'S' }, + { "dump", 0, 0, 'd' }, + { "enum", 0, 0, 'e' }, + { "read", 1, 0, 'r' }, + { "write", 1, 0, 'w'}, + { "enum-loop", 1, 0, 'E' }, + {0, 0, 0, 0} +}; + +/* module / option merging code */ +static struct option *opts = original_opts; +static unsigned int global_option_offset = 0; + +static char *program_name; +static char *program_version = LIBRFID_TOOL_VERSION; + +static void free_opts(int reset_offset) +{ + if (opts != original_opts) { + free(opts); + opts = original_opts; + if (reset_offset) + global_option_offset = 0; + } +} + +static struct option * +merge_options(struct option *oldopts, const struct option *newopts, + unsigned int *option_offset) +{ + unsigned int num_old, num_new, i; + struct option *merge; + + for (num_old = 0; oldopts[num_old].name; num_old++); + for (num_new = 0; oldopts[num_new].name; num_new++); + + global_option_offset += OPTION_OFFSET; + *option_offset = global_option_offset; + + merge = malloc(sizeof(struct option) * (num_new + num_old + 1)); + memcpy(merge, oldopts, num_old * sizeof(struct option)); + free_opts(0); /* Release previous options merged if any */ + for (i = 0; i < num_new; i++) { + merge[num_old + i] = newopts[i]; + merge[num_old + i].val += *option_offset; + } + memset(merge + num_old + num_new, 0, sizeof(struct option)); + + return merge; +} + +struct rfidtool_module *find_module(const char *name) +{ + return NULL; +} + +void register_module(struct rfidtool_module *me) +{ + struct rfidtool_module *old; + + if (strcmp(me->version, program_version) != 0) { + fprintf(stderr, "%s: target `%s' v%s (I'm v%s).\n", + program_name, me->name, me->version, program_version); + exit(1); + } + + old = find_module(me->name); + if (old) { + fprintf(stderr, "%s: target `%s' already registered.\n", + program_name, me->name); + exit(1); + } +} + +static void help(void) +{ + printf( " -s --scan scan until first RFID tag is found\n" + " -S --scan-loop endless scanning loop\n" + " -p --protocol {tcl,mifare-ultralight,mifare-classic,tagit,icode}\n" + " -l --layer2 {iso14443a,iso14443b,iso15693,icode1}\n" + " -d --dump dump rc632 registers\n" + " -e --enum enumerate all tag's in field \n" + " -E --enum-loop (ms) enumerate endless\n" + " -r --read read iso15693 sector \n\t\t\t(-1:0-255 stop on error, -2: 0-255 no stop)\n" + " -w --write write to iso15693 sector data: 01:02:03:04\n" + " -h --help\n"); +} + +int main(int argc, char **argv) +{ + int rc; + char buf[0x100]; + int i, len, protocol = -1, layer2 = -1; + +#ifdef __MINGW32__ + program_name = argv[0]; +#else /*__MINGW32__*/ + program_name = basename(argv[0]); +#endif/*__MINGW32__*/ + + printf("%s - (C) 2005-2008 by Harald Welte\n" + "This program is Free Software and has " + "ABSOLUTELY NO WARRANTY\n\n", program_name); + + printf("initializing librfid\n"); + rfid_init(); + + while (1) { + int c, option_index = 0; + c = getopt_long(argc, argv, "hp:l:sSdeE:r:w:", opts, &option_index); + if (c == -1) + break; + + switch (c) { + case 'w': + //hexread(key, optarg, strlen(optarg)); + i = strtol(optarg, NULL, 10); + if (reader_init() < 0) + exit(1); + layer2 = RFID_LAYER2_ISO15693; + iso15693_write(rh,layer2,i,"\x1\x2\x3\x4",4); + rfid_reader_close(rh); + exit(0); + break; + case 'r': + i = strtol(optarg, NULL, 10); + if (reader_init() < 0) + exit(1); + //if (layer2 < 0) + layer2 = RFID_LAYER2_ISO15693; + iso15693_dump(rh,layer2,i); + rfid_reader_close(rh); + exit(0); + break; + case 'E': + i = strtol(optarg, NULL, 10); + + if (reader_init() < 0) + exit(1); + if (layer2<0) + layer2 = RFID_LAYER2_ISO14443A; + + do_enum_loop(layer2, i>1? i : 500); + rfid_reader_close(rh); + exit(0); + break; + case 'e': + if (reader_init() < 0) + exit(1); + if (layer2 < 0) + layer2 = RFID_LAYER2_ISO14443A; + do_enum(layer2); + rfid_reader_close(rh); + exit(0); + break; + case 'd': + if (reader_init() < 0) + exit(1); + do_regdump(); + rfid_reader_close(rh); + break; + case 's': + if (reader_init() < 0) + exit(1); + do_scan(0); + rfid_reader_close(rh); + exit(0); + break; + case 'S': + if (reader_init() < 0) + exit(1); + do_endless_scan(); + exit(0); + break; + case 'p': + protocol = proto_by_name(optarg); + if (protocol < 0) { + fprintf(stderr, "unknown protocol `%s'\n", + optarg); + exit(2); + } + break; + case 'l': + layer2 = l2_by_name(optarg); + if (layer2 < 0) { + fprintf(stderr, "unknown layer2 `%s'\n", + optarg); + exit(2); + } + break; + default: + printf("unknown cmd: %c\n",c); + case 'h': + help(); + exit(0); + break; + case '?': + exit(0); + } + } + + switch (protocol) { + case RFID_PROTOCOL_MIFARE_UL: + case RFID_PROTOCOL_MIFARE_CLASSIC: + layer2 = RFID_LAYER2_ISO14443A; + break; + case -1: + fprintf(stderr, "you have to specify --protocol\n"); + exit(2); + } + + if (layer2 < 0) { + fprintf(stderr, "you have to specify --layer2\n"); + exit(2); + } + + if (reader_init() < 0) + exit(1); + + + if (l2_init(layer2) < 0) { + rfid_reader_close(rh); + exit(1); + } + + if (l3_init(protocol) < 0) { + rfid_reader_close(rh); + exit(1); + } + + switch (protocol) { + + case RFID_PROTOCOL_TCL: + printf("Protocol T=CL\n"); + /* we've established T=CL at this point */ + printf("selecting Master File\n"); + rc = select_mf(); + if (rc < 0) { + printf("error selecting MF\n"); + break; + } + + printf("Getting random challenge, length 255\n"); + rc = iso7816_get_challenge(0xff); + if (rc < 0) { + printf("error getting random challenge\n"); + break; + } + + printf("selecting Passport application\n"); + rc = iso7816_select_application(); + if (rc < 0) { + printf("error selecting passport application\n"); + break; + } + + printf("selecting EF 0x1e\n"); + rc = iso7816_select_ef(0x011e); + if (rc < 0) { + printf("error selecting EF 0x1e\n"); + break; + } + + printf("selecting EF 0x01\n"); + rc = iso7816_select_ef(0x0101); + if (rc < 0) { + printf("error selecting EF 0x01\n"); + break; + } + + while (1) { + printf("reading EF1\n"); + len = sizeof(buf); + printf("reading ef\n"); + rc = iso7816_read_binary(buf, &len); + if (rc < 0) { + printf("error reading EF\n"); + break; + } + } +#if 0 + for (i = 0; i < 4; i++) + iso7816_get_challenge(0xff); +#endif + break; + case RFID_PROTOCOL_MIFARE_UL: + printf("Protocol Mifare Ultralight\n"); + mifare_ulight_read(ph); +#if 0 + mifare_ulight_blank(ph); + mifare_ulight_write(ph); + mifare_ulight_read(ph); +#endif + break; + case RFID_PROTOCOL_MIFARE_CLASSIC: + printf("Protocol Mifare Classic\n"); + mifare_classic_dump(ph); + break; + default: + printf("unknown protocol %u\n", protocol); + exit(1); + break; + } + + rfid_reader_close(rh); + + exit(0); +} diff --git a/librfid/utils/librfid-tool.exe b/librfid/utils/librfid-tool.exe new file mode 100644 index 0000000..34a81d4 Binary files /dev/null and b/librfid/utils/librfid-tool.exe differ diff --git a/librfid/utils/librfid-tool.h b/librfid/utils/librfid-tool.h new file mode 100644 index 0000000..5ca49d4 --- /dev/null +++ b/librfid/utils/librfid-tool.h @@ -0,0 +1,35 @@ +#ifndef _RFIDTOOL_H +#define _RFIDTOOL_H + +#define _GNU_SOURCE +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + +extern const char * +hexdump(const void *data, unsigned int len); + +extern int +hexread(unsigned char *result, const unsigned char *in, unsigned int len); + +extern struct rfid_reader_handle *rh; +extern struct rfid_layer2_handle *l2h; +extern struct rfid_protocol_handle *ph; + +extern int reader_init(void); +extern int l2_init(int layer2); +extern int l3_init(int protocol); + +#define LIBRFID_TOOL_VERSION "0.1" + +struct rfidtool_module { + struct rfidtool_module *next; + char *name; + char *version; + const struct option *extra_opts; + + unsigned int option_offset; +}; + +#endif /* _REFIDTOOL_H */ diff --git a/librfid/utils/mifare-tool.1 b/librfid/utils/mifare-tool.1 new file mode 100644 index 0000000..5c97118 --- /dev/null +++ b/librfid/utils/mifare-tool.1 @@ -0,0 +1,39 @@ +.TH mifare-tool 1 "January 24, 2008" +.SH NAME +mifare-tool \- Low-level mifare tag command line tool based on librfid +.SH SYNOPSIS +.B mifare-tool \fR[\fB\-rlwkbh\fR] +.SH DESCRIPTION +.B mifare-tool +is a command line tool for testing low-level mifare tag support in librfid. +.SH OPTIONS +.B "\-r, \-\-read" +Read a mifare sector. +.TP +.B "\-l, \-\-loop-read" +Loop reading a mifare sector. +.TP +.B "\-w, \-\-write" +Write a mifare sector. +.TP +.B "\-k, \-\-key" +Specify a mifare access key (in hex tuples). +.TP +.B "\-b, \-\-brute-force N" +Brute-force read sector N. +.TP +.B "\-h, \-\-help" +Show a help text and exit. +.SH BUGS +Please report any bugs on the +.B librfid-devel +mailing list at +.BR https://lists.gnumonks.org/mailman/listinfo/librfid-devel/ "." +.SH LICENCE +.B mifare-tool +is covered by the GNU General Public License (GPL), version 2. +.SH AUTHORS +Harald Welte +.PP +This manual page was written by Uwe Hermann . +It is licensed under the terms of the GNU GPL (version 2 or later). diff --git a/librfid/utils/mifare-tool.c b/librfid/utils/mifare-tool.c new file mode 100644 index 0000000..ab6d216 --- /dev/null +++ b/librfid/utils/mifare-tool.c @@ -0,0 +1,248 @@ +/* mifare-tool - a small command-line tool for librfid mifare testing + * + * (C) 2006 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include + +#ifndef __MINGW32__ +#include +#endif + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "librfid-tool.h" + +static char *program_name; + +static void help(void) +{ + printf( " -h --help Print this help message\n" + " -r --read Read a mifare sector\n" + " -l --loop-read Loop reading a mifare sector\n" + " -w --write Write a mifare sector\n" + " -k --key Specify mifare access key (in hex tuples)\n" + " -b --brute-force n Brute Force read sector n\n"); +} + +static struct option mifare_opts[] = { + { "key", 1, 0, 'k' }, + { "read", 1, 0, 'r' }, + { "loop-read", 1, 0, 'l' }, + { "write", 1 ,0, 'w' }, + { "help", 0, 0, 'h' }, + { "brute-force", 1, 0, 'b' }, + { 0, 0, 0, 0 } +}; + +static int mifare_cl_auth(unsigned char *key, int page) +{ + int rc; + + rc = mfcl_set_key(ph, key); + if (rc < 0) { + fprintf(stderr, "key format error\n"); + return rc; + } + rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, page); + if (rc < 0) { + fprintf(stderr, "mifare auth error\n"); + return rc; + } else + printf("mifare auth succeeded!\n"); + + return 0; +} + +static void mifare_l3(void) +{ + while (l2_init(RFID_LAYER2_ISO14443A) < 0) ; + + printf("ISO14443-3A anticollision succeeded\n"); + + while (l3_init(RFID_PROTOCOL_MIFARE_CLASSIC) < 0) ; + + printf("Mifare card available\n"); +} + +int main(int argc, char **argv) +{ + int len, rc, c, option_index = 0; + unsigned int page,uid,uid_len; + char key[MIFARE_CL_KEY_LEN]; + char buf[MIFARE_CL_PAGE_SIZE]; + +#ifdef __MINGW32__ + program_name = argv[0]; +#else + program_name = basename(argv[0]); +#endif/*__MINGW32__*/ + + memcpy(key, MIFARE_CL_KEYA_DEFAULT_INFINEON, MIFARE_CL_KEY_LEN); + + printf("%s - (C) 2006 by Harald Welte\n" + "This program is Free Software and has " + "ABSOLUTELY NO WARRANTY\n\n", program_name); + + printf("initializing librfid\n"); + rfid_init(); + + if (reader_init() < 0) { + fprintf(stderr, "error opening reader\n"); + exit(1); + } + + while (1) { + c = getopt_long(argc, argv, "k:r:l:w:b:h", mifare_opts, + &option_index); + if (c == -1) + break; + + switch (c) { + int i; + case 'b': + page = atoi(optarg); + printf("key: %s\n", hexdump(key, MIFARE_CL_KEY_LEN)); + len = MIFARE_CL_PAGE_SIZE; + mifare_l3(); + for (i = 0; i <= 0xff; i++) { + key[MIFARE_CL_KEY_LEN-1]=i; + if (mifare_cl_auth(key, page) >= 0) + printf("KEY: %s\n",hexdump(key, MIFARE_CL_KEY_LEN)); + } + + break; + case 'k': + hexread(key, optarg, strlen(optarg)); + printf("key: %s\n", hexdump(key, MIFARE_CL_KEY_LEN)); + break; + case 'r': + page = atoi(optarg); + printf("read(key='%s',page=%u):", + hexdump(key, MIFARE_CL_KEY_LEN), page); + len = MIFARE_CL_PAGE_SIZE; + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + exit(1); + + uid_len=sizeof(uid); + uid=0; + if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0) + printf("UID=%08X (len=%u)\n",uid,uid_len); + + len=MIFARE_CL_PAGE_SIZE; + rc = rfid_protocol_read(ph, page, buf, &len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during read\n"); + break; + } + printf("len=%u data=%s\n", len, hexdump(buf, len)); + + if (page & 0x3 == 0x3) { + struct mfcl_access_sect s; + struct mfcl_access_exp_sect es; + int b; + u_int8_t recreated[4]; + mfcl_parse_access(&s, buf+6); + printf("access b0:%u b1:%u b2:%u b3:%u\n", + s.block[0], s.block[1], + s.block[2], s.block[3]); + mfcl_access_to_exp(&es, &s); + for (b = 0; b < 3; b++) + printf("%u: %s\n", b, mfcl_access_exp_stringify(&es.block[b])); + printf("3: %s\n", mfcl_access_exp_acc_stringify(&es.acc)); +#if 0 + mfcl_compile_access(recreated, &s); + printf("recreated; %s\n", hexdump(recreated,4)); +#endif + } + break; + case 'l': + page = atoi(optarg); + printf("read_loop(key='%s',page=%u):\n", + hexdump(key, MIFARE_CL_KEY_LEN), page); + while (1) { + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + continue; + + uid_len=sizeof(uid); + uid=0; + if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0) + printf("UID=%08X (len=%u)\n",uid,uid_len); + + len=MIFARE_CL_PAGE_SIZE; + rc = rfid_protocol_read(ph, page, buf, &len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during read\n"); + continue; + } + printf("%s\n", hexdump(buf, len)); + } + break; + case 'w': + page = atoi(optarg); + len = strlen(argv[optind]); + len = hexread(buf, argv[optind], len); + printf("write(key='%s',page=%u):", + hexdump(key, MIFARE_CL_KEY_LEN), page); + printf(" '%s'(%u):", hexdump(buf, len), len); + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + exit(1); + rc = rfid_protocol_write(ph, page, buf, len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during write\n"); + break; + } + printf("success\n"); + break; + case 'h': + default: + help(); + } + } + +#if 0 + rfid_protocol_close(ph); + rfid_protocol_fini(ph); + + rfid_layer2_close(l2h); + rfid_layer2_fini(l2h); +#endif + rfid_reader_close(rh); + exit(0); +} + diff --git a/librfid/utils/mifare-tool.exe b/librfid/utils/mifare-tool.exe new file mode 100644 index 0000000..f59a68a Binary files /dev/null and b/librfid/utils/mifare-tool.exe differ diff --git a/librfid/utils/send_script.c b/librfid/utils/send_script.c new file mode 100644 index 0000000..5b45704 --- /dev/null +++ b/librfid/utils/send_script.c @@ -0,0 +1,292 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include + +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const char * +hexdump(const void *data, unsigned int len) +{ + static char string[2048]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left, llen = len; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; llen--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } return string; + + if (i >= sizeof(string) -2) + return string; + snprintf(string+i, 2, " "); + i++; llen = len; + + d = (unsigned char *) data; + for (; llen--; i += 1) { + if (i >= sizeof(string) -2) + break; + snprintf(string+i, 2, "%c", isprint(*d) ? *d : '.'); + d++; + } + return string; +} + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; +static struct rfid_protocol_handle *ph; + +static int init() +{ + unsigned char buf[0x3f]; + int rc; + + printf("initializing librfid\n"); + rfid_init(); + + printf("opening reader handle\n"); + rh = rfid_reader_open(NULL, RFID_READER_CM5121); + if (!rh) { + fprintf(stderr, "error, no cm5121 handle\n"); + return -1; + } + + printf("opening layer2 handle\n"); + l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A); + //l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443B); + if (!l2h) { + fprintf(stderr, "error during iso14443a_init\n"); + return -1; + } + + //rc632_register_dump(rh->ah, buf); + + printf("running layer2 anticol\n"); + rc = rfid_layer2_open(l2h); + if (rc < 0) { + fprintf(stderr, "error during layer2_open\n"); + return rc; + } + + return 0; +} + +static int l3(int protocol) +{ + printf("running layer3 (ats)\n"); + ph = rfid_protocol_init(l2h, protocol); + if (!ph) { + fprintf(stderr, "error during protocol_init\n"); + return -1; + } + if (rfid_protocol_open(ph) < 0) { + fprintf(stderr, "error during protocol_open\n"); + return -1; + } + + printf("we now have layer3 up and running\n"); + + return 0; +} + +static int send_command(char* sbuf, int slen, char* rbuf, int rlen) +{ + int rv; + static int doit; + int answer, c = 0; + + if(doit == 0) { + fprintf(stderr, "?? %s (%i bytes)\n", hexdump(sbuf, slen), slen); + fprintf(stderr, "Execute? (Yes/No/All/Exit) "); + answer = getc(stdin); + if(answer != '\n') do { + c = getc(stdin); + } while(c != '\n' && c != EOF); + switch(answer) { + case 'y': // Fall-through + case 'Y': + case '\n': + // Do nothing + break; + case 'n': // Fall-through + case 'N': + return 0; + break; + case 'a': // Fall-through + case 'A': + doit = 1; + break; + case 'e': // Fall-through + case 'E': + return -1; + break; + default: + return 0; // Default to 'n' + break; + } + } + + printf(">> %s (%i bytes)\n", hexdump(sbuf, slen), slen); + + rv = rfid_protocol_transceive(ph, sbuf, slen, rbuf, &rlen, 0, 0); + if (rv < 0) { + fprintf(stderr, "Error from transceive: %i\n", rv); + return rv; + } + + printf("<< %s (%i bytes)\n", hexdump(rbuf, rlen), rlen); + + if(rlen < 2 || rbuf[rlen-2] != (char)0x90 || rbuf[rlen-1] != 0x00) { + fprintf(stderr, "SW is not 90 00. Ignore (i) or Abort (a)? "); + answer = getc(stdin); + if(answer != '\n') do { + c = getc(stdin); + } while(c != '\n' && c != EOF); + switch(answer) { + case 'i': // Fall-through + case 'I': + case '\n': + // Do nothing + break; + case 'a': // Fall-through + case 'A': + return -1; + break; + default: + return -1; // Default to 'a' + } + } + + return rlen; +} + +static char *nextline(FILE* fh) +{ + int buflen = 1024; // FIXME Might want to increase dynamically? + char *buffer = malloc(buflen); + if (!buffer) { + perror("malloc"); + return 0; + } + + if (!fgets(buffer, buflen, fh)) { + perror("fgets"); + free(buffer); + return 0; + } + + return buffer; +} + +static int unhexchar(char c) { + if ((c - '0') >= 0 && (c - '0') < 10) + return c-'0'; + if ((c - 'a') >= 0 && (c - 'a') < 6) + return 10 + c-'a'; + if ((c - 'A') >= 0 && (c - 'A') < 6) + return 10 + c-'A'; + return -1; +} + +int make_command( const char *line, char **buffer, int *blen ) +{ + int len = strlen(line), pos; + *buffer = malloc( len ); + *blen = 0; + if(!*buffer) { + perror("malloc"); + return 0; + } + + for(pos = 0; pos < len; pos++) { + if(!isxdigit(line[pos])) + continue; + if(! (pos+1 < len) ) + continue; + + (*buffer)[*blen] = unhexchar(line[pos]) * 16 + unhexchar(line[pos+1]); + pos += 1; + *blen += 1; + } + return 1; +} + +int main(int argc, char **argv) +{ + FILE *fh; + int slen, rlen, retval = 0; + char *next, *sbuf, *rbuf; + + if (argc != 2) { + fprintf(stderr, "Syntax: %s scriptfile\n", argv[0]); + exit(1); + } + + fh = fopen(argv[1], "r"); + if (!fh) { + perror("fopen"); + exit(1); + } + + if (init() < 0) + exit(1); + + if (l3(RFID_PROTOCOL_TCL) < 0) + exit(1); + + printf("Protocol T=CL\n"); + /* we've established T=CL at this point */ + + while (next = nextline(fh)) { + if (!(strlen(next) >= 2 && strncmp(next, "//", 2) == 0)) { + if (make_command(next, &sbuf, &slen)) { + rlen = 1024; + rbuf = calloc(rlen, 1); + + retval = send_command(sbuf, slen, rbuf, rlen); + + free(sbuf); + free(rbuf); + } + } + free(next); + + if (retval < 0) + break; + } + + rfid_reader_close(rh); + + exit(0); +} diff --git a/librfid/win32/Makefile b/librfid/win32/Makefile new file mode 100644 index 0000000..3c34e41 --- /dev/null +++ b/librfid/win32/Makefile @@ -0,0 +1,435 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# win32/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + + + +pkgdatadir = $(datadir)/librfid +pkgincludedir = $(includedir)/librfid +pkglibdir = $(libdir)/librfid +pkglibexecdir = $(libexecdir)/librfid +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +#am__append_1 = -mno-cygwin +#am__append_2 = -lusb +#am__append_3 = -DHAVE_LIBUSB +#am__append_4 = -DLIBRFID_FIRMWARE +subdir = win32 +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DATA = $(noinst_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run aclocal-1.11 +AMTAR = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoconf +AUTOHEADER = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run autoheader +AUTOMAKE = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run automake-1.11 +AWK = gawk +BUILDENV = UNIX +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"librfid\" -DVERSION=\"0.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = .exe +FGREP = /bin/grep -F +FIRMWARE_PATH = +GREP = /bin/grep +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = e:/programme/mingw/mingw32/bin/ld.exe +LDFLAGS = +LIBOBJS = +LIBS = $(am__append_2) +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_DEPS = ./ltmain.sh +LIPO = +LN_S = cp -p +LTLIBOBJS = +MAKEINFO = ${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid/missing" --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /mingw/bin/nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENCT_CFLAGS = +OPENCT_LIBS = +OTOOL = +OTOOL64 = +PACKAGE = librfid +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_URL = +PACKAGE_VERSION = +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 0.2.0 +abs_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid/win32 +abs_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid/win32 +abs_top_builddir = /D/Visual Studio 2010/Projects/Matomat/librfid +abs_top_srcdir = /D/Visual Studio 2010/Projects/Matomat/librfid +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} '/D/Visual Studio 2010/Projects/Matomat/librfid/install-sh' +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +#AM_LDFLAGS = -mno-cygwin +noinst_HEADERS = openpcd.h +noinst_DATA = openpcd.dll +LIBRFID_DIR = $(top_builddir)/src/.libs/ +CLEANFILES = $(noinst_DATA) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .dll .o +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu win32/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) $(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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +.c.o: + $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +.o.dll: + $(CC) -mno-cygwin --add-stdcall-alias -shared -o $@ -L$(LIBRFID_DIR) $< -lrfid -lwinmm -Wl,-no-undefined -Wl,--entry,__cygwin_noncygwin_dll_entry@12 + $(STRIP) --strip-unneeded $@ + +# 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: diff --git a/librfid/win32/Makefile.am b/librfid/win32/Makefile.am new file mode 100644 index 0000000..0821168 --- /dev/null +++ b/librfid/win32/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/Makefile.flags.am + +noinst_HEADERS = openpcd.h +noinst_DATA = openpcd.dll + +LIBRFID_DIR = $(top_builddir)/src/.libs/ +CLEANFILES = $(noinst_DATA) + +.c.o: + $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +.o.dll: + $(CC) -mno-cygwin --add-stdcall-alias -shared -o $@ -L$(LIBRFID_DIR) $< -lrfid -lwinmm -Wl,-no-undefined -Wl,--entry,__cygwin_noncygwin_dll_entry@12 + $(STRIP) --strip-unneeded $@ diff --git a/librfid/win32/Makefile.in b/librfid/win32/Makefile.in new file mode 100644 index 0000000..a01b814 --- /dev/null +++ b/librfid/win32/Makefile.in @@ -0,0 +1,435 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.flags.am +@ENABLE_WIN32_TRUE@am__append_1 = -mno-cygwin +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_2 = -lusb +@ENABLE_WIN32_FALSE@@HAVE_LIBUSB_TRUE@am__append_3 = -DHAVE_LIBUSB +@ENABLE_FIRMWARE_TRUE@am__append_4 = -DLIBRFID_FIRMWARE +subdir = win32 +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DATA = $(noinst_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(am__append_2) +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_3) $(am__append_4) +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_WIN32_TRUE@AM_LDFLAGS = -mno-cygwin +noinst_HEADERS = openpcd.h +noinst_DATA = openpcd.dll +LIBRFID_DIR = $(top_builddir)/src/.libs/ +CLEANFILES = $(noinst_DATA) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .dll .o +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.flags.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu win32/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) $(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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +.c.o: + $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +.o.dll: + $(CC) -mno-cygwin --add-stdcall-alias -shared -o $@ -L$(LIBRFID_DIR) $< -lrfid -lwinmm -Wl,-no-undefined -Wl,--entry,__cygwin_noncygwin_dll_entry@12 + $(STRIP) --strip-unneeded $@ + +# 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: diff --git a/librfid/win32/openpcd.c b/librfid/win32/openpcd.c new file mode 100644 index 0000000..748b52f --- /dev/null +++ b/librfid/win32/openpcd.c @@ -0,0 +1,389 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define BUILD_DLL +#include "openpcd.h" + +#define LIBMIFARE_MAGIC 0xDEADBEEF + +struct openpcd_state +{ + unsigned int magic; + unsigned int cl_auth; + struct rfid_reader_handle *rh; + struct rfid_layer2_handle *l2h; + struct rfid_protocol_handle *ph; + unsigned char key[MIFARE_CL_KEY_LEN]; + unsigned int uid; +} openpcd_state; + +int openpcd_cl_auth(struct openpcd_state* state ,int page) +{ + int rc; + + if(!state || page<=0 || page>MIFARE_CL_PAGE_MAX ) + return PCDERROR_INVALID_PARAMETER; + + if(!state->ph) + return PCDERROR_CLOSED; + + rc = mfcl_set_key(state->ph, state->key); + if (rc < 0) + return PCDERROR_KEY_FORMAT; + + rc = mfcl_auth(state->ph, state->cl_auth, page); + + return rc<0 ? PCDERROR_KEY_AUTH : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + switch(key_id) + { + case PCDAUTH_KEYID_1A: + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + break; + case PCDAUTH_KEYID_1B: + state->cl_auth=RFID_CMD_MIFARE_AUTH1B; + break; + default: + return PCDERROR_INVALID_PARAMETER; + } + + memcpy(state->key,key,MIFARE_CL_KEY_LEN); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle) +{ + int res; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + state->l2h = rfid_layer2_init(state->rh,RFID_LAYER2_ISO14443A); + if(!state->l2h) + res=PCDERROR_LAYER2_INIT; + else + { + if( rfid_layer2_open(state->l2h)>=0 ) + { + state->ph = rfid_protocol_init(state->l2h,RFID_PROTOCOL_MIFARE_CLASSIC); + + if(state->ph) + { + if(rfid_protocol_open(state->ph)>=0) + return PCDERROR_NONE; + + rfid_protocol_fini(state->ph); + state->ph=NULL; + + res=PCDERROR_LAYER3_OPEN; + } + else + res=PCDERROR_LAYER3_INIT; + + rfid_layer2_close(state->l2h); + } + else + res=PCDERROR_LAYER2_OPEN; + } + + rfid_layer2_fini(state->l2h); + state->l2h=NULL; + + return res; +} + +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + rfid_protocol_close(state->ph); + rfid_protocol_fini(state->ph); + rfid_layer2_close(state->l2h); + rfid_layer2_fini(state->l2h); + + state->ph=NULL; + state->l2h=NULL; + state->uid=0; + + return PCDERROR_NONE; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid) +{ + unsigned int uid_len; + struct openpcd_state *state; + + if(!handle || !uid) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + uid_len=sizeof(*uid); + if(rfid_layer2_getopt(state->l2h,RFID_OPT_LAYER2_UID,uid,&uid_len)) + return PCDERROR_INVALID_PARAMETER; + else + return uid_len==4 ? PCDERROR_NONE:PCDERROR_READ_FAILED; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle) +{ + struct rfid_reader_handle *rh; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if(!rh) + return PCDERROR_NO_READER; + + state=(struct openpcd_state*)malloc(sizeof(*state)); + if(state) + { + memset(state,0,sizeof(*state)); + state->magic=LIBMIFARE_MAGIC; + state->rh=rh; + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + memset(state->key,0xFF,sizeof(state->key)); + + // do initial reset + openpcd_reset_reader((MIFARE_HANDLE)state); + Sleep(1500); + // reopen + state->rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + + *handle=(MIFARE_HANDLE)state; + + return PCDERROR_NONE; + } + else + { + rfid_reader_close(rh); + return PCDERROR_OUT_OF_MEMORY; + } +} + +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + openpcd_deselect_card(handle); + + openpcd_reset_reader(handle); + Sleep(500); + + state->magic=0; + rfid_reader_close(state->rh); + free(state); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len) +{ + int res; + unsigned int count; + unsigned char buf[MIFARE_CL_PAGE_SIZE]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + count = sizeof(buf); + res = rfid_protocol_read(state->ph, page, buf, &count); + if(res>=0) + memcpy(data,buf,len); + + if ( res<0 ) + return PCDERROR_READ_FAILED; + else + return count; +} + +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len) +{ + int res; + unsigned char buf[16]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + memcpy(buf,data,len); + memset(&buf[len],0,sizeof(buf)-len); + + res = rfid_protocol_write(state->ph, page, buf, sizeof(buf)); + + return (res<0 && res!=-101) ? PCDERROR_WRITE_FAILED : len; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_api_version(MIFARE_HANDLE handle, unsigned int *version) +{ + unsigned char b; + struct openpcd_state *state; + + if( !handle || !version ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + b=0; + + if(state->rh->reader->get_api_version(state->rh,&b)<0) + return PCDERROR_READER_VERSION; + else + { + *version=b; + return PCDERROR_NONE; + } +} + +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->reset(state->rh)<0) ? PCDERROR_WRITE_FAILED : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_environment( + MIFARE_HANDLE handle, + unsigned char count, + unsigned char* data + ) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->get_environment(state->rh,count,data)<0) ? PCDERROR_READ_FAILED : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_set_environment( + MIFARE_HANDLE handle, + unsigned char count, + const unsigned char* data) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->set_environment(state->rh,count,data)<0) ? PCDERROR_WRITE_FAILED : PCDERROR_NONE; +} + +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error) +{ + const static char* msg[]={ + "PCDERROR_NONE", // 0 + "PCDERROR_INVALID_PARAMETER", // -1 + "PCDERROR_KEY_FORMAT", // -2 + "PCDERROR_KEY_AUTH", // -3 + "PCDERROR_NO_CARD_FOUND", // -4 + "PCDERROR_LAYER2_INIT", // -5 + "PCDERROR_LAYER2_OPEN", // -6 + "PCDERROR_LAYER3_INIT", // -7 + "PCDERROR_LAYER3_OPEN", // -8 + "PCDERROR_SELECT", // -9 + "PCDERROR_READ_FAILED", // -10 + "PCDERROR_WRITE_FAILED", // -11 + "PCDERROR_CLOSED", // -12 + "PCDERROR_NO_READER", // -13 + "PCDERROR_OUT_OF_MEMORY", // -14 + "PCDERROR_READER_VERSION" // -15 + }; + const int count=sizeof(msg)/sizeof(msg[0]); + + if(error>0) + error=0; + else + error=-error; + + return (error>=count) ? "PCDERROR_UNKNOWN" : (char*)msg[error]; +} diff --git a/librfid/win32/openpcd.def b/librfid/win32/openpcd.def new file mode 100644 index 0000000..2ba78d7 --- /dev/null +++ b/librfid/win32/openpcd.def @@ -0,0 +1,15 @@ +LIBRARY openpcd.dll +EXPORTS + openpcd_open_reader@4 + openpcd_close_reader@4 + openpcd_select_card@4 + openpcd_deselect_card@4 + openpcd_read@16 + openpcd_write@16 + openpcd_get_card_id@8 + openpcd_set_key@12 + openpcd_get_error_text@4 + openpcd_get_api_version@8 + openpcd_get_environment@12 + openpcd_set_environment@12 + openpcd_reset_reader@4 diff --git a/librfid/win32/openpcd.h b/librfid/win32/openpcd.h new file mode 100644 index 0000000..9cedcf2 --- /dev/null +++ b/librfid/win32/openpcd.h @@ -0,0 +1,175 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#ifndef __OPENPCD_H__ +#define __OPENPCD_H__ + +#ifdef __cplusplus +extern "C" { +#endif/*__cplusplus*/ + +#define EXPORT_CONVENTION __stdcall +#ifdef BUILD_DLL +/* DLL export */ +#define EXPORT __declspec(dllexport) +#else +/* EXE import */ +#define EXPORT __declspec(dllimport) +#endif /*BUILD_DLL*/ + +#define PCDERROR_NONE 0 +#define PCDERROR_INVALID_PARAMETER -1 +#define PCDERROR_KEY_FORMAT -2 +#define PCDERROR_KEY_AUTH -3 +#define PCDERROR_NO_CARD_FOUND -4 +#define PCDERROR_LAYER2_INIT -5 +#define PCDERROR_LAYER2_OPEN -6 +#define PCDERROR_LAYER3_INIT -7 +#define PCDERROR_LAYER3_OPEN -8 +#define PCDERROR_SELECT -9 +#define PCDERROR_READ_FAILED -10 +#define PCDERROR_WRITE_FAILED -11 +#define PCDERROR_CLOSED -12 +#define PCDERROR_NO_READER -13 +#define PCDERROR_OUT_OF_MEMORY -14 +#define PCDERROR_READER_VERSION -15 + +#define PCDAUTH_KEY_LENGTH 6 +#define PCDAUTH_KEYID_1A 0 +#define PCDAUTH_KEYID_1B 1 + +typedef void* MIFARE_HANDLE; + +/*************************************************************************/ +/* */ +/* Six steps for reading/writing to MIFARE cards */ +/* */ +/*************************************************************************/ + +/* Step 1. open reader + + supply the address of your handle variable to retrieve a handle + to the current reader. + */ +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle); + +/* Step 2. set MIFARE classic key + + if your key differs from the default Infineon key (6*0xFF), you can + supply a different key here. The key size is PCDAUTH_KEY_LENGTH bytes. + You can chose to set key_id to PCDAUTH_KEYID_1A or *_1B. + */ +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key); + +/* Step 3. select card + + start the anticollosion to select a card in the reader field - retry if + it fails. Currently supports only on card in the readerv field. + */ +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle); + +/* Step 4. read/write card + + read, write from the selected card - specify the page and supply up to + 16 bytes of payload + */ +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len); +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len); + +/* Step 5. deselect card when done + */ +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle); + +/* Step 6. close reader after deselected card + */ +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle); + + +/*************************************************************************/ +/* */ +/* Support functions */ +/* */ +/*************************************************************************/ + +/* openpcd_get_error_text: + + Used for converting the error code into a string + */ +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error); + + +/* openpcd_get_card_id: + + Get the card id of a selected RFID card + */ +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid); + +/* openpcd_get_api_version: + + Get the USB api version of the reader + */ +EXPORT int EXPORT_CONVENTION openpcd_get_api_version(MIFARE_HANDLE handle,unsigned int *version); + +/* openpcd_reset_reader: + + Reset the attached reader + */ +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle); + +/* openpcd_get_environment + + Store the given data to the nonvolatile reader flash + Returns read data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_get_environment( + MIFARE_HANDLE handle, + unsigned char count, + unsigned char* data +); + +/* openpcd_set_environment + + Read data from nonvolatile reader flash + Returns written data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_set_environment( + MIFARE_HANDLE handle, + unsigned char count, + const unsigned char* data +); + +#ifdef __cplusplus +} +#endif/*__cplusplus*/ +#endif/*__OPENPCD_H__*/ diff --git a/librfid/win32/openpcd.lib b/librfid/win32/openpcd.lib new file mode 100644 index 0000000..017d201 Binary files /dev/null and b/librfid/win32/openpcd.lib differ diff --git a/librfid_1999/COPYING b/librfid_1999/COPYING new file mode 100644 index 0000000..60549be --- /dev/null +++ b/librfid_1999/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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) 19yy 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. diff --git a/librfid_1999/LICENSING b/librfid_1999/LICENSING new file mode 100644 index 0000000..d1b0aae --- /dev/null +++ b/librfid_1999/LICENSING @@ -0,0 +1,11 @@ +librfid is licensed under GNU General Public License, Version 2 as published +by the Free Software Foundation (see the file COPYING). + +This means that as soon as you wish to distribute a program that links to +librfid, that other program has to be licensed under the GPL or a compatible +license, too. + +However, an alternative (royalty-based) licensing is possible. If you want to +create a proprietary program based on librfid, contact Harald Welte + for licensing details. + diff --git a/librfid_1999/Makefile.am b/librfid_1999/Makefile.am new file mode 100644 index 0000000..e7d31c6 --- /dev/null +++ b/librfid_1999/Makefile.am @@ -0,0 +1,26 @@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 + +SUBDIRS = etc include src + +DEFAULT_AM_CFLAGS = -std=gnu99 + +if ENABLE_WIN32 +SUBDIRS += win32 +LINKOPTS = -mno-cygwin +AM_CFLAGS = $(DEFAULT_AM_CFLAGS) -mno-cygwin +else +LINKOPTS = -lusb +AM_CFLAGS = $(DEFAULT_AM_CFLAGS) +endif + +if ENABLE_FIRMWARE +AM_CFLAGS += -DLIBRFID_FIRMWARE +else +SUBDIRS += utils +endif + +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch + +$(OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck diff --git a/librfid_1999/Makefile.in b/librfid_1999/Makefile.in new file mode 100644 index 0000000..2ecde2a --- /dev/null +++ b/librfid_1999/Makefile.in @@ -0,0 +1,719 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +@ENABLE_WIN32_TRUE@am__append_1 = win32 +@ENABLE_FIRMWARE_TRUE@am__append_2 = -DLIBRFID_FIRMWARE +@ENABLE_FIRMWARE_FALSE@am__append_3 = utils +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure COPYING TODO \ + compile config.guess config.sub depcomp install-sh ltmain.sh \ + missing +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 config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = etc include src win32 utils +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)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 +SUBDIRS = etc include src $(am__append_1) $(am__append_3) +DEFAULT_AM_CFLAGS = -std=gnu99 +@ENABLE_WIN32_FALSE@LINKOPTS = -lusb +@ENABLE_WIN32_TRUE@LINKOPTS = -mno-cygwin +@ENABLE_WIN32_FALSE@AM_CFLAGS = $(DEFAULT_AM_CFLAGS) $(am__append_2) +@ENABLE_WIN32_TRUE@AM_CFLAGS = $(DEFAULT_AM_CFLAGS) -mno-cygwin \ +@ENABLE_WIN32_TRUE@ $(am__append_2) +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__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: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || 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 $(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-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(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 + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(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.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(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) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__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 \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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 + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +$(OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck + +# 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: diff --git a/librfid_1999/README b/librfid_1999/README new file mode 100644 index 0000000..95f78bf --- /dev/null +++ b/librfid_1999/README @@ -0,0 +1,141 @@ +librfid - low-level RFID access library +(C) 2005-2007 by Harald Welte +====================================================================== + +This library intends to provide a reader- and (as much as possible) +PICC / tag independent API for RFID applications. + +1. Supported Protocols: + +At this early stage of implementation, it offers only ISO 14443-2, ISO 14443-3 +A and B as well as ISO 14443-4 (T=CL) support. Other protocols, both open +(such as ISO 15693) and proprietary are to be added as soon as I find some +more time. + +2. Supported Readers: + +At this time, the Omnikey Cardman 5121/5321 and the OpenPCD readers are supported. + +2.1 Omnikey Cardman 5121/5321 RFID (http://www.omnikey.de/) + +The cm5121 is a relatively stupid piece of hardware. Basically a contact-based +cm3121 that was enhanced by putting a Philips CL RC632 reader ASIC next to it. +There is no RFID protocol implementation on the cm5121, everything is done on +the host (PC) software. Four primitives (read/write byte/fifo) are provided +via simple PC_to_RDR_Escape CCID messages. + +The cm5321 seems to be an improved version of the 5121, mainly with different +antenna geometrics for better communications reliability. + +2.2 OpenPCD (http://www.openpcd.org/) + +The OpenPCD reader is completely free. You get the full schematics, the PCB +design, and the source code to the device firmware (written in C, to be +compiled with the free GNU toolchain). Also, all required development tools +are available under Free Software licenses! + +In addition, it has various headers for access to the intermediate signal +processing steps. + +This makes it the ideal device to learn and play with RFID, since you don't +have any (proprietary) software interfere and puts you in full control of +everything. + +This is now the primary development target for librfid. However, this doesn't +mean that we don't want to support as many readers as possible. + +Another interesting new option is to cross-compile librfid to fit it _inside_ +the OpenPCD firmware, enabling a fully autonomous RFID stack (and RFID +applications) on the reader, without any requirement for a host PC! + +2.3 Philips Pegoda + +This reader is not yet supported. Some initial experiments have shown that +adding support for it is + +2.x Further Readers + +Support for more devices shouldn't be too difficult to add, provided the +devices are stupid enough. More sophisticated readers like Integrated +Engineering or Philips Pegoda do much of the protocol handling in firmware on a +microcontroller. This makes them (at least till now) faster, but also of +limited use, especially in education and research. + +So if you happen to run into any other dumb RFID readers, especially those +based on Philips CL RC622, RC531 and RC632, adding support should be very +straightforward. If you want to contract me for implementing a driver +backend, don't hesitate to contact me. + + +3. Building / Installing + +In the default configuration, librfid only includes the driver for the OpenPCD +dumbreader firmware. + +If you want support for Omnikey Cardman 5121/5321, you have to add +'--enable-reader-cm5x21' to the './configure' command, _and_ choose the backend +you want to use, either: + +3.1 (new) native CCID backend + +If you add the '--enable-ccid' option to the './configure' command, then the new +native CCID driver (courtesy of Werner Koch) will be linked into the library. +This requires a working libusb with development headers. + +In order to use the reader, you will need to set the permissions of the +respective /proc/bus/usb or /sys/bus/usb files (or run the application as +root, if you trust my code, which you shouldn't). + +If you run udev, just use the 'etc/udev/librfid.rules' udev rulefile, which should +change the group of the usb device to 'users'. + +3.2 (old) OpenCT backend + +This backend has the advantage that it will allow you to use the contact-based +part and the contactless part of the CM5121 simultaneously. However, it requires +a patched version of OpenCT. + +A patch against openct-0.6.7 is available as openct-0.6.7-librfid.patch. + +Please note that while librfid in this configuration _uses_ OpenCT as a +lower-layer transport interface, it doesn't actually provide a virtual reader +interface to it, i.e. you can't use CT-API/OpenCT/PCSC API's to access RFID +transponders. + +In order to use this backend, you need to use the +'--enable-openct' option and - if it is not installed in a default +location like /usr or /usr/local - set the environment variables +PATH, LD_LIBRARY_PATH and PKG_CONFIG_PATH so all files are found. + + +4. Testing + +In the 'utils' directory, you will get a 'librfid-tool' binary. It is very +minimalist, and mainly an example on how to use the librfid API. For an ICAO +compliant passport, you may try "--layer2 iso14443a --protocol tcl". For a +mifare ultralight transponder, "--layer2 iso14443a --protocol +mifare-ultralight" will give you a full dump of the transponder. + +The most basic command to get started is "librfid-tool --scan" to make it +auto-detect the first available (and supported) transponder + + +5. Help and Support + +If you run into any problems using librfid, the primary contact address is the +mailinglist of librfid developers at librfid-devel@lists.gnumonks.org. Please +note that while the development community is trying to provide the best level +of support, response times might vary. + +You can subscribe to this list at + https://lists.gnumonks.org/mailman/listinfo/librfid-devel + +If you are interested in commercial grade support of librfid, feel free to +contact me privately to discuss your requirements and provide you with a quote. + +6. Licensing + +Pleas read the file LICENSING. + +-- Harald Welte + diff --git a/librfid_1999/TODO b/librfid_1999/TODO new file mode 100644 index 0000000..649fb96 --- /dev/null +++ b/librfid_1999/TODO @@ -0,0 +1,48 @@ +rc632: +- fix handling of timeout (program timer of RC632) +- add a timeout tolerance factor that can be user-specified +- make sure interrupt mode for timer wait works + +cm5121: +- fix handling of TX or RX > 0x7f [buffer length in atmel chip?] + +iso14443a: +[none] + +iso14443b: +- implement 'option 2' frame markers +- test anticollission (need multiple tags) + +iso15693: +- implement anticollision +- implement all the rest + +mifare_clasic: +- test +- try to auto-detect 1k/4k +- try to distinguish mifare ultralight and mifare classic in/after anticol + +tcl: +- implement pps for asymmetric (rx/tx) speeds + +openct: +- add ifdhandler driver + +other: +- implementation of code for various passive tags +- documentation +- add notion of 'asic implementation' for specifying reader-specific + initialization values such as mod_conductance +- abstract a read single block / read multiple block API where l2/proto + layer can provide multi-block function (e.g. iso15693), which will be + emulated in case there only is a single-block function +- switch over to use of rfid_buf structure, similar to linux skb. upper + layers have sufficient headroom in order to have lower layers add protocol + headers in front of a packet +- implement software checksumming support. The reader should be able to + indicate whether it supports hardware checksum generation / verification. +- application software should be able to override hardware csumming on request +- implement some auto-calibration mode where the user is requested to leave a + single PICC/VICC on the reader and the software iterates through various + mod_conductance and bitphase values to see whether it can calibrate to a given + [new] card. The resulting calibration values are printed by the program. diff --git a/librfid_1999/aclocal.m4 b/librfid_1999/aclocal.m4 new file mode 100644 index 0000000..573dcd9 --- /dev/null +++ b/librfid_1999/aclocal.m4 @@ -0,0 +1,9052 @@ +# generated automatically by aclocal 1.11 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 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. + +# 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. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, +[m4_warning([this file was generated for autoconf 2.63. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/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. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_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${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_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. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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 + ;; +sparc*-*solaris*) + # 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 + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# 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* | msys* | mingw* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_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 <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_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* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin* | msys*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $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 .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_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 +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_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 +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; 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 +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +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" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +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" +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' + ;; + +aix[[4-9]]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + ;; + + *) + 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}${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`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 + +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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[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]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 + +_LT_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 +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_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 + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + 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 + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# ---------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-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_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# 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]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_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_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 -rf 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 + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_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 + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # 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 + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | msys* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_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_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # 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. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` 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 + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_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]].*|aix[[5-9]]*) + 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + 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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_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*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_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}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_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' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$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_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [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]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +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_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will 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 + ;; + + aix[[4-9]]*) + 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]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +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 +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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 + $as_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 + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_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_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_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + 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]].*|aix[[5-9]]*) + 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_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + 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 + : + else + # We have old collect2 + _LT_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_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_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_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_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_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + 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_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_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; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_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' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_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::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_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=`func_echo_all "$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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_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_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_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} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_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_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + 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 +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([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. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +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... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); 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 + + 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${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 "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + 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 + ;; + aix[[4-9]]*) + 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]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_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_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + 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 + ;; + aix[[4-9]]*) + 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]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_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_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# 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. +_LT_TAG_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_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# -------------- +# If we don't have a new enough Autoconf to choose the best dlltool +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# 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. # + +m4_defun([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 +IFS=$as_save_IFS +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_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which path conversion functions should be +# used by func_to_host_path (and, implicitly, by +# func_to_host_pathlist). These are needed for certain +# cross-compile configurations and "native" mingw (which +# is actually an msys->mingw cross). +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build paths to $host format]) +AC_CACHE_VAL(lt_cv_to_host_path_cmd, +[case $host in + *mingw* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_mingw_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_cygwin_to_mingw_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_mingw_path_convert + ;; + esac + ;; + *cygwin* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_cygwin_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_cygwin_path_convert + ;; + esac + ;; + *msys* ) # that is, msys in msysdvlpr mode + case $build in + *mingw* ) # actually msys in normal mode == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *cygwin* ) # unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; +esac +]) +to_host_path_cmd=$lt_cv_to_host_path_cmd +AC_MSG_RESULT([$lt_cv_to_host_path_cmd]) +_LT_DECL([to_host_path_cmd], [lt_cv_to_host_path_cmd], + [0], [convert $build paths to $host format])dnl +AC_SUBST([to_host_path_cmd])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# Generated from ltversion.in. + +# serial 3110 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.7a]) +m4_define([LT_PACKAGE_REVISION], [1.3110]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.7a' +macro_revision='1.3110' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# 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 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# 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, 2006, 2008 +# 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 9 + +# 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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, 2006, 2009 +# 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 10 + +# 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# 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 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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, 2006, 2008, 2009 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 16 + +# 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.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# 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_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 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 +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +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])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 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_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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 6 + +# 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 +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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, 2006 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 for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 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_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], +[m4_foreach_w([_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, 2008 +# 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 5 + +# 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 +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 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_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# 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 + diff --git a/librfid_1999/autogen.sh b/librfid_1999/autogen.sh new file mode 100644 index 0000000..990e162 --- /dev/null +++ b/librfid_1999/autogen.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +run () +{ + echo "running: $*" + eval $* + + if test $? != 0 ; then + echo "error: while running '$*'" + exit 1 + fi +} + +run aclocal +run libtoolize -f +run automake -a +run autoconf diff --git a/librfid_1999/autom4te.cache/output.0 b/librfid_1999/autom4te.cache/output.0 new file mode 100644 index 0000000..7d19841 --- /dev/null +++ b/librfid_1999/autom4te.cache/output.0 @@ -0,0 +1,14078 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.67. +@%:@ +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_ccid +enable_openct +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + @<:@@<:@default=no@:>@@:>@ + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_func +cat >config.log <<_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.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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=librfid + VERSION=0.1.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "@%:@define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4' +macro_revision='1.3294' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if test "${lt_cv_to_host_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if test "${lt_cv_to_tool_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if test "${lt_cv_ar_at_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +@%:@ Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +@%:@ Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test "${lt_cv_path_mainfest_tool+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + + + 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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if test "${lt_cv_prog_compiler_pic+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + 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' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test "${lt_cv_irix_exported_symbol+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then : + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then : + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, libopenct, + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + , + OPENCT_MSG=no + ) + + +fi + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then : + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then : + withval=$with_; +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_close=yes +else + ac_cv_lib_usb_usb_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBUSB 1 +_ACEOF + + LIBS="-lusb $LIBS" + +fi + + if test "x$have_libusb" = "xyes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid_1999/autom4te.cache/output.1 b/librfid_1999/autom4te.cache/output.1 new file mode 100644 index 0000000..9f27bf3 --- /dev/null +++ b/librfid_1999/autom4te.cache/output.1 @@ -0,0 +1,14074 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.67. +@%:@ +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_ccid +enable_openct +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + @<:@@<:@default=no@:>@@:>@ + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} @%:@ ac_fn_c_check_func +cat >config.log <<_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.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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=librfid + VERSION=0.1.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "@%:@define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4' +macro_revision='1.3294' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if test "${lt_cv_to_host_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if test "${lt_cv_to_tool_file_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if test "${lt_cv_ar_at_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +@%:@ Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +@%:@ Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test "${lt_cv_path_mainfest_tool+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + + + 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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if test "${lt_cv_prog_compiler_pic+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if test "${lt_cv_aix_libpath_+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + 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' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test "${lt_cv_irix_exported_symbol+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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 + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then : + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then : + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, libopenct, + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + , + OPENCT_MSG=no + ) + + +fi + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then : + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then : + withval=$with_; +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_close=yes +else + ac_cv_lib_usb_usb_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBUSB 1 +_ACEOF + + LIBS="-lusb $LIBS" + +fi + + if test "x$have_libusb" = "xyes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in @%:@( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# 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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid_1999/autom4te.cache/output.2 b/librfid_1999/autom4te.cache/output.2 new file mode 100644 index 0000000..89c509c --- /dev/null +++ b/librfid_1999/autom4te.cache/output.2 @@ -0,0 +1,14385 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.63. +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } + +( + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + 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=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +( + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +SHELL=${CONFIG_SHELL-/bin/sh} + + +exec 7<&0 &1 + +# 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` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +to_host_path_cmd +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_ccid +enable_openct +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) { $as_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 && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + [default=no] + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +fi +cat >config.log <<_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.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&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_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=`$as_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_arg'" + ;; + 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +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, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +@%:@@%:@ ----------------- @%:@@%:@ +@%:@@%:@ Output variables. @%:@@%:@ +@%:@@%:@ ----------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +@%:@@%:@ ------------------- @%:@@%:@ +@%:@@%:@ File substitutions. @%:@@%:@ +@%:@@%:@ ------------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ confdefs.h. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_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 + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 +$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} + { (exit 1); exit 1; }; };; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 +$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} + { (exit 1); exit 1; }; };; +esac + +# 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". + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_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 + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +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=librfid + VERSION=0.1.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_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 + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&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' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&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 () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +@%:@define const /**/ +_ACEOF + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:$LINENO: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.7a' +macro_revision='1.3110' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:$LINENO: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:$LINENO: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:$LINENO: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:$LINENO: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + $as_echo_n "(cached) " >&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* | msys* | mingw* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to convert $build paths to $host format" >&5 +$as_echo_n "checking how to convert $build paths to $host format... " >&6; } +if test "${lt_cv_to_host_path_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $host in + *mingw* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_mingw_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_cygwin_to_mingw_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_mingw_path_convert + ;; + esac + ;; + *cygwin* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_cygwin_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_cygwin_path_convert + ;; + esac + ;; + *msys* ) # that is, msys in msysdvlpr mode + case $build in + *mingw* ) # actually msys in normal mode == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *cygwin* ) # unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; +esac + +fi + +to_host_path_cmd=$lt_cv_to_host_path_cmd +{ $as_echo "$as_me:$LINENO: result: $lt_cv_to_host_path_cmd" >&5 +$as_echo "$lt_cv_to_host_path_cmd" >&6; } + + + + + +{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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* | msys* ) + # 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', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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=$? + $as_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 <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_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=$? + $as_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 -rf 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 + { $as_echo "$as_me:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --enable-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=$? + $as_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 __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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=$? + $as_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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_cc_needs_belf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_ld_exported_symbols_list=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_ld_exported_symbols_list=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 + $as_echo_n "(cached) " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core 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 +#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)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + 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 + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` 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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 `func_echo_all "$deplibs" | $SED '\''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*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | 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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:$LINENO: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${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}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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 + pic_flag=$lt_prog_compiler_pic + 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + ;; + + *) + 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then + lt_cv_shlibpath_overrides_runpath=yes +fi + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_svld_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_dld_link=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:$LINENO: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:$LINENO: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, libopenct, + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + , + OPENCT_MSG=no + ) + + +fi + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then + withval=$with_; +fi + + + +{ $as_echo "$as_me:$LINENO: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_usb_usb_close=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_usb_usb_close=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBUSB 1 +_ACEOF + + LIBS="-lusb $LIBS" + +fi + + if test "x$have_libusb" = "xyes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $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 || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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_write_fail=1 +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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 + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_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" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_path_cmd='`$ECHO "$lt_cv_to_host_path_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# 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 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$AS + +# DLL creation program. +DLLTOOL=$DLLTOOL + +# Object dumper program. +OBJDUMP=$OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build paths to \$host format. +to_host_path_cmd=$lt_cv_to_host_path_cmd + +# 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 + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid_1999/autom4te.cache/output.3 b/librfid_1999/autom4te.cache/output.3 new file mode 100644 index 0000000..2b1798c --- /dev/null +++ b/librfid_1999/autom4te.cache/output.3 @@ -0,0 +1,14381 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.63. +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } + +( + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + 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=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +( + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +SHELL=${CONFIG_SHELL-/bin/sh} + + +exec 7<&0 &1 + +# 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` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +to_host_path_cmd +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_ccid +enable_openct +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) { $as_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 && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + [default=no] + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +fi +cat >config.log <<_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.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&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_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=`$as_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_arg'" + ;; + 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +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, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +@%:@@%:@ ----------------- @%:@@%:@ +@%:@@%:@ Output variables. @%:@@%:@ +@%:@@%:@ ----------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +@%:@@%:@ ------------------- @%:@@%:@ +@%:@@%:@ File substitutions. @%:@@%:@ +@%:@@%:@ ------------------- @%:@@%:@ +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ confdefs.h. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_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 + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 +$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} + { (exit 1); exit 1; }; };; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 +$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} + { (exit 1); exit 1; }; };; +esac + +# 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". + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_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 + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +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=librfid + VERSION=0.1.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_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 + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&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' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + +cat >>confdefs.h <<\_ACEOF +@%:@define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&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 () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +@%:@define const /**/ +_ACEOF + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:$LINENO: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.7a' +macro_revision='1.3110' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:$LINENO: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:$LINENO: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:$LINENO: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:$LINENO: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --with-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. + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + $as_echo_n "(cached) " >&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* | msys* | mingw* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to convert $build paths to $host format" >&5 +$as_echo_n "checking how to convert $build paths to $host format... " >&6; } +if test "${lt_cv_to_host_path_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $host in + *mingw* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_mingw_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_cygwin_to_mingw_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_mingw_path_convert + ;; + esac + ;; + *cygwin* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_cygwin_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_cygwin_path_convert + ;; + esac + ;; + *msys* ) # that is, msys in msysdvlpr mode + case $build in + *mingw* ) # actually msys in normal mode == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *cygwin* ) # unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; +esac + +fi + +to_host_path_cmd=$lt_cv_to_host_path_cmd +{ $as_echo "$as_me:$LINENO: result: $lt_cv_to_host_path_cmd" >&5 +$as_echo "$lt_cv_to_host_path_cmd" >&6; } + + + + + +{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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* | msys* ) + # 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', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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=$? + $as_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 <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_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=$? + $as_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 -rf 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 + { $as_echo "$as_me:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +@%:@ Check whether --enable-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=$? + $as_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 __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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=$? + $as_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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_cc_needs_belf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_ld_exported_symbols_list=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_ld_exported_symbols_list=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 + $as_echo_n "(cached) " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core 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 +#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)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + @%:@ Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + 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 + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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@&t@ -DPIC" + ;; +esac +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` 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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 `func_echo_all "$deplibs" | $SED '\''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*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | 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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:$LINENO: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${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}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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 + pic_flag=$lt_prog_compiler_pic + 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + ;; + + *) + 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then + lt_cv_shlibpath_overrides_runpath=yes +fi + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_svld_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_dld_link=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:$LINENO: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:$LINENO: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + +@%:@ Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +@%:@ Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, libopenct, + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + , + OPENCT_MSG=no + ) + + +fi + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +@%:@ Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +@%:@ Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +@%:@ Check whether --with- was given. +if test "${with_+set}" = set; then + withval=$with_; +fi + + + +{ $as_echo "$as_me:$LINENO: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_usb_usb_close=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_usb_usb_close=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBUSB 1 +_ACEOF + + LIBS="-lusb $LIBS" + +fi + + if test "x$have_libusb" = "xyes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $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 || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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_write_fail=1 +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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 + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_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" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_path_cmd='`$ECHO "$lt_cv_to_host_path_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# 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 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$AS + +# DLL creation program. +DLLTOOL=$DLLTOOL + +# Object dumper program. +OBJDUMP=$OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build paths to \$host format. +to_host_path_cmd=$lt_cv_to_host_path_cmd + +# 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 + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid_1999/autom4te.cache/requests b/librfid_1999/autom4te.cache/requests new file mode 100644 index 0000000..b377743 --- /dev/null +++ b/librfid_1999/autom4te.cache/requests @@ -0,0 +1,556 @@ +# This file was generated. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/mingw/share/autoconf' + ], + [ + '/mingw/share/autoconf/autoconf/autoconf.m4f', + '/mingw/share/aclocal/argz.m4', + '/mingw/share/aclocal/libtool.m4', + '/mingw/share/aclocal/ltdl.m4', + '/mingw/share/aclocal/ltoptions.m4', + '/mingw/share/aclocal/ltsugar.m4', + '/mingw/share/aclocal/ltversion.m4', + '/mingw/share/aclocal/lt~obsolete.m4', + '/mingw/share/aclocal-1.11/amversion.m4', + '/mingw/share/aclocal-1.11/auxdir.m4', + '/mingw/share/aclocal-1.11/cond.m4', + '/mingw/share/aclocal-1.11/depend.m4', + '/mingw/share/aclocal-1.11/depout.m4', + '/mingw/share/aclocal-1.11/init.m4', + '/mingw/share/aclocal-1.11/install-sh.m4', + '/mingw/share/aclocal-1.11/lead-dot.m4', + '/mingw/share/aclocal-1.11/make.m4', + '/mingw/share/aclocal-1.11/minuso.m4', + '/mingw/share/aclocal-1.11/missing.m4', + '/mingw/share/aclocal-1.11/mkdirp.m4', + '/mingw/share/aclocal-1.11/options.m4', + '/mingw/share/aclocal-1.11/runlog.m4', + '/mingw/share/aclocal-1.11/sanity.m4', + '/mingw/share/aclocal-1.11/silent.m4', + '/mingw/share/aclocal-1.11/strip.m4', + '/mingw/share/aclocal-1.11/substnot.m4', + '/mingw/share/aclocal-1.11/tar.m4', + 'configure.in' + ], + { + 'AC_LIB_LTDL' => 1, + 'AC_LIBTOOL_RC' => 1, + '_LT_PROG_FC' => 1, + 'LT_AC_PROG_RC' => 1, + '_LT_PROG_ECHO_BACKSLASH' => 1, + '_LT_AC_LANG_F77' => 1, + '_LT_AC_LANG_F77_CONFIG' => 1, + 'AC_PATH_MAGIC' => 1, + 'AC_PROG_EGREP' => 1, + '_LT_COMPILER_BOILERPLATE' => 1, + '_LTDL_SETUP' => 1, + 'AM_MAKE_INCLUDE' => 1, + '_LT_AC_LANG_GCJ' => 1, + 'LT_AC_PROG_EGREP' => 1, + 'AC_LIBTOOL_DLOPEN_SELF' => 1, + 'AC_DISABLE_SHARED' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_LTDL_SHLIBEXT' => 1, + 'AC_LIBTOOL_PICMODE' => 1, + 'gl_PREREQ_ARGZ' => 1, + 'LT_OUTPUT' => 1, + 'AC_CHECK_LIBM' => 1, + 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, + '_LT_PROG_F77' => 1, + 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, + 'AC_LIBLTDL_CONVENIENCE' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + '_LT_AC_TRY_DLOPEN_SELF' => 1, + '_LT_AC_CHECK_DLFCN' => 1, + 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, + '_LT_AC_PROG_ECHO_BACKSLASH' => 1, + 'AC_LTDL_SYMBOL_USCORE' => 1, + 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, + 'AC_DEPLIBS_CHECK_METHOD' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AC_PROG_LD' => 1, + '_LT_AC_LANG_GCJ_CONFIG' => 1, + 'AU_DEFUN' => 1, + '_AM_PROG_TAR' => 1, + '_LT_AC_LANG_CXX_CONFIG' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_LT_AC_PROG_CXXCPP' => 1, + 'LTOPTIONS_VERSION' => 1, + 'AM_ENABLE_SHARED' => 1, + 'AC_LIBTOOL_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_CONFIG' => 1, + 'AC_LTDL_PREOPEN' => 1, + 'AM_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_LANG_C_CONFIG' => 1, + 'AC_PROG_LD_GNU' => 1, + 'LTDL_INSTALLABLE' => 1, + 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, + '_LT_LINKER_BOILERPLATE' => 1, + 'LT_WITH_LTDL' => 1, + 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, + 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, + 'LT_SYS_SYMBOL_USCORE' => 1, + 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, + '_LT_AC_LOCK' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'LTSUGAR_VERSION' => 1, + '_AM_IF_OPTION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'LT_SYS_MODULE_PATH' => 1, + '_LT_AC_LANG_CXX' => 1, + 'LT_PROG_RC' => 1, + 'm4_include' => 1, + 'AC_ENABLE_SHARED' => 1, + 'LT_LIB_M' => 1, + 'AC_LIBTOOL_FC' => 1, + 'AC_LIBTOOL_F77' => 1, + 'LTOBSOLETE_VERSION' => 1, + 'm4_pattern_forbid' => 1, + 'AM_MISSING_PROG' => 1, + 'AC_WITH_LTDL' => 1, + 'LT_PATH_LD' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, + '_AC_PROG_LIBTOOL' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_LT_AC_SYS_LIBPATH_AIX' => 1, + '_LT_AC_LANG_C_CONFIG' => 1, + '_LT_AC_SHELL_INIT' => 1, + '_LT_WITH_SYSROOT' => 1, + 'AC_LIBTOOL_DLOPEN' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_LIBTOOL_GCJ' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFUN' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AC_LIBLTDL_INSTALLABLE' => 1, + 'gl_FUNC_ARGZ' => 1, + 'AC_PROG_NM' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_LT_PROG_CXX' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_SANITY_CHECK' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, + 'AC_LTDL_SHLIBPATH' => 1, + 'AC_LTDL_DLSYM_USCORE' => 1, + 'AM_DEP_TRACK' => 1, + '_LT_CC_BASENAME' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_PROG_LD' => 1, + '_LT_LIBOBJ' => 1, + 'AM_MISSING_HAS_RUN' => 1, + '_AM_DEPENDENCIES' => 1, + '_LT_PROG_LTMAIN' => 1, + '_AM_SET_OPTION' => 1, + 'AC_LTDL_DLLIB' => 1, + 'AC_LTDL_ENABLE_INSTALL' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_PROG_CC_C_O' => 1, + 'LT_AC_PROG_SED' => 1, + 'AC_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, + 'LT_SYS_DLOPEN_SELF' => 1, + 'LTVERSION_VERSION' => 1, + 'AM_PROG_MKDIR_P' => 1, + '_LT_REQUIRED_DARWIN_CHECKS' => 1, + 'LT_LANG' => 1, + '_LT_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_SETUP' => 1, + 'LT_CMD_MAX_LEN' => 1, + 'AC_PROG_LD_RELOAD_FLAG' => 1, + 'include' => 1, + 'LTDL_INIT' => 1, + '_LT_PREPARE_SED_QUOTE_VARS' => 1, + 'AM_RUN_LOG' => 1, + 'AM_DISABLE_SHARED' => 1, + '_LT_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_OBJDIR' => 1, + '_LT_AC_LANG_RC_CONFIG' => 1, + 'LT_PATH_NM' => 1, + 'LT_AC_PROG_GCJ' => 1, + '_LT_LINKER_OPTION' => 1, + 'LT_SYS_DLSEARCH_PATH' => 1, + 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, + 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, + 'AC_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_CXX' => 1, + 'AM_ENABLE_STATIC' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'LT_INIT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AC_LIBTOOL_PROG_CC_C_O' => 1, + 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, + 'AC_ENABLE_FAST_INSTALL' => 1, + 'AM_PROG_NM' => 1, + 'LT_SYS_DLOPEN_DEPLIBS' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_LT_AC_TAGVAR' => 1, + 'LT_FUNC_DLSYM_USCORE' => 1, + 'm4_pattern_allow' => 1, + 'LT_LIB_DLLOAD' => 1, + 'LTDL_CONVENIENCE' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_LTDL_OBJDIR' => 1, + 'AC_DISABLE_FAST_INSTALL' => 1, + 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, + '_LT_AC_SYS_COMPILER' => 1, + 'AC_ENABLE_STATIC' => 1, + 'AC_LTDL_SYSSEARCHPATH' => 1, + 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, + 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + 'LT_PROG_GCJ' => 1, + 'AC_LIBTOOL_LINKER_OPTION' => 1, + 'LT_SYS_MODULE_EXT' => 1, + '_AM_SET_OPTIONS' => 1, + 'AC_LIBTOOL_WIN32_DLL' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/mingw/share/autoconf' + ], + [ + '/mingw/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.in' + ], + { + 'AM_PROG_CXX_C_O' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_sinclude' => 1, + 'LT_INIT' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_PROG_FC_C_O' => 1, + 'sinclude' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AC_INIT' => 1, + 'AC_SUBST_TRACE' => 1, + 'AM_CONDITIONAL' => 1, + 'AH_OUTPUT' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + '_AM_COND_IF' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_CANONICAL_HOST' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AM_PROG_F77_C_O' => 1, + 'm4_pattern_allow' => 1, + 'm4_include' => 1, + 'm4_pattern_forbid' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_SILENT_RULES' => 1, + '_AM_COND_ELSE' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_FC_SRCEXT' => 1, + 'include' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_SUBST' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_AUTOMAKE_VERSION' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '2', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + '/usr/share/aclocal/argz.m4', + '/usr/share/aclocal/libtool.m4', + '/usr/share/aclocal/ltdl.m4', + '/usr/share/aclocal/ltoptions.m4', + '/usr/share/aclocal/ltsugar.m4', + '/usr/share/aclocal/ltversion.m4', + '/usr/share/aclocal/lt~obsolete.m4', + '/usr/share/aclocal-1.11/amversion.m4', + '/usr/share/aclocal-1.11/auxdir.m4', + '/usr/share/aclocal-1.11/cond.m4', + '/usr/share/aclocal-1.11/depend.m4', + '/usr/share/aclocal-1.11/depout.m4', + '/usr/share/aclocal-1.11/init.m4', + '/usr/share/aclocal-1.11/install-sh.m4', + '/usr/share/aclocal-1.11/lead-dot.m4', + '/usr/share/aclocal-1.11/make.m4', + '/usr/share/aclocal-1.11/minuso.m4', + '/usr/share/aclocal-1.11/missing.m4', + '/usr/share/aclocal-1.11/mkdirp.m4', + '/usr/share/aclocal-1.11/options.m4', + '/usr/share/aclocal-1.11/runlog.m4', + '/usr/share/aclocal-1.11/sanity.m4', + '/usr/share/aclocal-1.11/silent.m4', + '/usr/share/aclocal-1.11/strip.m4', + '/usr/share/aclocal-1.11/substnot.m4', + '/usr/share/aclocal-1.11/tar.m4', + 'configure.in' + ], + { + 'AC_LIB_LTDL' => 1, + 'AC_LIBTOOL_RC' => 1, + '_LT_PROG_FC' => 1, + 'LT_AC_PROG_RC' => 1, + '_LT_PROG_ECHO_BACKSLASH' => 1, + '_LT_AC_LANG_F77' => 1, + '_LT_AC_LANG_F77_CONFIG' => 1, + 'AC_PATH_MAGIC' => 1, + 'AC_PROG_EGREP' => 1, + '_LT_COMPILER_BOILERPLATE' => 1, + '_LTDL_SETUP' => 1, + 'AM_MAKE_INCLUDE' => 1, + '_LT_AC_LANG_GCJ' => 1, + 'LT_AC_PROG_EGREP' => 1, + 'AC_LIBTOOL_DLOPEN_SELF' => 1, + 'AC_DISABLE_SHARED' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_LTDL_SHLIBEXT' => 1, + 'AC_LIBTOOL_PICMODE' => 1, + 'gl_PREREQ_ARGZ' => 1, + 'LT_OUTPUT' => 1, + 'AC_CHECK_LIBM' => 1, + 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, + '_LT_PROG_F77' => 1, + 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, + 'AC_LIBLTDL_CONVENIENCE' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + '_LT_AC_TRY_DLOPEN_SELF' => 1, + '_LT_AC_CHECK_DLFCN' => 1, + 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, + '_LT_AC_PROG_ECHO_BACKSLASH' => 1, + 'AC_LTDL_SYMBOL_USCORE' => 1, + 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, + 'AC_DEPLIBS_CHECK_METHOD' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AC_PROG_LD' => 1, + '_LT_AC_LANG_GCJ_CONFIG' => 1, + 'AU_DEFUN' => 1, + '_AM_PROG_TAR' => 1, + '_LT_AC_LANG_CXX_CONFIG' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_LT_AC_PROG_CXXCPP' => 1, + 'LTOPTIONS_VERSION' => 1, + 'AM_ENABLE_SHARED' => 1, + 'AC_LIBTOOL_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_CONFIG' => 1, + 'AC_LTDL_PREOPEN' => 1, + 'AM_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_LANG_C_CONFIG' => 1, + 'AC_PROG_LD_GNU' => 1, + 'LTDL_INSTALLABLE' => 1, + 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, + '_LT_LINKER_BOILERPLATE' => 1, + 'LT_WITH_LTDL' => 1, + 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, + 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, + 'LT_SYS_SYMBOL_USCORE' => 1, + 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, + '_LT_AC_LOCK' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'LTSUGAR_VERSION' => 1, + '_AM_IF_OPTION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'LT_SYS_MODULE_PATH' => 1, + '_LT_AC_LANG_CXX' => 1, + 'LT_PROG_RC' => 1, + 'm4_include' => 1, + 'AC_ENABLE_SHARED' => 1, + 'LT_LIB_M' => 1, + 'AC_LIBTOOL_FC' => 1, + 'AC_LIBTOOL_F77' => 1, + 'LTOBSOLETE_VERSION' => 1, + 'm4_pattern_forbid' => 1, + 'AM_MISSING_PROG' => 1, + 'AC_WITH_LTDL' => 1, + 'LT_PATH_LD' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, + '_AC_PROG_LIBTOOL' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_LT_AC_SYS_LIBPATH_AIX' => 1, + '_LT_AC_LANG_C_CONFIG' => 1, + '_LT_AC_SHELL_INIT' => 1, + 'AC_LIBTOOL_DLOPEN' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_LIBTOOL_GCJ' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFUN' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AC_LIBLTDL_INSTALLABLE' => 1, + 'gl_FUNC_ARGZ' => 1, + 'AC_PROG_NM' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_LT_PROG_CXX' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_SANITY_CHECK' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, + 'AC_LTDL_SHLIBPATH' => 1, + 'AC_LTDL_DLSYM_USCORE' => 1, + 'AM_DEP_TRACK' => 1, + '_LT_CC_BASENAME' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_PROG_LD' => 1, + '_LT_LIBOBJ' => 1, + 'AM_MISSING_HAS_RUN' => 1, + '_AM_DEPENDENCIES' => 1, + '_LT_PROG_LTMAIN' => 1, + '_AM_SET_OPTION' => 1, + 'AC_LTDL_DLLIB' => 1, + 'AC_LTDL_ENABLE_INSTALL' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_PROG_CC_C_O' => 1, + 'LT_AC_PROG_SED' => 1, + 'AC_DISABLE_STATIC' => 1, + 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, + 'LT_SYS_DLOPEN_SELF' => 1, + 'LTVERSION_VERSION' => 1, + 'AM_PROG_MKDIR_P' => 1, + '_LT_REQUIRED_DARWIN_CHECKS' => 1, + 'LT_LANG' => 1, + '_LT_COMPILER_OPTION' => 1, + 'AC_LIBTOOL_SETUP' => 1, + 'LT_CMD_MAX_LEN' => 1, + 'AC_PROG_LD_RELOAD_FLAG' => 1, + 'include' => 1, + 'LTDL_INIT' => 1, + '_LT_PREPARE_SED_QUOTE_VARS' => 1, + 'AM_RUN_LOG' => 1, + 'AM_DISABLE_SHARED' => 1, + '_LT_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_OBJDIR' => 1, + '_LT_AC_LANG_RC_CONFIG' => 1, + 'LT_PATH_NM' => 1, + 'LT_AC_PROG_GCJ' => 1, + '_LT_LINKER_OPTION' => 1, + 'LT_SYS_DLSEARCH_PATH' => 1, + 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, + 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, + 'AC_PATH_TOOL_PREFIX' => 1, + 'AC_LIBTOOL_CXX' => 1, + 'AM_ENABLE_STATIC' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'LT_INIT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AC_LIBTOOL_PROG_CC_C_O' => 1, + 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, + 'AC_ENABLE_FAST_INSTALL' => 1, + 'AM_PROG_NM' => 1, + 'LT_SYS_DLOPEN_DEPLIBS' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_LT_AC_TAGVAR' => 1, + 'LT_FUNC_DLSYM_USCORE' => 1, + 'm4_pattern_allow' => 1, + 'LT_LIB_DLLOAD' => 1, + 'LTDL_CONVENIENCE' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_LTDL_OBJDIR' => 1, + 'AC_DISABLE_FAST_INSTALL' => 1, + 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, + '_LT_AC_SYS_COMPILER' => 1, + 'AC_ENABLE_STATIC' => 1, + 'AC_LTDL_SYSSEARCHPATH' => 1, + 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, + 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, + 'LT_PROG_GCJ' => 1, + 'AC_LIBTOOL_LINKER_OPTION' => 1, + 'LT_SYS_MODULE_EXT' => 1, + '_AM_SET_OPTIONS' => 1, + 'AC_LIBTOOL_WIN32_DLL' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '3', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.in' + ], + { + 'AM_PROG_CXX_C_O' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_sinclude' => 1, + 'LT_INIT' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_PROG_FC_C_O' => 1, + 'sinclude' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AC_INIT' => 1, + 'AC_SUBST_TRACE' => 1, + 'AM_CONDITIONAL' => 1, + 'AH_OUTPUT' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + '_AM_COND_IF' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_CANONICAL_HOST' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AM_PROG_F77_C_O' => 1, + 'm4_pattern_allow' => 1, + 'm4_include' => 1, + 'm4_pattern_forbid' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_SILENT_RULES' => 1, + '_AM_COND_ELSE' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_FC_SRCEXT' => 1, + 'include' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_SUBST' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_AUTOMAKE_VERSION' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/librfid_1999/autom4te.cache/traces.0 b/librfid_1999/autom4te.cache/traces.0 new file mode 100644 index 0000000..194de51 --- /dev/null +++ b/librfid_1999/autom4te.cache/traces.0 @@ -0,0 +1,2461 @@ +m4trace:/mingw/share/aclocal/argz.m4:12: -1- AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ + +AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.]) + AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h + does not typedef error_t.])], + [#if defined(HAVE_ARGZ_H) +# include +#endif]) + +ARGZ_H= +AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ + argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) + +dnl if have system argz functions, allow forced use of +dnl libltdl-supplied implementation (and default to do so +dnl on "known bad" systems). Could use a runtime check, but +dnl (a) detecting malloc issues is notoriously unreliable +dnl (b) only known system that declares argz functions, +dnl provides them, yet they are broken, is cygwin +dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) +dnl So, it's more straightforward simply to special case +dnl this for known bad systems. +AS_IF([test -z "$ARGZ_H"], + [AC_CACHE_CHECK( + [if argz actually works], + [lt_cv_sys_argz_works], + [[case $host_os in #( + *cygwin*) + lt_cv_sys_argz_works=no + if test "$cross_compiling" != no; then + lt_cv_sys_argz_works="guessing no" + else + lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' + save_IFS=$IFS + IFS=-. + set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` + IFS=$save_IFS + lt_os_major=${2-0} + lt_os_minor=${3-0} + lt_os_micro=${4-0} + if test "$lt_os_major" -gt 1 \ + || { test "$lt_os_major" -eq 1 \ + && { test "$lt_os_minor" -gt 5 \ + || { test "$lt_os_minor" -eq 5 \ + && test "$lt_os_micro" -gt 24; }; }; }; then + lt_cv_sys_argz_works=yes + fi + fi + ;; #( + *) lt_cv_sys_argz_works=yes ;; + esac]]) + AS_IF([test "$lt_cv_sys_argz_works" = yes], + [AC_DEFINE([HAVE_WORKING_ARGZ], 1, + [This value is set to 1 to indicate that the system argz facility works])], + [ARGZ_H=argz.h + AC_LIBOBJ([argz])])]) + +AC_SUBST([ARGZ_H]) +]) +m4trace:/mingw/share/aclocal/argz.m4:79: -1- AC_DEFUN([gl_PREREQ_ARGZ], [:]) +m4trace:/mingw/share/aclocal/libtool.m4:69: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:107: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:107: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:108: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:108: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:607: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +]) +m4trace:/mingw/share/aclocal/libtool.m4:788: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) +m4trace:/mingw/share/aclocal/libtool.m4:799: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:861: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +m4trace:/mingw/share/aclocal/libtool.m4:861: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. +You should run autoupdate.])dnl +LT_LANG(C++)]) +m4trace:/mingw/share/aclocal/libtool.m4:862: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +m4trace:/mingw/share/aclocal/libtool.m4:862: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran 77)]) +m4trace:/mingw/share/aclocal/libtool.m4:863: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +m4trace:/mingw/share/aclocal/libtool.m4:863: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran)]) +m4trace:/mingw/share/aclocal/libtool.m4:864: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +m4trace:/mingw/share/aclocal/libtool.m4:864: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Java)]) +m4trace:/mingw/share/aclocal/libtool.m4:865: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +m4trace:/mingw/share/aclocal/libtool.m4:865: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Windows Resource)]) +m4trace:/mingw/share/aclocal/libtool.m4:1181: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) +m4trace:/mingw/share/aclocal/libtool.m4:1445: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +]) +m4trace:/mingw/share/aclocal/libtool.m4:1487: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1487: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1496: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +]) +m4trace:/mingw/share/aclocal/libtool.m4:1531: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1531: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1538: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +# 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* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:1671: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1671: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1782: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_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* | cegcc*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:1899: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:1899: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2871: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 + +_LT_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 +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:2933: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2933: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:2956: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 | 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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:3430: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3430: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3431: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3431: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3501: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) +]) +m4trace:/mingw/share/aclocal/libtool.m4:3520: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:3520: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7478: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) +m4trace:/mingw/share/aclocal/libtool.m4:7487: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7487: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7494: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) +]) +m4trace:/mingw/share/aclocal/libtool.m4:7499: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7499: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7619: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/mingw/share/aclocal/libtool.m4:7619: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) +_$0($*) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:68: -1- AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/mingw/share/aclocal/ltdl.m4:81: -1- AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/mingw/share/aclocal/ltdl.m4:81: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_CONVENIENCE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/mingw/share/aclocal/ltdl.m4:124: -1- AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/mingw/share/aclocal/ltdl.m4:137: -1- AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/mingw/share/aclocal/ltdl.m4:137: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_INSTALLABLE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/mingw/share/aclocal/ltdl.m4:213: -1- AC_DEFUN([_LT_LIBOBJ], [ + m4_pattern_allow([^_LT_LIBOBJS$]) + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" +]) +m4trace:/mingw/share/aclocal/ltdl.m4:226: -1- AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +dnl We need to keep our own list of libobjs separate from our parent project, +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while +dnl we look for our own LIBOBJs. +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) +m4_pushdef([AC_LIBSOURCES]) + +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: +m4_if(_LTDL_MODE, [], + [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) + +AC_ARG_WITH([included_ltdl], + [AS_HELP_STRING([--with-included-ltdl], + [use the GNU ltdl sources included here])]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_DECL([lt_dlinterface_register], + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], + [with_included_ltdl=no], + [with_included_ltdl=yes])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT + #include ])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT] + ) +fi + +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE +dnl was called yet, then for old times' sake, we assume libltdl is in an +dnl eponymous directory: +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) + +AC_ARG_WITH([ltdl_include], + [AS_HELP_STRING([--with-ltdl-include=DIR], + [use the ltdl headers installed in DIR])]) + +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) + fi +else + with_ltdl_include=no +fi + +AC_ARG_WITH([ltdl_lib], + [AS_HELP_STRING([--with-ltdl-lib=DIR], + [use the libltdl.la installed in DIR])]) + +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) + fi +else + with_ltdl_lib=no +fi + +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + m4_case(m4_default(_LTDL_TYPE, [convenience]), + [convenience], [_LTDL_CONVENIENCE], + [installable], [_LTDL_INSTALLABLE], + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL="-I$with_ltdl_include" + ;; +esac +INCLTDL="$LTDLINCL" + +# Report our decision... +AC_MSG_CHECKING([where to find libltdl headers]) +AC_MSG_RESULT([$LTDLINCL]) +AC_MSG_CHECKING([where to find libltdl library]) +AC_MSG_RESULT([$LIBLTDL]) + +_LTDL_SETUP + +dnl restore autoconf definition. +m4_popdef([AC_LIBOBJ]) +m4_popdef([AC_LIBSOURCES]) + +AC_CONFIG_COMMANDS_PRE([ + _ltdl_libobjs= + _ltdl_ltlibobjs= + if test -n "$_LT_LIBOBJS"; then + # Remove the extension. + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" + done + fi + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) +]) + +# Only expand once: +m4_define([LTDL_INIT]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:352: -1- AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:352: -1- AC_DEFUN([AC_LIB_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIB_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:353: -1- AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:353: -1- AC_DEFUN([AC_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:354: -1- AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:354: -1- AC_DEFUN([LT_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `LT_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/mingw/share/aclocal/ltdl.m4:367: -1- AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl +AC_REQUIRE([LT_LIB_DLLOAD])dnl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl +AC_REQUIRE([gl_FUNC_ARGZ])dnl + +m4_require([_LT_CHECK_OBJDIR])dnl +m4_require([_LT_HEADER_DLFCN])dnl +m4_require([_LT_CHECK_DLPREOPEN])dnl +m4_require([_LT_DECL_SED])dnl + +dnl Don't require this, or it will be expanded earlier than the code +dnl that sets the variables it relies on: +_LT_ENABLE_INSTALL + +dnl _LTDL_MODE specific code must be called at least once: +_LTDL_MODE_DISPATCH + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +AC_CONFIG_COMMANDS_PRE([dnl +m4_pattern_allow([^LT_CONFIG_H$])dnl +m4_ifset([AH_HEADER], + [LT_CONFIG_H=AH_HEADER], + [m4_ifset([AC_LIST_HEADERS], + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], + [])])]) +AC_SUBST([LT_CONFIG_H]) + +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], + [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) + +m4_pattern_allow([LT_LIBEXT])dnl +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) + +name= +eval "lt_libprefix=\"$libname_spec\"" +m4_pattern_allow([LT_LIBPREFIX])dnl +AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) + +name=ltdl +eval "LTDLOPEN=\"$libname_spec\"" +AC_SUBST([LTDLOPEN]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:443: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [lt_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say `no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$lt_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:542: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:542: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:549: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which extension is used for runtime loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_MODULE_EXT])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for runtime loadable modules, say, ".so".]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:565: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:565: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:572: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which variable specifies run-time module search path], + [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) +if test -n "$lt_cv_module_path_var"; then + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], + [Define to the name of the environment variable that determines the run-time module search path.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:584: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:584: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:591: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([for the default library search path], + [lt_cv_sys_dlsearch_path], + [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path="$dir" + else + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" + fi + done + m4_pattern_allow([LT_DLSEARCH_PATH])dnl + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], + [Define to the system default library search path.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:612: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:612: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:638: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) +LT_DLLOADERS= +AC_SUBST([LT_DLLOADERS]) + +AC_LANG_PUSH([C]) + +LIBADD_DLOPEN= +AC_SEARCH_LIBS([dlopen], [dl], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + if test "$ac_cv_search_dlopen" != "none required" ; then + LIBADD_DLOPEN="-ldl" + fi + libltdl_cv_lib_dl_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H +# include +#endif + ]], [[dlopen(0, 0);]])], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_SUBST([LIBADD_DLOPEN]) + +LIBADD_SHL_LOAD= +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD="-ldld"])]) +AC_SUBST([LIBADD_SHL_LOAD]) + +case $host_os in +darwin[[1567]].*) +# We only want this for pre-Mac OS X 10.4. + AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | mingw* | os2* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac + +AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) +AC_SUBST([LIBADD_DLD_LINK]) + +m4_pattern_allow([^LT_DLPREOPEN$]) +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + AC_DEFINE([HAVE_LIBDLLOADER], [1], + [Define if libdlloader will be built on this platform]) +fi +AC_SUBST([LT_DLPREOPEN]) + +dnl This isn't used anymore, but set it for backwards compatibility +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" +AC_SUBST([LIBADD_DL]) + +AC_LANG_POP +]) +m4trace:/mingw/share/aclocal/ltdl.m4:731: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:731: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:739: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [lt_cv_sys_symbol_underscore], + [lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + AC_SUBST([sys_symbol_underscore]) +]) +m4trace:/mingw/share/aclocal/ltdl.m4:776: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:776: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:783: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +if test x"$lt_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + _LT_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +]) +m4trace:/mingw/share/aclocal/ltdl.m4:808: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltdl.m4:808: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/mingw/share/aclocal/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +m4trace:/mingw/share/aclocal/ltoptions.m4:111: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:111: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:146: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:146: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:195: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:199: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:203: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:203: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:204: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:204: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_SHARED($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:249: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:253: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:257: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:257: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:258: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:258: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_STATIC($@)]) +m4trace:/mingw/share/aclocal/ltoptions.m4:303: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:303: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:310: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:310: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:343: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltoptions.m4:343: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/mingw/share/aclocal/ltsugar.m4:13: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) +m4trace:/mingw/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' +macro_revision='1.3294' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:36: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:40: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:44: -1- AC_DEFUN([_LT_AC_TAGVAR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:45: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_PREOPEN]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:47: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_LOCK]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:49: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:50: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:51: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LTDL_OBJDIR]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:57: -1- AC_DEFUN([AC_PATH_MAGIC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PROG_LD_GNU]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:60: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:61: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:66: -1- AC_DEFUN([LT_AC_PROG_EGREP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:71: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:72: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:73: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:74: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:77: -1- AC_DEFUN([_LT_AC_LANG_CXX]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_F77]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:93: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:96: -1- AC_DEFUN([_LT_PROG_F77]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_FC]) +m4trace:/mingw/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_CXX]) +m4trace:/mingw/share/aclocal-1.11/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/mingw/share/aclocal-1.11/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/mingw/share/aclocal-1.11/auxdir.m4:47: -1- 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` +]) +m4trace:/mingw/share/aclocal-1.11/cond.m4:15: -1- 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:28: -1- 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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]) +]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/mingw/share/aclocal-1.11/depend.m4:171: -1- 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) +m4trace:/mingw/share/aclocal-1.11/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 +} +]) +m4trace:/mingw/share/aclocal-1.11/depout.m4:75: -1- 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"]) +]) +m4trace:/mingw/share/aclocal-1.11/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/mingw/share/aclocal-1.11/init.m4:126: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/mingw/share/aclocal-1.11/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/mingw/share/aclocal-1.11/lead-dot.m4:12: -1- 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])]) +m4trace:/mingw/share/aclocal-1.11/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/mingw/share/aclocal-1.11/minuso.m4:14: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) +m4trace:/mingw/share/aclocal-1.11/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/mingw/share/aclocal-1.11/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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 +]) +m4trace:/mingw/share/aclocal-1.11/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/mingw/share/aclocal-1.11/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/mingw/share/aclocal-1.11/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/mingw/share/aclocal-1.11/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/mingw/share/aclocal-1.11/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/mingw/share/aclocal-1.11/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/mingw/share/aclocal-1.11/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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)]) +m4trace:/mingw/share/aclocal-1.11/silent.m4:14: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/mingw/share/aclocal-1.11/strip.m4:17: -1- 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/mingw/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/mingw/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/mingw/share/aclocal-1.11/tar.m4:24: -1- 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]) +]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:1858: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.1.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11.1]) +m4trace:configure.in:5: -1- _AM_AUTOCONF_VERSION([2.67]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AM_SANITY_CHECK +m4trace:configure.in:5: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.in:5: -1- AM_MISSING_HAS_RUN +m4trace:configure.in:5: -1- AM_AUX_DIR_EXPAND +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_SH +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AM_PROG_MKDIR_P +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AM_SET_LEADING_DOT +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.in:5: -1- _AM_PROG_TAR([v7]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AMTAR], [tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:5: -1- _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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([silent-rules]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.in:7: -1- AM_SET_DEPDIR +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:7: -1- AM_MAKE_INCLUDE +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_DEP_TRACK +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:11: -1- AC_LIBTOOL_WIN32_DLL +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [/mingw/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [/mingw/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- AM_PROG_LIBTOOL +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [/mingw/share/aclocal/libtool.m4:108: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- LTOPTIONS_VERSION +m4trace:configure.in:12: -1- LTSUGAR_VERSION +m4trace:configure.in:12: -1- LTVERSION_VERSION +m4trace:configure.in:12: -1- LTOBSOLETE_VERSION +m4trace:configure.in:12: -1- _LT_PROG_LTMAIN +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- _LT_PREPARE_SED_QUOTE_VARS +m4trace:configure.in:12: -1- _LT_PROG_ECHO_BACKSLASH +m4trace:configure.in:12: -1- LT_PATH_LD +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_PROG_EGREP +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- LT_PATH_NM +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- LT_CMD_MAX_LEN +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_AR$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- _LT_WITH_SYSROOT +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; + esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) +m4trace:configure.in:12: -1- m4_pattern_allow([^MANIFEST_TOOL$]) +m4trace:configure.in:12: -1- _LT_REQUIRED_DARWIN_CHECKS +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) +m4trace:configure.in:12: -1- LT_SYS_DLOPEN_SELF +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:30: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:34: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:34: the top level]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:47: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:49: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:54: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:55: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:64: -1- m4_pattern_allow([^HAVE_LIBUSB$]) +m4trace:configure.in:65: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "x$have_libusb" = "xyes"]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:68: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:68: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:68: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:68: -1- _LT_PROG_LTMAIN diff --git a/librfid_1999/autom4te.cache/traces.1 b/librfid_1999/autom4te.cache/traces.1 new file mode 100644 index 0000000..aa0f5dc --- /dev/null +++ b/librfid_1999/autom4te.cache/traces.1 @@ -0,0 +1,616 @@ +m4trace:configure.in:3: -1- AC_INIT +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- AC_SUBST([SHELL]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.in:3: -1- AC_SUBST([DEFS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- AC_SUBST([LIBS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- AC_SUBST([build_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([host_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([target_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- AC_CANONICAL_SYSTEM +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:1858: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- AC_CANONICAL_TARGET +m4trace:configure.in:4: -1- AC_CANONICAL_HOST +m4trace:configure.in:4: -1- AC_CANONICAL_BUILD +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.in:4: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([build_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([host_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- AC_SUBST([target], [$ac_cv_target]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- AC_SUBST([target_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([target_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([target_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.1.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11.1]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- AC_SUBST([PACKAGE], [librfid]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AC_SUBST([VERSION], [0.1.0]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.in:5: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AC_SUBST([install_sh]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AC_SUBST([STRIP]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- AC_SUBST([AWK]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- AC_SUBST([AMTAR]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- AC_SUBST([am__tar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- AC_SUBST([am__untar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LIBS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AC_SUBST([am__include]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- AC_SUBST([am__quote]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:8: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */ +@%:@undef NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.in:9: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:9: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +@%:@undef const]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [aclocal.m4:7980: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- AC_SUBST([AS]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([AS]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [aclocal.m4:7980: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [aclocal.m4:129: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) +m4trace:configure.in:12: -1- AC_SUBST([LIBTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIBTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([SED]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([EGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([FGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([FGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([LD]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([NM]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NM]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- AC_SUBST([LN_S], [$as_ln_s]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LN_S]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([AR]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- AC_SUBST([ac_ct_AR]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([ac_ct_AR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_AR$]) +m4trace:configure.in:12: -1- AC_SUBST([STRIP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- AC_SUBST([RANLIB]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +@%:@undef LT_OBJDIR]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- AC_SUBST([MANIFEST_TOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([MANIFEST_TOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^MANIFEST_TOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([DSYMUTIL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DSYMUTIL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- AC_SUBST([NMEDIT]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NMEDIT]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- AC_SUBST([LIPO]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIPO]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL64]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL64]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_DLFCN_H]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:12: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MEMORY_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H]) +m4trace:configure.in:12: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) +m4trace:configure.in:13: -1- AC_SUBST([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- AC_SUBST_TRACE([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- AC_SUBST([BUILDENV]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([BUILDENV]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:30: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:30: -1- AC_SUBST([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:30: -1- AC_SUBST([ENABLE_CCID_FALSE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([ENABLE_CCID_FALSE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:34: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/mingw/src/autoconf/26/autoconf-2.67/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:34: the top level]) +m4trace:configure.in:46: -1- AC_SUBST([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- AC_SUBST_TRACE([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:47: -1- AC_SUBST([OPENCT_LIBS]) +m4trace:configure.in:47: -1- AC_SUBST_TRACE([OPENCT_LIBS]) +m4trace:configure.in:47: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:49: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:49: -1- AC_SUBST([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- AC_SUBST_TRACE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:49: -1- AC_SUBST([HAVE_OPENCT_FALSE]) +m4trace:configure.in:49: -1- AC_SUBST_TRACE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:54: -1- AC_SUBST([FIRMWARE_PATH]) +m4trace:configure.in:54: -1- AC_SUBST_TRACE([FIRMWARE_PATH]) +m4trace:configure.in:54: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:55: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:55: -1- AC_SUBST([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:55: -1- AC_SUBST([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:55: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:60: -1- AC_SUBST([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:60: -1- AC_SUBST([ENABLE_STATIC_FALSE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:64: -1- AH_OUTPUT([HAVE_LIBUSB], [/* Define to 1 if you have the `usb\' library (-lusb). */ +@%:@undef HAVE_LIBUSB]) +m4trace:configure.in:64: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBUSB]) +m4trace:configure.in:64: -1- m4_pattern_allow([^HAVE_LIBUSB$]) +m4trace:configure.in:65: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "x$have_libusb" = "xyes"]) +m4trace:configure.in:65: -1- AC_SUBST([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:65: -1- AC_SUBST([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:68: -1- AC_CONFIG_FILES([Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile]) +m4trace:configure.in:68: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:68: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:68: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:68: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:68: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:68: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:68: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) diff --git a/librfid_1999/autom4te.cache/traces.2 b/librfid_1999/autom4te.cache/traces.2 new file mode 100644 index 0000000..666cb79 --- /dev/null +++ b/librfid_1999/autom4te.cache/traces.2 @@ -0,0 +1,2422 @@ +m4trace:/usr/share/aclocal/argz.m4:76: -1- AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ + +AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.]) + AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h + does not typedef error_t.])], + [#if defined(HAVE_ARGZ_H) +# include +#endif]) + +ARGZ_H= +AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ + argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) + +dnl if have system argz functions, allow forced use of +dnl libltdl-supplied implementation (and default to do so +dnl on "known bad" systems). Could use a runtime check, but +dnl (a) detecting malloc issues is notoriously unreliable +dnl (b) only known system that declares argz functions, +dnl provides them, yet they are broken, is cygwin +dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) +dnl So, it's more straightforward simply to special case +dnl this for known bad systems. +AS_IF([test -z "$ARGZ_H"], + [AC_CACHE_CHECK( + [if argz actually works], + [lt_cv_sys_argz_works], + [[case $host_os in #( + *cygwin* | *msys*) + lt_cv_sys_argz_works=no + if test "$cross_compiling" != no; then + lt_cv_sys_argz_works="guessing no" + else + lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' + save_IFS=$IFS + IFS=-. + set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` + IFS=$save_IFS + lt_os_major=${2-0} + lt_os_minor=${3-0} + lt_os_micro=${4-0} + if test "$lt_os_major" -gt 1 \ + || { test "$lt_os_major" -eq 1 \ + && { test "$lt_os_minor" -gt 5 \ + || { test "$lt_os_minor" -eq 5 \ + && test "$lt_os_micro" -gt 24; }; }; }; then + lt_cv_sys_argz_works=yes + fi + fi + ;; #( + *) lt_cv_sys_argz_works=yes ;; + esac]]) + AS_IF([test $lt_cv_sys_argz_works = yes], + [AC_DEFINE([HAVE_WORKING_ARGZ], 1, + [This value is set to 1 to indicate that the system argz facility works])], + [ARGZ_H=argz.h + AC_LIBOBJ([argz])])]) + +AC_SUBST([ARGZ_H]) +]) +m4trace:/usr/share/aclocal/argz.m4:79: -1- AC_DEFUN([gl_PREREQ_ARGZ], [:]) +m4trace:/usr/share/aclocal/libtool.m4:102: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +]) +m4trace:/usr/share/aclocal/libtool.m4:105: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:105: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:106: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:106: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:689: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +]) +m4trace:/usr/share/aclocal/libtool.m4:788: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) +m4trace:/usr/share/aclocal/libtool.m4:811: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +]) +m4trace:/usr/share/aclocal/libtool.m4:861: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +m4trace:/usr/share/aclocal/libtool.m4:861: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. +You should run autoupdate.])dnl +LT_LANG(C++)]) +m4trace:/usr/share/aclocal/libtool.m4:862: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +m4trace:/usr/share/aclocal/libtool.m4:862: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran 77)]) +m4trace:/usr/share/aclocal/libtool.m4:863: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +m4trace:/usr/share/aclocal/libtool.m4:863: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Fortran)]) +m4trace:/usr/share/aclocal/libtool.m4:864: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +m4trace:/usr/share/aclocal/libtool.m4:864: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Java)]) +m4trace:/usr/share/aclocal/libtool.m4:865: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +m4trace:/usr/share/aclocal/libtool.m4:865: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. +You should run autoupdate.])dnl +LT_LANG(Windows Resource)]) +m4trace:/usr/share/aclocal/libtool.m4:1378: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$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}\{0,1\} :&$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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +]) +m4trace:/usr/share/aclocal/libtool.m4:1381: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1381: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1422: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +]) +m4trace:/usr/share/aclocal/libtool.m4:1425: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1425: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1562: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +# 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* | msys* | mingw* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + 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 +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +]) +m4trace:/usr/share/aclocal/libtool.m4:1565: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1565: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1780: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_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* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin* | msys*) + 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="-ldld"], + [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="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + wl=$lt_prog_compiler_wl 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_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +]) +m4trace:/usr/share/aclocal/libtool.m4:1783: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1783: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2748: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 + +_LT_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 +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +]) +m4trace:/usr/share/aclocal/libtool.m4:2751: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2751: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2860: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_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])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 variants of GNU ld 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 | 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" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +]) +m4trace:/usr/share/aclocal/libtool.m4:3218: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3218: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3219: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3219: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3283: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-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_SUBST([LIBM]) +]) +m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7005: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) +m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7017: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) +]) +m4trace:/usr/share/aclocal/libtool.m4:7020: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7020: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7141: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7141: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:19: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) +_$0($*) +]) +m4trace:/usr/share/aclocal/ltdl.m4:77: -1- AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/usr/share/aclocal/ltdl.m4:83: -1- AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/usr/share/aclocal/ltdl.m4:83: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_CONVENIENCE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) +m4trace:/usr/share/aclocal/ltdl.m4:133: -1- AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +]) +m4trace:/usr/share/aclocal/ltdl.m4:139: -1- AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/usr/share/aclocal/ltdl.m4:139: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_INSTALLABLE' is obsolete. +You should run autoupdate.])dnl +_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) +m4trace:/usr/share/aclocal/ltdl.m4:216: -1- AC_DEFUN([_LT_LIBOBJ], [ + m4_pattern_allow([^_LT_LIBOBJS$]) + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" +]) +m4trace:/usr/share/aclocal/ltdl.m4:349: -1- AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +dnl We need to keep our own list of libobjs separate from our parent project, +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while +dnl we look for our own LIBOBJs. +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) +m4_pushdef([AC_LIBSOURCES]) + +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: +m4_if(_LTDL_MODE, [], + [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) + +AC_ARG_WITH([included_ltdl], + [AS_HELP_STRING([--with-included-ltdl], + [use the GNU ltdl sources included here])]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_DECL([lt_dlinterface_register], + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], + [with_included_ltdl=no], + [with_included_ltdl=yes])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT + #include ])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT] + ) +fi + +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE +dnl was called yet, then for old times' sake, we assume libltdl is in an +dnl eponymous directory: +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) + +AC_ARG_WITH([ltdl_include], + [AS_HELP_STRING([--with-ltdl-include=DIR], + [use the ltdl headers installed in DIR])]) + +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) + fi +else + with_ltdl_include=no +fi + +AC_ARG_WITH([ltdl_lib], + [AS_HELP_STRING([--with-ltdl-lib=DIR], + [use the libltdl.la installed in DIR])]) + +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) + fi +else + with_ltdl_lib=no +fi + +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + m4_case(m4_default(_LTDL_TYPE, [convenience]), + [convenience], [_LTDL_CONVENIENCE], + [installable], [_LTDL_INSTALLABLE], + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL="-I$with_ltdl_include" + ;; +esac +INCLTDL="$LTDLINCL" + +# Report our decision... +AC_MSG_CHECKING([where to find libltdl headers]) +AC_MSG_RESULT([$LTDLINCL]) +AC_MSG_CHECKING([where to find libltdl library]) +AC_MSG_RESULT([$LIBLTDL]) + +_LTDL_SETUP + +dnl restore autoconf definition. +m4_popdef([AC_LIBOBJ]) +m4_popdef([AC_LIBSOURCES]) + +AC_CONFIG_COMMANDS_PRE([ + _ltdl_libobjs= + _ltdl_ltlibobjs= + if test -n "$_LT_LIBOBJS"; then + # Remove the extension. + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" + done + fi + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) +]) + +# Only expand once: +m4_define([LTDL_INIT]) +]) +m4trace:/usr/share/aclocal/ltdl.m4:352: -1- AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:352: -1- AC_DEFUN([AC_LIB_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIB_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:353: -1- AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:353: -1- AC_DEFUN([AC_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:354: -1- AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:354: -1- AC_DEFUN([LT_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `LT_WITH_LTDL' is obsolete. +You should run autoupdate.])dnl +LTDL_INIT($@)]) +m4trace:/usr/share/aclocal/ltdl.m4:416: -1- AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl +AC_REQUIRE([LT_LIB_DLLOAD])dnl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl +AC_REQUIRE([gl_FUNC_ARGZ])dnl + +m4_require([_LT_CHECK_OBJDIR])dnl +m4_require([_LT_HEADER_DLFCN])dnl +m4_require([_LT_CHECK_DLPREOPEN])dnl +m4_require([_LT_DECL_SED])dnl + +dnl Don't require this, or it will be expanded earlier than the code +dnl that sets the variables it relies on: +_LT_ENABLE_INSTALL + +dnl _LTDL_MODE specific code must be called at least once: +_LTDL_MODE_DISPATCH + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +AC_CONFIG_COMMANDS_PRE([dnl +m4_pattern_allow([^LT_CONFIG_H$])dnl +m4_ifset([AH_HEADER], + [LT_CONFIG_H=AH_HEADER], + [m4_ifset([AC_LIST_HEADERS], + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], + [])])]) +AC_SUBST([LT_CONFIG_H]) + +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], + [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) + +m4_pattern_allow([LT_LIBEXT])dnl +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) + +name=ltdl +LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` +AC_SUBST([LTDLOPEN]) +]) +m4trace:/usr/share/aclocal/ltdl.m4:534: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [lt_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say `no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$lt_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +]) +m4trace:/usr/share/aclocal/ltdl.m4:537: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:537: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:557: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which extension is used for runtime loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_MODULE_EXT])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for runtime loadable modules, say, ".so".]) +fi +]) +m4trace:/usr/share/aclocal/ltdl.m4:560: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:560: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:576: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([which variable specifies run-time module search path], + [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) +if test -n "$lt_cv_module_path_var"; then + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], + [Define to the name of the environment variable that determines the run-time module search path.]) +fi +]) +m4trace:/usr/share/aclocal/ltdl.m4:579: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:579: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:604: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([for the default library search path], + [lt_cv_sys_dlsearch_path], + [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path="$dir" + else + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" + fi + done + m4_pattern_allow([LT_DLSEARCH_PATH])dnl + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], + [Define to the system default library search path.]) +fi +]) +m4trace:/usr/share/aclocal/ltdl.m4:607: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:607: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:723: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) +LT_DLLOADERS= +AC_SUBST([LT_DLLOADERS]) + +AC_LANG_PUSH([C]) + +LIBADD_DLOPEN= +AC_SEARCH_LIBS([dlopen], [dl], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + if test "$ac_cv_search_dlopen" != "none required" ; then + LIBADD_DLOPEN="-ldl" + fi + libltdl_cv_lib_dl_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H +# include +#endif + ]], [[dlopen(0, 0);]])], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_SUBST([LIBADD_DLOPEN]) + +LIBADD_SHL_LOAD= +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD="-ldld"])]) +AC_SUBST([LIBADD_SHL_LOAD]) + +case $host_os in +darwin[[1567]].*) +# We only want this for pre-Mac OS X 10.4. + AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | msys* | mingw* | os2* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac + +AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) +AC_SUBST([LIBADD_DLD_LINK]) + +m4_pattern_allow([^LT_DLPREOPEN$]) +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + AC_DEFINE([HAVE_LIBDLLOADER], [1], + [Define if libdlloader will be built on this platform]) +fi +AC_SUBST([LT_DLPREOPEN]) + +dnl This isn't used anymore, but set it for backwards compatibility +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" +AC_SUBST([LIBADD_DL]) + +AC_LANG_POP +]) +m4trace:/usr/share/aclocal/ltdl.m4:726: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:726: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:768: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [lt_cv_sys_symbol_underscore], + [lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + AC_SUBST([sys_symbol_underscore]) +]) +m4trace:/usr/share/aclocal/ltdl.m4:771: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:771: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:800: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +if test x"$lt_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + _LT_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +]) +m4trace:/usr/share/aclocal/ltdl.m4:803: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:803: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. +You should run autoupdate.])dnl +m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltoptions.m4:13: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +m4trace:/usr/share/aclocal/ltoptions.m4:115: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:115: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:151: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:151: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:196: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:200: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:202: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:202: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:250: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:254: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:256: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:256: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_ENABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. +You should run autoupdate.])dnl +AC_DISABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:307: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:307: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:314: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:314: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:347: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltoptions.m4:347: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. +You should run autoupdate.])dnl +_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) +m4trace:/usr/share/aclocal/ltsugar.m4:13: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) +m4trace:/usr/share/aclocal/ltversion.m4:23: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.7a' +macro_revision='1.3110' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:36: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:40: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:44: -1- AC_DEFUN([_LT_AC_TAGVAR]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:45: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_PREOPEN]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:47: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_LOCK]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:49: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:50: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:51: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LTDL_OBJDIR]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:57: -1- AC_DEFUN([AC_PATH_MAGIC]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PROG_LD_GNU]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:60: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:61: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:66: -1- AC_DEFUN([LT_AC_PROG_EGREP]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:71: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:72: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:73: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:74: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:77: -1- AC_DEFUN([_LT_AC_LANG_CXX]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_F77]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:93: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:96: -1- AC_DEFUN([_LT_PROG_F77]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_FC]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_CXX]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:37: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.11/auxdir.m4:52: -1- 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` +]) +m4trace:/usr/share/aclocal-1.11/cond.m4:35: -1- 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) +m4trace:/usr/share/aclocal-1.11/depend.m4:156: -1- 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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]) +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:166: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:182: -1- 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:65: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 +} +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:79: -1- 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"]) +]) +m4trace:/usr/share/aclocal-1.11/init.m4:110: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/usr/share/aclocal-1.11/init.m4:138: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.11/install-sh.m4:21: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/usr/share/aclocal-1.11/lead-dot.m4:21: -1- 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])]) +m4trace:/usr/share/aclocal-1.11/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/usr/share/aclocal-1.11/minuso.m4:35: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) +m4trace:/usr/share/aclocal-1.11/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.11/missing.m4:42: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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 +]) +m4trace:/usr/share/aclocal-1.11/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/usr/share/aclocal-1.11/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.11/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/usr/share/aclocal-1.11/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.11/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.11/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.11/sanity.m4:64: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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)]) +m4trace:/usr/share/aclocal-1.11/silent.m4:27: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/strip.m4:28: -1- 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.11/tar.m4:95: -1- 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]) +]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/usr/src/autoconf/autoconf-2.63/lib/autoconf/general.m4:1819: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.1.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11]) +m4trace:configure.in:5: -1- _AM_AUTOCONF_VERSION([2.63]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AM_SANITY_CHECK +m4trace:configure.in:5: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.in:5: -1- AM_MISSING_HAS_RUN +m4trace:configure.in:5: -1- AM_AUX_DIR_EXPAND +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_SH +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AM_PROG_MKDIR_P +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AM_SET_LEADING_DOT +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.in:5: -1- _AM_PROG_TAR([v7]) +m4trace:configure.in:5: -1- AM_MISSING_PROG([AMTAR], [tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:5: -1- _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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.in:5: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.in:5: -2- _AM_MANGLE_OPTION([silent-rules]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.in:7: -1- AM_SET_DEPDIR +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:7: -1- AM_MAKE_INCLUDE +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_DEP_TRACK +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:11: -1- AC_LIBTOOL_WIN32_DLL +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [/usr/share/aclocal/ltoptions.m4:151: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [/usr/share/aclocal/ltoptions.m4:151: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- AM_PROG_LIBTOOL +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [/usr/share/aclocal/libtool.m4:106: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- LTOPTIONS_VERSION +m4trace:configure.in:12: -1- LTSUGAR_VERSION +m4trace:configure.in:12: -1- LTVERSION_VERSION +m4trace:configure.in:12: -1- LTOBSOLETE_VERSION +m4trace:configure.in:12: -1- _LT_PROG_LTMAIN +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- _LT_PREPARE_SED_QUOTE_VARS +m4trace:configure.in:12: -1- _LT_PROG_ECHO_BACKSLASH +m4trace:configure.in:12: -1- LT_PATH_LD +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_PROG_EGREP +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- LT_PATH_NM +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- LT_CMD_MAX_LEN +m4trace:configure.in:12: -1- m4_pattern_allow([^to_host_path_cmd$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) +m4trace:configure.in:12: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; + esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) +m4trace:configure.in:12: -1- _LT_REQUIRED_DARWIN_CHECKS +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) +m4trace:configure.in:12: -1- LT_SYS_DLOPEN_SELF +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:30: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:34: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/usr/src/autoconf/autoconf-2.63/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:34: the top level]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:47: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:49: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:54: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:55: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:64: -1- m4_pattern_allow([^HAVE_LIBUSB$]) +m4trace:configure.in:65: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "x$have_libusb" = "xyes"]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:68: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:68: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:68: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:68: -1- _LT_PROG_LTMAIN diff --git a/librfid_1999/autom4te.cache/traces.3 b/librfid_1999/autom4te.cache/traces.3 new file mode 100644 index 0000000..f838dad --- /dev/null +++ b/librfid_1999/autom4te.cache/traces.3 @@ -0,0 +1,604 @@ +m4trace:configure.in:3: -1- AC_INIT +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:3: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:3: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:3: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:3: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:3: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:3: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +#undef PACKAGE_NAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +#undef PACKAGE_VERSION]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- AC_SUBST([DEFS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:3: -1- AC_SUBST([LIBS]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:3: -1- AC_SUBST([build_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([host_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:3: -1- AC_SUBST([target_alias]) +m4trace:configure.in:3: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:4: -1- AC_CANONICAL_SYSTEM +m4trace:configure.in:4: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete. +You should run autoupdate.], [/usr/src/autoconf/autoconf-2.63/lib/autoconf/general.m4:1819: AC_CANONICAL_SYSTEM is expanded from... +configure.in:4: the top level]) +m4trace:configure.in:4: -1- AC_CANONICAL_TARGET +m4trace:configure.in:4: -1- AC_CANONICAL_HOST +m4trace:configure.in:4: -1- AC_CANONICAL_BUILD +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.in:4: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.in:4: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build$]) +m4trace:configure.in:4: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([build_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.in:4: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host$]) +m4trace:configure.in:4: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([host_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.in:4: -1- AC_SUBST([target], [$ac_cv_target]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target$]) +m4trace:configure.in:4: -1- AC_SUBST([target_cpu], [$[1]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_cpu]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_cpu$]) +m4trace:configure.in:4: -1- AC_SUBST([target_vendor], [$[2]]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_vendor]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_vendor$]) +m4trace:configure.in:4: -1- AC_SUBST([target_os]) +m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_os]) +m4trace:configure.in:4: -1- m4_pattern_allow([^target_os$]) +m4trace:configure.in:5: -1- AM_INIT_AUTOMAKE([librfid], [0.1.0]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:5: -1- AM_AUTOMAKE_VERSION([1.11]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:5: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:5: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:5: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.in:5: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:5: -1- AC_SUBST([PACKAGE], [librfid]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AC_SUBST([VERSION], [0.1.0]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +#undef PACKAGE]) +m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.in:5: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:5: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +#undef VERSION]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.in:5: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.in:5: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:5: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:5: -1- AC_SUBST([install_sh]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.in:5: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:5: -1- AC_SUBST([STRIP]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:5: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:5: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:5: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:5: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:5: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:5: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.in:5: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:5: -1- AC_SUBST([AWK]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:5: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.in:5: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:5: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:5: -1- AC_SUBST([AMTAR]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.in:5: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:5: -1- AC_SUBST([am__tar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:5: -1- AC_SUBST([am__untar]) +m4trace:configure.in:5: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.in:5: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([LIBS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:7: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:7: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.in:7: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.in:7: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.in:7: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:7: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.in:7: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:7: -1- AC_SUBST([am__include]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:7: -1- AC_SUBST([am__quote]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:7: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:7: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:7: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.in:7: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:7: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:8: -1- AM_PROG_CC_C_O +m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.in:8: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O]) +m4trace:configure.in:8: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.in:9: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.in:9: -1- m4_pattern_allow([^const$]) +m4trace:configure.in:9: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +#undef const]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.], [aclocal.m4:7625: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:11: -1- AC_SUBST([AS]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([AS]) +m4trace:configure.in:11: -1- m4_pattern_allow([^AS$]) +m4trace:configure.in:11: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:11: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:11: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:11: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:11: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:11: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.], [aclocal.m4:7625: AC_LIBTOOL_WIN32_DLL is expanded from... +configure.in:11: the top level]) +m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [aclocal.m4:127: AM_PROG_LIBTOOL is expanded from... +configure.in:12: the top level]) +m4trace:configure.in:12: -1- LT_INIT +m4trace:configure.in:12: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.in:12: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.in:12: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) +m4trace:configure.in:12: -1- AC_SUBST([LIBTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIBTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([SED]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.in:12: -1- m4_pattern_allow([^SED$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([EGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([FGREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([FGREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.in:12: -1- AC_SUBST([GREP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.in:12: -1- AC_SUBST([LD]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.in:12: -1- AC_SUBST([NM]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NM]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NM$]) +m4trace:configure.in:12: -1- AC_SUBST([LN_S], [$as_ln_s]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LN_S]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.in:12: -1- AC_SUBST([to_host_path_cmd]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([to_host_path_cmd]) +m4trace:configure.in:12: -1- m4_pattern_allow([^to_host_path_cmd$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([OBJDUMP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OBJDUMP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OBJDUMP$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([DLLTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DLLTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DLLTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([AR]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:12: -1- AC_SUBST([STRIP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:12: -1- AC_SUBST([RANLIB]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.in:12: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:12: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.in:12: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR]) +m4trace:configure.in:12: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.in:12: -1- AC_SUBST([DSYMUTIL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([DSYMUTIL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.in:12: -1- AC_SUBST([NMEDIT]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([NMEDIT]) +m4trace:configure.in:12: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.in:12: -1- AC_SUBST([LIPO]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([LIPO]) +m4trace:configure.in:12: -1- m4_pattern_allow([^LIPO$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL$]) +m4trace:configure.in:12: -1- AC_SUBST([OTOOL64]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([OTOOL64]) +m4trace:configure.in:12: -1- m4_pattern_allow([^OTOOL64$]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.in:12: -1- AC_SUBST([CPP]) +m4trace:configure.in:12: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.in:12: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.in:12: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.in:12: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.in:12: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H]) +m4trace:configure.in:12: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H]) +m4trace:configure.in:13: -1- AC_SUBST([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- AC_SUBST_TRACE([LIBTOOL_DEPS]) +m4trace:configure.in:13: -1- m4_pattern_allow([^LIBTOOL_DEPS$]) +m4trace:configure.in:22: -1- AC_SUBST([BUILDENV]) +m4trace:configure.in:22: -1- AC_SUBST_TRACE([BUILDENV]) +m4trace:configure.in:22: -1- m4_pattern_allow([^BUILDENV$]) +m4trace:configure.in:23: -1- AM_CONDITIONAL([ENABLE_WIN32], [test "$BUILDENV" == "WIN32"]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_TRUE$]) +m4trace:configure.in:23: -1- AC_SUBST([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- AC_SUBST_TRACE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:23: -1- m4_pattern_allow([^ENABLE_WIN32_FALSE$]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_TRUE]) +m4trace:configure.in:23: -1- _AM_SUBST_NOTMAKE([ENABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AM_CONDITIONAL([DISABLE_WIN32], [test "$BUILDENV" != "WIN32"]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_TRUE$]) +m4trace:configure.in:24: -1- AC_SUBST([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- AC_SUBST_TRACE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:24: -1- m4_pattern_allow([^DISABLE_WIN32_FALSE$]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_TRUE]) +m4trace:configure.in:24: -1- _AM_SUBST_NOTMAKE([DISABLE_WIN32_FALSE]) +m4trace:configure.in:30: -1- AM_CONDITIONAL([ENABLE_CCID], [test "$MY_CCID" == "1"]) +m4trace:configure.in:30: -1- AC_SUBST([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_TRUE$]) +m4trace:configure.in:30: -1- AC_SUBST([ENABLE_CCID_FALSE]) +m4trace:configure.in:30: -1- AC_SUBST_TRACE([ENABLE_CCID_FALSE]) +m4trace:configure.in:30: -1- m4_pattern_allow([^ENABLE_CCID_FALSE$]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_TRUE]) +m4trace:configure.in:30: -1- _AM_SUBST_NOTMAKE([ENABLE_CCID_FALSE]) +m4trace:configure.in:34: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +You should run autoupdate.], [/usr/src/autoconf/autoconf-2.63/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... +configure.in:34: the top level]) +m4trace:configure.in:46: -1- AC_SUBST([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- AC_SUBST_TRACE([OPENCT_CFLAGS]) +m4trace:configure.in:46: -1- m4_pattern_allow([^OPENCT_CFLAGS$]) +m4trace:configure.in:47: -1- AC_SUBST([OPENCT_LIBS]) +m4trace:configure.in:47: -1- AC_SUBST_TRACE([OPENCT_LIBS]) +m4trace:configure.in:47: -1- m4_pattern_allow([^OPENCT_LIBS$]) +m4trace:configure.in:49: -1- AM_CONDITIONAL([HAVE_OPENCT], [test "x$OPENCT_MSG" = "xyes"]) +m4trace:configure.in:49: -1- AC_SUBST([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- AC_SUBST_TRACE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_TRUE$]) +m4trace:configure.in:49: -1- AC_SUBST([HAVE_OPENCT_FALSE]) +m4trace:configure.in:49: -1- AC_SUBST_TRACE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:49: -1- m4_pattern_allow([^HAVE_OPENCT_FALSE$]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_TRUE]) +m4trace:configure.in:49: -1- _AM_SUBST_NOTMAKE([HAVE_OPENCT_FALSE]) +m4trace:configure.in:54: -1- AC_SUBST([FIRMWARE_PATH]) +m4trace:configure.in:54: -1- AC_SUBST_TRACE([FIRMWARE_PATH]) +m4trace:configure.in:54: -1- m4_pattern_allow([^FIRMWARE_PATH$]) +m4trace:configure.in:55: -1- AM_CONDITIONAL([ENABLE_FIRMWARE], [test "$FIRMWARE_PATH" != ""]) +m4trace:configure.in:55: -1- AC_SUBST([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_TRUE$]) +m4trace:configure.in:55: -1- AC_SUBST([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:55: -1- AC_SUBST_TRACE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:55: -1- m4_pattern_allow([^ENABLE_FIRMWARE_FALSE$]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_TRUE]) +m4trace:configure.in:55: -1- _AM_SUBST_NOTMAKE([ENABLE_FIRMWARE_FALSE]) +m4trace:configure.in:60: -1- AM_CONDITIONAL([ENABLE_STATIC], [test "$ENABLE_STATIC" == "1"]) +m4trace:configure.in:60: -1- AC_SUBST([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_TRUE$]) +m4trace:configure.in:60: -1- AC_SUBST([ENABLE_STATIC_FALSE]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ENABLE_STATIC_FALSE$]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_TRUE]) +m4trace:configure.in:60: -1- _AM_SUBST_NOTMAKE([ENABLE_STATIC_FALSE]) +m4trace:configure.in:64: -1- AH_OUTPUT([HAVE_LIBUSB], [/* Define to 1 if you have the `usb\' library (-lusb). */ +#undef HAVE_LIBUSB]) +m4trace:configure.in:64: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBUSB]) +m4trace:configure.in:64: -1- m4_pattern_allow([^HAVE_LIBUSB$]) +m4trace:configure.in:65: -1- AM_CONDITIONAL([HAVE_LIBUSB], [test "x$have_libusb" = "xyes"]) +m4trace:configure.in:65: -1- AC_SUBST([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_TRUE$]) +m4trace:configure.in:65: -1- AC_SUBST([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:65: -1- m4_pattern_allow([^HAVE_LIBUSB_FALSE$]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_TRUE]) +m4trace:configure.in:65: -1- _AM_SUBST_NOTMAKE([HAVE_LIBUSB_FALSE]) +m4trace:configure.in:68: -1- AC_CONFIG_FILES([Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile]) +m4trace:configure.in:68: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.in:68: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:68: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.in:68: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:68: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.in:68: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.in:68: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.in:68: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.in:68: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:68: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) diff --git a/librfid_1999/compile b/librfid_1999/compile new file mode 100644 index 0000000..c0096a7 --- /dev/null +++ b/librfid_1999/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid_1999/config.guess b/librfid_1999/config.guess new file mode 100644 index 0000000..dc84c68 --- /dev/null +++ b/librfid_1999/config.guess @@ -0,0 +1,1501 @@ +#! /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, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# 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 (context +# diff format) to and include a 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. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +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, 2006, 2007, 2008 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 "$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 ; set_cc_for_build= ;' + +# 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 + +# 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 ;; + sh5el) machine=sh5le-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 -q __ELF__ + 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 ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-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 ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-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:*:[456]) + 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 + 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 -q __LP64__ + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *: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 ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-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*:*:* | x86_64: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 ;; + 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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.[02]*:*) + 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 i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-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; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) + 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 ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + 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 ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-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 + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + 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 ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + 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: diff --git a/librfid_1999/config.log b/librfid_1999/config.log new file mode 100644 index 0000000..5ca3112 --- /dev/null +++ b/librfid_1999/config.log @@ -0,0 +1,642 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = BlubbFish +uname -m = i686 +uname -r = 1.0.11(0.46/3/2) +uname -s = MINGW32_NT-6.1 +uname -v = 2009-07-11 17:46 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /usr/local/bin +PATH: /mingw/bin +PATH: /bin +PATH: /c/Program Files/PC Connectivity Solution/ +PATH: /c/Program Files/ATI Stream/bin/x86 +PATH: /e/Programme/MikTeX/miktex/bin +PATH: /c/Windows/system32 +PATH: /c/Windows +PATH: /c/Windows/System32/Wbem +PATH: /c/Windows/System32/WindowsPowerShell/v1.0/ +PATH: /e/Programme/SVN/bin/ +PATH: /c/Program Files/ATI Stream/Tools/Stream KernelAnalyzer 1.5/ +PATH: /c/VXIPNP/WinNT/Bin +PATH: /e/Programme/JAF +PATH: /mingw/libexec/arm/bin +PATH: /e/Programme/hacker/Nmap +PATH: /c/Program Files/OpenVPN/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1950: checking build system type +configure:1968: result: i686-pc-mingw32 +configure:1990: checking host system type +configure:2005: result: i686-pc-mingw32 +configure:2027: checking target system type +configure:2042: result: i686-pc-mingw32 +configure:2086: checking for a BSD-compatible install +configure:2154: result: /bin/install -c +configure:2165: checking whether build environment is sane +configure:2225: result: yes +configure:2366: checking for a thread-safe mkdir -p +configure:2405: result: /bin/mkdir -p +configure:2418: checking for gawk +configure:2434: found /bin/gawk +configure:2445: result: gawk +configure:2456: checking whether make sets $(MAKE) +configure:2478: result: yes +configure:2609: checking for gcc +configure:2625: found /mingw/bin/gcc +configure:2636: result: gcc +configure:2868: checking for C compiler version +configure:2876: gcc --version >&5 +gcc.exe (GCC) 3.4.5 (mingw-vista special r3) +Copyright (C) 2004 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. + +configure:2880: $? = 0 +configure:2887: gcc -v >&5 +Reading specs from E:/Programme/Mingw/bin/../lib/gcc/mingw32/3.4.5/specs +Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug +Thread model: win32 +gcc version 3.4.5 (mingw-vista special r3) +configure:2891: $? = 0 +configure:2898: gcc -V >&5 +gcc.exe: `-V' option must have argument +configure:2902: $? = 1 +configure:2925: checking for C compiler default output file name +configure:2947: gcc conftest.c >&5 +configure:2951: $? = 0 +configure:2989: result: a.exe +configure:3008: checking whether the C compiler works +configure:3018: ./a.exe +configure:3022: $? = 0 +configure:3041: result: yes +configure:3048: checking whether we are cross compiling +configure:3050: result: no +configure:3053: checking for suffix of executables +configure:3060: gcc -o conftest.exe conftest.c >&5 +configure:3064: $? = 0 +configure:3090: result: .exe +configure:3096: checking for suffix of object files +configure:3122: gcc -c conftest.c >&5 +configure:3126: $? = 0 +configure:3151: result: o +configure:3155: checking whether we are using the GNU C compiler +configure:3184: gcc -c conftest.c >&5 +configure:3191: $? = 0 +configure:3208: result: yes +configure:3217: checking whether gcc accepts -g +configure:3247: gcc -c -g conftest.c >&5 +configure:3254: $? = 0 +configure:3355: result: yes +configure:3372: checking for gcc option to accept ISO C89 +configure:3446: gcc -c -g -O2 conftest.c >&5 +configure:3453: $? = 0 +configure:3476: result: none needed +configure:3505: checking for style of include used by make +configure:3533: result: GNU +configure:3558: checking dependency style of gcc +configure:3668: result: gcc3 +configure:3684: checking whether gcc and cc understand -c and -o together +configure:3719: gcc -c conftest.c -o conftest2.o >&5 +configure:3723: $? = 0 +configure:3729: gcc -c conftest.c -o conftest2.o >&5 +configure:3733: $? = 0 +configure:3744: cc -c conftest.c >&5 +./configure: line 3746: cc: command not found +configure:3748: $? = 127 +configure:3788: result: yes +configure:3816: checking for an ANSI C-conforming const +configure:3891: gcc -c -g -O2 conftest.c >&5 +configure:3898: $? = 0 +configure:3913: result: yes +configure:3971: checking for as +configure:3987: found /mingw/bin/as +configure:3998: result: as +configure:4063: checking for dlltool +configure:4079: found /mingw/bin/dlltool +configure:4090: result: dlltool +configure:4155: checking for objdump +configure:4171: found /mingw/bin/objdump +configure:4182: result: objdump +configure:4229: WARNING: Libtool does not cope well with whitespace in `pwd` +configure:4273: checking how to print strings +configure:4300: result: printf +configure:4321: checking for a sed that does not truncate output +configure:4387: result: /bin/sed +configure:4405: checking for grep that handles long lines and -e +configure:4465: result: /bin/grep +configure:4470: checking for egrep +configure:4534: result: /bin/grep -E +configure:4539: checking for fgrep +configure:4603: result: /bin/grep -F +configure:4638: checking for ld used by gcc +configure:4705: result: E:/Programme/Mingw/mingw32/bin/ld.exe +configure:4714: checking if the linker (E:/Programme/Mingw/mingw32/bin/ld.exe) is GNU ld +configure:4729: result: yes +configure:4741: checking for BSD- or MS-compatible name lister (nm) +configure:4790: result: /mingw/bin/nm +configure:4920: checking the name lister (/mingw/bin/nm) interface +configure:4927: gcc -c -g -O2 conftest.c >&5 +configure:4930: /mingw/bin/nm "conftest.o" +configure:4933: output +00000000 b .bss +00000000 d .data +00000000 N .stab +00000000 N .stabstr +00000000 t .text +00000000 B _some_variable +configure:4940: result: BSD nm +configure:4943: checking whether ln -s works +configure:4947: result: yes +configure:4955: checking the maximum length of command line arguments +configure:5080: result: 8192 +configure:5097: checking whether the shell understands some XSI constructs +configure:5107: result: yes +configure:5111: checking whether the shell understands "+=" +configure:5117: result: yes +configure:5152: checking how to convert i686-pc-mingw32 paths to i686-pc-mingw32 format +configure:5214: result: func_msys_to_mingw_path_convert +configure:5221: checking for E:/Programme/Mingw/mingw32/bin/ld.exe option to reload object files +configure:5228: result: -r +configure:5297: checking for objdump +configure:5324: result: objdump +configure:5353: checking how to recognize dependent libraries +configure:5549: result: file_magic ^x86 archive import|^x86 DLL +configure:5609: checking for dlltool +configure:5636: result: dlltool +configure:5666: checking how to associate runtime and link libraries +configure:5693: result: func_cygming_dll_for_implib_fallback +configure:5747: checking for ar +configure:5763: found /mingw/bin/ar +configure:5774: result: ar +configure:5852: checking for strip +configure:5868: found /mingw/bin/strip +configure:5879: result: strip +configure:5951: checking for ranlib +configure:5967: found /mingw/bin/ranlib +configure:5978: result: ranlib +configure:6080: checking command to parse /mingw/bin/nm output from gcc object +configure:6198: gcc -c -g -O2 conftest.c >&5 +configure:6201: $? = 0 +configure:6205: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 \2 \2/p' \> conftest.nm +configure:6208: $? = 0 +cannot find nm_test_var in conftest.nm +configure:6198: gcc -c -g -O2 conftest.c >&5 +configure:6201: $? = 0 +configure:6205: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 _\2 \2/p' \> conftest.nm +configure:6208: $? = 0 +configure:6262: gcc -o conftest.exe -g -O2 conftest.c conftstm.o >&5 +configure:6265: $? = 0 +configure:6303: result: ok +configure:7169: checking how to run the C preprocessor +configure:7209: gcc -E conftest.c +configure:7216: $? = 0 +configure:7247: gcc -E conftest.c +conftest.c:10:28: ac_nonexistent.h: No such file or directory +configure:7254: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE "librfid" +| #define VERSION "0.1.0" +| /* end confdefs.h. */ +| #include +configure:7287: result: gcc -E +configure:7316: gcc -E conftest.c +configure:7323: $? = 0 +configure:7354: gcc -E conftest.c +conftest.c:10:28: ac_nonexistent.h: No such file or directory +configure:7361: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE "librfid" +| #define VERSION "0.1.0" +| /* end confdefs.h. */ +| #include +configure:7401: checking for ANSI C header files +configure:7431: gcc -c -g -O2 conftest.c >&5 +configure:7438: $? = 0 +configure:7537: gcc -o conftest.exe -g -O2 conftest.c >&5 +configure:7541: $? = 0 +configure:7547: ./conftest.exe +configure:7551: $? = 0 +configure:7569: result: yes +configure:7593: checking for sys/types.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for sys/stat.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for stdlib.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for string.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for memory.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for strings.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for inttypes.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for stdint.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7593: checking for unistd.h +configure:7614: gcc -c -g -O2 conftest.c >&5 +configure:7621: $? = 0 +configure:7638: result: yes +configure:7656: checking for dlfcn.h +configure:7677: gcc -c -g -O2 conftest.c >&5 +conftest.c:54:19: dlfcn.h: No such file or directory +configure:7684: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE "librfid" +| #define VERSION "0.1.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| +| #include +configure:7701: result: no +configure:7888: checking for objdir +configure:7903: result: .libs +configure:8165: checking if gcc supports -fno-rtti -fno-exceptions +configure:8183: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 +cc1.exe: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C +configure:8187: $? = 0 +configure:8200: result: no +configure:8220: checking for gcc option to produce PIC +configure:8492: result: -DDLL_EXPORT -DPIC +configure:8504: checking if gcc PIC flag -DDLL_EXPORT -DPIC works +configure:8522: gcc -c -g -O2 -DDLL_EXPORT -DPIC -DPIC conftest.c >&5 +configure:8526: $? = 0 +configure:8539: result: yes +configure:8563: checking if gcc static flag -static works +configure:8591: result: yes +configure:8606: checking if gcc supports -c -o file.o +configure:8627: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 +configure:8631: $? = 0 +configure:8653: result: yes +configure:8661: checking if gcc supports -c -o file.o +configure:8708: result: yes +configure:8741: checking whether the gcc linker (E:/Programme/Mingw/mingw32/bin/ld.exe) supports shared libraries +configure:9890: result: yes +configure:9927: checking whether -lc should be explicitly linked in +configure:9935: gcc -c -g -O2 conftest.c >&5 +configure:9938: $? = 0 +configure:9953: gcc -shared conftest.o -v -o ./conftest -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 +configure:9956: $? = 1 +configure:9970: result: yes +configure:10135: checking dynamic linker characteristics +configure:10837: result: Win32 ld.exe +configure:10944: checking how to hardcode library paths into programs +configure:10969: result: immediate +configure:11802: checking whether stripping libraries is possible +configure:11807: result: yes +configure:11842: checking if libtool supports shared libraries +configure:11844: result: yes +configure:11847: checking whether to build shared libraries +configure:11868: result: yes +configure:11871: checking whether to build static libraries +configure:11875: result: yes +configure:11912: checking for build environment +configure:11919: result: UNIX + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=i686-pc-mingw32 +ac_cv_c_compiler_gnu=yes +ac_cv_c_const=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext=.exe +ac_cv_header_dlfcn_h=no +ac_cv_header_inttypes_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=i686-pc-mingw32 +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_FGREP='/bin/grep -F' +ac_cv_path_GREP=/bin/grep +ac_cv_path_SED=/bin/sed +ac_cv_path_install='/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=gawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_AS=as +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_DLLTOOL=dlltool +ac_cv_prog_ac_ct_OBJDUMP=objdump +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_gcc_c_o=yes +ac_cv_prog_make_make_set=yes +ac_cv_target=i686-pc-mingw32 +am_cv_CC_dependencies_compiler_type=gcc3 +lt_cv_archive_cmds_need_lc=yes +lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +lt_cv_file_magic_cmd=func_win32_libid +lt_cv_file_magic_test_file= +lt_cv_ld_reload_flag=-r +lt_cv_nm_interface='BSD nm' +lt_cv_objdir=.libs +lt_cv_path_LD=E:/Programme/Mingw/mingw32/bin/ld.exe +lt_cv_path_NM=/mingw/bin/nm +lt_cv_prog_compiler_c_o=yes +lt_cv_prog_compiler_pic_works=yes +lt_cv_prog_compiler_rtti_exceptions=no +lt_cv_prog_compiler_static_works=yes +lt_cv_prog_gnu_ld=yes +lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\) \{0,1\}$/\1 _\2 \2/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_max_cmd_len=8192 +lt_cv_to_host_path_cmd=func_msys_to_mingw_path_convert + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run tar' +AR='ar' +AS='as' +AUTOCONF='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run autoconf' +AUTOHEADER='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run autoheader' +AUTOMAKE='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run automake-1.11' +AWK='gawk' +BUILDENV='UNIX' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFLAGS='-g -O2' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH_W='echo' +DEFS='' +DEPDIR='.deps' +DISABLE_WIN32_FALSE='#' +DISABLE_WIN32_TRUE='' +DLLTOOL='dlltool' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +ENABLE_CCID_FALSE='' +ENABLE_CCID_TRUE='#' +ENABLE_FIRMWARE_FALSE='' +ENABLE_FIRMWARE_TRUE='' +ENABLE_STATIC_FALSE='' +ENABLE_STATIC_TRUE='' +ENABLE_WIN32_FALSE='' +ENABLE_WIN32_TRUE='#' +EXEEXT='.exe' +FGREP='/bin/grep -F' +FIRMWARE_PATH='' +GREP='/bin/grep' +HAVE_LIBUSB_FALSE='' +HAVE_LIBUSB_TRUE='' +HAVE_OPENCT_FALSE='' +HAVE_OPENCT_TRUE='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LD='E:/Programme/Mingw/mingw32/bin/ld.exe' +LDFLAGS='' +LIBOBJS='' +LIBS='' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIBTOOL_DEPS='./ltmain.sh' +LIPO='' +LN_S='ln -s' +LTLIBOBJS='' +MAKEINFO='${SHELL} "/D/Visual Studio 2010/Projects/Matomat/librfid_1999/missing" --run makeinfo' +MKDIR_P='/bin/mkdir -p' +NM='/mingw/bin/nm' +NMEDIT='' +OBJDUMP='objdump' +OBJEXT='o' +OPENCT_CFLAGS='' +OPENCT_LIBS='' +OTOOL64='' +OTOOL='' +PACKAGE='librfid' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +RANLIB='ranlib' +SED='/bin/sed' +SET_MAKE='' +SHELL='/bin/sh' +STRIP='strip' +VERSION='0.1.0' +ac_ct_CC='gcc' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__quote='' +am__tar='${AMTAR} chof - "$$tardir"' +am__untar='${AMTAR} xf -' +bindir='${exec_prefix}/bin' +build='i686-pc-mingw32' +build_alias='' +build_cpu='i686' +build_os='mingw32' +build_vendor='pc' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='NONE' +host='i686-pc-mingw32' +host_alias='' +host_cpu='i686' +host_os='mingw32' +host_vendor='pc' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} '\''/D/Visual Studio 2010/Projects/Matomat/librfid_1999/install-sh'\''' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='NONE' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='i686-pc-mingw32' +target_alias='' +target_cpu='i686' +target_os='mingw32' +target_vendor='pc' +to_host_path_cmd='func_msys_to_mingw_path_convert' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define PACKAGE "librfid" +#define VERSION "0.1.0" +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define LT_OBJDIR ".libs/" + +configure: exit 258 diff --git a/librfid_1999/config.sub b/librfid_1999/config.sub new file mode 100644 index 0000000..2a55a50 --- /dev/null +++ b/librfid_1999/config.sub @@ -0,0 +1,1705 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# 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 GNU 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. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# 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, 2006, 2007, 2008 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-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-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 | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -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 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -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/'` + ;; + -sco5v6*) + # 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 | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # 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-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # 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 + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + 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 + ;; + cr16) + basic_machine=cr16-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 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + 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 + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + 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 + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + 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 + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + 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 + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + 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 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + 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 + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + 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 + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + 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 + ;; + z80-*-coff) + basic_machine=z80-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 + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + 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. + -auroraux) + os=-auroraux + ;; + -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* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -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* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # 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* | -haiku* \ + | -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 + ;; + -dicos*) + os=-dicos + ;; + -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 + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-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 + ;; + mep-*) + os=-elf + ;; + 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 + ;; + *-haiku) + os=-haiku + ;; + *-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 + ;; + -cnk*|-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: diff --git a/librfid_1999/configure b/librfid_1999/configure new file mode 100644 index 0000000..6bcff58 --- /dev/null +++ b/librfid_1999/configure @@ -0,0 +1,14381 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } + +( + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + 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=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +( + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +SHELL=${CONFIG_SHELL-/bin/sh} + + +exec 7<&0 &1 + +# 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` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAVE_LIBUSB_FALSE +HAVE_LIBUSB_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_FIRMWARE_FALSE +ENABLE_FIRMWARE_TRUE +FIRMWARE_PATH +HAVE_OPENCT_FALSE +HAVE_OPENCT_TRUE +OPENCT_LIBS +OPENCT_CFLAGS +ENABLE_CCID_FALSE +ENABLE_CCID_TRUE +DISABLE_WIN32_FALSE +DISABLE_WIN32_TRUE +ENABLE_WIN32_FALSE +ENABLE_WIN32_TRUE +BUILDENV +LIBTOOL_DEPS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +to_host_path_cmd +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_ccid +enable_openct +with_firmware +with_ +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) { $as_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 && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-ccid Include internal CCID driver for CM5121 + --enable-openct Use (patched) OpenCT for CM5121 CCID access. + [default=no] + --enable-static Don't use dynamic allocations at all + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-firmware=PATH Compile for running inside firmware + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 +fi +cat >config.log <<_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.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&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_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=`$as_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_arg'" + ;; + 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +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, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_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 + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.11' + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 +$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} + { (exit 1); exit 1; }; };; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 +$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} + { (exit 1); exit 1; }; };; +esac + +# 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". + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_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 + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +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=librfid + VERSION=0.1.0 + + +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"} + +# 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 -' + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_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 + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&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' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-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="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&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 () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const /**/ +_ACEOF + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:$LINENO: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.7a' +macro_revision='1.3110' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:$LINENO: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:$LINENO: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:$LINENO: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:$LINENO: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-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. + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + $as_echo_n "(cached) " >&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 variants of GNU ld 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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:4927: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:4930: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4933: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + $as_echo_n "(cached) " >&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* | msys* | mingw* | cegcc*) + # 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 all BSDs + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to convert $build paths to $host format" >&5 +$as_echo_n "checking how to convert $build paths to $host format... " >&6; } +if test "${lt_cv_to_host_path_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $host in + *mingw* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_mingw_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_cygwin_to_mingw_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_mingw_path_convert + ;; + esac + ;; + *cygwin* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_host_path_cmd=func_msys_to_cygwin_path_convert + ;; + *cygwin* ) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode == unsupported! + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_path_cmd=func_nix_to_cygwin_path_convert + ;; + esac + ;; + *msys* ) # that is, msys in msysdvlpr mode + case $build in + *mingw* ) # actually msys in normal mode == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *cygwin* ) # unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + *msys* ) # msys in msysdvlpr mode + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + * ) # otherwise, assume *nix == unsupported + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_path_cmd=func_noop_path_convert + ;; +esac + +fi + +to_host_path_cmd=$lt_cv_to_host_path_cmd +{ $as_echo "$as_me:$LINENO: result: $lt_cv_to_host_path_cmd" >&5 +$as_echo "$lt_cv_to_host_path_cmd" >&6; } + + + + + +{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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* | msys* ) + # 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', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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])(-bit)?( [LM]SB)? 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + 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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$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 test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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=$? + $as_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 <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_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=$? + $as_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 -rf 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 + { $as_echo "$as_me:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-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=$? + $as_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 6359 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|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=$? + $as_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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + 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" + { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_cc_needs_belf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + lt_cv_ld_exported_symbols_list=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_ld_exported_symbols_list=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +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 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 + $as_echo_n "(cached) " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&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 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core 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 +#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)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-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 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 --with-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 whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +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 + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8183: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8187: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + 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 + ;; + + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # 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='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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 +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8522: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8526: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8627: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8631: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8682: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8686: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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>&1` 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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + 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*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | msys* | mingw* | pw32* | cegcc*) + # 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 `func_echo_all "$deplibs" | $SED '\''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*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | 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*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:$LINENO: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + 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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${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}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_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 + pic_flag=$lt_prog_compiler_pic + 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=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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=`func_echo_all "$lib" | $SED '\''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' + ;; + esac + ;; + +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* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + ;; + + *) + 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + 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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then + lt_cv_shlibpath_overrides_runpath=yes +fi + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # 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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_shl_load=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dl_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_svld_dlopen=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dld_dld_link=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line 11587 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line 11683 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ $as_echo "$as_me:$LINENO: checking for build environment" >&5 +$as_echo_n "checking for build environment... " >&6; } +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +{ $as_echo "$as_me:$LINENO: result: $BUILDENV" >&5 +$as_echo "$BUILDENV" >&6; } + + if test "$BUILDENV" == "WIN32"; then + ENABLE_WIN32_TRUE= + ENABLE_WIN32_FALSE='#' +else + ENABLE_WIN32_TRUE='#' + ENABLE_WIN32_FALSE= +fi + + if test "$BUILDENV" != "WIN32"; then + DISABLE_WIN32_TRUE= + DISABLE_WIN32_FALSE='#' +else + DISABLE_WIN32_TRUE='#' + DISABLE_WIN32_FALSE= +fi + + +# Check whether --enable-ccid was given. +if test "${enable_ccid+set}" = set; then + enableval=$enable_ccid; MY_CCID=1 +else + MY_CCID=0 +fi + +# AC_SUBST(MY_CCID) + if test "$MY_CCID" == "1"; then + ENABLE_CCID_TRUE= + ENABLE_CCID_FALSE='#' +else + ENABLE_CCID_TRUE='#' + ENABLE_CCID_FALSE= +fi + + +# Check whether --enable-openct was given. +if test "${enable_openct+set}" = set; then + enableval=$enable_openct; ENABLE_OPENCT="${enableval}" +else + ENABLE_OPENCT="no" +fi + + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, libopenct, + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + , + OPENCT_MSG=no + ) + + +fi + if test "x$OPENCT_MSG" = "xyes"; then + HAVE_OPENCT_TRUE= + HAVE_OPENCT_FALSE='#' +else + HAVE_OPENCT_TRUE='#' + HAVE_OPENCT_FALSE= +fi + + + +# Check whether --with-firmware was given. +if test "${with_firmware+set}" = set; then + withval=$with_firmware; FIRMWARE_PATH="$withval" +else + FIRMWARE_PATH="" +fi + + + if test "$FIRMWARE_PATH" != ""; then + ENABLE_FIRMWARE_TRUE= + ENABLE_FIRMWARE_FALSE='#' +else + ENABLE_FIRMWARE_TRUE='#' + ENABLE_FIRMWARE_FALSE= +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; ENABLE_STATIC=1 +else + ENABLE_STATIC=0 +fi + + if test "$ENABLE_STATIC" == "1"; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' +else + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= +fi + + + +# Check whether --with- was given. +if test "${with_+set}" = set; then + withval=$with_; +fi + + + +{ $as_echo "$as_me:$LINENO: checking for usb_close in -lusb" >&5 +$as_echo_n "checking for usb_close in -lusb... " >&6; } +if test "${ac_cv_lib_usb_usb_close+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $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 GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_close (); +int +main () +{ +return usb_close (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_usb_usb_close=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_usb_usb_close=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_close" >&5 +$as_echo "$ac_cv_lib_usb_usb_close" >&6; } +if test "x$ac_cv_lib_usb_usb_close" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUSB 1 +_ACEOF + + LIBS="-lusb $LIBS" + +fi + + if test "x$have_libusb" = "xyes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +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_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 +if test -z "${ENABLE_WIN32_TRUE}" && test -z "${ENABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${DISABLE_WIN32_TRUE}" && test -z "${DISABLE_WIN32_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"DISABLE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_CCID_TRUE}" && test -z "${ENABLE_CCID_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_CCID\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_OPENCT_TRUE}" && test -z "${HAVE_OPENCT_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_OPENCT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_FIRMWARE_TRUE}" && test -z "${ENABLE_FIRMWARE_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_FIRMWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $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 || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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_write_fail=1 +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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 + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_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" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_path_cmd='`$ECHO "$lt_cv_to_host_path_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/librfid/Makefile") CONFIG_FILES="$CONFIG_FILES include/librfid/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "src/librfid.pc") CONFIG_FILES="$CONFIG_FILES src/librfid.pc" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# 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 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + + + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$AS + +# DLL creation program. +DLLTOOL=$DLLTOOL + +# Object dumper program. +OBJDUMP=$OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build paths to \$host format. +to_host_path_cmd=$lt_cv_to_host_path_cmd + +# 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 + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/librfid_1999/configure.in b/librfid_1999/configure.in new file mode 100644 index 0000000..8f42d49 --- /dev/null +++ b/librfid_1999/configure.in @@ -0,0 +1,68 @@ +dnl Process this file with autoconf to create configure. + +AC_INIT +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE(librfid, 0.1.0) + +AC_PROG_CC +AM_PROG_CC_C_O +AC_C_CONST +AC_EXEEXT +AC_LIBTOOL_WIN32_DLL +AM_PROG_LIBTOOL +AC_SUBST(LIBTOOL_DEPS) + +AC_MSG_CHECKING([for build environment]) +case "$target_alias" in +*-mingw*) BUILDENV=WIN32;; +*-cygwin*) BUILDENV=WIN32;; +*) BUILDENV=UNIX;; +esac +AC_MSG_RESULT($BUILDENV) +AC_SUBST(BUILDENV) +AM_CONDITIONAL(ENABLE_WIN32, test "$BUILDENV" == "WIN32") +AM_CONDITIONAL(DISABLE_WIN32, test "$BUILDENV" != "WIN32") + +AC_ARG_ENABLE(ccid, + [ --enable-ccid Include internal CCID driver for CM5121], + [MY_CCID=1], [MY_CCID=0]) +# AC_SUBST(MY_CCID) +AM_CONDITIONAL(ENABLE_CCID, test "$MY_CCID" == "1") + +dnl Enable/disable openct +AC_ARG_ENABLE(openct, + AC_HELP_STRING([--enable-openct], [Use (patched) OpenCT for CM5121 CCID access. [[default=no]]]), + [ENABLE_OPENCT="${enableval}"], + [ENABLE_OPENCT="no"]) + +OPENCT_MSG=no +if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, [libopenct], [ + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + ], [ + OPENCT_MSG=no + ]) + AC_SUBST(OPENCT_CFLAGS) + AC_SUBST(OPENCT_LIBS) +fi +AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes") + +AC_ARG_WITH(firmware, + [ --with-firmware=PATH Compile for running inside firmware], + [FIRMWARE_PATH="$withval"], [FIRMWARE_PATH=""]) +AC_SUBST(FIRMWARE_PATH) +AM_CONDITIONAL(ENABLE_FIRMWARE, test "$FIRMWARE_PATH" != "") + +AC_ARG_ENABLE(static, + [ --enable-static Don't use dynamic allocations at all], + [ENABLE_STATIC=1], [ENABLE_STATIC=0]) +AM_CONDITIONAL(ENABLE_STATIC, test "$ENABLE_STATIC" == "1") + +AC_ARG_WITH() + +AC_CHECK_LIB(usb, usb_close,,) +AM_CONDITIONAL(HAVE_LIBUSB, test "x$have_libusb" = "xyes") + +dnl Output the makefile +AC_OUTPUT(Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile) diff --git a/librfid_1999/depcomp b/librfid_1999/depcomp new file mode 100644 index 0000000..df8eea7 --- /dev/null +++ b/librfid_1999/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . + +# 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 + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +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. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + 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. + 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 + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + 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 + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +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 mechanism 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 $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + 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. + -arch) + eat=yes ;; + -*|$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 "X$1" != 'X--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. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # 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 + ;; + +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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid_1999/etc/Makefile.am b/librfid_1999/etc/Makefile.am new file mode 100644 index 0000000..9f94de1 --- /dev/null +++ b/librfid_1999/etc/Makefile.am @@ -0,0 +1,2 @@ + +SUBDIRS = udev diff --git a/librfid_1999/etc/Makefile.in b/librfid_1999/etc/Makefile.in new file mode 100644 index 0000000..d79b0e2 --- /dev/null +++ b/librfid_1999/etc/Makefile.in @@ -0,0 +1,560 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = etc +DIST_COMMON = $(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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = udev +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid_1999/etc/udev/Makefile.am b/librfid_1999/etc/udev/Makefile.am new file mode 100644 index 0000000..215cd34 --- /dev/null +++ b/librfid_1999/etc/udev/Makefile.am @@ -0,0 +1,2 @@ + +EXTRA_DIST = librfid.rules diff --git a/librfid_1999/etc/udev/Makefile.in b/librfid_1999/etc/udev/Makefile.in new file mode 100644 index 0000000..ead3111 --- /dev/null +++ b/librfid_1999/etc/udev/Makefile.in @@ -0,0 +1,358 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = etc/udev +DIST_COMMON = $(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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = librfid.rules +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/udev/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/udev/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: diff --git a/librfid_1999/etc/udev/librfid.rules b/librfid_1999/etc/udev/librfid.rules new file mode 100644 index 0000000..a33dace --- /dev/null +++ b/librfid_1999/etc/udev/librfid.rules @@ -0,0 +1,13 @@ +# This file is part of the librfid distribution +# +# udev rules file for supported readers +# +# + +ACTION!="add", GOTO="librfid_rules_end" +SUBSYSTEM!="usb_device", GOTO="librfid_rules_end" + +# Omnikey 5121 +SYSFS{idVendor}=="076b", SYSFS{idProduct}=="5121", MODE="664", GROUP="users" + +LABEL="librfid_rules_end" diff --git a/librfid_1999/include/Makefile.am b/librfid_1999/include/Makefile.am new file mode 100644 index 0000000..dfaa277 --- /dev/null +++ b/librfid_1999/include/Makefile.am @@ -0,0 +1,2 @@ + +SUBDIRS = librfid diff --git a/librfid_1999/include/Makefile.in b/librfid_1999/include/Makefile.in new file mode 100644 index 0000000..0c8781d --- /dev/null +++ b/librfid_1999/include/Makefile.in @@ -0,0 +1,560 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = include +DIST_COMMON = $(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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = librfid +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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; \ + ($(am__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" + +$(RECURSIVE_CLEAN_TARGETS): + @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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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 || \ + set "$$@" "$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +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: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-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: diff --git a/librfid_1999/include/librfid/Makefile.am b/librfid_1999/include/librfid/Makefile.am new file mode 100644 index 0000000..9af455b --- /dev/null +++ b/librfid_1999/include/librfid/Makefile.am @@ -0,0 +1,13 @@ + +pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \ + rfid_layer2.h rfid_layer2_iso14443a.h \ + rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \ + rfid_protocol.h rfid_protocol_tcl.h \ + rfid_protocol_mifare_ul.h \ + rfid_protocol_mifare_classic.h \ + rfid_reader.h \ + rfid_system.h \ + rfid_access_mifare_classic.h \ + rfid_reader_cm5121.h \ + rfid_reader_openpcd.h + diff --git a/librfid_1999/include/librfid/Makefile.in b/librfid_1999/include/librfid/Makefile.in new file mode 100644 index 0000000..4d5a3cb --- /dev/null +++ b/librfid_1999/include/librfid/Makefile.in @@ -0,0 +1,467 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = include/librfid +DIST_COMMON = $(pkginclude_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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \ + rfid_layer2.h rfid_layer2_iso14443a.h \ + rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \ + rfid_protocol.h rfid_protocol_tcl.h \ + rfid_protocol_mifare_ul.h \ + rfid_protocol_mifare_classic.h \ + rfid_reader.h \ + rfid_system.h \ + rfid_access_mifare_classic.h \ + rfid_reader_cm5121.h \ + rfid_reader_openpcd.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/librfid/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/librfid/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + + +# 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: diff --git a/librfid_1999/include/librfid/rfid.h b/librfid_1999/include/librfid/rfid.h new file mode 100644 index 0000000..580cc09 --- /dev/null +++ b/librfid_1999/include/librfid/rfid.h @@ -0,0 +1,64 @@ +#ifndef _RFID_H +#define _RFID_H + +#include +#include + +#ifdef __MINGW32__ +#define ENOTSUP 100 +#define ETIMEDOUT 101 +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; +typedef unsigned long u_int32_t; +typedef unsigned long long u_int64_t; +#endif/*__MINGW32__*/ + +#ifdef __LIBRFID__ + +#include + +#ifdef DEBUG_LIBRFID + +#ifdef LIBRFID_FIRMWARE +extern void debugp(const char *format, ...); +extern const char *hexdump(const void *data, unsigned int len); +#define rfid_hexdump(x, y) hexdump(x, y) +#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) +#define DEBUGPC(x, args ...) debugp(x, ## args) +#else /* LIBRFID_FIRMWARE */ +extern const char *rfid_hexdump(const void *data, unsigned int len); +#define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) +#define DEBUGPC(x, args ...) fprintf(stderr, x, ## args) +#endif /* LIBRFID_FIRMWARE */ + +#else /* DEBUG */ +extern const char *rfid_hexdump(const void *data, unsigned int len); + +#define DEBUGP(x, args ...) +#define DEBUGPC(x, args ...) + +#endif /* DEBUG */ + + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + +#endif /* __LIBRFID__ */ + +int rfid_init(); + +enum rfid_opt_level { + RFID_LEVEL_ASIC, + RFID_LEVEL_READER, + RFID_LEVEL_LAYER2, + RFID_LEVEL_LAYER3, +}; + +enum rfid_frametype { + RFID_14443A_FRAME_REGULAR, + RFID_14443B_FRAME_REGULAR, + RFID_MIFARE_FRAME, +}; + +#endif /* _RFID_H */ diff --git a/librfid_1999/include/librfid/rfid_access_mifare_classic.h b/librfid_1999/include/librfid/rfid_access_mifare_classic.h new file mode 100644 index 0000000..3c23724 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_access_mifare_classic.h @@ -0,0 +1,46 @@ +#ifndef _RFID_MIFARE_ACCESS_H +#define _RFID_MIFARE_ACCESS_H + +struct mfcl_access_sect { + u_int8_t block[4]; +}; + +int mfcl_compile_access(u_int8_t *encoded, + const struct mfcl_access_sect *ac); +int mfcl_parse_access(struct mfcl_access_sect *ac, u_int8_t *encoded); + + +enum mfcl_access_exp_data { + MFCL_ACCESS_NEVER = 0, + MFCL_ACCESS_KEY_A = 1, + MFCL_ACCESS_KEY_B = 2, +}; + +struct mfcl_access_exp_block { + u_int8_t read:2, + write:2, + inc:2, + dec:2; +}; + +struct mfcl_access_exp_acc { + u_int16_t key_a_rd:2, + key_a_wr:2, + acc_rd:2, + acc_wr:2, + key_b_rd:2, + key_b_wr:2; +}; + + +struct mfcl_access_exp_sect { + struct mfcl_access_exp_block block[3]; + struct mfcl_access_exp_acc acc; +}; + +void mfcl_access_to_exp(struct mfcl_access_exp_sect *exp, + const struct mfcl_access_sect *sect); + +char *mfcl_access_exp_stringify(const struct mfcl_access_exp_block *exp); +char *mfcl_access_exp_acc_stringify(const struct mfcl_access_exp_acc *acc); +#endif diff --git a/librfid_1999/include/librfid/rfid_asic.h b/librfid_1999/include/librfid/rfid_asic.h new file mode 100644 index 0000000..113eb19 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_asic.h @@ -0,0 +1,55 @@ +#ifndef _RFID_ASIC_H +#define _RFID_ASIC_H + +enum rfid_frametype; + +#include + +/* a low-level transport, over which the ASIC layer can talk to its ASIC */ +struct rfid_asic_transport { + char *name; + union { + struct rfid_asic_rc632_transport rc632; + } priv; +}; + +/* An instance handle to 'struct rfid_asic_transport' */ +struct rfid_asic_transport_handle { + void *data; /* handle to stuff like even lower layers */ + + struct rfid_asic_transport *rat; +}; + +/* Some implementation-specific data. A reader will specify one of these for + * ASIC-specific parameters such as e.g. RC632 mod conductance */ + +struct rfid_asic_implementation { + union { + struct rfid_asic_rc632_impl rc632; + } priv; +}; + +struct rfid_asic_handle { + struct rfid_asic_transport_handle *rath; + unsigned int fc; + unsigned int mtu; + unsigned int mru; + + union { + struct rfid_asic_rc632_handle rc632; + //struct rfid_asic_rc531_handle rc531; + } priv; + struct rfid_asic *asic; +}; + + +struct rfid_asic { + char *name; + unsigned int fc; /* carrier frequency */ + union { + struct rfid_asic_rc632 rc632; + //struct rfid_asic_rc531 rc531; + } priv; +}; + +#endif /* _RFID_ASIC_H */ diff --git a/librfid_1999/include/librfid/rfid_asic_rc632.h b/librfid_1999/include/librfid/rfid_asic_rc632.h new file mode 100644 index 0000000..3aebd1f --- /dev/null +++ b/librfid_1999/include/librfid/rfid_asic_rc632.h @@ -0,0 +1,97 @@ +#ifndef _RFID_ASIC_RC632_H +#define _RFID_ASIC_RC632_H + +struct rfid_asic_transport_handle; + +#include +#include + +struct rfid_asic_rc632_transport { + struct { + int (*reg_write)(struct rfid_asic_transport_handle *rath, + u_int8_t reg, + u_int8_t value); + int (*reg_read)(struct rfid_asic_transport_handle *rath, + u_int8_t reg, + u_int8_t *value); + int (*fifo_write)(struct rfid_asic_transport_handle *rath, + u_int8_t len, + const u_int8_t *buf, + u_int8_t flags); + int (*fifo_read)(struct rfid_asic_transport_handle *rath, + u_int8_t len, + u_int8_t *buf); + } fn; +}; + +struct rfid_asic_handle; + +struct iso14443a_atqa; +struct iso14443a_anticol_cmd; + +struct rfid_asic_rc632 { + struct { + int (*power_up)(struct rfid_asic_handle *h); + int (*power_down)(struct rfid_asic_handle *h); + int (*turn_on_rf)(struct rfid_asic_handle *h); + int (*turn_off_rf)(struct rfid_asic_handle *h); + int (*transceive)(struct rfid_asic_handle *h, + enum rfid_frametype, + const u_int8_t *tx_buf, + unsigned int tx_len, + u_int8_t *rx_buf, + unsigned int *rx_len, + u_int64_t timeout, + unsigned int flags); + struct { + int (*init)(struct rfid_asic_handle *h); + int (*transceive_sf)(struct rfid_asic_handle *h, + u_int8_t cmd, + struct iso14443a_atqa *atqa); + int (*transceive_acf)(struct rfid_asic_handle *h, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col); + int (*set_speed)(struct rfid_asic_handle *h, + unsigned int tx, + unsigned int speed); + } iso14443a; + struct { + int (*init)(struct rfid_asic_handle *h); + } iso14443b; + struct { + int (*init)(struct rfid_asic_handle *h); + } iso15693; + struct { + int (*setkey)(struct rfid_asic_handle *h, + const unsigned char *key); + int (*auth)(struct rfid_asic_handle *h, u_int8_t cmd, + u_int32_t serno, u_int8_t block); + } mifare_classic; + } fn; +}; + +struct rc632_transport_handle { +}; + +/* A handle to a specific RC632 chip */ +struct rfid_asic_rc632_handle { + struct rc632_transport_handle th; +}; + +struct rfid_asic_rc632_impl_proto { + u_int8_t mod_conductance; + u_int8_t cw_conductance; + u_int8_t bitphase; + u_int8_t threshold; +}; + +struct rfid_asic_rc632_impl { + u_int32_t mru; /* maximum receive unit (PICC->PCD) */ + u_int32_t mtu; /* maximum transmit unit (PCD->PICC) */ + //struct rfid_asic_rc632_impl_proto proto[NUM_RFID_PROTOCOLS]; +}; + +extern struct rfid_asic_handle * rc632_open(struct rfid_asic_transport_handle *th); +extern void rc632_close(struct rfid_asic_handle *h); + +#endif diff --git a/librfid_1999/include/librfid/rfid_layer2.h b/librfid_1999/include/librfid/rfid_layer2.h new file mode 100644 index 0000000..84d4579 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_layer2.h @@ -0,0 +1,84 @@ +#ifndef _RFID_LAYER2_H +#define _RFID_LAYER2_H + +#include + +struct rfid_layer2_handle; +struct rfid_reader_handle; + +enum rfid_layer2_id { + RFID_LAYER2_NONE, + RFID_LAYER2_ISO14443A, + RFID_LAYER2_ISO14443B, + RFID_LAYER2_ISO15693, +}; + +/* 0...0xffff = global options, 0x10000...0x1ffff = private options */ +#define RFID_OPT_L2_PRIV 0x00010000 +enum rfid_layer2_opt { + RFID_OPT_LAYER2_UID = 0x0001, + RFID_OPT_LAYER2_PROTO_SUPP = 0x0002, + RFID_OPT_LAYER2_WUP = 0x0003, +}; + +struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh, + unsigned int id); +int rfid_layer2_open(struct rfid_layer2_handle *l2h); +int rfid_layer2_transceive(struct rfid_layer2_handle *l2h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags); +int rfid_layer2_close(struct rfid_layer2_handle *l2h); +int rfid_layer2_fini(struct rfid_layer2_handle *l2h); +int rfid_layer2_getopt(struct rfid_layer2_handle *ph, int optname, + void *optval, unsigned int *optlen); +int rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname, + const void *optval, unsigned int optlen); +char *rfid_layer2_name(struct rfid_layer2_handle *l2h); +#ifdef __LIBRFID__ + +#include +#include +#include + +struct rfid_layer2 { + unsigned int id; + char *name; + + struct { + struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h); + int (*open)(struct rfid_layer2_handle *h); + int (*transceive)(struct rfid_layer2_handle *h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, + unsigned int tx_len, unsigned char *rx_buf, + unsigned int *rx_len, u_int64_t timeout, + unsigned int flags); + int (*close)(struct rfid_layer2_handle *h); + int (*fini)(struct rfid_layer2_handle *h); + int (*getopt)(struct rfid_layer2_handle *h, + int optname, void *optval, unsigned int *optlen); + int (*setopt)(struct rfid_layer2_handle *h, + int optname, const void *optval, + unsigned int optlen); + } fn; +}; + +struct rfid_layer2_handle { + struct rfid_reader_handle *rh; + unsigned char uid[10]; /* triple size 14443a id is 10 bytes */ + unsigned int uid_len; + unsigned int proto_supported; + unsigned int flags; + union { + struct iso14443a_handle iso14443a; + struct iso14443b_handle iso14443b; + struct iso15693_handle iso15693; + } priv; + struct rfid_layer2 *l2; +}; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid_1999/include/librfid/rfid_layer2_iso14443a.h b/librfid_1999/include/librfid/rfid_layer2_iso14443a.h new file mode 100644 index 0000000..9a795c2 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_layer2_iso14443a.h @@ -0,0 +1,95 @@ +#ifndef _RFID_ISO14443A_H +#define _RFID_ISO14443A_H + +enum rfid_14443a_opt { + RFID_OPT_14443A_SPEED_RX = 0x00010001, + RFID_OPT_14443A_SPEED_TX = 0x00010002, + RFID_OPT_14443A_ATQA = 0x00010003, + RFID_OPT_14443A_WUPA = 0x00010004, +}; + +enum rfid_14443_opt_speed { + RFID_14443A_SPEED_106K = 0x01, + RFID_14443A_SPEED_212K = 0x02, + RFID_14443A_SPEED_424K = 0x04, + RFID_14443A_SPEED_848K = 0x08, +}; + +#ifdef __LIBRFID__ + +#include + +/* protocol definitions */ + +/* ISO 14443-3, Chapter 6.3.1 */ +enum iso14443a_sf_cmd { + ISO14443A_SF_CMD_REQA = 0x26, + ISO14443A_SF_CMD_WUPA = 0x52, + ISO14443A_SF_CMD_OPT_TIMESLOT = 0x35, /* Annex C */ + /* 40 to 4f and 78 to 7f: proprietary */ +}; + +struct iso14443a_atqa { + u_int8_t bf_anticol:5, + rfu1:1, + uid_size:2; + u_int8_t proprietary:4, + rfu2:4; +} __attribute__((packed)); + +#define ISO14443A_HLTA 0x5000 + +/* ISO 14443-3, Chapter 6.3.2 */ +struct iso14443a_anticol_cmd { + unsigned char sel_code; + unsigned char nvb; + unsigned char uid_bits[5]; +} __attribute__((packed)); + +enum iso14443a_anticol_sel_code { + ISO14443A_AC_SEL_CODE_CL1 = 0x93, + ISO14443A_AC_SEL_CODE_CL2 = 0x95, + ISO14443A_AC_SEL_CODE_CL3 = 0x97, +}; + +#define ISO14443A_BITOFCOL_NONE 0xffffffff + +struct iso14443a_handle { + unsigned int state; + unsigned int level; + unsigned int tcl_capable; + struct iso14443a_atqa atqa; +}; + +enum iso14443a_level { + ISO14443A_LEVEL_NONE, + ISO14443A_LEVEL_CL1, + ISO14443A_LEVEL_CL2, + ISO14443A_LEVEL_CL3, +}; + +enum iso14443a_state { + ISO14443A_STATE_ERROR, + ISO14443A_STATE_NONE, + ISO14443A_STATE_REQA_SENT, + ISO14443A_STATE_ATQA_RCVD, + ISO14443A_STATE_NO_BITFRAME_ANTICOL, + ISO14443A_STATE_ANTICOL_RUNNING, + ISO14443A_STATE_SELECTED, +}; + +/* Section 6.1.2 values in usec, rounded up to next usec */ +#define ISO14443A_FDT_ANTICOL_LAST1 92 /* 1236 / fc = 91.15 usec */ +#define ISO14443A_FDT_ANTICOL_LAST0 87 /* 1172 / fc = 86.43 usec */ + +#define ISO14443_CARRIER_FREQ 13560000 +#define ISO14443A_FDT_OTHER_LAST1(n) (((n*128+84)*1000000)/ISO14443_CARRIER_FREQ) + + +#include +extern const struct rfid_layer2 rfid_layer2_iso14443a; + +#endif /* __LIBRFID__ */ + + +#endif /* _ISO14443A_H */ diff --git a/librfid_1999/include/librfid/rfid_layer2_iso14443b.h b/librfid_1999/include/librfid/rfid_layer2_iso14443b.h new file mode 100644 index 0000000..89999c6 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_layer2_iso14443b.h @@ -0,0 +1,96 @@ +#ifndef _RFID_LAYER2_ISO14443B_H +#define _RFID_LAYER2_ISO14443B_H + +#include + +enum rfid_iso14443_opt { + RFID_OPT_14443B_CID = 0x00010001, + RFID_OPT_14443B_FSC = 0x00010002, + RFID_OPT_14443B_FSD = 0x00010003, + RFID_OPT_14443B_FWT = 0x00010004, + RFID_OPT_14443B_TR0 = 0x00010005, + RFID_OPT_14443B_TR1 = 0x00010006, +}; + +#ifdef __LIBRFID__ + +struct iso14443b_atqb { + unsigned char fifty; + unsigned char pupi[4]; + unsigned char app_data[4]; + struct { + unsigned char bit_rate_capability; + unsigned char protocol_type:4, + max_frame_size:4; + unsigned char fo:2, + adc:2, + fwi:4; + } __attribute__ ((packed)) protocol_info; +} __attribute__ ((packed)); + +struct iso14443b_attrib_hdr { + unsigned char one_d; + unsigned char identifier[4]; + struct { + unsigned char rfu:2, + sof:1, + eof:1, + min_tr1:2, + min_tr0:2; + } __attribute__ ((packed)) param1; + struct { + unsigned char fsdi:4, + spd_out:2, + spd_in:2; + } __attribute__ ((packed)) param2; + struct { + unsigned char protocol_type:4, + rfu:4; + } __attribute__ ((packed)) param3; + struct { + unsigned char cid:4, + rfu:4; + } __attribute__ ((packed)) param4; +} __attribute__ ((packed)); + +struct iso14443b_handle { + unsigned int tcl_capable; /* do we support T=CL */ + + unsigned int cid; /* Card ID */ + + unsigned int fsc; /* max. frame size card */ + unsigned int fsd; /* max. frame size reader */ + + unsigned int fwt; /* frame waiting time (in usec) */ + + unsigned int mbl; /* maximum buffer length */ + + unsigned int tr0; /* pcd-eof to picc-subcarrier-on */ + unsigned int tr1; /* picc-subcarrier-on to picc-sof */ + + unsigned int flags; + unsigned int state; +}; + +enum { + ISO14443B_CID_SUPPORTED = 0x01, + ISO14443B_NAD_SUPPORTED = 0x02, +}; + +enum { + ISO14443B_STATE_ERROR, + ISO14443B_STATE_NONE, + ISO14443B_STATE_REQB_SENT, + ISO14443B_STATE_ATQB_RCVD, + ISO14443B_STATE_ATTRIB_SENT, + ISO14443B_STATE_SELECTED, + ISO14443B_STATE_HLTB_SENT, + ISO14443B_STATE_HALTED, +}; + +#include +extern const struct rfid_layer2 rfid_layer2_iso14443b; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid_1999/include/librfid/rfid_layer2_iso15693.h b/librfid_1999/include/librfid/rfid_layer2_iso15693.h new file mode 100644 index 0000000..d09daa7 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_layer2_iso15693.h @@ -0,0 +1,177 @@ +#ifndef _RFID_ISO15693_H +#define _RFID_ISO15693_H + +#include + +/* +07h = TagIt +04h = I.CODE +05h = Infineon +02h = ST +*/ + +/* protocol definitions */ + +#if 0 +struct rfid_15693_handle; + +struct rfid_layer2_15693t { + unsigned char *name; + + struct { + int (*init)(struct iso15693_handle *handle); + int (*fini)(struct iso15693_handle *handle); + +#if 0 + int (*transceive_sf)(struct iso14443a_handle *handle, + unsigned char cmd, + struct iso14443a_atqa *atqa); + int (*transceive_acf)(struct iso14443a_handle *handle, + struct iso14443a_anticol_cmd *acf, + unsigned int *bit_of_col); +#endif + int (*transceive)(struct iso15693_handle *handle, + const unsigned char *tx_buf, + unsigned int tx_len, + unsigned char *rx_buf, + unsigned int *rx_len); + } fn; + + union { + } priv; +}; +#endif + +struct iso15693_handle { + unsigned int state; + unsigned int ask100:1, + out256:1; +}; + +enum rfid_15693_state { + ISO15693_STATE_ERROR, + ISO15693_STATE_NONE, +}; + +enum rfid_15693_opt { + RFID_OPT_15693_MOD_DEPTH = 0x00010001, + RFID_OPT_15693_VCD_CODING = 0x00010002, + RFID_OPT_15693_VICC_SUBC = 0x00010003, + RFID_OPT_15693_VICC_SPEED = 0x00010004, +}; + +enum rfid_15693_opt_mod_depth { + RFID_15693_MOD_10ASK = 0x01, + RFID_15693_MOD_100ASK = 0x02, +}; + +enum rfid_15693_opt_vcd_coding { + RFID_15693_VCD_CODING_1OUT256 = 0x01, + RFID_15693_VCD_CODING_1OUT4 = 0x02, +}; + +enum rfid_15693_opt_vicc_subc { + RFID_15693_VICC_SUBC_SINGLE = 0x01, + RFID_15693_VICC_SUBC_DUAL = 0x02, +}; + +enum rfid_15693_opt_vicc_speed { + RFID_15693_VICC_SPEED_SLOW = 0x01, + RFID_15693_VICC_SPEED_FAST = 0x02, +}; + +#ifdef __LIBRFID__ + +#define ISO15693_UID_LEN 8 +#define ISO15693_CRC_LEN 2 + +/* ISO 15693-3, Ch. 7.2 Table 3*/ +enum iso15693_request_flags { + RFID_15693_F_SUBC_TWO = 0x01, + RFID_15693_F_RATE_HIGH = 0x02, + RFID_15693_F_INV_TABLE_5 = 0x04, + RFID_15693_F_PROT_OEXT = 0x08, +}; + +/* ISO 15693-3, Ch. 7.2 Table 4 */ +enum iso15693_request_flags_table4 { + RFID_15693_F4_SELECTED = 0x10, /* only VICC in 'select' state */ + RFID_15693_F4_ADDRESS = 0x20, /* request is addressed */ + RFID_15693_F4_CUSTOM = 0x40, +}; + +/* ISO 15693-3, Ch. 7.2 Table 5 */ +enum iso15693_request_flags_table5 { + RFID_15693_F5_AFI_PRES = 0x10, /* AFI is present */ + RFID_15693_F5_NSLOTS_1 = 0x20, /* only 1 slot (instead of 16) */ + RFID_15693_F5_CUSTOM = 0x40, +}; + +/* ISO 15963-3, Ch. 7.2 Figure 4 */ +struct iso15693_request { + u_int8_t flags; + u_int8_t command; + u_int8_t data[0]; +} __attribute__ ((packed)); + +/* ISO 15693, Ch. 7.3 Table 6 */ +enum iso15693_response_flags { + RFID_15693_RF_ERROR = 0x01, + RFID_15693_RF_EXTENDED = 0x08, +}; + +/* ISO 15693, Ch. 7.3.2 Table 7 */ +enum iso15693_response_errors { + RFID_15693_ERR_NOTSUPP = 0x01, + RFID_15693_ERR_INVALID = 0x02, /* command not recognized */ + RFID_15693_ERR_UNKNOWN = 0x0f, /* unknown error */ + RFID_15693_ERR_BLOCK_NA = 0x10, /* block not available */ + RFID_15693_ERR_BLOCK_LOCKED = 0x11, + RFID_15693_ERR_BLOCK_LOCKED_CH = 0x12, + RFID_15693_ERR_BLOCK_NOTPROG = 0x13, + RFID_15693_ERR_BLOCK_NOTLOCK = 0x14, +}; + +/* ISO 15693, Ch. 7.4 */ +enum iso15693_vicc_states { + RFID_15693_STATE_POWER_OFF, + RFID_15693_STATE_READY, + RFID_15693_STATE_QUIET, + RFID_15693_STATE_SELECTED, +}; + +/* ISO 15693, Ch. 9.1 Table 10*/ +enum iso15693_commands { + /* Mandatory 0x01 .. 0x1f */ + ISO15693_CMD_INVENTORY = 0x01, + ISO15693_CMD_STAY_QUIET = 0x02, + /* Optional 0x20 .. 0x9f */ + ISO15693_CMD_READ_BLOCK_SINGLE = 0x20, + ISO15693_CMD_WRITE_BLOCK_SINGLE = 0x21, + ISO15693_CMD_LOCK_BLOCK = 0x22, + ISO15693_CMD_READ_BLOCK_MULTI = 0x23, + ISO15693_CMD_WRITE_BLOCK_MULTI = 0x24, + ISO15693_CMD_SELECT = 0x25, + ISO15693_CMD_RESET_TO_READY = 0x26, + ISO15693_CMD_WRITE_AFI = 0x27, + ISO15693_CMD_LOCK_AFI = 0x28, + ISO15693_CMD_WRITE_DSFID = 0x29, + ISO15693_CMD_LOCK_DSFID = 0x2a, + ISO15693_CMD_GET_SYSINFO = 0x2b, + ISO15693_CMD_GET_BLOCK_SECURITY = 0x2c, + /* Custom 0xa0 .. 0xdf */ + ICODE_CMD_INVENTORY_READ = 0xa0, + ICODE_CMD_FAST_INVENTORY_READ = 0xa1, + ICODE_CMD_EAS_SET = 0xa2, + ICODE_CMD_EAS_RESET = 0xa3, + ICODE_CMD_EAS_LOCK = 0xa4, + ICODE_CMD_EAS_ALARM = 0xa5, + /* Proprietary 0xe0 .. 0xff */ +}; + + +#include +extern const struct rfid_layer2 rfid_layer2_iso15693; + +#endif /* __LIBRFID__ */ +#endif /* _ISO15693_H */ diff --git a/librfid_1999/include/librfid/rfid_protocol.h b/librfid_1999/include/librfid/rfid_protocol.h new file mode 100644 index 0000000..06f704f --- /dev/null +++ b/librfid_1999/include/librfid/rfid_protocol.h @@ -0,0 +1,103 @@ +#ifndef _RFID_PROTOCOL_H +#define _RFID_PROTOCOL_H + +#include + +struct rfid_protocol_handle; + +struct rfid_protocol_handle * +rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id); +int rfid_protocol_open(struct rfid_protocol_handle *ph); +int rfid_protocol_transceive(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + unsigned int timeout, unsigned int flags); +int +rfid_protocol_read(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len); + +int +rfid_protocol_write(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len); + +int rfid_protocol_fini(struct rfid_protocol_handle *ph); +int rfid_protocol_close(struct rfid_protocol_handle *ph); + +int rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname, + void *optval, unsigned int *optlen); + +int rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname, + const void *optval, unsigned int optlen); + +char *rfid_protocol_name(struct rfid_protocol_handle *ph); + +enum rfid_protocol_id { + RFID_PROTOCOL_UNKNOWN, + RFID_PROTOCOL_TCL, + RFID_PROTOCOL_MIFARE_UL, + RFID_PROTOCOL_MIFARE_CLASSIC, + NUM_RFID_PROTOCOLS +}; + +enum rfid_protocol_opt { + RFID_OPT_PROTO_ID, + RFID_OPT_PROTO_SIZE = 0x10000001, +}; + +#ifdef __LIBRFID__ + +struct rfid_protocol { + unsigned int id; + char *name; + struct { + struct rfid_protocol_handle *(*init)(struct rfid_layer2_handle *l2h); + int (*open)(struct rfid_protocol_handle *ph); + int (*close)(struct rfid_protocol_handle *ph); + int (*fini)(struct rfid_protocol_handle *ph); + /* transceive for session based transport protocols */ + int (*transceive)(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, + unsigned int tx_len, + unsigned char *rx_buf, + unsigned int *rx_len, + unsigned int timeout, + unsigned int flags); + /* read/write for synchronous memory cards */ + int (*read)(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len); + int (*write)(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len); + int (*getopt)(struct rfid_protocol_handle *h, + int optname, void *optval, unsigned int *optlen); + int (*setopt)(struct rfid_protocol_handle *h, + int optname, const void *optval, + unsigned int optlen); + } fn; +}; + +#include +#include +#include + +struct rfid_protocol_handle { + struct rfid_layer2_handle *l2h; + struct rfid_protocol *proto; + union { + struct tcl_handle tcl; + } priv; /* priv has to be last, since + * it could contain additional + * private data over the end of + * sizeof(priv). */ +}; + +#endif /* __LIBRFID__ */ + +#endif /* _RFID_PROTOCOL_H */ diff --git a/librfid_1999/include/librfid/rfid_protocol_mifare_classic.h b/librfid_1999/include/librfid/rfid_protocol_mifare_classic.h new file mode 100644 index 0000000..e50cd2f --- /dev/null +++ b/librfid_1999/include/librfid/rfid_protocol_mifare_classic.h @@ -0,0 +1,41 @@ +#ifndef _MIFARE_CLASSIC_H +#define _MIFARE_CLASSIC_H + +#include + +#define MIFARE_CL_KEYA_DEFAULT "\xa0\xa1\xa2\xa3\xa4\xa5" +#define MIFARE_CL_KEYB_DEFAULT "\xb0\xb1\xb2\xb3\xb4\xb5" + +#define MIFARE_CL_KEYA_DEFAULT_INFINEON "\xff\xff\xff\xff\xff\xff" +#define MIFARE_CL_KEYB_DEFAULT_INFINEON MIFARE_CL_KEYA_DEFAULT_INFINEON + +#define MIFARE_CL_KEY_LEN (sizeof(MIFARE_CL_KEYA_DEFAULT)-1) + +#define MIFARE_CL_PAGE_MAX 0xff +#define MIFARE_CL_PAGE_SIZE 20 + +#define RFID_CMD_MIFARE_AUTH1A 0x60 +#define RFID_CMD_MIFARE_AUTH1B 0x61 + +enum rfid_proto_mfcl_opt { + RFID_OPT_P_MFCL_SIZE = 0x10000001, +}; + +#ifdef __LIBRFID__ + +extern const struct rfid_protocol rfid_protocol_mfcl; + + +#define MIFARE_CL_CMD_WRITE16 0xA0 +#define MIFARE_CL_CMD_WRITE4 0xA2 +#define MIFARE_CL_CMD_READ 0x30 + +#define MIFARE_CL_RESP_ACK 0x0a +#define MIFARE_CL_RESP_NAK 0x00 + +#endif /* __LIBRFID__ */ + +extern int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key); +extern int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block); + +#endif /* _MIFARE_CLASSIC_H */ diff --git a/librfid_1999/include/librfid/rfid_protocol_mifare_ul.h b/librfid_1999/include/librfid/rfid_protocol_mifare_ul.h new file mode 100644 index 0000000..593894e --- /dev/null +++ b/librfid_1999/include/librfid/rfid_protocol_mifare_ul.h @@ -0,0 +1,24 @@ +#ifndef _RFID_PROTOCOL_MFUL_H +#define _RFID_PROTOCOL_MFUL_H + +int rfid_mful_lock_page(struct rfid_protocol_handle *ph, unsigned int page); +int rfid_mful_lock_otp(struct rfid_protocol_handle *ph); + +#define MIFARE_UL_PAGE_MAX 15 + +#ifdef __LIBRFID__ + +#define MIFARE_UL_CMD_WRITE 0xA2 +#define MIFARE_UL_CMD_READ 0x30 + +#define MIFARE_UL_RESP_ACK 0x0a +#define MIFARE_UL_RESP_NAK 0x00 + +#define MIFARE_UL_PAGE_LOCK 2 +#define MIFARE_UL_PAGE_OTP 3 + +extern const struct rfid_protocol rfid_protocol_mful; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid_1999/include/librfid/rfid_protocol_tcl.h b/librfid_1999/include/librfid/rfid_protocol_tcl.h new file mode 100644 index 0000000..535af11 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_protocol_tcl.h @@ -0,0 +1,76 @@ +#ifndef _RFID_PROTOCOL_TCL_H +#define _RFID_PROTOCOL_TCL_H + +enum rfid_proto_tcl_opt { + RFID_OPT_P_TCL_ATS = 0x00010001, + RFID_OPT_P_TCL_ATS_LEN = 0x00010002, +}; + +#ifdef __LIBRFID__ + +enum tcl_transport_rate { + TCL_RATE_106 = 0x01, + TCL_RATE_212 = 0x02, + TCL_RATE_424 = 0x04, + TCL_RATE_848 = 0x08, +}; + +enum tcl_transport_transceive_flags { + TCL_TRANSP_F_TX_CRC = 0x01, /* transport adds TX CRC */ + TCL_TRANSP_F_RX_CRC = 0x02, +}; + +struct tcl_handle { + /* derived from ats */ + unsigned char *historical_bytes; /* points into ats */ + unsigned int historical_len; + + unsigned int fsc; /* max frame size accepted by card */ + unsigned int fsd; /* max frame size accepted by reader */ + unsigned int fwt; /* frame waiting time (in usec)*/ + unsigned char ta; /* divisor information */ + unsigned char sfgt; /* start-up frame guard time (in usec) */ + + /* otherwise determined */ + unsigned int cid; /* Card ID */ + unsigned int nad; /* Node Address */ + + unsigned int flags; + unsigned int state; /* protocol state */ + + unsigned int toggle; /* send toggle with next frame */ + + unsigned int ats_len; + unsigned char ats[256]; /* ATS cannot be bigger than FSD-2 bytes, + according to ISO 14443-4 5.2.2 */ +}; + +enum tcl_handle_flags { + TCL_HANDLE_F_NAD_SUPPORTED = 0x0001, + TCL_HANDLE_F_CID_SUPPORTED = 0x0002, + TCL_HANDLE_F_NAD_USED = 0x0010, + TCL_HANDLE_F_CID_USED = 0x0020, +}; + + +enum tcl_pcb_bits { + TCL_PCB_CID_FOLLOWING = 0x08, + TCL_PCB_NAD_FOLLOWING = 0x04, +}; + +enum tcl_pcd_state { + TCL_STATE_NONE = 0x00, + TCL_STATE_INITIAL, + TCL_STATE_RATS_SENT, /* waiting for ATS */ + TCL_STATE_ATS_RCVD, /* ATS received */ + TCL_STATE_PPS_SENT, /* waiting for PPS response */ + TCL_STATE_ESTABLISHED, /* xchg transparent data */ + TCL_STATE_DESELECT_SENT, /* waiting for DESELECT response */ + TCL_STATE_DESELECTED, /* card deselected or HLTA'd */ +}; + +extern const struct rfid_protocol rfid_protocol_tcl; + +#endif /* __LIBRFID__ */ + +#endif diff --git a/librfid_1999/include/librfid/rfid_reader.h b/librfid_1999/include/librfid/rfid_reader.h new file mode 100644 index 0000000..af2f4be --- /dev/null +++ b/librfid_1999/include/librfid/rfid_reader.h @@ -0,0 +1,85 @@ +#ifndef _RFID_READER_H +#define _RFID_READER_H + +#include +#include + +struct rfid_reader_handle; + +struct rfid_reader { + char *name; + unsigned int id; + unsigned int l2_supported; + unsigned int proto_supported; + + int (*get_api_version)( + struct rfid_reader_handle *h, + u_int8_t *version); + + int (*get_environment)( + struct rfid_reader_handle *rh, + unsigned char num_bytes, + unsigned char *buf); + + int (*set_environment)( + struct rfid_reader_handle *rh, + unsigned char num_bytes, + const unsigned char *buf); + + int (*reset)(struct rfid_reader_handle *h); + + int (*transceive)(struct rfid_reader_handle *h, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags); + struct rfid_reader_handle * (*open)(void *data); + void (*close)(struct rfid_reader_handle *h); + + struct rfid_14443a_reader { + int (*init)(struct rfid_reader_handle *h); + int (*transceive_sf)(struct rfid_reader_handle *h, + unsigned char cmd, + struct iso14443a_atqa *atqa); + int (*transceive_acf)(struct rfid_reader_handle *h, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col); + int (*set_speed)(struct rfid_reader_handle *h, + unsigned int tx, + unsigned int speed); + unsigned int speed; + } iso14443a; + struct rfid_14443b_reader { + int (*init)(struct rfid_reader_handle *rh); + unsigned int speed; + } iso14443b; + struct rfid_15693_reader { + int (*init)(struct rfid_reader_handle *rh); + } iso15693; + struct rfid_mifare_classic_reader { + int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key); + int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd, + u_int32_t serno, u_int8_t block); + } mifare_classic; +}; + +enum rfid_reader_id { + RFID_READER_CM5121, + RFID_READER_PEGODA, + RFID_READER_OPENPCD, +}; + +struct rfid_reader_handle { + struct rfid_asic_handle *ah; + + union { + + } priv; + struct rfid_reader *reader; +}; + +extern struct rfid_reader_handle * +rfid_reader_open(void *data, unsigned int id); + +extern void rfid_reader_close(struct rfid_reader_handle *rh); +#endif diff --git a/librfid_1999/include/librfid/rfid_reader_cm5121.h b/librfid_1999/include/librfid/rfid_reader_cm5121.h new file mode 100644 index 0000000..e3e64c0 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_reader_cm5121.h @@ -0,0 +1,22 @@ +#ifndef _RFID_READER_CM5121_H +#define _RFID_READER_CM5121_H + +#include + +#define CM5121_CW_CONDUCTANCE 0x3f +#define CM5121_MOD_CONDUCTANCE 0x3f +#define CM5121_14443A_BITPHASE 0xa9 +#define CM5121_14443A_THRESHOLD 0xff + +#define CM5121_14443B_BITPHASE 0xad +#define CM5121_14443B_THRESHOLD 0xff + +extern int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len); + +extern const struct rfid_reader rfid_reader_cm5121; +// extern struct rfid_asic_transport cm5121_ccid; + +#endif diff --git a/librfid_1999/include/librfid/rfid_reader_openpcd.h b/librfid_1999/include/librfid/rfid_reader_openpcd.h new file mode 100644 index 0000000..14b1f63 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_reader_openpcd.h @@ -0,0 +1,102 @@ +#ifndef _OPENPCD_PROTO_H +#define _OPENPCD_PROTO_H + +/* This header file describes the USB protocol of the OpenPCD RFID reader */ + +#include + +struct openpcd_hdr { + u_int8_t cmd; /* command. high nibble: class, + * low nibble: cmd */ + u_int8_t flags; + u_int8_t reg; /* register */ + u_int8_t val; /* value (in case of write *) */ + u_int8_t data[0]; +} __attribute__ ((packed)); + +#define OPCD_REV_LEN 16 +struct openpcd_compile_version { + char svnrev[OPCD_REV_LEN]; + char by[OPCD_REV_LEN]; + char date[OPCD_REV_LEN]; +} __attribute__ ((packed)); + +#define OPENPCD_FLAG_RESPOND 0x01 /* Response requested */ +#define OPENPCD_FLAG_ERROR 0x80 /* An error occurred */ + +enum openpcd_cmd_class { + OPENPCD_CMD_CLS_GENERIC = 0x0, + /* PCD (reader) side */ + OPENPCD_CMD_CLS_RC632 = 0x1, + //OPENPCD_CMD_CLS_LED = 0x2, + OPENPCD_CMD_CLS_SSC = 0x3, + OPENPCD_CMD_CLS_PWM = 0x4, + OPENPCD_CMD_CLS_ADC = 0x5, + /* PICC (transponder) side */ + OPENPCD_CMD_CLS_PICC = 0xe, + + OPENPCD_CMD_CLS_USBTEST = 0xf, +}; + +#define OPENPCD_REG_MAX 0x3f + +#define OPENPCD_CMD_CLS(x) (x >> 4) +#define OPENPCD_CMD(x) (x & 0xf) + +#define OPENPCD_CLS2CMD(x) (x << 4) + +#define OPENPCD_CMD_GET_VERSION (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_LED (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_SERIAL (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_API_VERSION (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_GET_ENVIRONMENT (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_SET_ENVIRONMENT (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) +#define OPENPCD_CMD_RESET (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC)) + +/* CMD_CLS_RC632 */ +#define OPENPCD_CMD_WRITE_REG (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_FIFO (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_WRITE_VFIFO (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_CLEAR (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_REG_BITS_SET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_REG (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_FIFO (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_READ_VFIFO (0x8|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_DUMP_REGS (0x9|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) +#define OPENPCD_CMD_IRQ (0xa|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632)) + +/* CMD_CLS_SSC */ +#define OPENPCD_CMD_SSC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) +#define OPENPCD_CMD_SSC_WRITE (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC)) + +/* CMD_CLS_PWM */ +#define OPENPCD_CMD_PWM_ENABLE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_SET (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_DUTY_GET (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_SET (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) +#define OPENPCD_CMD_PWM_FREQ_GET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM)) + +/* CMD_CLS_PICC */ +#define OPENPCD_CMD_PICC_REG_WRITE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) +#define OPENPCD_CMD_PICC_REG_READ (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC)) + +/* CMD_CLS_ADC */ +#define OPENPCD_CMD_ADC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_ADC)) + +/* CMD_CLS_USBTEST */ +#define OPENPCD_CMD_USBTEST_IN (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) +#define OPENPCD_CMD_USBTEST_OUT (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + +/* FIXME */ +#define OPENPCD_CMD_PIO_IRQ (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST)) + + +#define OPENPCD_VENDOR_ID 0x2342 +#define OPENPCD_PRODUCT_ID 0x0001 +#define OPENPCD_OUT_EP 0x01 +#define OPENPCD_IN_EP 0x82 +#define OPENPCD_IRQ_EP 0x83 + +extern const struct rfid_reader rfid_reader_openpcd; + +#endif diff --git a/librfid_1999/include/librfid/rfid_scan.h b/librfid_1999/include/librfid/rfid_scan.h new file mode 100644 index 0000000..50910fb --- /dev/null +++ b/librfid_1999/include/librfid/rfid_scan.h @@ -0,0 +1,18 @@ +#ifndef _RFID_SCAN_H +#define _RFID_SCAN_H + +#include +#include +#include + +struct rfid_layer2_handle * +rfid_layer2_scan(struct rfid_reader_handle *rh); + +struct rfid_protocol_handle * +rfid_protocol_scan(struct rfid_layer2_handle *l2h); + +int rfid_scan(struct rfid_reader_handle *rh, + struct rfid_layer2_handle **l2h, + struct rfid_protocol_handle **ph); + +#endif /* _RFID_SCAN_H */ diff --git a/librfid_1999/include/librfid/rfid_system.h b/librfid_1999/include/librfid/rfid_system.h new file mode 100644 index 0000000..9b6ffb7 --- /dev/null +++ b/librfid_1999/include/librfid/rfid_system.h @@ -0,0 +1,57 @@ +/* system / environment specific defines */ + +/* build for openpcd firmware */ +//#define LIBRFID_FIRMWARE + +/* build without dynamic allocations */ +//#define LIBRFID_STATIC + +#ifdef __LIBRFID__ + +#ifndef LIBRFID_STATIC +/* If we're not doing a firmware compile, then we just use the regular + * malloc()/free() functions as expected */ + +#define malloc_asic_handle(x) malloc(x) +#define free_asic_handle(x) free(x) + +#define malloc_layer2_handle(x) malloc(x) +#define free_layer2_handle(x) free(x) + +#define malloc_protocol_handle(x) malloc(x) +#define free_protocol_handle(x) free(x) + +#define malloc_rat_handle(x) malloc(x) +#define free_rat_handle(x) free(x) + +#define malloc_reader_handle(x) malloc(x) +#define free_reader_handle(x) free(x) + +#else +/* If we're actually doing a firmware compile, then we use pre-allocated + * handles in order to avoid dynamic memory allocation. */ + +#define EMPTY_STATEMENT do {} while(0) +extern struct rfid_asic_handle rfid_ah; +#define malloc_asic_handle(x) &rfid_ah +#define free_asic_handle(x) EMPTY_STATEMENT + +extern struct rfid_layer2_handle rfid_l2h; +#define malloc_layer2_handle(x) &rfid_l2h +#define free_layer2_handle(x) EMPTY_STATEMENT + +extern struct rfid_protocol_handle rfid_ph; +#define malloc_protocol_handle(x) &rfid_ph +#define free_protocol_handle(x) EMPTY_STATEMENT + +extern struct rfid_asic_transport_handle rfid_ath; +#define malloc_rat_handle(x) &rfid_ath +#define free_rat_handle(x) EMPTY_STATEMENT + +extern struct rfid_reader_handle rfid_rh; +#define malloc_reader_handle(x) &rfid_rh +#define free_reader_handle(x) EMPTY_STATEMENT + +#endif /* LIBRFID_STATIC */ + +#endif /* __LIBRFID__ */ diff --git a/librfid_1999/install-sh b/librfid_1999/install-sh new file mode 100644 index 0000000..6781b98 --- /dev/null +++ b/librfid_1999/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +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: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -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. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; 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 + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + 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 "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # 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: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # 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 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid_1999/librfid.spec b/librfid_1999/librfid.spec new file mode 100644 index 0000000..3823bf6 --- /dev/null +++ b/librfid_1999/librfid.spec @@ -0,0 +1,73 @@ +Name: librfid +Version: 0.1.0 +Release: 1%{?dist} +Summary: The librfid is a Free Software RFID library + +Group: System Environment/Libraries +License: GPL +URL: http://www.openmrtd.org/projects/librfid/ +Source0: http://www.openmrtd.org/projects/librfid/files/%{name}-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: libusb-devel + + +%description +librfid is a Free Software RFID library. It implements the PCD (reader) +side protocol stack of ISO 14443 A, ISO 14443 B, ISO 15693, +Mifare Ultralight and Mifare Classic. Support for iCODE and +other 13.56MHz based transponders is planned. + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%setup -q + + +%build +%configure --disable-static +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc COPYING README TODO +%{_libdir}/*.so.* +%{_bindir}/librfid-tool +%{_bindir}/mifare-tool +%{_bindir}/send_script + +%files devel +%defattr(-,root,root,-) +%doc COPYING README TODO +%{_includedir}/* +%{_libdir}/*.so + + +%changelog +* Sat Dec 30 2006 Kushal Das 0.1.0-1 +- Initial release diff --git a/librfid_1999/ltmain.sh b/librfid_1999/ltmain.sh new file mode 100644 index 0000000..ff25add --- /dev/null +++ b/librfid_1999/ltmain.sh @@ -0,0 +1,9248 @@ +# Generated from ltmain.m4sh. + +# libtool (GNU libtool 1.3110 2009-07-01) 2.2.7a +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009 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. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [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 +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# 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. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool 1.3110 2009-07-01) 2.2.7a +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.7a +TIMESTAMP=" 1.3110 2009-07-01" +package_revision=1.3110 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done + +$lt_unset CDPATH + + + + + + + +# 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" + + + +: ${CP="cp -f"} +: ${ECHO=$as_echo} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} + +# Generated shell functions inserted here. + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +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' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case "$1" in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# // + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *-h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +# $mode is unset +nonopt= +execute_dlfiles= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +opt_dry_run=false +opt_duplicate_deps=false +opt_silent=false +opt_debug=: + +# 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= + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_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 $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --help-all) opt_help=': help-all' ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *msys* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# 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 () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # 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. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # 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 + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # 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 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | msys* | mingw* | pw32* | os2* | cegcc*) + 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "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." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/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." + + $opt_dry_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 + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [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: $progname [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 + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [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 + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +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: $progname [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." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + 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 + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # 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 +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + 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. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && 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" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # 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. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + 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. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # 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 + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + 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 -e "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. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + 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 + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | msys* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_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 + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_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 + func_basename "$file" + destfile="$func_basename_result" + 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 + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *msys* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*|*/bin/install*,*msys*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *msys* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + eval '$sharedlib_from_linklib "$dlprefile"' + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist.tmp'" + # work around bug in msys gcc; puts __nm_ symbols in import lib even for functions + eval "cat '$nlist.tmp' | sed -n -e '/^D /p' | sort > '$nlist.tmpD'" + eval "cat '$nlist.tmp' | sed -n -e '/^T /p' | sort > '$nlist.tmpT'" + eval "join -j 2 -o 1.1,1.2 '$nlist.tmpD' '$nlist.tmpT' | sed -e 's|^|/^|' -e 's|\$|/d|' > '$nlist.tmp.sed'" + eval "cat '$nlist.tmp' | sed -f '$nlist.tmp.sed' > '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # 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/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *msys* | *mingw* | *cegcc* ) + echo >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + echo >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + 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*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *msys* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + 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 "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# 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. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + 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 'file format (pei?-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + 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_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + sed '/^Contents of section '"$1"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ \t]*file format pe[i]\{,1\}-i386$/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remoaining lines, remove first 43 characters + s/^.\{43\}//' | + sed -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p + ' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + sed -e '/^\./d' -e '/^.\./d' | sed -n -e '1p' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_cygming_gnu_implib_tmp=`eval "\$NM \$1 | \$global_symbol_pipe | \$EGREP ' (_head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname)\\\$'"` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_cygming_ms_implib_tmp=`eval "\$NM \$1 | \$global_symbol_pipe | grep '_NULL_IMPORT_DESCRIPTOR'"` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + 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 + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_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've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + 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 -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_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" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# 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 variables: + generated_by_libtool_version='$macro_version' + 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 + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all exist in the "--lt-" namespace +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done +} + +# Sets opts_contain_lt_result to \"yes\" if the +# supplied arguments contain any elements in the +# --lt-* namespace. Empty otherwise. +opts_contain_lt_result= +func_opts_contain_lt () +{ + opts_contain_lt_result= + for lt_option + do + case \"\$lt_option\" in + --lt-*) opts_contain_lt_result=yes + break ;; + *) ;; + esac + done +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"(main) newargz[\$lt_dump_args_N] : \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"(main) lt_argv_zero : \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"(main) lt_argv_zero : \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + func_opts_contain_lt \${1+\"\$@\"} + if test -n \"\$opts_contain_lt_result\"; then + # the following is adapted from _AC_INIT_PREPARE, except + # (1) we don't care about duplicates, and + # (2) we strip out --lt-*, not --no-create/--no-recursion/--silent + lt_wrapper_args= + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) continue ;; + *\\'*) + lt_wr_arg=\`\$ECHO \"X\$lt_wr_arg\" | + $SED -e \"s/^X//\" -e \"s/'/'\\\\\\\\\\\\\\\\''/g\"\` + ;; + esac + lt_wrapper_args=\"\$lt_wrapper_args '\$lt_wr_arg'\" + done + eval func_exec_program_core \$lt_wrapper_args + else + func_exec_program_core \${1+\"\$@\"} + fi +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + 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 "\ + + # 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 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + 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 "\ + # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + 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 1 + fi +fi\ +" +} + +#################################### +# PATH CONVERSION HELPER FUNCTIONS # +#################################### + +# func_wine_to_win32_path ARG +# Helper function used by path conversion functions +# when $build is *nix, and $host is mingw, cygwin, +# or some other win32 environment. Relies on a +# correctly configured wine environment available, +# with the winepath program in $build's $PATH. +# +# ARG is the $build path to be converted to win32 format. +# result is available in $func_wine_to_win32_path_result +# result is empty on error (or when arg is empty) +func_wine_to_win32_path () +{ + $opt_debug + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + func_wine_to_win32_path_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_wine_to_win32_path_tmp}"; then + func_to_host_path_result=`$ECHO "$func_wine_to_win32_path_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_wine_to_win32_path_result= + fi + fi +} +# end: func_wine_to_win32_path + + +# func_wine_to_win32_pathlist ARG +# Helper function used by path conversion functions +# when $build is *nix, and $host is mingw, cygwin, +# or some other win32 environment. Relies on a +# correctly configured wine environment available, +# with the winepath program in $build's $PATH. +# Assumes ARG has no leading or trailing path separator +# characters. +# +# ARG is pathlist to be converted from $build format to win32. +# Result is available in $func_wine_to_win32_pathlist_result +# Unconvertible paths in pathlist are skipped; if no paths +# are convertible, result may be empty. +func_wine_to_win32_pathlist () +{ + $opt_debug + # unfortunately, winepath doesn't convert pathlists + func_wine_to_win32_pathlist_result="" + if test -n "$1"; then + func_wine_to_win32_pathlist_oldIFS=$IFS + IFS=: + for func_wine_to_win32_pathlist_f in $1; do + IFS=$func_wine_to_win32_pathlist_oldIFS + if test -n "$func_wine_to_win32_pathlist_f" ; then + func_wine_to_win32_path "$func_wine_to_win32_pathlist_f" + if test -n "$func_wine_to_win32_path_result" ; then + if test -z "$func_wine_to_win32_pathlist_result"; then + func_wine_to_win32_pathlist_result="$func_wine_to_win32_path_result" + else + func_append func_wine_to_win32_pathlist_result ";$func_wine_to_win32_path_result" + fi + fi + fi + done + IFS=$func_wine_to_win32_pathlist_oldIFS + fi +} +# end: func_wine_to_win32_pathlist + + +# func_cygpath ARGS... +# a wrapper around calling the cygpath program via +# LT_CYGPATH, when $host is *nix and cygwin is +# hosted via a wine environment (or, rarely, when +# host is mingw -- that is, msys). +# +# Result is available in func_cygpath_result, which +# may be empty on error. Can accomodate both paths +# and pathlists (with appropriate options). +# +# ARGS are the typical arguments and options for +# the cygpath program. Usually, the last argument +# is the path or pathlist to be converted. +# +# The full *nix (or msys) path to the cygpath program must be +# specified in the LT_CYGPATH environment variable. This +# is because (a) the cygpath program shouldn't be in $PATH, +# because it usually lives in cygwin's bin/ directory -- +# along with *cygwin* versions of sed, id, cp. If the *nix (or +# msys) host environment had those programs in its $PATH, many +# bad things could happen. (b) especially in cygwin-1.7, multiple +# installations (with separate "mount tables" in +# /etc/fstab) can coexist on the same Win32 +# instance. The cygpath.exe for cygwin installation #N in +# /bin automatically deduces the appropriate +# ../etc/fstab file. Therefore, it matters which cygpath.exe +# is used. LT_CYGPATH may be replaced or supplemented by an +# LT_INIT-activated configure option in the future. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existant file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_msys_to_win32 ARG +# Converts ARG from msys (unix-ish) format to +# win32 format. Can accomodate both paths and pathlists. +# Result is available in func_msys_to_win32_result. +func_msys_to_win32 () +{ + $opt_debug + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # awkward: cmd appends spaces to result + func_msys_to_win32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_msys_to_win32 + + +# func_path_convert_check ARG1 ARG2 +# Verify that ARG1 (a path in $build format) was +# converted to $host format in ARG2. Otherwise, emit +# an error message, but continue (resetting +# func_to_host_path_result to ARG1). +func_path_convert_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host path corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi +} +# end func_path_convert_check + + +# func_pathlist_convert_check FROM_PATHSEP TO_PATHSEP FROM_PATHLIST TO_PATHLIST +# Verify that FROM_PATHLIST (a path in $build format) was converted +# $host format in TO_PATHLIST. Otherwise, emit an error message, but +# continue, resetting func_to_host_path_result to a simplistic +# fallback value (see below). +func_pathlist_convert_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path(s) corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. If even this fallback fails, the fix is not to + # complicate the expression below, but for the user to provide, + # in that situation, whatever elements are missing from the + # environment so that the actual pathlist conversion functions + # work properly (for instance, a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works). + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_pathlist_result=`echo "$3" |\ + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_pathlist_result="$3" + fi + fi +} +# end func_pathlist_convert_check + + +# func_pathlist_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_pathlist_result by prepending REPL +# if ORIG matches FRONTPAT and appending REPL if ORIG matches +# BACKPAT. +func_pathlist_front_back_pathsep () +{ + $opt_debug + case "$4" in + $1 ) func_to_host_pathlist_result="$3$func_to_host_pathlist_result" + ;; + esac + case "$4" in + $2 ) func_append func_to_host_pathlist_result "$3" + ;; + esac +} +# end func_pathlist_front_back_pathsep + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `eval $to_host_path_cmd ARG' +# +# At present, the following path conversions are supported: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# mingw (msys) cygwin [*] [**] +# *nix + wine cygwin [**] +# where wine is equipped with the `winepath' executable. +# [*] available, but not officially supported. See comments with +# func_msys_to_cygwin_path_convert. +# [**] requires environment variable $LT_CYGPATH. See comments +# with func_cygpath. +# In each case, ARG is the path to be converted from $build +# to $host format. the result will be available in +# $func_to_host_path_result. + + +# func_to_host_path ARG +# converts the path ARG from $build format to $host +# format. +func_to_host_path () +{ + $opt_debug + eval '$to_host_path_cmd "$1"' +} +# end func_to_host_path + + +# func_noop_path_convert ARG +# A no-op path conversion function for use when $build == $host. +# or when there is no required (or known) conversion function +# between $build and $host. +func_noop_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" +} +# end func_noop_path_convert + + +# func_msys_to_mingw_path_convert ARG +# A path conversion function for use with "native" mingw +# builds -- that is, when $host is *mingw*, and $build +# is *mingw* (which is to say, msys). In this case, the +# msys shell automatically converts paths for any non-msys +# applications it launches, but that facility isn't available +# from inside the cwrapper. +# +# ARG is the path to be converted; the result is available +# in func_to_host_path_result. +func_msys_to_mingw_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + func_msys_to_win32 "$1" + func_to_host_path_result="$func_msys_to_win32_result" + fi + func_path_convert_check "$1" "$func_to_host_path_result" +} +# end func_msys_to_mingw_path_convert + + +# func_cygwin_to_mingw_path_convert ARG +# A path conversion function for use when $host is *mingw* +# but $build is *cygwin*. In this case, the cygpath program +# provided by the $build environment is sufficient for all +# conversions. +# +# ARG is the path to be converted; the result is available +# in func_to_host_path_result. +func_cygwin_to_mingw_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath + # in $PATH; no need to use LT_CYGPATH in this case. + func_to_host_path_result=`cygpath -m "$1"` + fi + func_path_convert_check "$1" "$func_to_host_path_result" +} +# end func_cygwin_to_mingw_path_convert + + +# func_nix_to_mingw_path_convert ARG +# A path conversion function for use when $host is *mingw* +# but $build is some *nix variant. In this case, we assume +# that a wine environment with a working winepath executable +# is available in $build's $PATH. +# +# ARG is the path to be converted; the result is available +# in func_to_host_path_result. +func_nix_to_mingw_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + func_wine_to_win32_path "$1" + func_to_host_path_result="$func_wine_to_win32_path_result" + fi + func_path_convert_check "$1" "$func_to_host_path_result" +} +# end func_nix_to_mingw_path_convert + + +# func_msys_to_cygwin_path_convert ARG +# A path conversion function for use when $host is *cygwin* +# but $build is *mingw* (that is, msys). This implies running +# a cross build from msys to cygwin -- but msys has notorious +# problems executing cygwin apps, because of conflicts between +# cygwin1.dll and msys-1.0.dll. However, we'll try it. First, +# convert from msys to win32, then use func_cygpath to convert +# from win32 to cygwin. Requires LT_CYGPATH. +# +# ARG is the path to be converted; the result is available +# in func_to_host_path_result. +func_msys_to_cygwin_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + func_msys_to_win32 "$1" + func_cygpath -u "$func_msys_to_win32_result" + func_to_host_path_result="$func_cygpath_result" + fi + func_path_convert_check "$1" "$func_to_host_path_result" +} +# end func_msys_to_cygwin_path_convert + +# func_nix_to_cygwin_path_convert ARG +# A path conversion function for use when $host is *cygwin* +# but $build is some *nix variant. In this case, we assume +# that a wine environment with a working winepath executable +# is available in $build's $PATH, and that cygwin is installed +# within that wine environment. Requires LT_CYGPATH (see +# func_cygpath). +# +# ARG is the path to be converted; the result is available +# in func_to_host_path_result. +func_nix_to_cygwin_path_convert () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # convert from *nix to win32, then use cygpath to + # convert from win32 to cygwin. + func_wine_to_win32_path "$1" + func_cygpath -u "$func_wine_to_win32_path_result" + func_to_host_path_result="$func_cygpath_result" + fi + func_path_convert_check "$1" "$func_to_host_path_result" +} +# end func_nix_to_cygwin_path_convert + + +################################################# +# $build to $host PATHLIST CONVERSION FUNCTIONS # +################################################# +# invoked via `eval $to_host_pathlist_cmd ARG' +# +# At present, the following pathlist conversions are supported: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# mingw (msys) cygwin [*] [**] +# *nix + wine cygwin [**] +# where wine is equipped with the `winepath' executable. +# [*] available, but not officially supported. See comments with +# func_msys_to_cygwin_pathlist_convert. +# [**] requires environment variable $LT_CYGPATH. See comments +# with func_cygpath. +# In each case, ARG is the pathlist to be converted from +# $build to $host format. the result will be available in +# $func_to_host_pathlist_result. +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. + + +# func_init_to_host_pathlist_cmd +# Ensures that function "pointer" variable +# $to_host_pathlist_cmd is set to the appropriate +# value, based on the value of $to_host_path_cmd. +# +# ASSUMPTIONS: all such conversion functions are +# named using the following convention: +# path conversion function : xxxxxx_path_convert () +# pathlist conversion function: xxxxxx_pathlist_convert () +# where, for any given $build/$host combination the 'xxxxxx' +# value is the same. +to_host_pathlist_cmd= +func_init_to_host_pathlist_cmd () +{ + $opt_debug + if test -z "$to_host_pathlist_cmd"; then + func_stripname '' '_path_convert' "$to_host_path_cmd" + to_host_pathlist_cmd="${func_stripname_result}_pathlist_convert" + fi +} + + +# func_to_host_pathlist ARG +# converts the pathlist ARG from $build format to $host +# format. +func_to_host_pathlist () +{ + $opt_debug + func_init_to_host_pathlist_cmd + eval '$to_host_pathlist_cmd "$1"' +} +# end func_to_host_pathlist + + +# func_noop_pathlist_convert ARG +# A no-op pathlist conversion function for use when $build == $host, +# or when there is no required (or known) conversion function +# between $build and $host. +func_noop_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" +} +# end func_noop_pathlist_convert + + +# func_msys_to_mingw_pathlist_convert ARG +# A pathlist conversion function for use with "native" mingw +# builds -- that is, when $host is *mingw*, and $build +# is *mingw* (which is to say, msys). In this case, the +# msys shell automatically converts pathlists for any non-msys +# applications it launches, but that facility isn't available +# from inside the cwrapper. +# +# ARG is the pathlist to be converted; the result is available +# in func_to_host_pathlist_result. +func_msys_to_mingw_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + func_msys_to_win32 "$func_to_host_pathlist_tmp1" + func_to_host_pathlist_result="$func_msys_to_win32_result" + func_pathlist_convert_check ":" ";" \ + "$func_to_host_pathlist_tmp1" "$func_to_host_pathlist_result" + func_pathlist_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_msys_to_mingw_pathlist_convert + + +# func_cygwin_to_mingw_pathlist_convert ARG +# A pathlist conversion function for use when $host is *mingw* +# but $build is *cygwin*. In this case, the cygpath program +# provided by the $build environment is sufficient for all +# conversions. +# +# ARG is the pathlist to be converted; the result is available +# in func_to_host_pathlist_result. +func_cygwin_to_mingw_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + func_to_host_pathlist_result=`cygpath -m -p "$func_to_host_pathlist_tmp1"` + func_pathlist_convert_check ":" ";" \ + "$func_to_host_pathlist_tmp1" "$func_to_host_pathlist_result" + func_pathlist_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_cygwin_to_mingw_pathlist_convert + + +# func_nix_to_mingw_pathlist_convert ARG +# A pathlist conversion function for use when $host is *mingw* +# but $build is some *nix variant. In this case, we assume +# that a wine environment with a working winepath executable +# is available in $build's $PATH. +# +# ARG is the pathlist to be converted; the result is available +# in func_to_host_pathlist_result. +func_nix_to_mingw_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + func_wine_to_win32_pathlist "$func_to_host_pathlist_tmp1" + func_to_host_pathlist_result="$func_wine_to_win32_pathlist_result" + func_pathlist_convert_check ":" ";" \ + "$func_to_host_pathlist_tmp1" "$func_to_host_pathlist_result" + func_pathlist_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_nix_to_mingw_pathlist_convert + + +# func_msys_to_cygwin_pathlist_convert ARG +# A pathlist conversion function for use when $host is *cygwin* +# but $build is *mingw* (that is, msys). This implies running +# a cross build from msys to cygwin -- but msys has notorious +# problems executing cygwin apps, because of conflicts between +# cygwin1.dll and msys-1.0.dll. However, we'll try it. First, +# convert from msys to win32, then use func_cygpath to convert +# from win32 to cygwin. Requires LT_CYGPATH. +# +# ARG is the pathlist to be converted; the result is available +# in func_to_host_pathlist_result. +func_msys_to_cygwin_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + func_msys_to_win32 "$func_to_host_pathlist_tmp1" + func_cygpath -u -p "$func_msys_to_win32_result" + func_to_host_pathlist_result="$func_cygpath_result" + func_pathlist_convert_check ":" ":" \ + "$func_to_host_pathlist_tmp1" "$func_to_host_pathlist_result" + func_pathlist_front_back_pathsep ":*" "*:" ":" "$1" + fi +} +# end func_msys_to_cygwin_pathlist_convert + + +# func_nix_to_cygwin_pathlist_convert ARG +# A pathlist conversion function for use when $host is *cygwin* +# but $build is some *nix variant. In this case, we assume +# that a wine environment with a working winepath executable +# is available in $build's $PATH, and that cygwin is installed +# within that wine environment. Requires LT_CYGPATH (see +# func_cygpath). +# +# ARG is the pathlist to be converted; the result is available +# in func_to_host_pathlist_result. +func_nix_to_cygwin_pathlist_convert () +{ + $opt_debug + func_to_host_pathlist_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + func_wine_to_win32_pathlist "$func_to_host_pathlist_tmp1" + func_cygpath -u -p "$func_wine_to_win32_pathlist_result" + func_to_host_pathlist_result="$func_cygpath_result" + func_pathlist_convert_check ":" ":" \ + "$func_to_host_pathlist_tmp1" "$func_to_host_pathlist_result" + func_pathlist_front_back_pathsep ":*" "*:" ":" "$1" + fi +} +# end func_nix_to_cygwin_pathlist_convert + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# ifndef __MSYS__ +# include +# endif +# if defined(__CYGWIN__) || defined(__MSYS__) +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) || defined(__MSYS__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) || defined(__MSYS__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +# ifndef __intptr_t_defined + typedef long intptr_t; +# define __intptr_t_defined +# endif +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_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 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *fmt, ...); +void lt_fatal (const char *message, ...); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); + +EOF + + cat <")); + for (i = 0; i < newargc; i++) + { + lt_debugprintf ("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "")); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + lt_debugprintf ("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"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; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + lt_debugprintf ("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf ("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf ("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf ("checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("Could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +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; +} + +void +lt_debugprintf (const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +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); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf ("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : "")); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf ("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : "")); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf ("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : "")); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_emit_exe_manifest +# emit a Win32 UAC manifest for executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_exe_manifest () +{ + cat < + + + + + + + + + + + + +EOF +} + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_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 + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append 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" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$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 func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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. + func_append 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 + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + 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 + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + 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 + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -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 + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + 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*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-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 System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && 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 + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + 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*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # 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 + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # -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*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + 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. + func_append 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 + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool 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. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + 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 $opt_duplicate_deps ; 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 $opt_duplicate_compiler_generated_deps; 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 dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + 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 + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + 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 "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + 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|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; 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 func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + 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 + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + 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 + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + 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 + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # 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) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + 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 use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + 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 + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # 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 + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + 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 + func_fatal_error "cannot find name of link library for \`$lib'" + 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" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + 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 + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + 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 + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # 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 + func_warning "library \`$lib' was moved." + 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 + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *msys* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + newdlprefiles="$newdlprefiles $dir/$linklib" + else + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + 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" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $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 + ;; + esac + 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*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + 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 $opt_duplicate_deps ; 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 "$prefer_static_libs,$installed" = "built,yes"; } || + 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 + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *msys* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && 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 + shift + realname="$1" + 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* | *msys* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + 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.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; 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 + elif test -n "$old_library"; then + 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 && + test "$hardcode_direct_absolute" = no; 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 + func_fatal_configuration "unsupported hardcode properties" + 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 && + test "$hardcode_direct_absolute" = no; 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 + 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*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + 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 $opt_duplicate_deps ; 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 + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + 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 "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + 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" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # 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*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + 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 + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # 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="$1" + number_minor="$2" + number_revision="$3" + # + # 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|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + 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]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + 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]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + 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 + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + 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 + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + 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 + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + 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 + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + 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 | *.gcno) + ;; + $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 + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "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* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-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. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # 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. + $opt_dry_run || $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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 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 + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + 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 + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + 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 + ;; + esac + ;; + 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 with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + 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 + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # 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 + shift + realname="$1" + 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" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | msys* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $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" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + 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 + $opt_dry_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:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # 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 + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + echo ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append 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. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + 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~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "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" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + 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\" + test "X$libobjs" = "X " && libobjs= + 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 + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_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 and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${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" + # $opt_dry_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" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*|*msys*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *msys* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_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" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED '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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin* | *msys* ) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *msys* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + # Create the UAC manifests first if necessary + case $output_name in + *instal*|*patch*|*setup*|*update*) + func_emit_exe_manifest > $cwrapper.manifest + func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest + ;; + esac + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + 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 $symfileobj" + 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" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + 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 + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # 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 + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$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 + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$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 + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$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= + len=$len0 + 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 + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "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}\" || $lt_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 + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + 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) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + 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 | *msys*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# 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' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_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 + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + 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 + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + 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 func_lalib_p "$file"; then + func_source $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" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $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) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $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 func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # 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 + func_show_eval "$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 + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# 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: +# vi:sw=2 + diff --git a/librfid_1999/missing b/librfid_1999/missing new file mode 100644 index 0000000..28055d2 --- /dev/null +++ b/librfid_1999/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 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, see . + +# 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=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# 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' + autom4te touch the output file, or create a stub one + 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] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +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 + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# 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). This is about non-GNU programs, so use $1 not +# $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 $program 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/librfid_1999/openct-cm5121-librfid.patch b/librfid_1999/openct-cm5121-librfid.patch new file mode 100644 index 0000000..1163cb6 --- /dev/null +++ b/librfid_1999/openct-cm5121-librfid.patch @@ -0,0 +1,306 @@ +diff -Nru openct-0.6.7/src/ifd/Makefile.am openct-0.6.7-rfid/src/ifd/Makefile.am +--- openct-0.6.7/src/ifd/Makefile.am 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/Makefile.am 2006-05-27 19:32:21.000000000 +0200 +@@ -20,7 +20,7 @@ + ifd-wbeiuu.c \ + \ + proto-gbp.c proto-sync.c proto-t0.c proto-t1.c \ +- proto-trans.c \ ++ proto-trans.c proto-escape.c \ + \ + sys-sunray.c sys-solaris.c sys-bsd.c sys-linux.c sys-null.c sys-osx.c \ + \ +diff -Nru openct-0.6.7/src/ifd/ifd-ccid.c openct-0.6.7-rfid/src/ifd/ifd-ccid.c +--- openct-0.6.7/src/ifd/ifd-ccid.c 2006-04-24 21:52:03.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/ifd-ccid.c 2006-05-27 19:46:29.000000000 +0200 +@@ -5,6 +5,9 @@ + * + * 2005-04-20: Harald Welte + * Add support for PCMCIA based CCID Device (CardMan 4040) ++ * ++ * 2005-05-22: Harald Welte ++ * Add suport for OmniKey Cardman 5121 RFID extensions + */ + + #include "internal.h" +@@ -122,6 +125,7 @@ + + #define SUPPORT_T0 0x1 + #define SUPPORT_T1 0x2 ++#define SUPPORT_ESCAPE 0x80 + + #define SUPPORT_50V 1 + #define SUPPORT_33V 2 +@@ -740,6 +744,12 @@ + st->reader_type = TYPE_TPDU; + } + ++ if (de.idVendor == 0x076b && de.idProduct == 0x5121) { ++ /* special handling of RFID part of OmniKey 5121 */ ++ reader->nslots++; /* one virtual slot for RFID escape */ ++ st->proto_support |= SUPPORT_ESCAPE; ++ } ++ + return 0; + } + +@@ -816,6 +826,13 @@ + int any = 0; + int i, j, bits, stat; + ++ if (st->proto_support & SUPPORT_ESCAPE ++ && slot == reader->nslots-1) { ++ ifd_debug(1, "virtual escape slot, setting card present\n"); ++ *status = IFD_CARD_PRESENT; ++ return 0; ++ } ++ + i = 1 + (slot / 4); + j = 2 * (slot % 4); + stat = 0; +@@ -880,6 +897,8 @@ + return 0; + } + ++static int ccid_set_protocol(ifd_reader_t *reader, int s, int proto); ++ + /* + * Reset + */ +@@ -898,6 +917,13 @@ + if (!(status & IFD_CARD_PRESENT)) + return IFD_ERROR_NO_CARD; + ++ if (st->proto_support & SUPPORT_ESCAPE ++ && slot == reader->nslots-1) { ++ ifd_debug(1, "slot: %d, setting atr to 0xff", slot); ++ *((char *)atr) = 0xff; ++ ccid_set_protocol(reader, slot, IFD_PROTOCOL_ESCAPE); ++ return 1; ++ } + memset(ctlbuf, 0, 3); + + n = -1; +@@ -940,6 +966,17 @@ + ifd_atr_info_t atr_info; + int r; + ++ slot = &reader->slot[s]; ++ ++ /* If we support RFID escaping, we only allow ESCAPE protocol ++ * at the last (== virtual) slot */ ++ if ((st->proto_support & SUPPORT_ESCAPE) ++ && (proto != IFD_PROTOCOL_ESCAPE) ++ && (s == reader->nslots-1)) { ++ ct_error("reader doesn't support this protocol at this slot\n"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ + switch (proto) { + case IFD_PROTOCOL_T0: + if (!(st->proto_support & SUPPORT_T0)) { +@@ -953,13 +990,36 @@ + return IFD_ERROR_NOT_SUPPORTED; + } + break; ++ case IFD_PROTOCOL_ESCAPE: ++ /* virtual "escape" fallthrough protocol for stacking RFID ++ * protocol stack on top of openct */ ++ if (!(st->proto_support & SUPPORT_ESCAPE)) { ++ ct_error("reader does not support this protocol"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ if (s != reader->nslots-1) { ++ ct_error("reader doesn't support this protocol at this slot"); ++ return IFD_ERROR_NOT_SUPPORTED; ++ } ++ p = ifd_protocol_new(IFD_PROTOCOL_ESCAPE,reader, slot->dad); ++ if (!p) { ++ ct_error("%s: internal error", reader->name); ++ return -1; ++ } ++ if (slot->proto) { ++ ifd_protocol_free(slot->proto); ++ slot->proto = NULL; ++ } ++ slot->proto = p; ++ st->icc_proto[s] = proto; ++ ifd_debug(1, "set protocol to ESCAPE\n"); ++ return 0; ++ break; + default: + ct_error("protocol unknown"); + return IFD_ERROR_NOT_SUPPORTED; + } + +- slot = &reader->slot[s]; +- + if (st->reader_type == TYPE_APDU) { + p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, + reader, slot->dad); +@@ -1103,6 +1163,27 @@ + return 0; + } + ++static int ccid_escape(ifd_reader_t *reader, int slot, void *sbuf, ++ size_t slen, void *rbuf, size_t rlen) ++{ ++ unsigned char sendbuf[CCID_MAX_MSG_LEN]; ++ unsigned char recvbuf[CCID_MAX_MSG_LEN]; ++ int r; ++ ++ ifd_debug(1, "slot: %d, slen %d, rlen %d", slot, slen, rlen); ++ ++ r = ccid_prepare_cmd(reader, sendbuf, sizeof(sendbuf), slot, ++ CCID_CMD_ESCAPE, NULL, sbuf, slen); ++ if (r < 0) ++ return r; ++ ++ r = ccid_command(reader, &sendbuf[0], r, recvbuf, sizeof(recvbuf)); ++ if (r < 0) ++ return r; ++ ++ return ccid_extract_data(&recvbuf, r, rbuf, rlen); ++} ++ + static int + ccid_transparent(ifd_reader_t * reader, int slot, + const void *sbuf, size_t slen, void *rbuf, size_t rlen) +@@ -1177,6 +1258,7 @@ + ccid_driver.transparent = ccid_transparent; + ccid_driver.send = ccid_send; + ccid_driver.recv = ccid_recv; ++ ccid_driver.escape = ccid_escape; + + ifd_driver_register("ccid", &ccid_driver); + } +diff -Nru openct-0.6.7/src/ifd/init.c openct-0.6.7-rfid/src/ifd/init.c +--- openct-0.6.7/src/ifd/init.c 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/init.c 2006-05-27 19:32:21.000000000 +0200 +@@ -54,6 +54,7 @@ + ifd_protocol_register(&ifd_protocol_2wire); + ifd_protocol_register(&ifd_protocol_3wire); + ifd_protocol_register(&ifd_protocol_eurochip); ++ ifd_protocol_register(&ifd_protocol_esc); + + if (ifd_conf_get_integer("debug", &ival) >= 0 && ival > ct_config.debug) + ct_config.debug = ival; +diff -Nru openct-0.6.7/src/ifd/internal.h openct-0.6.7-rfid/src/ifd/internal.h +--- openct-0.6.7/src/ifd/internal.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/ifd/internal.h 2006-05-27 19:32:21.000000000 +0200 +@@ -118,6 +118,7 @@ + extern struct ifd_protocol_ops ifd_protocol_2wire; + extern struct ifd_protocol_ops ifd_protocol_3wire; + extern struct ifd_protocol_ops ifd_protocol_eurochip; ++extern struct ifd_protocol_ops ifd_protocol_esc; + + extern void ifd_acr30u_register(void); + extern void ifd_cardman_register(void); +diff -Nru openct-0.6.7/src/ifd/proto-escape.c openct-0.6.7-rfid/src/ifd/proto-escape.c +--- openct-0.6.7/src/ifd/proto-escape.c 1970-01-01 01:00:00.000000000 +0100 ++++ openct-0.6.7-rfid/src/ifd/proto-escape.c 2006-05-27 19:32:21.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * Escape protocol - simply pass everything to the reader driver's escape() ++ * ++ * This is required for exporting access to vendor-specific CCID extensions, ++ * such as the Omnikey CardMan 5121 RFID support. ++ * ++ * The higher-level applications select a virtual slot (the last available slot ++ * number). This virtual slot will automatically get the IFD_PROTOCOL_ESCAPE ++ * assgigned to it and can then be used to transceive() data to/from the CCID. ++ * ++ * It's a bit ugly, but I was unable to come up with something cleaner. ++ * ++ * Copyright (C) 2005, Harald Welte ++ */ ++ ++#include "internal.h" ++#include ++#include ++#include ++ ++static int ++escape_init(ifd_protocol_t *prot) ++{ ++ ifd_reader_t *reader = prot->reader; ++ const ifd_driver_t *drv; ++ ++ if (!reader || !(drv = reader->driver) ++ || !drv->ops || !drv->ops->escape) ++ return -1; ++ return 0; ++} ++ ++static void ++escape_release(ifd_protocol_t *prot) ++{ ++ /* NOP */ ++} ++ ++static int ++escape_set_param(ifd_protocol_t *prot, int type, long value) ++{ ++ ct_error("set_pameter not supported"); ++ return -1; ++} ++ ++static int ++escape_get_param(ifd_protocol_t *prot, int type, long *result) ++{ ++ ct_error("get_pameter not supported"); ++ return -1; ++} ++ ++static int ++escape_transceive(ifd_protocol_t *prot, int dad, ++ const void *sbuf, size_t slen, ++ void *rbuf, size_t rlen) ++{ ++ ifd_reader_t *reader = prot->reader; ++ const ifd_driver_t *drv = reader->driver; ++ ++ return drv->ops->escape(reader, dad, sbuf, slen, rbuf, rlen); ++} ++ ++struct ifd_protocol_ops ifd_protocol_esc = { ++ IFD_PROTOCOL_ESCAPE, /* id */ ++ "escape", /* name */ ++ sizeof(ifd_protocol_t), /* size */ ++ escape_init, /* init */ ++ escape_release, /* release */ ++ escape_set_param, /* set_param */ ++ escape_get_param, /* get_param */ ++ NULL, /* resynchronize */ ++ escape_transceive, /* transceive */ ++ NULL, /* sync_read */ ++ NULL, /* sync_write */ ++}; ++ +diff -Nru openct-0.6.7/src/include/openct/driver.h openct-0.6.7-rfid/src/include/openct/driver.h +--- openct-0.6.7/src/include/openct/driver.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/include/openct/driver.h 2006-05-27 19:32:21.000000000 +0200 +@@ -318,6 +318,11 @@ + int (*sync_write)(ifd_reader_t *reader, int slot, int proto, + unsigned short addr, + const unsigned char *sbuf, size_t slen); ++ ++ /*Support for transparent access to "escape" */ ++ int (*escape)(ifd_reader_t *reader, int slot, ++ void *sbuf, size_t slen, ++ void *rbuf, size_t rlen); + }; + + extern void ifd_driver_register(const char *, +diff -Nru openct-0.6.7/src/include/openct/ifd.h openct-0.6.7-rfid/src/include/openct/ifd.h +--- openct-0.6.7/src/include/openct/ifd.h 2006-04-21 08:37:58.000000000 +0200 ++++ openct-0.6.7-rfid/src/include/openct/ifd.h 2006-05-27 19:42:54.000000000 +0200 +@@ -29,6 +29,8 @@ + IFD_PROTOCOL_TLP, /* older Gemplus protocol */ + IFD_PROTOCOL_GBP, /* Gemplus block protocol */ + IFD_PROTOCOL_EUROCHIP, /* Eurochip Countercard */ ++ IFD_PROTOCOL_TCL, /* ISO 14443-4 T=CL */ ++ IFD_PROTOCOL_ESCAPE, /* Virtual 'escape' protocol */ + IFD_PROTOCOL_TRANSPARENT = 128 + }; + diff --git a/librfid_1999/pegoda/Makefile b/librfid_1999/pegoda/Makefile new file mode 100644 index 0000000..7310022 --- /dev/null +++ b/librfid_1999/pegoda/Makefile @@ -0,0 +1,8 @@ + +all: pegoda + +pegoda: pegoda.o + $(CC) -lusb -o $@ $^ + +clean: + rm -f pegoda *.o diff --git a/librfid_1999/pegoda/pegoda.c b/librfid_1999/pegoda/pegoda.c new file mode 100644 index 0000000..8b73755 --- /dev/null +++ b/librfid_1999/pegoda/pegoda.c @@ -0,0 +1,298 @@ +/* + * (C) 2005 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + + +#include +#include +#include +#include +#include + +#include +#include "pegoda.h" + +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +struct pegoda_handle { + struct usb_dev_handle *handle; + unsigned char seq; + unsigned char snr[4]; +}; + + +struct usb_device *find_device(u_int16_t vendor, u_int16_t device) +{ + struct usb_bus *bus; + + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + for (dev = bus->devices; dev; dev = dev->next) { + if (dev->descriptor.idVendor == vendor && + dev->descriptor.idProduct == device) { + return dev; + } + } + } + return NULL; +} + +int pegoda_transceive(struct pegoda_handle *ph, + u_int8_t cmd, unsigned char *tx, unsigned int tx_len, + unsigned char *rx, unsigned int *rx_len) +{ + unsigned char txbuf[256]; + unsigned char rxbuf[256]; + int rc; + unsigned int len_expected; + struct pegoda_cmd_hdr *hdr = (struct pegoda_cmd_hdr *)txbuf; + struct pegoda_cmd_hdr *rxhdr = (struct pegoda_cmd_hdr *)rxbuf; + + hdr->seq = ++(ph->seq); + hdr->cmd = cmd; + hdr->len = htons(tx_len); + memcpy(txbuf + sizeof(*hdr), tx, tx_len); + + printf("tx [%u]: %s\n", tx_len+sizeof(*hdr), + hexdump(txbuf, tx_len + sizeof(*hdr))); + rc = usb_bulk_write(ph->handle, 0x02, (char *)txbuf, + tx_len + sizeof(*hdr), 0); + if (rc < 0) + return rc; + + rc = usb_bulk_read(ph->handle, 0x81, (char *)rxbuf, sizeof(rxbuf), 0); + if (rc <= 0) + return rc; + + if (rc != 2) { + fprintf(stderr, "unexpected: received %u bytes as length?\n"); + return -EIO; + } + printf("len [%u]: %s\n", rc, hexdump(rxbuf, rc)); + + len_expected = rxbuf[0]; + + if (len_expected > sizeof(rxbuf)) + return -EIO; + + rc = usb_bulk_read(ph->handle, 0x81, (char *)rxbuf, len_expected, 0); + if (rc <= 0) + return rc; + printf("rx [%u]: %s\n", rc, hexdump(rxbuf, rc)); + + if (rc < 4) + return -EIO; + + if (rxhdr->seq != hdr->seq) + return -EIO; + + *rx_len = ntohs(rxhdr->len); + + memcpy(rx, rxbuf+sizeof(*rxhdr), rc-sizeof(*rxhdr)); + + return rxhdr->cmd; +} + +struct pegoda_handle *pegoda_open(void) +{ + struct usb_device *pegoda; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + struct pegoda_handle *ph; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + + pegoda = find_device(USB_VENDOR_PHILIPS, USB_DEVICE_PEGODA); + + if (!pegoda) + return NULL; + + ph = malloc(sizeof(*ph)); + if (!ph) + return NULL; + memset(ph, 0, sizeof(*ph)); + + printf("found pegoda, %u configurations\n", + pegoda->descriptor.bNumConfigurations); + + printf("config 2 [nr %u] has %u interfaces\n", + pegoda->config[1].bConfigurationValue, + pegoda->config[1].bNumInterfaces); + + printf("config 2 interface 0 has %u altsettings\n", + pegoda->config[1].interface[0].num_altsetting); + + ph->handle = usb_open(pegoda); + if (!ph->handle) + goto out_free; + + if (usb_set_configuration(ph->handle, 2)) + goto out_free; + + printf("configuration 2 successfully set\n"); + + if (usb_claim_interface(ph->handle, 0)) + goto out_free; + + printf("interface 0 claimed\n"); + + if (usb_set_altinterface(ph->handle, 1)) + goto out_free; + + printf("alt setting 1 selected\n"); + + pegoda_transceive(ph, PEGODA_CMD_PCD_CONFIG, NULL, 0, rbuf, &rlen); + + return ph; +out_free: + free(ph); + return NULL; +} + +/* Transform crypto1 key from generic 6byte into rc632 specific 12byte */ +static int +mifare_transform_key(const u_int8_t *key6, u_int8_t *key12) +{ + int i; + u_int8_t ln; + u_int8_t hn; + + for (i = 0; i < 6; i++) { + ln = key6[i] & 0x0f; + hn = key6[i] >> 4; + key12[i * 2 + 1] = (~ln << 4) | ln; + key12[i * 2] = (~hn << 4) | hn; + } + return 0; +} + +static int pegoda_auth_e2(struct pegoda_handle *ph, + u_int8_t keynr, u_int8_t sector) +{ + unsigned char buf[3]; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + + buf[0] = 0x60; + buf[1] = keynr; /* key number */ + buf[2] = sector; /* sector */ + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH, buf, 3, rbuf, &rlen); + + /* FIXME: check response */ + + return 0; +} + +static int pegoda_auth_key(struct pegoda_handle *ph, + u_int8_t sector, const unsigned char *key6) +{ + unsigned char buf[1+4+12+1]; + unsigned char rbuf[16]; + unsigned int rlen = sizeof(rbuf); + + buf[0] = 0x60; + memcpy(buf+1, ph->snr, 4); + mifare_transform_key(key6, buf+5); + buf[17] = sector; + + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH_KEY, buf, 18, rbuf, &rlen); + + /* FIXME: check response */ + + return 0; +} + +static int pegoda_read16(struct pegoda_handle *ph, + u_int8_t page, unsigned char *rx) +{ + int rc; + unsigned int rlen = 16; + + rc = pegoda_transceive(ph, PEGODA_CMD_PICC_READ, + &page, 1, rx, &rlen); + if (rlen != 16) + return -EIO; + + return 0; +} + +int main(int argc, char **argv) +{ + unsigned char buf[256]; + unsigned char rbuf[256]; + unsigned int rlen = sizeof(rbuf); + struct pegoda_handle *ph; + int i; + + ph = pegoda_open(); + if (!ph) + exit(1); + + /* LED off */ + buf[0] = 0x00; + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_SWITCH_LED, buf, 1, rbuf, &rlen); + + /* anticollision */ + + buf[0] = 0x26; + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_COMMON_REQUEST, + buf, 1, rbuf, &rlen); + + buf[0] = 0x93; + memset(buf+1, 0, 5); + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_ANTICOLL, + buf, 6, rbuf, &rlen); + + memcpy(ph->snr, rbuf, 4); + + buf[0] = 0x93; + memcpy(buf+1, ph->snr, 4); + rlen = sizeof(rbuf); + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_SELECT, + buf, 5, rbuf, &rlen); + + for (i = 0; i < 16; i++) { + int j; + pegoda_auth_key(ph, i, "\xff\xff\xff\xff\xff\xff"); + for (j = 0; j < 4; j++) { + pegoda_read16(ph, (i*4)+j, rbuf); + printf("read16[%u:%u] = %s\n", i,j,hexdump(rbuf, 16)); + } + } + + exit(0); +} diff --git a/librfid_1999/pegoda/pegoda.h b/librfid_1999/pegoda/pegoda.h new file mode 100644 index 0000000..236dc0a --- /dev/null +++ b/librfid_1999/pegoda/pegoda.h @@ -0,0 +1,140 @@ +#ifndef _PEGODA_H +#define _PEGODA_H +/* + * (C) 2005 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#define USB_VENDOR_PHILIPS 0x0742 +#define USB_DEVICE_PEGODA 0xff01 + +/* header of a pegoda usb command packet */ +struct pegoda_cmd_hdr { + u_int8_t seq; + u_int8_t cmd; + u_int16_t len; +}; + +enum { + PEGODA_CMD_WRITE_RC = 0x01, + PEGODA_CMD_READ_RC = 0x02, + PEGODA_CMD_EXCHANGE_BYTESTREAM = 0x03, + PEGODA_CMD_WRITE_MULTIPLE = 0x04, + PEGODA_CMD_READ_MULTIPLE = 0x05, + PEGODA_CMD_READ_WORD = 0x06, + + + PEGODA_CMD_PCD_CONFIG = 0x10, + PEGODA_CMD_PICC_REQUEST = 0x11, + PEGODA_CMD_PICC_ANTICOLL = 0x12, + PEGODA_CMD_PICC_SELECT = 0x13, + PEGODA_CMD_PICC_AUTH = 0x14, + PEGODA_CMD_PICC_AUTH_E2 = 0x15, + PEGODA_CMD_LOAD_KEY_E2 = 0x17, + PEGODA_CMD_PICC_AUTH_KEY = 0x18, + PEGODA_CMD_PICC_READ = 0x19, + PEGODA_CMD_PICC_WRITE = 0x1a, + PEGODA_CMD_PICC_VALUE = 0x1b, + PEGODA_CMD_PICC_VALUE_DEBIT = 0x1c, + PEGODA_CMD_PICC_HALT = 0x1d, + PEGODA_CMD_PICC_WRITE4 = 0x1e, + PEGODA_CMD_PICC_COMMON_WRITE = 0x1f, + + PEGODA_CMD_PCD_RF_RESET = 0x20, + PEGODA_CMD_PCD_RESET = 0x21, + PEGODA_CMD_PCD_GET_SNR = 0x22, + PEGODA_CMD_PCD_READ_E2 = 0x23, + PEGODA_CMD_PCD_SET_TMO = 0x27, + PEGODA_CMD_PICC_COMMON_READ = 0x28, + PEGODA_CMD_PCD_INITIALIZE_E2 = 0x29, + PEGODA_CMD_ACTIVE_ANTENNA_MASTER = 0x2a, + PEGODA_CMD_ACTIVE_ANTENNA_SLAVE = 0x2b, + + PEGODA_CMD_HOST_TRANS_TMR_START = 0x30, + PEGODA_CMD_HOST_TRANS_TMR_STOP = 0x31, + PEGODA_CMD_HOST_GET_EXEC_TIME = 0x32, + + PEGODA_CMD_PICC_COMMON_REQUEST = 0x40, + PEGODA_CMD_PICC_CASC_ANTICOLL = 0x41, + PEGODA_CMD_PICC_CASC_SELECT = 0x42, + PEGODA_CMD_PICC_ACTIVATE_IDLE = 0x43, + PEGODA_CMD_PICC_ACTIVATE_WAKEUP = 0x44, + PEGODA_CMD_PCD_SET_DEFAULT_ATTRIB = 0x45, + PEGODA_CMD_PCD_SET_ATTRIB = 0x46, + PEGODA_CMD_PCD_GET_ATTRIB = 0x47, + PEGODA_CMD_PICC_EXCHANGE_BLOCK = 0x48, + PEGODA_CMD_PICC_ACTIVATE_IDLE_LOOP = 0x49, + PEGODA_CMD_PICC_ACTTIVATION = 0x4a, + PEGODA_CMD_PCD_ENABLE_HIGH_BAUD_RATES = 0x4b, + + PEGODA_CMD_SWITCH_LED = 0x60, + PEGODA_CMD_TEST_FLASH_NR = 0x61, + PEGODA_CMD_START_DOWNLOAD = 0x62, + PEGODA_CMD_GET_FW_VERSION = 0x63, + PEGODA_CMD_GET_RIC_VERSION = 0x64, + PEGODA_CMD_ENABLE_DEBUG_PINS = 0x65, + PEGODA_CMD_MIRROR_DATA = 0x66, + PEGODA_CMD_TEST_CMDS = 0x67, + + PEGODA_CMD_TEST_PCD = 0x70, + PEGODA_CMD_TEST_PICC = 0x71, + PEGODA_CMD_GET_ONLINE_STATUS = 0x72, + + PEGODA_CMD_I1_PCD_CONFIG = 0x80, + PEGODA_CMD_I1_INIT_STD_MODE = 0x81, + PEGODA_CMD_I1_CALC_TSE_HASH = 0x82, + PEGODA_CMD_I1_INIT_FAST_MODE = 0x83, + PEGODA_CMD_I1_OUTPUT_READ = 0x85, + PEGODA_CMD_I1_OUTPUT_ANTICOL_SELECT = 0x86, + PEGODA_CMD_I1_OUTPUT_WRITE = 0x87, + PEGODA_CMD_I1_OUTPUT_HALT = 0x88, + PEGODA_CMD_I1_OUTPUT_EAS = 0x89, + PEGODA_CMD_I1_RESET_QUIET = 0x8a, + PEGODA_CMD_I1_PCD_RF_RESET = 0x8b, + PEGODA_CMD_I1_SET_BIT_PHASE = 0x8c, + + PEGODA_CMD_I2_INIT_STD_MODE = 0x90, + PEGODA_CMD_I2_INIT_FAST_MODE = 0x91, + PEGODA_CMD_15693_READ_SM = 0x92, + PEGODA_CMD_15693_INVENTORY = 0x93, + PEGODA_CMD_15693_WRITE_SM = 0x94, + PEGODA_CMD_15693_STAY_QUIET = 0x95, + PEGODA_CMD_15693_LOCK_BLOCK = 0x96, + PEGODA_CMD_15693_SELECT = 0x97, + PEGODA_CMD_15693_RESET_TO_READY = 0x98, + PEGODA_CMD_15693_WRITE_AFI = 0x99, + PEGODA_CMD_15693_LOCK_AFI = 0x9a, + PEGODA_CMD_15693_WRITE_DSFID = 0x9b, + PEGODA_CMD_15693_LOCK_DSFID = 0x9c, + PEGODA_CMD_15693_GET_SYSTEM_INFO = 0x9d, + PEGODA_CMD_15693_GET_MULTI_BLOCK_SEC = 0x9e, + PEGODA_CMD_15693_INVENTORY_READ = 0x9f, + PEGODA_CMD_15693_FAST_INVENTORY_READ = 0xa0, + PEGODA_CMD_15693_SET_EAS = 0xa1, + PEGODA_CMD_15693_RESET_EAS = 0xa2, + PEGODA_CMD_15693_LOCK_EAS = 0xa3, + PEGODA_CMD_15693_EAS_ALARM = 0xa4, + + PEGODA_CMD_PC_PCD_CONFIG = 0xb0, + PEGODA_CMD_PC_BEGIN_ROUND = 0xb1, + PEGODA_CMD_PC_WRITE = 0xb3, + + PEGODA_CMD_UID_PCD_CONFIG = 0xb8, + PEGODA_CMD_UID_BEGIN_ROUND = 0xb9, + PEGODA_CMD_UID_WRITE = 0xba, + PEGODA_CMD_UID_DESTROY = 0xbb, +}; + +#endif diff --git a/librfid_1999/python/Makefile b/librfid_1999/python/Makefile new file mode 100644 index 0000000..28fd93c --- /dev/null +++ b/librfid_1999/python/Makefile @@ -0,0 +1,34 @@ +CC=gcc +PYTHON=python +PREFIX=/usr +PYTHON_VER=2.5 +PYTHON_INC=$(PREFIX)/include/python$(PYTHON_VER) +PYTHON_LIB=$(PREFIX)/lib/python$(PYTHON_VER)/site-packages/ +LIBRFID_DIR=../src/.libs/librfid.la +LIBUSB_DIR=/usr/local/lib + +SOURCE_MAIN=pyrfid.c +SOURCES=$(SOURCE_MAIN) ../utils/common.c +INCLUDES=-I$(PYTHON_INC) -I../include/ -I../utils/ +CFLAGS=-O3 -Wall $(INCLUDES) +LDFLAGS=-shared -L$(LIBRFID_DIR) -lrfid -L$(LIBUSB_DIR) -lusb -Wl,--rpath -Wl,/usr/local/lib $(LIBS) +TARGET=$(SOURCE_MAIN:.c=.so) +OBJECTS=$(SOURCES:.c=.o) + +all: $(SOURCE_MAIN) $(TARGET) + +test: + $(PYTHON) $@.py + +install: $(TARGET) + install $(TARGET) $(PYTHON_LIB) + +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $(OBJECTS) + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJECTS) $(TARGET) + diff --git a/librfid_1999/python/pyrfid.c b/librfid_1999/python/pyrfid.c new file mode 100644 index 0000000..2bcde61 --- /dev/null +++ b/librfid_1999/python/pyrfid.c @@ -0,0 +1,98 @@ +/* Python bindings for librfid + * (C) 2007 by Kushal Das + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +static PyObject *pyi_open(PyObject *self, PyObject *args); +static PyObject *pyi_close(PyObject *self, PyObject *args); +static PyObject *pyi_rfidscan(PyObject *self, PyObject *args); +static PyObject *pyi_rfidlayeropt(PyObject *self, PyObject *args); + +static PyObject *pyi_Error; +struct rfid_reader_handle *rh; +struct rfid_layer2_handle *l2h; +struct rfid_protocol_handle *ph; + +static PyMethodDef pyi_Methods[] = { + {"open", pyi_open, METH_VARARGS, + "This will initialise the RFID reader"}, + {"close", pyi_close, METH_VARARGS, + "This will close the RFID reader"}, + {"scan", pyi_rfidscan, METH_VARARGS, + "This will scan for any card"}, + {"get_id", pyi_rfidlayeropt, METH_VARARGS, + "This will read the id of the card"}, + {NULL, NULL, 0, NULL} +}; + +PyMODINIT_FUNC initpyrfid() { + PyObject *m; + + m = Py_InitModule("pyrfid", pyi_Methods); + pyi_Error = PyErr_NewException("pyrfid.error", NULL, NULL); + Py_INCREF(pyi_Error); + PyModule_AddObject(m, "error", pyi_Error); + return; +} + +static PyObject *pyi_open(PyObject *self, PyObject *args) { + rfid_init(); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if (!rh) + return Py_BuildValue("i", 1); + else + return Py_BuildValue("i", 0); +} + +static PyObject *pyi_close(PyObject *self, PyObject *args) { + rfid_reader_close(rh); +// Py_INCREF(Py_None); +// return Py_None; + return Py_BuildValue("i", 0); +} + +static PyObject *pyi_rfidscan(PyObject *self, PyObject *args) { + int rc; + rc = rfid_scan(rh, &l2h, &ph); + return Py_BuildValue("i", rc); +} + +static PyObject *pyi_rfidlayeropt(PyObject *self, PyObject *args) { + unsigned char uid_buf[16]; + char card_id[16]; + unsigned int uid_len = sizeof(uid_buf); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, + &uid_len); + strcpy(card_id,hexdump(uid_buf, uid_len)); + return Py_BuildValue("s", card_id); +} diff --git a/librfid_1999/python/test.py b/librfid_1999/python/test.py new file mode 100644 index 0000000..2e258b6 --- /dev/null +++ b/librfid_1999/python/test.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + #Python bindings test file + #(C) 2007 by Kushal Das + + #This program is free software; you can redistribute it and/or modify + #it under the terms of the GNU General Public License version 2 + #as published by the Free Software Foundation + + #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 + +import pyrfid + +res = pyrfid.open() +if res == 1: + print "No device found" +else: + print "We found a device :)" + while 1: + res = pyrfid.scan() + if res == 3: + print "The id of the card is %s" %(pyrfid.get_id()) + pyrfid.close() diff --git a/librfid_1999/src/Makefile.am b/librfid_1999/src/Makefile.am new file mode 100644 index 0000000..b3c1c24 --- /dev/null +++ b/librfid_1999/src/Makefile.am @@ -0,0 +1,52 @@ +LIBVERSION= 0:0:0 + +if ENABLE_FIRMWARE +INCLUDES_FIRMWARE = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include +AM_CFLAGS_FIRMWARE = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__ +endif + +if ENABLE_STATIC +AM_CFLAGS_STATIC = -DLIBRFID_STATIC +endif + +noinst_HEADERS=rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h + +CORE=rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c +L2=rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_layer2_iso15693.c rfid_iso14443_common.c +PROTO=rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c +ASIC=rfid_asic_rc632.c +READER=rfid_reader_openpcd.c +MISC=rfid_access_mifare_classic.c + +if ENABLE_WIN32 +WIN32=usleep.c libusb_dyn.c +AM_LDLAGS_WIN32=-mno-cygwin -lwinmm +AM_CFLAGS_WIN32=-mno-cygwin +endif + +if ENABLE_CCID +READER_CM5121=rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c +AM_CFLAGS_CM5121= -DENABLE_CM5121 +endif + +if HAVE_OPENCT +READER_CM5121=rfid_reader_cm5121.c rfid_reader_cm5121_openct.c +AM_CFLAGS_CM5121= -DENABLE_CM5121 +endif + +INCLUDES = $(all_includes) -I$(top_srcdir)/include $(INCLUDES_FIRMWARE) \ + $(INCLUDES_STATIC) @OPENCT_CFLAGS@ +AM_CFLAGS = -std=gnu99 -D__LIBRFID__ $(AM_CFLAGS_FIRMWARE) $(AM_CFLAGS_STATIC) \ + $(AM_CFLAGS_CM5121) $(AM_CFLAGS_WIN32) + +lib_LTLIBRARIES = librfid.la +librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@ +librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) \ + $(READER) $(READER_CM5121) $(WIN32) + +if ENABLE_WIN32 +librfid_la_LIBADD = -lwinmm +endif + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = librfid.pc diff --git a/librfid_1999/src/Makefile.in b/librfid_1999/src/Makefile.in new file mode 100644 index 0000000..92979af --- /dev/null +++ b/librfid_1999/src/Makefile.in @@ -0,0 +1,643 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/librfid.pc.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 = librfid.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +librfid_la_DEPENDENCIES = +am__librfid_la_SOURCES_DIST = rfid.c rfid_layer2.c rfid_protocol.c \ + rfid_reader.c rfid_scan.c rfid_layer2_iso14443a.c \ + rfid_layer2_iso14443b.c rfid_layer2_iso15693.c \ + rfid_iso14443_common.c rfid_proto_tcl.c rfid_proto_mifare_ul.c \ + rfid_proto_mifare_classic.c rfid_asic_rc632.c \ + rfid_access_mifare_classic.c rfid_reader_openpcd.c \ + rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c \ + ccid/ccid-driver.c rfid_reader_cm5121_openct.c usleep.c \ + libusb_dyn.c +am__objects_1 = rfid.lo rfid_layer2.lo rfid_protocol.lo rfid_reader.lo \ + rfid_scan.lo +am__objects_2 = rfid_layer2_iso14443a.lo rfid_layer2_iso14443b.lo \ + rfid_layer2_iso15693.lo rfid_iso14443_common.lo +am__objects_3 = rfid_proto_tcl.lo rfid_proto_mifare_ul.lo \ + rfid_proto_mifare_classic.lo +am__objects_4 = rfid_asic_rc632.lo +am__objects_5 = rfid_access_mifare_classic.lo +am__objects_6 = rfid_reader_openpcd.lo +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@am__objects_7 = \ +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@ rfid_reader_cm5121.lo \ +@ENABLE_CCID_FALSE@@HAVE_OPENCT_TRUE@ rfid_reader_cm5121_openct.lo +@ENABLE_CCID_TRUE@am__objects_7 = rfid_reader_cm5121.lo \ +@ENABLE_CCID_TRUE@ rfid_reader_cm5121_ccid_direct.lo \ +@ENABLE_CCID_TRUE@ ccid-driver.lo +@ENABLE_WIN32_TRUE@am__objects_8 = usleep.lo libusb_dyn.lo +am_librfid_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) $(am__objects_8) +librfid_la_OBJECTS = $(am_librfid_la_OBJECTS) +librfid_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_la_SOURCES) +DIST_SOURCES = $(am__librfid_la_SOURCES_DIST) +DATA = $(pkgconfig_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +@ENABLE_FIRMWARE_TRUE@INCLUDES_FIRMWARE = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include +@ENABLE_FIRMWARE_TRUE@AM_CFLAGS_FIRMWARE = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__ +@ENABLE_STATIC_TRUE@AM_CFLAGS_STATIC = -DLIBRFID_STATIC +noinst_HEADERS = rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h +CORE = rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c +L2 = rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_layer2_iso15693.c rfid_iso14443_common.c +PROTO = rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c +ASIC = rfid_asic_rc632.c +READER = rfid_reader_openpcd.c +MISC = rfid_access_mifare_classic.c +@ENABLE_WIN32_TRUE@WIN32 = usleep.c libusb_dyn.c +@ENABLE_WIN32_TRUE@AM_LDLAGS_WIN32 = -mno-cygwin -lwinmm +@ENABLE_WIN32_TRUE@AM_CFLAGS_WIN32 = -mno-cygwin +@ENABLE_CCID_TRUE@READER_CM5121 = rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c +@HAVE_OPENCT_TRUE@READER_CM5121 = rfid_reader_cm5121.c rfid_reader_cm5121_openct.c +@ENABLE_CCID_TRUE@AM_CFLAGS_CM5121 = -DENABLE_CM5121 +@HAVE_OPENCT_TRUE@AM_CFLAGS_CM5121 = -DENABLE_CM5121 +INCLUDES = $(all_includes) -I$(top_srcdir)/include $(INCLUDES_FIRMWARE) \ + $(INCLUDES_STATIC) @OPENCT_CFLAGS@ + +AM_CFLAGS = -std=gnu99 -D__LIBRFID__ $(AM_CFLAGS_FIRMWARE) $(AM_CFLAGS_STATIC) \ + $(AM_CFLAGS_CM5121) $(AM_CFLAGS_WIN32) + +lib_LTLIBRARIES = librfid.la +librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@ +librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) \ + $(READER) $(READER_CM5121) $(WIN32) + +@ENABLE_WIN32_TRUE@librfid_la_LIBADD = -lwinmm +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = librfid.pc +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +librfid.pc: $(top_builddir)/config.status $(srcdir)/librfid.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +librfid.la: $(librfid_la_OBJECTS) $(librfid_la_DEPENDENCIES) + $(librfid_la_LINK) -rpath $(libdir) $(librfid_la_OBJECTS) $(librfid_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccid-driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_dyn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_access_mifare_classic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_asic_rc632.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_iso14443_common.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso14443a.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso14443b.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_layer2_iso15693.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_mifare_classic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_mifare_ul.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_proto_tcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_protocol.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_cm5121_openct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_reader_openpcd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfid_scan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usleep.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +rfid_reader_cm5121_ccid_direct.lo: ccid/rfid_reader_cm5121_ccid_direct.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfid_reader_cm5121_ccid_direct.lo -MD -MP -MF $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Tpo $(DEPDIR)/rfid_reader_cm5121_ccid_direct.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccid/rfid_reader_cm5121_ccid_direct.c' object='rfid_reader_cm5121_ccid_direct.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfid_reader_cm5121_ccid_direct.lo `test -f 'ccid/rfid_reader_cm5121_ccid_direct.c' || echo '$(srcdir)/'`ccid/rfid_reader_cm5121_ccid_direct.c + +ccid-driver.lo: ccid/ccid-driver.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ccid-driver.lo -MD -MP -MF $(DEPDIR)/ccid-driver.Tpo -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ccid-driver.Tpo $(DEPDIR)/ccid-driver.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccid/ccid-driver.c' object='ccid-driver.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ccid-driver.lo `test -f 'ccid/ccid-driver.c' || echo '$(srcdir)/'`ccid/ccid-driver.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; 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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES 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-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am 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-libLTLIBRARIES \ + uninstall-pkgconfigDATA + + +# 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: diff --git a/librfid_1999/src/ccid/ccid-driver.c b/librfid_1999/src/ccid/ccid-driver.c new file mode 100644 index 0000000..e440167 --- /dev/null +++ b/librfid_1999/src/ccid/ccid-driver.c @@ -0,0 +1,2454 @@ +/* ccid-driver.c - USB ChipCardInterfaceDevices driver + * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + * Written by Werner Koch. + * + * This file is part of GnuPG. + * + * GnuPG 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. + * + * GnuPG 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. + * + * ALTERNATIVELY, this file may be distributed under the terms of the + * following license, in which case the provisions of this license are + * required INSTEAD OF the GNU General Public License. If you wish to + * allow use of your version of this file only under the terms of the + * GNU General Public License, and not to allow others to use your + * version of this file under the terms of the following license, + * indicate your decision by deleting this paragraph and the license + * below. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Date: 2005-09-09 13:18:08 +0200 (Fri, 09 Sep 2005) $ + */ + + +/* CCID (ChipCardInterfaceDevices) is a specification for accessing + smartcard via a reader connected to the USB. + + This is a limited driver allowing to use some CCID drivers directly + without any other specila drivers. This is a fallback driver to be + used when nothing else works or the system should be kept minimal + for security reasons. It makes use of the libusb library to gain + portable access to USB. + + This driver has been tested with the SCM SCR335 and SPR532 + smartcard readers and requires that a reader implements the TPDU + level exchange and does fully automatic initialization. +*/ + +#include + +#ifndef LIBRFID_FIRMWARE + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined(HAVE_LIBUSB) || defined(TEST) + +#include +#include +#include +#include +#include + +#include + +#include "ccid-driver.h" + +#define DRVNAME "ccid-driver: " + + +/* Depending on how this source is used we either define our error + output to go to stderr or to the jnlib based logging functions. We + use the latter when GNUPG_MAJOR_VERSION is defines or when both, + GNUPG_SCD_MAIN_HEADER and HAVE_JNLIB_LOGGING are defined. +*/ +#if defined(GNUPG_MAJOR_VERSION) \ + || (defined(GNUPG_SCD_MAIN_HEADER) && defined(HAVE_JNLIB_LOGGING)) + +#if defined(GNUPG_SCD_MAIN_HEADER) +# include GNUPG_SCD_MAIN_HEADER +#elif GNUPG_MAJOR_VERSION == 1 /* GnuPG Version is < 1.9. */ +# include "options.h" +# include "util.h" +# include "memory.h" +# include "cardglue.h" +# else /* This is the modularized GnuPG 1.9 or later. */ +# include "scdaemon.h" +#endif + + +# define DEBUGOUT(t) do { if (debug_level) \ + log_debug (DRVNAME t); } while (0) +# define DEBUGOUT_1(t,a) do { if (debug_level) \ + log_debug (DRVNAME t,(a)); } while (0) +# define DEBUGOUT_2(t,a,b) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b)); } while (0) +# define DEBUGOUT_3(t,a,b,c) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b),(c));} while (0) +# define DEBUGOUT_4(t,a,b,c,d) do { if (debug_level) \ + log_debug (DRVNAME t,(a),(b),(c),(d));} while (0) +# define DEBUGOUT_CONT(t) do { if (debug_level) \ + log_printf (t); } while (0) +# define DEBUGOUT_CONT_1(t,a) do { if (debug_level) \ + log_printf (t,(a)); } while (0) +# define DEBUGOUT_CONT_2(t,a,b) do { if (debug_level) \ + log_printf (t,(a),(b)); } while (0) +# define DEBUGOUT_CONT_3(t,a,b,c) do { if (debug_level) \ + log_printf (t,(a),(b),(c)); } while (0) +# define DEBUGOUT_LF() do { if (debug_level) \ + log_printf ("\n"); } while (0) + +#else /* Other usage of this source - don't use gnupg specifics. */ + +# define DEBUGOUT(t) do { if (debug_level) \ + fprintf (stderr, DRVNAME t); } while (0) +# define DEBUGOUT_1(t,a) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a)); } while (0) +# define DEBUGOUT_2(t,a,b) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b)); } while (0) +# define DEBUGOUT_3(t,a,b,c) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b), (c)); } while (0) +# define DEBUGOUT_4(t,a,b,c,d) do { if (debug_level) \ + fprintf (stderr, DRVNAME t, (a), (b), (c), (d));} while(0) +# define DEBUGOUT_CONT(t) do { if (debug_level) \ + fprintf (stderr, t); } while (0) +# define DEBUGOUT_CONT_1(t,a) do { if (debug_level) \ + fprintf (stderr, t, (a)); } while (0) +# define DEBUGOUT_CONT_2(t,a,b) do { if (debug_level) \ + fprintf (stderr, t, (a), (b)); } while (0) +# define DEBUGOUT_CONT_3(t,a,b,c) do { if (debug_level) \ + fprintf (stderr, t, (a), (b), (c)); } while (0) +# define DEBUGOUT_LF() do { if (debug_level) \ + putc ('\n', stderr); } while (0) + +#endif /* This source not used by scdaemon. */ + + + +enum { + RDR_to_PC_NotifySlotChange= 0x50, + RDR_to_PC_HardwareError = 0x51, + + PC_to_RDR_SetParameters = 0x61, + PC_to_RDR_IccPowerOn = 0x62, + PC_to_RDR_IccPowerOff = 0x63, + PC_to_RDR_GetSlotStatus = 0x65, + PC_to_RDR_Secure = 0x69, + PC_to_RDR_T0APDU = 0x6a, + PC_to_RDR_Escape = 0x6b, + PC_to_RDR_GetParameters = 0x6c, + PC_to_RDR_ResetParameters = 0x6d, + PC_to_RDR_IccClock = 0x6e, + PC_to_RDR_XfrBlock = 0x6f, + PC_to_RDR_Mechanical = 0x71, + PC_to_RDR_Abort = 0x72, + PC_to_RDR_SetDataRate = 0x73, + + RDR_to_PC_DataBlock = 0x80, + RDR_to_PC_SlotStatus = 0x81, + RDR_to_PC_Parameters = 0x82, + RDR_to_PC_Escape = 0x83, + RDR_to_PC_DataRate = 0x84 +}; + + +/* Two macro to detect whether a CCID command has failed and to get + the error code. These macros assume that we can access the + mandatory first 10 bytes of a CCID message in BUF. */ +#define CCID_COMMAND_FAILED(buf) ((buf)[7] & 0x40) +#define CCID_ERROR_CODE(buf) (((unsigned char *)(buf))[8]) + + +/* We need to know the vendor to do some hacks. */ +enum { + VENDOR_SCM = 0x04e6, + VENDOR_CHERRY = 0x046a, + VENDOR_OMNIKEY= 0x076b, + VENDOR_GEMPC = 0x08e6 +}; + + +/* Store information on the driver's state. A pointer to such a + structure is used as handle for most functions. */ +struct ccid_driver_s +{ + usb_dev_handle *idev; + char *rid; + unsigned short id_vendor; + unsigned short id_product; + unsigned short bcd_device; + int ifc_no; + int ep_bulk_out; + int ep_bulk_in; + int ep_intr; + int seqno; + unsigned char t1_ns; + unsigned char t1_nr; + int nonnull_nad; + int auto_ifsd; + int max_ifsd; + int ifsd; + int powered_off; + int has_pinpad; + int apdu_level; /* Reader supports short APDU level exchange. */ +}; + + +static int initialized_usb; /* Tracks whether USB has been initialized. */ +static int debug_level; /* Flag to control the debug output. + 0 = No debugging + 1 = USB I/O info + 2 = T=1 protocol tracing + */ + + +static unsigned int compute_edc (const unsigned char *data, size_t datalen, + int use_crc); +static int bulk_out (ccid_driver_t handle, unsigned char *msg, size_t msglen); +static int bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length, + size_t *nread, int expected_type, int seqno, int timeout, + int no_debug); + +/* Convert a little endian stored 4 byte value into an unsigned + integer. */ +static unsigned int +convert_le_u32 (const unsigned char *buf) +{ + return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); +} + +static void +set_msg_len (unsigned char *msg, unsigned int length) +{ + msg[1] = length; + msg[2] = length >> 8; + msg[3] = length >> 16; + msg[4] = length >> 24; +} + + +/* Pint an error message for a failed CCID command including a textual + error code. MSG is shall be the CCID message of at least 10 bytes. */ +static void +print_command_failed (const unsigned char *msg) +{ + const char *t; + char buffer[100]; + int ec; + + if (!debug_level) + return; + + ec = CCID_ERROR_CODE (msg); + switch (ec) + { + case 0x00: t = "Command not supported"; break; + + case 0xE0: t = "Slot busy"; break; + case 0xEF: t = "PIN cancelled"; break; + case 0xF0: t = "PIN timeout"; break; + + case 0xF2: t = "Automatic sequence ongoing"; break; + case 0xF3: t = "Deactivated Protocol"; break; + case 0xF4: t = "Procedure byte conflict"; break; + case 0xF5: t = "ICC class not supported"; break; + case 0xF6: t = "ICC protocol not supported"; break; + case 0xF7: t = "Bad checksum in ATR"; break; + case 0xF8: t = "Bad TS in ATR"; break; + + case 0xFB: t = "An all inclusive hardware error occurred"; break; + case 0xFC: t = "Overrun error while talking to the ICC"; break; + case 0xFD: t = "Parity error while talking to the ICC"; break; + case 0xFE: t = "CCID timed out while talking to the ICC"; break; + case 0xFF: t = "Host aborted the current activity"; break; + + default: + if (ec > 0 && ec < 128) + sprintf (buffer, "Parameter error at offset %d", ec); + else + sprintf (buffer, "Error code %02X", ec); + t = buffer; + break; + } + DEBUGOUT_1 ("CCID command failed: %s\n", t); +} + + + + +/* Parse a CCID descriptor, optionally print all available features + and test whether this reader is usable by this driver. Returns 0 + if it is usable. + + Note, that this code is based on the one in lsusb.c of the + usb-utils package, I wrote on 2003-09-01. -wk. */ +static int +parse_ccid_descriptor (ccid_driver_t handle, + const unsigned char *buf, size_t buflen) +{ + unsigned int i; + unsigned int us; + int have_t1 = 0, have_tpdu=0, have_auto_conf = 0; + + + handle->nonnull_nad = 0; + handle->auto_ifsd = 0; + handle->max_ifsd = 32; + handle->ifsd = 0; + handle->has_pinpad = 0; + handle->apdu_level = 0; + DEBUGOUT_3 ("idVendor: %04X idProduct: %04X bcdDevice: %04X\n", + handle->id_vendor, handle->id_product, handle->bcd_device); + if (buflen < 54 || buf[0] < 54) + { + DEBUGOUT ("CCID device descriptor is too short\n"); + return -1; + } + + DEBUGOUT ("ChipCard Interface Descriptor:\n"); + DEBUGOUT_1 (" bLength %5u\n", buf[0]); + DEBUGOUT_1 (" bDescriptorType %5u\n", buf[1]); + DEBUGOUT_2 (" bcdCCID %2x.%02x", buf[3], buf[2]); + if (buf[3] != 1 || buf[2] != 0) + DEBUGOUT_CONT(" (Warning: Only accurate for version 1.0)"); + DEBUGOUT_LF (); + + DEBUGOUT_1 (" nMaxSlotIndex %5u\n", buf[4]); + DEBUGOUT_2 (" bVoltageSupport %5u %s\n", + buf[5], (buf[5] == 1? "5.0V" : buf[5] == 2? "3.0V" + : buf[5] == 3? "1.8V":"?")); + + us = convert_le_u32 (buf+6); + DEBUGOUT_1 (" dwProtocols %5u ", us); + if ((us & 1)) + DEBUGOUT_CONT (" T=0"); + if ((us & 2)) + { + DEBUGOUT_CONT (" T=1"); + have_t1 = 1; + } + if ((us & ~3)) + DEBUGOUT_CONT (" (Invalid values detected)"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+10); + DEBUGOUT_1 (" dwDefaultClock %5u\n", us); + us = convert_le_u32(buf+14); + DEBUGOUT_1 (" dwMaxiumumClock %5u\n", us); + DEBUGOUT_1 (" bNumClockSupported %5u\n", buf[18]); + us = convert_le_u32(buf+19); + DEBUGOUT_1 (" dwDataRate %7u bps\n", us); + us = convert_le_u32(buf+23); + DEBUGOUT_1 (" dwMaxDataRate %7u bps\n", us); + DEBUGOUT_1 (" bNumDataRatesSupp. %5u\n", buf[27]); + + us = convert_le_u32(buf+28); + DEBUGOUT_1 (" dwMaxIFSD %5u\n", us); + handle->max_ifsd = us; + + us = convert_le_u32(buf+32); + DEBUGOUT_1 (" dwSyncProtocols %08X ", us); + if ((us&1)) + DEBUGOUT_CONT ( " 2-wire"); + if ((us&2)) + DEBUGOUT_CONT ( " 3-wire"); + if ((us&4)) + DEBUGOUT_CONT ( " I2C"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+36); + DEBUGOUT_1 (" dwMechanical %08X ", us); + if ((us & 1)) + DEBUGOUT_CONT (" accept"); + if ((us & 2)) + DEBUGOUT_CONT (" eject"); + if ((us & 4)) + DEBUGOUT_CONT (" capture"); + if ((us & 8)) + DEBUGOUT_CONT (" lock"); + DEBUGOUT_LF (); + + us = convert_le_u32(buf+40); + DEBUGOUT_1 (" dwFeatures %08X\n", us); + if ((us & 0x0002)) + { + DEBUGOUT (" Auto configuration based on ATR\n"); + have_auto_conf = 1; + } + if ((us & 0x0004)) + DEBUGOUT (" Auto activation on insert\n"); + if ((us & 0x0008)) + DEBUGOUT (" Auto voltage selection\n"); + if ((us & 0x0010)) + DEBUGOUT (" Auto clock change\n"); + if ((us & 0x0020)) + DEBUGOUT (" Auto baud rate change\n"); + if ((us & 0x0040)) + DEBUGOUT (" Auto parameter negotation made by CCID\n"); + else if ((us & 0x0080)) + DEBUGOUT (" Auto PPS made by CCID\n"); + else if ((us & (0x0040 | 0x0080))) + DEBUGOUT (" WARNING: conflicting negotation features\n"); + + if ((us & 0x0100)) + DEBUGOUT (" CCID can set ICC in clock stop mode\n"); + if ((us & 0x0200)) + { + DEBUGOUT (" NAD value other than 0x00 accepted\n"); + handle->nonnull_nad = 1; + } + if ((us & 0x0400)) + { + DEBUGOUT (" Auto IFSD exchange\n"); + handle->auto_ifsd = 1; + } + + if ((us & 0x00010000)) + { + DEBUGOUT (" TPDU level exchange\n"); + have_tpdu = 1; + } + else if ((us & 0x00020000)) + { + DEBUGOUT (" Short APDU level exchange\n"); + handle->apdu_level = 1; + } + else if ((us & 0x00040000)) + { + DEBUGOUT (" Short and extended APDU level exchange\n"); + handle->apdu_level = 1; + } + else if ((us & 0x00070000)) + DEBUGOUT (" WARNING: conflicting exchange levels\n"); + + us = convert_le_u32(buf+44); + DEBUGOUT_1 (" dwMaxCCIDMsgLen %5u\n", us); + + DEBUGOUT ( " bClassGetResponse "); + if (buf[48] == 0xff) + DEBUGOUT_CONT ("echo\n"); + else + DEBUGOUT_CONT_1 (" %02X\n", buf[48]); + + DEBUGOUT ( " bClassEnvelope "); + if (buf[49] == 0xff) + DEBUGOUT_CONT ("echo\n"); + else + DEBUGOUT_CONT_1 (" %02X\n", buf[48]); + + DEBUGOUT ( " wlcdLayout "); + if (!buf[50] && !buf[51]) + DEBUGOUT_CONT ("none\n"); + else + DEBUGOUT_CONT_2 ("%u cols %u lines\n", buf[50], buf[51]); + + DEBUGOUT_1 (" bPINSupport %5u ", buf[52]); + if ((buf[52] & 1)) + { + DEBUGOUT_CONT ( " verification"); + handle->has_pinpad |= 1; + } + if ((buf[52] & 2)) + { + DEBUGOUT_CONT ( " modification"); + handle->has_pinpad |= 2; + } + DEBUGOUT_LF (); + + DEBUGOUT_1 (" bMaxCCIDBusySlots %5u\n", buf[53]); + + if (buf[0] > 54) { + DEBUGOUT (" junk "); + for (i=54; i < buf[0]-54; i++) + DEBUGOUT_CONT_1 (" %02X", buf[i]); + DEBUGOUT_LF (); + } + + if (!have_t1 || !(have_tpdu || handle->apdu_level) || !have_auto_conf) + { + DEBUGOUT ("this drivers requires that the reader supports T=1, " + "TPDU or APDU level exchange and auto configuration - " + "this is not available\n"); + return -1; + } + + + /* SCM drivers get stuck in their internal USB stack if they try to + send a frame of n*wMaxPacketSize back to us. Given that + wMaxPacketSize is 64 for these readers we set the IFSD to a value + lower than that: + 64 - 10 CCID header - 4 T1frame - 2 reserved = 48 + Product Ids: + 0xe001 - SCR 331 + 0x5111 - SCR 331-DI + 0x5115 - SCR 335 + 0xe003 - SPR 532 + */ + if (handle->id_vendor == VENDOR_SCM + && handle->max_ifsd > 48 + && ( (handle->id_product == 0xe001 && handle->bcd_device < 0x0516) + ||(handle->id_product == 0x5111 && handle->bcd_device < 0x0620) + ||(handle->id_product == 0x5115 && handle->bcd_device < 0x0514) + ||(handle->id_product == 0xe003 && handle->bcd_device < 0x0504) + )) + { + DEBUGOUT ("enabling workaround for buggy SCM readers\n"); + handle->max_ifsd = 48; + } + + + return 0; +} + + +static char * +get_escaped_usb_string (usb_dev_handle *idev, int idx, + const char *prefix, const char *suffix) +{ + int rc; + unsigned char buf[280]; + unsigned char *s; + unsigned int langid; + size_t i, n, len; + char *result; + + if (!idx) + return NULL; + + /* Fixme: The next line is for the current Valgrid without support + for USB IOCTLs. */ + memset (buf, 0, sizeof buf); + + /* First get the list of supported languages and use the first one. + If we do don't find it we try to use English. Note that this is + all in a 2 bute Unicode encoding using little endian. */ + rc = usb_control_msg (idev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8), 0, + (char*)buf, sizeof buf, 1000 /* ms timeout */); + if (rc < 4) + langid = 0x0409; /* English. */ + else + langid = (buf[3] << 8) | buf[2]; + + rc = usb_control_msg (idev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8) + idx, langid, + (char*)buf, sizeof buf, 1000 /* ms timeout */); + if (rc < 2 || buf[1] != USB_DT_STRING) + return NULL; /* Error or not a string. */ + len = buf[0]; + if (len > rc) + return NULL; /* Larger than our buffer. */ + + for (s=buf+2, i=2, n=0; i+1 < len; i += 2, s += 2) + { + if (s[1]) + n++; /* High byte set. */ + else if (*s <= 0x20 || *s >= 0x7f || *s == '%' || *s == ':') + n += 3 ; + else + n++; + } + + result = malloc (strlen (prefix) + n + strlen (suffix) + 1); + if (!result) + return NULL; + + strcpy (result, prefix); + n = strlen (prefix); + for (s=buf+2, i=2; i+1 < len; i += 2, s += 2) + { + if (s[1]) + result[n++] = '\xff'; /* High byte set. */ + else if (*s <= 0x20 || *s >= 0x7f || *s == '%' || *s == ':') + { + sprintf (result+n, "%%%02X", *s); + n += 3; + } + else + result[n++] = *s; + } + strcpy (result+n, suffix); + + return result; +} + +/* This function creates an reader id to be used to find the same + physical reader after a reset. It returns an allocated and possibly + percent escaped string or NULL if not enough memory is available. */ +static char * +make_reader_id (usb_dev_handle *idev, + unsigned int vendor, unsigned int product, + unsigned char serialno_index) +{ + char *rid; + char prefix[20]; + + sprintf (prefix, "%04X:%04X:", (vendor & 0xfff), (product & 0xffff)); + rid = get_escaped_usb_string (idev, serialno_index, prefix, ":0"); + if (!rid) + { + rid = malloc (strlen (prefix) + 3 + 1); + if (!rid) + return NULL; + strcpy (rid, prefix); + strcat (rid, "X:0"); + } + return rid; +} + + +/* Helper to find the endpoint from an interface descriptor. */ +static int +find_endpoint (struct usb_interface_descriptor *ifcdesc, int mode) +{ + int no; + int want_bulk_in = 0; + + if (mode == 1) + want_bulk_in = 0x80; + for (no=0; no < ifcdesc->bNumEndpoints; no++) + { + struct usb_endpoint_descriptor *ep = ifcdesc->endpoint + no; + if (ep->bDescriptorType != USB_DT_ENDPOINT) + ; + else if (mode == 2 + && ((ep->bmAttributes & USB_ENDPOINT_TYPE_MASK) + == USB_ENDPOINT_TYPE_INTERRUPT) + && (ep->bEndpointAddress & 0x80)) + return (ep->bEndpointAddress & 0x0f); + else if (((ep->bmAttributes & USB_ENDPOINT_TYPE_MASK) + == USB_ENDPOINT_TYPE_BULK) + && (ep->bEndpointAddress & 0x80) == want_bulk_in) + return (ep->bEndpointAddress & 0x0f); + } + /* Should never happen. */ + return mode == 2? 0x83 : mode == 1? 0x82 :1; +} + + + +/* Combination function to either scan all CCID devices or to find and + open one specific device. + + With READERNO = -1 and READERID is NULL, scan mode is used and + R_RID should be the address where to store the list of reader_ids + we found. If on return this list is empty, no CCID device has been + found; otherwise it points to an allocated linked list of reader + IDs. Note that in this mode the function always returns NULL. + + With READERNO >= 0 or READERID is not NULL find mode is used. This + uses the same algorithm as the scan mode but stops and returns at + the entry number READERNO and return the handle for the the opened + USB device. If R_ID is not NULL it will receive the reader ID of + that device. If R_DEV is not NULL it will the device pointer of + that device. If IFCDESC_EXTRA is NOT NULL it will receive a + malloced copy of the interfaces "extra: data filed; + IFCDESC_EXTRA_LEN receive the lengtyh of this field. If there is + no reader with number READERNO or that reader is not usable by our + implementation NULL will be returned. The caller must close a + returned USB device handle and free (if not passed as NULL) the + returned reader ID info as well as the IFCDESC_EXTRA. On error + NULL will get stored at R_RID, R_DEV, IFCDESC_EXTRA and + IFCDESC_EXTRA_LEN. With READERID being -1 the function stops if + the READERID was found. + + Note that the first entry of the returned reader ID list in scan mode + corresponds with a READERNO of 0 in find mode. +*/ +static usb_dev_handle * +scan_or_find_devices (int readerno, const char *readerid, + char **r_rid, + struct usb_device **r_dev, + unsigned char **ifcdesc_extra, + size_t *ifcdesc_extra_len, + int *interface_number, + int *ep_bulk_out, int *ep_bulk_in, int *ep_intr) +{ + char *rid_list = NULL; + int count = 0; + struct usb_bus *busses, *bus; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + int scan_mode = (readerno == -1 && !readerid); + + /* Set return values to a default. */ + if (r_rid) + *r_rid = NULL; + if (r_dev) + *r_dev = NULL; + if (ifcdesc_extra) + *ifcdesc_extra = NULL; + if (ifcdesc_extra_len) + *ifcdesc_extra_len = 0; + if (interface_number) + *interface_number = 0; + + /* See whether we want scan or find mode. */ + if (scan_mode) + { + assert (r_rid); + } + + usb_find_busses(); + usb_find_devices(); + +#ifdef HAVE_USB_GET_BUSSES + busses = usb_get_busses(); +#else + busses = usb_busses; +#endif + + for (bus = busses; bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + int cfg_no; + + for (cfg_no=0; cfg_no < dev->descriptor.bNumConfigurations; cfg_no++) + { + struct usb_config_descriptor *config = dev->config + cfg_no; + int ifc_no; + + if(!config) + continue; + + for (ifc_no=0; ifc_no < config->bNumInterfaces; ifc_no++) + { + struct usb_interface *interface + = config->interface + ifc_no; + int set_no; + + if (!interface) + continue; + + for (set_no=0; set_no < interface->num_altsetting; set_no++) + { + struct usb_interface_descriptor *ifcdesc + = interface->altsetting + set_no; + char *rid; + + /* The second condition is for some SCM Micro + SPR 532 which does not know about the + assigned CCID class. Instead of trying to + interpret the strings we simply look at the + product ID. */ + if (ifcdesc && ifcdesc->extra + && ( (ifcdesc->bInterfaceClass == 11 + && ifcdesc->bInterfaceSubClass == 0 + && ifcdesc->bInterfaceProtocol == 0) + || (ifcdesc->bInterfaceClass == 255 + && dev->descriptor.idVendor == 0x04e6 + && dev->descriptor.idProduct == 0xe003))) + { + idev = usb_open (dev); + if (!idev) + { + DEBUGOUT_1 ("usb_open failed: %s\n", + strerror (errno)); + continue; + } + + rid = make_reader_id (idev, + dev->descriptor.idVendor, + dev->descriptor.idProduct, + dev->descriptor.iSerialNumber); + if (rid) + { + if (scan_mode) + { + char *p; + + /* We are collecting infos about all + available CCID readers. Store + them and continue. */ + DEBUGOUT_2 ("found CCID reader %d " + "(ID=%s)\n", + count, rid ); + if ((p = malloc ((rid_list? + strlen (rid_list):0) + + 1 + strlen (rid) + + 1))) + { + *p = 0; + if (rid_list) + { + strcat (p, rid_list); + free (rid_list); + } + strcat (p, rid); + strcat (p, "\n"); + rid_list = p; + } + else /* Out of memory. */ + free (rid); + rid = NULL; + count++; + } + else if (!readerno + || (readerno < 0 + && readerid + && !strcmp (readerid, rid))) + { + /* We found the requested reader. */ + if (ifcdesc_extra && ifcdesc_extra_len) + { + *ifcdesc_extra = malloc (ifcdesc + ->extralen); + if (!*ifcdesc_extra) + { + usb_close (idev); + free (rid); + return NULL; /* Out of core. */ + } + memcpy (*ifcdesc_extra, ifcdesc->extra, + ifcdesc->extralen); + *ifcdesc_extra_len = ifcdesc->extralen; + } + if (interface_number) + *interface_number = (ifcdesc-> + bInterfaceNumber); + if (ep_bulk_out) + *ep_bulk_out = find_endpoint (ifcdesc, 0); + if (ep_bulk_in) + *ep_bulk_in = find_endpoint (ifcdesc, 1); + if (ep_intr) + *ep_intr = find_endpoint (ifcdesc, 2); + + + if (r_dev) + *r_dev = dev; + if (r_rid) + { + *r_rid = rid; + rid = NULL; + } + else + free (rid); + return idev; /* READY. */ + } + else + { + /* This is not yet the reader we + want. fixme: We could avoid the + extra usb_open in this case. */ + if (readerno >= 0) + readerno--; + } + free (rid); + } + + usb_close (idev); + idev = NULL; + goto next_device; + } + } + } + } + next_device: + ; + } + } + + if (scan_mode) + *r_rid = rid_list; + + return NULL; +} + + +/* Set the level of debugging to to usea dn return the old level. -1 + just returns the old level. A level of 0 disables debugging, 1 + enables debugging, 2 enables additional tracing of the T=1 + protocol, other values are not yet defined. */ +int +ccid_set_debug_level (int level) +{ + int old = debug_level; + if (level != -1) + debug_level = level; + return old; +} + + +char * +ccid_get_reader_list (void) +{ + char *reader_list; + + if (!initialized_usb) + { + usb_init (); + initialized_usb = 1; + } + + scan_or_find_devices (-1, NULL, &reader_list, NULL, NULL, NULL, NULL, + NULL, NULL, NULL); + return reader_list; +} + + +/* Open the reader with the internal number READERNO and return a + pointer to be used as handle in HANDLE. Returns 0 on success. */ +int +ccid_open_reader (ccid_driver_t *handle, const char *readerid) +{ + int rc = 0; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + char *rid = NULL; + unsigned char *ifcdesc_extra = NULL; + size_t ifcdesc_extra_len; + int readerno; + int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr; + + *handle = NULL; + + if (!initialized_usb) + { + usb_init (); + initialized_usb = 1; + } + + /* See whether we want to use the reader ID string or a reader + number. A readerno of -1 indicates that the reader ID string is + to be used. */ + if (readerid && strchr (readerid, ':')) + readerno = -1; /* We want to use the readerid. */ + else if (readerid) + { + readerno = atoi (readerid); + if (readerno < 0) + { + DEBUGOUT ("no CCID readers found\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + } + else + readerno = 0; /* Default. */ + + idev = scan_or_find_devices (readerno, readerid, &rid, &dev, + &ifcdesc_extra, &ifcdesc_extra_len, + &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr); + if (!idev) + { + if (readerno == -1) + DEBUGOUT_1 ("no CCID reader with ID %s\n", readerid ); + else + DEBUGOUT_1 ("no CCID reader with number %d\n", readerno ); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + /* Okay, this is a CCID reader. */ + *handle = calloc (1, sizeof **handle); + if (!*handle) + { + DEBUGOUT ("out of memory\n"); + rc = CCID_DRIVER_ERR_OUT_OF_CORE; + goto leave; + } + (*handle)->idev = idev; + (*handle)->rid = rid; + (*handle)->id_vendor = dev->descriptor.idVendor; + (*handle)->id_product = dev->descriptor.idProduct; + (*handle)->bcd_device = dev->descriptor.bcdDevice; + (*handle)->ifc_no = ifc_no; + (*handle)->ep_bulk_out = ep_bulk_out; + (*handle)->ep_bulk_in = ep_bulk_in; + (*handle)->ep_intr = ep_intr; + + DEBUGOUT_2 ("using CCID reader %d (ID=%s)\n", readerno, rid ); + + + if (parse_ccid_descriptor (*handle, ifcdesc_extra, ifcdesc_extra_len)) + { + DEBUGOUT ("device not supported\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + rc = usb_claim_interface (idev, ifc_no); + if (rc) + { + DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc); + rc = CCID_DRIVER_ERR_CARD_IO_ERROR; + goto leave; + } + + leave: + free (ifcdesc_extra); + if (rc) + { + free (rid); + if (idev) + usb_close (idev); + free (*handle); + *handle = NULL; + } + + return rc; +} + + +static void +do_close_reader (ccid_driver_t handle) +{ + int rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + + if (!handle->powered_off) + { + msg[0] = PC_to_RDR_IccPowerOff; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + msglen = 10; + + rc = bulk_out (handle, msg, msglen); + if (!rc) + bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_SlotStatus, + seqno, 2000, 0); + handle->powered_off = 1; + } + if (handle->idev) + { + usb_release_interface (handle->idev, handle->ifc_no); + usb_close (handle->idev); + handle->idev = NULL; + } +} + + +/* Reset a reader on HANDLE. This is useful in case a reader has been + plugged of and inserted at a different port. By resetting the + handle, the same reader will be get used. Note, that on error the + handle won't get released. + + This does not return an ATR, so ccid_get_atr should be called right + after this one. +*/ +int +ccid_shutdown_reader (ccid_driver_t handle) +{ + int rc = 0; + struct usb_device *dev = NULL; + usb_dev_handle *idev = NULL; + unsigned char *ifcdesc_extra = NULL; + size_t ifcdesc_extra_len; + int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr; + + if (!handle || !handle->rid) + return CCID_DRIVER_ERR_INV_VALUE; + + do_close_reader (handle); + + idev = scan_or_find_devices (-1, handle->rid, NULL, &dev, + &ifcdesc_extra, &ifcdesc_extra_len, + &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr); + if (!idev) + { + DEBUGOUT_1 ("no CCID reader with ID %s\n", handle->rid); + return CCID_DRIVER_ERR_NO_READER; + } + + + handle->idev = idev; + handle->ifc_no = ifc_no; + handle->ep_bulk_out = ep_bulk_out; + handle->ep_bulk_in = ep_bulk_in; + handle->ep_intr = ep_intr; + + if (parse_ccid_descriptor (handle, ifcdesc_extra, ifcdesc_extra_len)) + { + DEBUGOUT ("device not supported\n"); + rc = CCID_DRIVER_ERR_NO_READER; + goto leave; + } + + rc = usb_claim_interface (idev, ifc_no); + if (rc) + { + DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc); + rc = CCID_DRIVER_ERR_CARD_IO_ERROR; + goto leave; + } + + leave: + free (ifcdesc_extra); + if (rc) + { + usb_close (handle->idev); + handle->idev = NULL; + } + + return rc; + +} + + +/* Close the reader HANDLE. */ +int +ccid_close_reader (ccid_driver_t handle) +{ + if (!handle || !handle->idev) + return 0; + + do_close_reader (handle); + free (handle->rid); + free (handle); + return 0; +} + + +/* Return False if a card is present and powered. */ +int +ccid_check_card_presence (ccid_driver_t handle) +{ + + return -1; +} + + +/* Write a MSG of length MSGLEN to the designated bulk out endpoint. + Returns 0 on success. */ +static int +bulk_out (ccid_driver_t handle, unsigned char *msg, size_t msglen) +{ + int rc; + + rc = usb_bulk_write (handle->idev, + handle->ep_bulk_out, + (char*)msg, msglen, + 1000 /* ms timeout */); + if (rc == msglen) + return 0; + + if (rc == -1) + DEBUGOUT_1 ("usb_bulk_write error: %s\n", strerror (errno)); + else + DEBUGOUT_1 ("usb_bulk_write failed: %d\n", rc); + return CCID_DRIVER_ERR_CARD_IO_ERROR; +} + + +/* Read a maximum of LENGTH bytes from the bulk in endpoint into + BUFFER and return the actual read number if bytes in NREAD. SEQNO + is the sequence number used to send the request and EXPECTED_TYPE + the type of message we expect. Does checks on the ccid + header. TIMEOUT is the timeout value in ms. NO_DEBUG may be set to + avoid debug messages in case of no error. Returns 0 on success. */ +static int +bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length, + size_t *nread, int expected_type, int seqno, int timeout, + int no_debug) +{ + int i, rc; + size_t msglen; + + /* Fixme: The next line for the current Valgrind without support + for USB IOCTLs. */ + memset (buffer, 0, length); + retry: + rc = usb_bulk_read (handle->idev, + handle->ep_bulk_in, + (char*)buffer, length, + timeout); + if (rc < 0) + { + DEBUGOUT_1 ("usb_bulk_read error: %s\n", strerror (errno)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + *nread = msglen = rc; + + if (msglen < 10) + { + DEBUGOUT_1 ("bulk-in msg too short (%u)\n", (unsigned int)msglen); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[0] != expected_type) + { + DEBUGOUT_1 ("unexpected bulk-in msg type (%02x)\n", buffer[0]); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[5] != 0) + { + DEBUGOUT_1 ("unexpected bulk-in slot (%d)\n", buffer[5]); + return CCID_DRIVER_ERR_INV_VALUE; + } + if (buffer[6] != seqno) + { + DEBUGOUT_2 ("bulk-in seqno does not match (%d/%d)\n", + seqno, buffer[6]); + return CCID_DRIVER_ERR_INV_VALUE; + } + + if ( !(buffer[7] & 0x03) && (buffer[7] & 0xC0) == 0x80) + { + /* Card present and active, time extension requested. */ + DEBUGOUT_2 ("time extension requested (%02X,%02X)\n", + buffer[7], buffer[8]); + goto retry; + } + + if (!no_debug) + { + DEBUGOUT_3 ("status: %02X error: %02X octet[9]: %02X\n" + " data:", buffer[7], buffer[8], buffer[9] ); + for (i=10; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", buffer[i]); + DEBUGOUT_LF (); + } + if (CCID_COMMAND_FAILED (buffer)) + print_command_failed (buffer); + + /* Check whether a card is at all available. Note: If you add new + error codes here, check whether they need to be ignored in + send_escape_cmd. */ + switch ((buffer[7] & 0x03)) + { + case 0: /* no error */ break; + case 1: return CCID_DRIVER_ERR_CARD_INACTIVE; + case 2: return CCID_DRIVER_ERR_NO_CARD; + case 3: /* RFU */ break; + } + return 0; +} + + +/* Note that this function won't return the error codes NO_CARD or + CARD_INACTIVE. IF RESULT is not NULL, the result from the + operation will get returned in RESULT and its length in RESULTLEN. + If the response is larger than RESULTMAX, an error is returned and + the required buffer length returned in RESULTLEN. */ +static int +send_escape_cmd (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *result, size_t resultmax, size_t *resultlen) +{ + int i, rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + + if (resultlen) + *resultlen = 0; + + if (datalen > sizeof msg - 10) + return CCID_DRIVER_ERR_INV_VALUE; /* Escape data too large. */ + + msg[0] = PC_to_RDR_Escape; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + memcpy (msg+10, data, datalen); + msglen = 10 + datalen; + set_msg_len (msg, datalen); + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_Escape, + seqno, 5000, 0); + if (result) + switch (rc) + { + /* We need to ignore certain errorcode here. */ + case 0: + case CCID_DRIVER_ERR_CARD_INACTIVE: + case CCID_DRIVER_ERR_NO_CARD: + { + if (msglen < 10 || (msglen-10) > resultmax ) + rc = CCID_DRIVER_ERR_INV_VALUE; /* Invalid length of response. */ + else + { + memcpy (result, msg+10, msglen-10); + *resultlen = msglen-10; + } + rc = 0; + } + break; + default: + break; + } + + return rc; +} + + +int +ccid_transceive_escape (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + return send_escape_cmd (handle, data, datalen, resp, maxresplen, nresp); +} + + + +/* experimental */ +int +ccid_poll (ccid_driver_t handle) +{ + int rc; + unsigned char msg[10]; + size_t msglen; + int i, j; + + rc = usb_bulk_read (handle->idev, + handle->ep_intr, + (char*)msg, sizeof msg, + 0 /* ms timeout */ ); + if (rc < 0 && errno == ETIMEDOUT) + return 0; + + if (rc < 0) + { + DEBUGOUT_1 ("usb_intr_read error: %s\n", strerror (errno)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + msglen = rc; + rc = 0; + + if (msglen < 1) + { + DEBUGOUT ("intr-in msg too short\n"); + return CCID_DRIVER_ERR_INV_VALUE; + } + + if (msg[0] == RDR_to_PC_NotifySlotChange) + { + DEBUGOUT ("notify slot change:"); + for (i=1; i < msglen; i++) + for (j=0; j < 4; j++) + DEBUGOUT_CONT_3 (" %d:%c%c", + (i-1)*4+j, + (msg[i] & (1<<(j*2)))? 'p':'-', + (msg[i] & (2<<(j*2)))? '*':' '); + DEBUGOUT_LF (); + } + else if (msg[0] == RDR_to_PC_HardwareError) + { + DEBUGOUT ("hardware error occured\n"); + } + else + { + DEBUGOUT_1 ("unknown intr-in msg of type %02X\n", msg[0]); + } + + return 0; +} + + +/* Note that this fucntion won't return the error codes NO_CARD or + CARD_INACTIVE */ +int +ccid_slot_status (ccid_driver_t handle, int *statusbits) +{ + int rc; + unsigned char msg[100]; + size_t msglen; + unsigned char seqno; + int retries = 0; + + retry: + msg[0] = PC_to_RDR_GetSlotStatus; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* RFU */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + + rc = bulk_out (handle, msg, 10); + if (rc) + return rc; + /* Note that we set the NO_DEBUG flag here, so that the logs won't + get cluttered up by a ticker function checking for the slot + status and debugging enabled. */ + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_SlotStatus, + seqno, retries? 1000 : 200, 1); + if (rc == CCID_DRIVER_ERR_CARD_IO_ERROR && retries < 3) + { + if (!retries) + { + DEBUGOUT ("USB: CALLING USB_CLEAR_HALT\n"); + usb_clear_halt (handle->idev, handle->ep_bulk_in); + usb_clear_halt (handle->idev, handle->ep_bulk_out); + } + else + DEBUGOUT ("USB: RETRYING bulk_in AGAIN\n"); + retries++; + goto retry; + } + if (rc && rc != CCID_DRIVER_ERR_NO_CARD + && rc != CCID_DRIVER_ERR_CARD_INACTIVE) + return rc; + *statusbits = (msg[7] & 3); + + return 0; +} + + +int +ccid_get_atr (ccid_driver_t handle, + unsigned char *atr, size_t maxatrlen, size_t *atrlen) +{ + int rc; + int statusbits; + unsigned char msg[100]; + unsigned char *tpdu; + size_t msglen, tpdulen; + unsigned char seqno; + int use_crc = 0; + unsigned int edc; + int i; + int tried_iso = 0; + + /* First check whether a card is available. */ + rc = ccid_slot_status (handle, &statusbits); + if (rc) + return rc; + if (statusbits == 2) + return CCID_DRIVER_ERR_NO_CARD; + + /* For an inactive and also for an active card, issue the PowerOn + command to get the ATR. */ + again: + msg[0] = PC_to_RDR_IccPowerOn; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; /* power select (0=auto, 1=5V, 2=3V, 3=1.8V) */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, 0); + msglen = 10; + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_DataBlock, + seqno, 5000, 0); + if (rc) + return rc; + if (!tried_iso && CCID_COMMAND_FAILED (msg) && CCID_ERROR_CODE (msg) == 0xbb + && ((handle->id_vendor == VENDOR_CHERRY + && handle->id_product == 0x0005) + || (handle->id_vendor == VENDOR_GEMPC + && handle->id_product == 0x4433) + )) + { + tried_iso = 1; + /* Try switching to ISO mode. */ + if (!send_escape_cmd (handle, (const unsigned char*)"\xF1\x01", 2, + NULL, 0, NULL)) + goto again; + } + else if (CCID_COMMAND_FAILED (msg)) + return CCID_DRIVER_ERR_CARD_IO_ERROR; + + + handle->powered_off = 0; + + if (atr) + { + size_t n = msglen - 10; + + if (n > maxatrlen) + n = maxatrlen; + memcpy (atr, msg+10, n); + *atrlen = n; + } + + /* Setup parameters to select T=1. */ + msg[0] = PC_to_RDR_SetParameters; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 1; /* Select T=1. */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + + /* FIXME: Get those values from the ATR. */ + msg[10]= 0x01; /* Fi/Di */ + msg[11]= 0x10; /* LRC, direct convention. */ + msg[12]= 0; /* Extra guardtime. */ + msg[13]= 0x41; /* BWI/CWI */ + msg[14]= 0; /* No clock stoppping. */ + msg[15]= 254; /* IFSC */ + msg[16]= 0; /* Does not support non default NAD values. */ + set_msg_len (msg, 7); + msglen = 10 + 7; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + /* Note that we ignore the error code on purpose. */ + bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_Parameters, + seqno, 5000, 0); + + handle->t1_ns = 0; + handle->t1_nr = 0; + + /* Send an S-Block with our maximun IFSD to the CCID. */ + if (!handle->auto_ifsd) + { + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0xc0 | 0 | 1); /* S-block request: change IFSD */ + tpdu[2] = 1; + tpdu[3] = handle->max_ifsd? handle->max_ifsd : 32; + tpdulen = 4; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 0; + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, tpdulen); + msglen = 10 + tpdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + if (debug_level > 1) + DEBUGOUT_3 ("T=1: put %c-block seq=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + + rc = bulk_in (handle, msg, sizeof msg, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + return CCID_DRIVER_ERR_ABORTED; + + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if ((tpdu[1] & 0xe0) != 0xe0 || tpdu[2] != 1) + { + DEBUGOUT ("invalid response for S-block (Change-IFSD)\n"); + return -1; + } + DEBUGOUT_1 ("IFSD has been set to %d\n", tpdu[3]); + } + + return 0; +} + + + + +static unsigned int +compute_edc (const unsigned char *data, size_t datalen, int use_crc) +{ + if (use_crc) + { + return 0x42; /* Not yet implemented. */ + } + else + { + unsigned char crc = 0; + + for (; datalen; datalen--) + crc ^= *data++; + return crc; + } +} + + +/* Helper for ccid_transceive used for APDU level exchanges. */ +static int +ccid_transceive_apdu_level (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + unsigned char *resp, size_t maxresplen, + size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + const unsigned char *apdu; + size_t apdulen; + unsigned char *msg; + size_t msglen; + unsigned char seqno; + int i; + + msg = send_buffer; + + apdu = apdu_buf; + apdulen = apdu_buflen; + assert (apdulen); + + if (apdulen > 254) + return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + memcpy (msg+10, apdu, apdulen); + set_msg_len (msg, apdulen); + msglen = 10 + apdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + apdu = msg + 10; + apdulen = msglen - 10; + + if (resp) + { + if (apdulen > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)apdulen, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, apdu, apdulen); + *nresp = apdulen; + } + + return 0; +} + + + +/* + Protocol T=1 overview + + Block Structure: + Prologue Field: + 1 byte Node Address (NAD) + 1 byte Protocol Control Byte (PCB) + 1 byte Length (LEN) + Information Field: + 0-254 byte APDU or Control Information (INF) + Epilogue Field: + 1 byte Error Detection Code (EDC) + + NAD: + bit 7 unused + bit 4..6 Destination Node Address (DAD) + bit 3 unused + bit 2..0 Source Node Address (SAD) + + If node adresses are not used, SAD and DAD should be set to 0 on + the first block sent to the card. If they are used they should + have different values (0 for one is okay); that first block sets up + the addresses of the nodes. + + PCB: + Information Block (I-Block): + bit 7 0 + bit 6 Sequence number (yep, that is modulo 2) + bit 5 Chaining flag + bit 4..0 reserved + Received-Ready Block (R-Block): + bit 7 1 + bit 6 0 + bit 5 0 + bit 4 Sequence number + bit 3..0 0 = no error + 1 = EDC or parity error + 2 = other error + other values are reserved + Supervisory Block (S-Block): + bit 7 1 + bit 6 1 + bit 5 clear=request,set=response + bit 4..0 0 = resyncronisation request + 1 = information field size request + 2 = abort request + 3 = extension of BWT request + 4 = VPP error + other values are reserved + +*/ + +int +ccid_transceive (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + const unsigned char *apdu; + size_t apdulen; + unsigned char *msg, *tpdu, *p; + size_t msglen, tpdulen, last_tpdulen, n; + unsigned char seqno; + int i; + unsigned int edc; + int use_crc = 0; + size_t dummy_nresp; + int next_chunk = 1; + int sending = 1; + int retries = 0; + + if (!nresp) + nresp = &dummy_nresp; + *nresp = 0; + + /* Smarter readers allow to send APDUs directly; divert here. */ + if (handle->apdu_level) + return ccid_transceive_apdu_level (handle, apdu_buf, apdu_buflen, + resp, maxresplen, nresp); + + /* The other readers we support require sending TPDUs. */ + + tpdulen = 0; /* Avoid compiler warning about no initialization. */ + msg = send_buffer; + for (;;) + { + if (next_chunk) + { + next_chunk = 0; + + apdu = apdu_buf; + apdulen = apdu_buflen; + assert (apdulen); + + /* Construct an I-Block. */ + if (apdulen > 254) + return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ + + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = ((handle->t1_ns & 1) << 6); /* I-block */ + if (apdulen > 128 /* fixme: replace by ifsc */) + { + apdulen = 128; + apdu_buf += 128; + apdu_buflen -= 128; + tpdu[1] |= (1 << 5); /* Set more bit. */ + } + tpdu[2] = apdulen; + memcpy (tpdu+3, apdu, apdulen); + tpdulen = 3 + apdulen; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + } + + msg[0] = PC_to_RDR_XfrBlock; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + set_msg_len (msg, tpdulen); + msglen = 10 + tpdulen; + last_tpdulen = tpdulen; + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + if (debug_level > 1) + DEBUGOUT_3 ("T=1: put %c-block seq=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) + : !!(msg[11] & 0x40)), + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + { + usb_clear_halt (handle->idev, handle->ep_bulk_in); + return CCID_DRIVER_ERR_ABORTED; + } + + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if (!(tpdu[1] & 0x80)) + { /* This is an I-block. */ + retries = 0; + if (sending) + { /* last block sent was successful. */ + handle->t1_ns ^= 1; + sending = 0; + } + + if (!!(tpdu[1] & 0x40) != handle->t1_nr) + { /* Reponse does not match our sequence number. */ + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0x80 | (handle->t1_nr & 1) << 4 | 2); /* R-block */ + tpdu[2] = 0; + tpdulen = 3; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + + continue; + } + + handle->t1_nr ^= 1; + + p = tpdu + 3; /* Skip the prologue field. */ + n = tpdulen - 3 - 1; /* Strip the epilogue field. */ + /* fixme: verify the checksum. */ + if (resp) + { + if (n > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)n, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, p, n); + resp += n; + *nresp += n; + maxresplen -= n; + } + + if (!(tpdu[1] & 0x20)) + return 0; /* No chaining requested - ready. */ + + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0x80 | (handle->t1_nr & 1) << 4); /* R-block */ + tpdu[2] = 0; + tpdulen = 3; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + } + else if ((tpdu[1] & 0xc0) == 0x80) + { /* This is a R-block. */ + if ( (tpdu[1] & 0x0f)) + { /* Error: repeat last block */ + if (++retries > 3) + { + DEBUGOUT ("3 failed retries\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + msg = send_buffer; + tpdulen = last_tpdulen; + } + else if (sending && !!(tpdu[1] & 0x10) == handle->t1_ns) + { /* Response does not match our sequence number. */ + DEBUGOUT ("R-block with wrong seqno received on more bit\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if (sending) + { /* Send next chunk. */ + retries = 0; + msg = send_buffer; + next_chunk = 1; + handle->t1_ns ^= 1; + } + else + { + DEBUGOUT ("unexpected ACK R-block received\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } + else + { /* This is a S-block. */ + retries = 0; + DEBUGOUT_2 ("T=1 S-block %s received cmd=%d\n", + (tpdu[1] & 0x20)? "response": "request", + (tpdu[1] & 0x1f)); + if ( !(tpdu[1] & 0x20) && (tpdu[1] & 0x1f) == 3 && tpdu[2]) + { /* Wait time extension request. */ + unsigned char bwi = tpdu[3]; + msg = send_buffer; + tpdu = msg+10; + /* NAD: DAD=1, SAD=0 */ + tpdu[0] = handle->nonnull_nad? ((1 << 4) | 0): 0; + tpdu[1] = (0xc0 | 0x20 | 3); /* S-block response */ + tpdu[2] = 1; + tpdu[3] = bwi; + tpdulen = 4; + edc = compute_edc (tpdu, tpdulen, use_crc); + if (use_crc) + tpdu[tpdulen++] = (edc >> 8); + tpdu[tpdulen++] = edc; + DEBUGOUT_1 ("T=1 waittime extension of bwi=%d\n", bwi); + } + else + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } /* end T=1 protocol loop. */ + + return 0; +} + + +/* Send the CCID Secure command to the reader. APDU_BUF should + contain the APDU template. PIN_MODE defines how the pin gets + formatted: + + 1 := The PIN is ASCII encoded and of variable length. The + length of the PIN entered will be put into Lc by the reader. + The APDU should me made up of 4 bytes without Lc. + + PINLEN_MIN and PINLEN_MAX define the limits for the pin length. 0 + may be used t enable reasonable defaults. PIN_PADLEN should be 0. + + When called with RESP and NRESP set to NULL, the function will + merely check whether the reader supports the secure command for the + given APDU and PIN_MODE. */ +int +ccid_transceive_secure (ccid_driver_t handle, + const unsigned char *apdu_buf, size_t apdu_buflen, + int pin_mode, int pinlen_min, int pinlen_max, + int pin_padlen, + unsigned char *resp, size_t maxresplen, size_t *nresp) +{ + int rc; + unsigned char send_buffer[10+259], recv_buffer[10+259]; + unsigned char *msg, *tpdu, *p; + size_t msglen, tpdulen, n; + unsigned char seqno; + int i; + size_t dummy_nresp; + int testmode; + + testmode = !resp && !nresp; + + if (!nresp) + nresp = &dummy_nresp; + *nresp = 0; + + if (apdu_buflen >= 4 && apdu_buf[1] == 0x20 && (handle->has_pinpad & 1)) + ; + else if (apdu_buflen >= 4 && apdu_buf[1] == 0x24 && (handle->has_pinpad & 2)) + return CCID_DRIVER_ERR_NOT_SUPPORTED; /* Not yet by our code. */ + else + return CCID_DRIVER_ERR_NO_KEYPAD; + + if (pin_mode != 1) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (pin_padlen != 0) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (!pinlen_min) + pinlen_min = 1; + if (!pinlen_max) + pinlen_max = 25; + + /* Note that the 25 is the maximum value the SPR532 allows. */ + if (pinlen_min < 1 || pinlen_min > 25 + || pinlen_max < 1 || pinlen_max > 25 + || pinlen_min > pinlen_max) + return CCID_DRIVER_ERR_INV_VALUE; + + /* We have only tested this with an SCM reader so better don't risk + anything and do not allow the use with other readers. */ + if (handle->id_vendor != VENDOR_SCM) + return CCID_DRIVER_ERR_NOT_SUPPORTED; + + if (testmode) + return 0; /* Success */ + + msg = send_buffer; + if (handle->id_vendor == VENDOR_SCM) + { + DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n"); + rc = send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3, + NULL, 0, NULL); + if (rc) + return rc; + } + + msg[0] = PC_to_RDR_Secure; + msg[5] = 0; /* slot */ + msg[6] = seqno = handle->seqno++; + msg[7] = 4; /* bBWI */ + msg[8] = 0; /* RFU */ + msg[9] = 0; /* RFU */ + msg[10] = 0; /* Perform PIN verification. */ + msg[11] = 0; /* Timeout in seconds. */ + msg[12] = 0x82; /* bmFormatString: Byte, pos=0, left, ASCII. */ + if (handle->id_vendor == VENDOR_SCM) + { + /* For the SPR532 the next 2 bytes need to be zero. We do this + for all SCM product. Kudos to Martin Paljak for this + hint. */ + msg[13] = msg[14] = 0; + } + else + { + msg[13] = 0x00; /* bmPINBlockString: + 0 bits of pin length to insert. + 0 bytes of PIN block size. */ + msg[14] = 0x00; /* bmPINLengthFormat: + Units are bytes, position is 0. */ + } + msg[15] = pinlen_min; /* wPINMaxExtraDigit-Minimum. */ + msg[16] = pinlen_max; /* wPINMaxExtraDigit-Maximum. */ + msg[17] = 0x02; /* bEntryValidationCondition: + Validation key pressed */ + if (pinlen_min && pinlen_max && pinlen_min == pinlen_max) + msg[17] |= 0x01; /* Max size reached. */ + msg[18] = 0xff; /* bNumberMessage: Default. */ + msg[19] = 0x04; /* wLangId-High. */ + msg[20] = 0x09; /* wLangId-Low: English FIXME: use the first entry. */ + msg[21] = 0; /* bMsgIndex. */ + /* bTeoProlog follows: */ + msg[22] = handle->nonnull_nad? ((1 << 4) | 0): 0; + msg[23] = ((handle->t1_ns & 1) << 6); /* I-block */ + msg[24] = 4; /* apdulen. */ + /* APDU follows: */ + msg[25] = apdu_buf[0]; /* CLA */ + msg[26] = apdu_buf[1]; /* INS */ + msg[27] = apdu_buf[2]; /* P1 */ + msg[28] = apdu_buf[3]; /* P2 */ + msglen = 29; + set_msg_len (msg, msglen - 10); + + DEBUGOUT ("sending"); + for (i=0; i < msglen; i++) + DEBUGOUT_CONT_1 (" %02X", msg[i]); + DEBUGOUT_LF (); + + rc = bulk_out (handle, msg, msglen); + if (rc) + return rc; + + msg = recv_buffer; + rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen, + RDR_to_PC_DataBlock, seqno, 5000, 0); + if (rc) + return rc; + + tpdu = msg + 10; + tpdulen = msglen - 10; + + if (tpdulen < 4) + { + usb_clear_halt (handle->idev, handle->ep_bulk_in); + return CCID_DRIVER_ERR_ABORTED; + } + if (debug_level > 1) + DEBUGOUT_4 ("T=1: got %c-block seq=%d err=%d%s\n", + ((msg[11] & 0xc0) == 0x80)? 'R' : + (msg[11] & 0x80)? 'S' : 'I', + ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)), + ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0, + (!(msg[11] & 0x80) && (msg[11] & 0x20)? " [more]":"")); + + if (!(tpdu[1] & 0x80)) + { /* This is an I-block. */ + /* Last block sent was successful. */ + handle->t1_ns ^= 1; + + if (!!(tpdu[1] & 0x40) != handle->t1_nr) + { /* Reponse does not match our sequence number. */ + DEBUGOUT ("I-block with wrong seqno received\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + handle->t1_nr ^= 1; + + p = tpdu + 3; /* Skip the prologue field. */ + n = tpdulen - 3 - 1; /* Strip the epilogue field. */ + /* fixme: verify the checksum. */ + if (resp) + { + if (n > maxresplen) + { + DEBUGOUT_2 ("provided buffer too short for received data " + "(%u/%u)\n", + (unsigned int)n, (unsigned int)maxresplen); + return CCID_DRIVER_ERR_INV_VALUE; + } + + memcpy (resp, p, n); + resp += n; + *nresp += n; + maxresplen -= n; + } + + if (!(tpdu[1] & 0x20)) + return 0; /* No chaining requested - ready. */ + + DEBUGOUT ("chaining requested but not supported for Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if ((tpdu[1] & 0xc0) == 0x80) + { /* This is a R-block. */ + if ( (tpdu[1] & 0x0f)) + { /* Error: repeat last block */ + DEBUGOUT ("No retries supported for Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else if (!!(tpdu[1] & 0x10) == handle->t1_ns) + { /* Reponse does not match our sequence number. */ + DEBUGOUT ("R-block with wrong seqno received on more bit\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + else + { /* Send next chunk. */ + DEBUGOUT ("chaining not supported on Secure operation\n"); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + } + else + { /* This is a S-block. */ + DEBUGOUT_2 ("T=1 S-block %s received cmd=%d for Secure operation\n", + (tpdu[1] & 0x20)? "response": "request", + (tpdu[1] & 0x1f)); + return CCID_DRIVER_ERR_CARD_IO_ERROR; + } + + return 0; +} + + + + +#ifdef TEST + + +static void +print_error (int err) +{ + const char *p; + char buf[50]; + + switch (err) + { + case 0: p = "success"; + case CCID_DRIVER_ERR_OUT_OF_CORE: p = "out of core"; break; + case CCID_DRIVER_ERR_INV_VALUE: p = "invalid value"; break; + case CCID_DRIVER_ERR_NO_DRIVER: p = "no driver"; break; + case CCID_DRIVER_ERR_NOT_SUPPORTED: p = "not supported"; break; + case CCID_DRIVER_ERR_LOCKING_FAILED: p = "locking failed"; break; + case CCID_DRIVER_ERR_BUSY: p = "busy"; break; + case CCID_DRIVER_ERR_NO_CARD: p = "no card"; break; + case CCID_DRIVER_ERR_CARD_INACTIVE: p = "card inactive"; break; + case CCID_DRIVER_ERR_CARD_IO_ERROR: p = "card I/O error"; break; + case CCID_DRIVER_ERR_GENERAL_ERROR: p = "general error"; break; + case CCID_DRIVER_ERR_NO_READER: p = "no reader"; break; + case CCID_DRIVER_ERR_ABORTED: p = "aborted"; break; + default: sprintf (buf, "0x%05x", err); p = buf; break; + } + fprintf (stderr, "operation failed: %s\n", p); +} + +static void +print_data (const unsigned char *data, size_t length) +{ + if (length >= 2) + { + fprintf (stderr, "operation status: %02X%02X\n", + data[length-2], data[length-1]); + length -= 2; + } + if (length) + { + fputs (" returned data:", stderr); + for (; length; length--, data++) + fprintf (stderr, " %02X", *data); + putc ('\n', stderr); + } +} + +static void +print_result (int rc, const unsigned char *data, size_t length) +{ + if (rc) + print_error (rc); + else if (data) + print_data (data, length); +} + +int +main (int argc, char **argv) +{ + int rc; + ccid_driver_t ccid; + unsigned int slotstat; + unsigned char result[512]; + size_t resultlen; + int no_pinpad = 0; + int verify_123456 = 0; + int did_verify = 0; + int no_poll = 0; + + if (argc) + { + argc--; + argv++; + } + + while (argc) + { + if ( !strcmp (*argv, "--list")) + { + char *p; + p = ccid_get_reader_list (); + if (!p) + return 1; + fputs (p, stderr); + free (p); + return 0; + } + else if ( !strcmp (*argv, "--debug")) + { + ccid_set_debug_level (1); + argc--; argv++; + } + else if ( !strcmp (*argv, "--no-poll")) + { + no_poll = 1; + argc--; argv++; + } + else if ( !strcmp (*argv, "--no-pinpad")) + { + no_pinpad = 1; + argc--; argv++; + } + else if ( !strcmp (*argv, "--verify-123456")) + { + verify_123456 = 1; + argc--; argv++; + } + else + break; + } + + rc = ccid_open_reader (&ccid, argc? *argv:NULL); + if (rc) + return 1; + + if (!no_poll) + ccid_poll (ccid); + fputs ("getting ATR ...\n", stderr); + rc = ccid_get_atr (ccid, NULL, 0, NULL); + if (rc) + { + print_error (rc); + return 1; + } + + if (!no_poll) + ccid_poll (ccid); + fputs ("getting slot status ...\n", stderr); + rc = ccid_slot_status (ccid, &slotstat); + if (rc) + { + print_error (rc); + return 1; + } + + if (!no_poll) + ccid_poll (ccid); + + fputs ("selecting application OpenPGP ....\n", stderr); + { + static unsigned char apdu[] = { + 0, 0xA4, 4, 0, 6, 0xD2, 0x76, 0x00, 0x01, 0x24, 0x01}; + rc = ccid_transceive (ccid, + apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + + + if (!no_poll) + ccid_poll (ccid); + + fputs ("getting OpenPGP DO 0x65 ....\n", stderr); + { + static unsigned char apdu[] = { 0, 0xCA, 0, 0x65, 254 }; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + + if (!no_pinpad) + { + } + + if (!no_pinpad) + { + static unsigned char apdu[] = { 0, 0x20, 0, 0x81 }; + + + if (ccid_transceive_secure (ccid, + apdu, sizeof apdu, + 1, 0, 0, 0, + NULL, 0, NULL)) + fputs ("can't verify using a PIN-Pad reader\n", stderr); + else + { + fputs ("verifying CHV1 using the PINPad ....\n", stderr); + + rc = ccid_transceive_secure (ccid, + apdu, sizeof apdu, + 1, 0, 0, 0, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + did_verify = 1; + } + } + + if (verify_123456 && !did_verify) + { + fputs ("verifying that CHV1 is 123456....\n", stderr); + { + static unsigned char apdu[] = {0, 0x20, 0, 0x81, + 6, '1','2','3','4','5','6'}; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + } + + if (!rc) + { + fputs ("getting OpenPGP DO 0x5E ....\n", stderr); + { + static unsigned char apdu[] = { 0, 0xCA, 0, 0x5E, 254 }; + rc = ccid_transceive (ccid, apdu, sizeof apdu, + result, sizeof result, &resultlen); + print_result (rc, result, resultlen); + } + } + + ccid_close_reader (ccid); + + return 0; +} + +/* + * Local Variables: + * compile-command: "gcc -DTEST -Wall -I/usr/local/include -lusb -g ccid-driver.c" + * End: + */ +#endif /*TEST*/ +#endif /*HAVE_LIBUSB*/ + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid_1999/src/ccid/ccid-driver.h b/librfid_1999/src/ccid/ccid-driver.h new file mode 100644 index 0000000..ae6b7fd --- /dev/null +++ b/librfid_1999/src/ccid/ccid-driver.h @@ -0,0 +1,108 @@ +/* ccid-driver.c - USB ChipCardInterfaceDevices driver + * Copyright (C) 2003 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG 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. + * + * GnuPG 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. + * + * ALTERNATIVELY, this file may be distributed under the terms of the + * following license, in which case the provisions of this license are + * required INSTEAD OF the GNU General Public License. If you wish to + * allow use of your version of this file only under the terms of the + * GNU General Public License, and not to allow others to use your + * version of this file under the terms of the following license, + * indicate your decision by deleting this paragraph and the license + * below. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Id: ccid-driver.h 3887 2005-09-09 11:18:08Z wk $ + */ + +#ifndef CCID_DRIVER_H +#define CCID_DRIVER_H + +/* The CID driver returns the same error codes as the status words + used by GnuPG's apdu.h. For ease of maintenance they should always + match. */ +#define CCID_DRIVER_ERR_OUT_OF_CORE 0x10001 +#define CCID_DRIVER_ERR_INV_VALUE 0x10002 +#define CCID_DRIVER_ERR_INCOMPLETE_CARD_RESPONSE = 0x10003 +#define CCID_DRIVER_ERR_NO_DRIVER 0x10004 +#define CCID_DRIVER_ERR_NOT_SUPPORTED 0x10005 +#define CCID_DRIVER_ERR_LOCKING_FAILED 0x10006 +#define CCID_DRIVER_ERR_BUSY 0x10007 +#define CCID_DRIVER_ERR_NO_CARD 0x10008 +#define CCID_DRIVER_ERR_CARD_INACTIVE 0x10009 +#define CCID_DRIVER_ERR_CARD_IO_ERROR 0x1000a +#define CCID_DRIVER_ERR_GENERAL_ERROR 0x1000b +#define CCID_DRIVER_ERR_NO_READER 0x1000c +#define CCID_DRIVER_ERR_ABORTED 0x1000d +#define CCID_DRIVER_ERR_NO_KEYPAD 0x1000e + +struct ccid_driver_s; +typedef struct ccid_driver_s *ccid_driver_t; + +int ccid_set_debug_level (int level); +char *ccid_get_reader_list (void); +int ccid_open_reader (ccid_driver_t *handle, const char *readerid); +int ccid_shutdown_reader (ccid_driver_t handle); +int ccid_close_reader (ccid_driver_t handle); +int ccid_get_atr (ccid_driver_t handle, + unsigned char *atr, size_t maxatrlen, size_t *atrlen); +int ccid_slot_status (ccid_driver_t handle, int *statusbits); +int ccid_transceive (ccid_driver_t handle, + const unsigned char *apdu, size_t apdulen, + unsigned char *resp, size_t maxresplen, size_t *nresp); +int ccid_transceive_secure (ccid_driver_t handle, + const unsigned char *apdu, size_t apdulen, + int pin_mode, + int pinlen_min, int pinlen_max, int pin_padlen, + unsigned char *resp, size_t maxresplen, size_t *nresp); +int ccid_transceive_escape (ccid_driver_t handle, + const unsigned char *data, size_t datalen, + unsigned char *resp, size_t maxresplen, + size_t *nresp); + + + +#endif /*CCID_DRIVER_H*/ + + + diff --git a/librfid_1999/src/ccid/rfid_reader_cm5121_ccid_direct.c b/librfid_1999/src/ccid/rfid_reader_cm5121_ccid_direct.c new file mode 100644 index 0000000..9879ccf --- /dev/null +++ b/librfid_1999/src/ccid/rfid_reader_cm5121_ccid_direct.c @@ -0,0 +1,42 @@ +/* CM5121 backend for 'internal' CCID driver */ +#include +#include +#include + +#include + +#ifndef LIBRFID_FIRMWARE + +#include + +#include "ccid-driver.h" + +/* this is the sole function required by rfid_reader_cm5121.c */ +int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len) +{ + int rc; + ccid_driver_t ch = handle; + size_t maxrxlen = *rx_len; + + rc = ccid_transceive_escape (ch, tx_buf, tx_len, + rx_buf, maxrxlen, rx_len); + + return rc; +} + +int cm5121_source_init(struct rfid_asic_transport_handle *rath) +{ + int rc; + + rc = ccid_open_reader(&rath->data, NULL); + if (rc) { + fprintf (stderr, "failed to open CCID reader: %#x\n", rc); + return -1; + } + return 0; +} + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid_1999/src/cm5121_source.h b/librfid_1999/src/cm5121_source.h new file mode 100644 index 0000000..8646703 --- /dev/null +++ b/librfid_1999/src/cm5121_source.h @@ -0,0 +1,2 @@ + +extern int cm5121_source_init(struct rfid_asic_transport_handle *rath); diff --git a/librfid_1999/src/librfid.pc.in b/librfid_1999/src/librfid.pc.in new file mode 100644 index 0000000..6c64c00 --- /dev/null +++ b/librfid_1999/src/librfid.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +sysincludedir=@sysincludedir@ + +Name: librfid +Description: librfid +Version: @VERSION@ +Libs: -L${libdir} @LIBS@ -lrfid +Cflags: -I${sysincludedir} -I${includedir} diff --git a/librfid_1999/src/libusb_dyn.c b/librfid_1999/src/libusb_dyn.c new file mode 100644 index 0000000..78acc49 --- /dev/null +++ b/librfid_1999/src/libusb_dyn.c @@ -0,0 +1,484 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include +#include + +#include "libusb_dyn.h" + +#define LIBUSB_DLL_NAME "libusb0.dll" + +typedef usb_dev_handle * (*usb_open_t)(struct usb_device *dev); +typedef int (*usb_close_t)(usb_dev_handle *dev); +typedef int (*usb_get_string_t)(usb_dev_handle *dev, int index, int langid, + char *buf, size_t buflen); +typedef int (*usb_get_string_simple_t)(usb_dev_handle *dev, int index, + char *buf, size_t buflen); +typedef int (*usb_get_descriptor_by_endpoint_t)(usb_dev_handle *udev, int ep, + unsigned char type, + unsigned char index, + void *buf, int size); +typedef int (*usb_get_descriptor_t)(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); +typedef int (*usb_bulk_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_bulk_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_control_msg_t)(usb_dev_handle *dev, int requesttype, + int request, int value, int index, + char *bytes, int size, int timeout); +typedef int (*usb_set_configuration_t)(usb_dev_handle *dev, int configuration); +typedef int (*usb_claim_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_release_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_set_altinterface_t)(usb_dev_handle *dev, int alternate); +typedef int (*usb_resetep_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_clear_halt_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_reset_t)(usb_dev_handle *dev); +typedef char * (*usb_strerror_t)(void); +typedef void (*usb_init_t)(void); +typedef void (*usb_set_debug_t)(int level); +typedef int (*usb_find_busses_t)(void); +typedef int (*usb_find_devices_t)(void); +typedef struct usb_device * (*usb_device_t)(usb_dev_handle *dev); +typedef struct usb_bus * (*usb_get_busses_t)(void); +typedef int (*usb_install_service_np_t)(void); +typedef int (*usb_uninstall_service_np_t)(void); +typedef int (*usb_install_driver_np_t)(const char *inf_file); +typedef const struct usb_version * (*usb_get_version_t)(void); +typedef int (*usb_isochronous_setup_async_t)(usb_dev_handle *dev, + void **context, + unsigned char ep, int pktsize); +typedef int (*usb_bulk_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_interrupt_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_submit_async_t)(void *context, char *bytes, int size); +typedef int (*usb_reap_async_t)(void *context, int timeout); +typedef int (*usb_free_async_t)(void **context); + + +static usb_open_t _usb_open = NULL; +static usb_close_t _usb_close = NULL; +static usb_get_string_t _usb_get_string = NULL; +static usb_get_string_simple_t _usb_get_string_simple = NULL; +static usb_get_descriptor_by_endpoint_t _usb_get_descriptor_by_endpoint = NULL; +static usb_get_descriptor_t _usb_get_descriptor = NULL; +static usb_bulk_write_t _usb_bulk_write = NULL; +static usb_bulk_read_t _usb_bulk_read = NULL; +static usb_interrupt_write_t _usb_interrupt_write = NULL; +static usb_interrupt_read_t _usb_interrupt_read = NULL; +static usb_control_msg_t _usb_control_msg = NULL; +static usb_set_configuration_t _usb_set_configuration = NULL; +static usb_claim_interface_t _usb_claim_interface = NULL; +static usb_release_interface_t _usb_release_interface = NULL; +static usb_set_altinterface_t _usb_set_altinterface = NULL; +static usb_resetep_t _usb_resetep = NULL; +static usb_clear_halt_t _usb_clear_halt = NULL; +static usb_reset_t _usb_reset = NULL; +static usb_strerror_t _usb_strerror = NULL; +static usb_init_t _usb_init = NULL; +static usb_set_debug_t _usb_set_debug = NULL; +static usb_find_busses_t _usb_find_busses = NULL; +static usb_find_devices_t _usb_find_devices = NULL; +static usb_device_t _usb_device = NULL; +static usb_get_busses_t _usb_get_busses = NULL; +static usb_install_service_np_t _usb_install_service_np = NULL; +static usb_uninstall_service_np_t _usb_uninstall_service_np = NULL; +static usb_install_driver_np_t _usb_install_driver_np = NULL; +static usb_get_version_t _usb_get_version = NULL; +static usb_isochronous_setup_async_t _usb_isochronous_setup_async = NULL; +static usb_bulk_setup_async_t _usb_bulk_setup_async = NULL; +static usb_interrupt_setup_async_t _usb_interrupt_setup_async = NULL; +static usb_submit_async_t _usb_submit_async = NULL; +static usb_reap_async_t _usb_reap_async = NULL; +static usb_free_async_t _usb_free_async = NULL; + + +void usb_init(void) +{ + HINSTANCE libusb_dll = LoadLibrary(LIBUSB_DLL_NAME); + + if(!libusb_dll) + return; + + timeBeginPeriod(1); + + _usb_open = (usb_open_t) + GetProcAddress(libusb_dll, "usb_open"); + _usb_close = (usb_close_t) + GetProcAddress(libusb_dll, "usb_close"); + _usb_get_string = (usb_get_string_t) + GetProcAddress(libusb_dll, "usb_get_string"); + _usb_get_string_simple = (usb_get_string_simple_t) + GetProcAddress(libusb_dll, "usb_get_string_simple"); + _usb_get_descriptor_by_endpoint = (usb_get_descriptor_by_endpoint_t) + GetProcAddress(libusb_dll, "usb_get_descriptor_by_endpoint"); + _usb_get_descriptor = (usb_get_descriptor_t) + GetProcAddress(libusb_dll, "usb_get_descriptor"); + _usb_bulk_write = (usb_bulk_write_t) + GetProcAddress(libusb_dll, "usb_bulk_write"); + _usb_bulk_read = (usb_bulk_read_t) + GetProcAddress(libusb_dll, "usb_bulk_read"); + _usb_interrupt_write = (usb_interrupt_write_t) + GetProcAddress(libusb_dll, "usb_interrupt_write"); + _usb_interrupt_read = (usb_interrupt_read_t) + GetProcAddress(libusb_dll, "usb_interrupt_read"); + _usb_control_msg = (usb_control_msg_t) + GetProcAddress(libusb_dll, "usb_control_msg"); + _usb_set_configuration = (usb_set_configuration_t) + GetProcAddress(libusb_dll, "usb_set_configuration"); + _usb_claim_interface = (usb_claim_interface_t) + GetProcAddress(libusb_dll, "usb_claim_interface"); + _usb_release_interface = (usb_release_interface_t) + GetProcAddress(libusb_dll, "usb_release_interface"); + _usb_set_altinterface = (usb_set_altinterface_t) + GetProcAddress(libusb_dll, "usb_set_altinterface"); + _usb_resetep = (usb_resetep_t) + GetProcAddress(libusb_dll, "usb_resetep"); + _usb_clear_halt = (usb_clear_halt_t) + GetProcAddress(libusb_dll, "usb_clear_halt"); + _usb_reset = (usb_reset_t) + GetProcAddress(libusb_dll, "usb_reset"); + _usb_strerror = (usb_strerror_t) + GetProcAddress(libusb_dll, "usb_strerror"); + _usb_init = (usb_init_t) + GetProcAddress(libusb_dll, "usb_init"); + _usb_set_debug = (usb_set_debug_t) + GetProcAddress(libusb_dll, "usb_set_debug"); + _usb_find_busses = (usb_find_busses_t) + GetProcAddress(libusb_dll, "usb_find_busses"); + _usb_find_devices = (usb_find_devices_t) + GetProcAddress(libusb_dll, "usb_find_devices"); + _usb_device = (usb_device_t) + GetProcAddress(libusb_dll, "usb_device"); + _usb_get_busses = (usb_get_busses_t) + GetProcAddress(libusb_dll, "usb_get_busses"); + _usb_install_service_np = (usb_install_service_np_t) + GetProcAddress(libusb_dll, "usb_install_service_np"); + _usb_uninstall_service_np = (usb_uninstall_service_np_t) + GetProcAddress(libusb_dll, "usb_uninstall_service_np"); + _usb_install_driver_np = (usb_install_driver_np_t) + GetProcAddress(libusb_dll, "usb_install_driver_np"); + _usb_get_version = (usb_get_version_t) + GetProcAddress(libusb_dll, "usb_get_version"); + _usb_isochronous_setup_async = (usb_isochronous_setup_async_t) + GetProcAddress(libusb_dll, "usb_isochronous_setup_async"); + _usb_bulk_setup_async = (usb_bulk_setup_async_t) + GetProcAddress(libusb_dll, "usb_bulk_setup_async"); + _usb_interrupt_setup_async = (usb_interrupt_setup_async_t) + GetProcAddress(libusb_dll, "usb_interrupt_setup_async"); + _usb_submit_async = (usb_submit_async_t) + GetProcAddress(libusb_dll, "usb_submit_async"); + _usb_reap_async = (usb_reap_async_t) + GetProcAddress(libusb_dll, "usb_reap_async"); + _usb_free_async = (usb_free_async_t) + GetProcAddress(libusb_dll, "usb_free_async"); + + if(_usb_init) + _usb_init(); +} + +usb_dev_handle *usb_open(struct usb_device *dev) +{ + if(_usb_open) + return _usb_open(dev); + else + return NULL; +} + +int usb_close(usb_dev_handle *dev) +{ + if(_usb_close) + return _usb_close(dev); + else + return -ENOFILE; +} + +int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen) +{ + if(_usb_get_string) + return _usb_get_string(dev, index, langid, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen) +{ + if(_usb_get_string_simple) + return _usb_get_string_simple(dev, index, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size) +{ + if(_usb_get_descriptor_by_endpoint) + return _usb_get_descriptor_by_endpoint(udev, ep, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size) +{ + if(_usb_get_descriptor) + return _usb_get_descriptor(udev, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_bulk_write) + return _usb_bulk_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_bulk_read) + return _usb_bulk_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_interrupt_write) + return _usb_interrupt_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if(_usb_interrupt_read) + return _usb_interrupt_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout) +{ + if(_usb_control_msg) + return _usb_control_msg(dev, requesttype, request, value, index, bytes, + size, timeout); + else + return -ENOFILE; +} + +int usb_set_configuration(usb_dev_handle *dev, int configuration) +{ + if(_usb_set_configuration) + return _usb_set_configuration(dev, configuration); + else + return -ENOFILE; +} + +int usb_claim_interface(usb_dev_handle *dev, int interface) +{ + if(_usb_claim_interface) + return _usb_claim_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_release_interface(usb_dev_handle *dev, int interface) +{ + if(_usb_release_interface) + return _usb_release_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_set_altinterface(usb_dev_handle *dev, int alternate) +{ + if(_usb_set_altinterface) + return _usb_set_altinterface(dev, alternate); + else + return -ENOFILE; +} + +int usb_resetep(usb_dev_handle *dev, unsigned int ep) +{ + if(_usb_resetep) + return _usb_resetep(dev, ep); + else + return -ENOFILE; +} + +int usb_clear_halt(usb_dev_handle *dev, unsigned int ep) +{ + if(_usb_clear_halt) + return _usb_clear_halt(dev, ep); + else + return -ENOFILE; +} + +int usb_reset(usb_dev_handle *dev) +{ + if(_usb_reset) + return _usb_reset(dev); + else + return -ENOFILE; +} + +char *usb_strerror(void) +{ + if(_usb_strerror) + return _usb_strerror(); + else + return NULL; +} + +void usb_set_debug(int level) +{ + if(_usb_set_debug) + return _usb_set_debug(level); +} + +int usb_find_busses(void) +{ + if(_usb_find_busses) + return _usb_find_busses(); + else + return -ENOFILE; +} + +int usb_find_devices(void) +{ + if(_usb_find_devices) + return _usb_find_devices(); + else + return -ENOFILE; +} + +struct usb_device *usb_device(usb_dev_handle *dev) +{ + if(_usb_device) + return _usb_device(dev); + else + return NULL; +} + +struct usb_bus *usb_get_busses(void) +{ + if(_usb_get_busses) + return _usb_get_busses(); + else + return NULL; +} + +int usb_install_service_np(void) +{ + if(_usb_install_service_np) + return _usb_install_service_np(); + else + return -ENOFILE; +} + +int usb_uninstall_service_np(void) +{ + if(_usb_uninstall_service_np) + return _usb_uninstall_service_np(); + else + return -ENOFILE; +} + +int usb_install_driver_np(const char *inf_file) +{ + if(_usb_install_driver_np) + return _usb_install_driver_np(inf_file); + else + return -ENOFILE; +} + +const struct usb_version *usb_get_version(void) +{ + if(_usb_get_version) + return _usb_get_version(); + else + return NULL; +} + +int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize) +{ + if(_usb_isochronous_setup_async) + return _usb_isochronous_setup_async(dev, context, ep, pktsize); + else + return -ENOFILE; +} + +int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if(_usb_bulk_setup_async) + return _usb_bulk_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if(_usb_interrupt_setup_async) + return _usb_interrupt_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_submit_async(void *context, char *bytes, int size) +{ + if(_usb_submit_async) + return _usb_submit_async(context, bytes, size); + else + return -ENOFILE; +} + +int usb_reap_async(void *context, int timeout) +{ + if(_usb_reap_async) + return _usb_reap_async(context, timeout); + else + return -ENOFILE; +} + +int usb_free_async(void **context) +{ + if(_usb_free_async) + return _usb_free_async(context); + else + return -ENOFILE; +} diff --git a/librfid_1999/src/libusb_dyn.h b/librfid_1999/src/libusb_dyn.h new file mode 100644 index 0000000..9fc43d4 --- /dev/null +++ b/librfid_1999/src/libusb_dyn.h @@ -0,0 +1,394 @@ +#ifndef __USB_H__ +#define __USB_H__ + +#include +#include + +/* + * 'interface' is defined somewhere in the Windows header files. This macro + * is deleted here to avoid conflicts and compile errors. + */ + +#ifdef interface +#undef interface +#endif + +/* + * PATH_MAX from limits.h can't be used on Windows if the dll and + * import libraries are build/used by different compilers + */ + +#define LIBUSB_PATH_MAX 512 + + +/* + * USB spec information + * + * This is all stuff grabbed from various USB specs and is pretty much + * not subject to change + */ + +/* + * Device and/or Interface Class codes + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* + * Descriptor types + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* + * Descriptor sizes per descriptor type + */ +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define USB_DT_HUB_NONVAR_SIZE 7 + + +/* ensure byte-packed structures */ +#include + + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header { + unsigned char bLength; + unsigned char bDescriptorType; +}; + +/* String descriptor */ +struct usb_string_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wData[1]; +}; + +/* HID descriptor */ +struct usb_hid_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdHID; + unsigned char bCountryCode; + unsigned char bNumDescriptors; +}; + +/* Endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; + unsigned char bRefresh; + unsigned char bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +/* Interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; + + struct usb_endpoint_descriptor *endpoint; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ + +struct usb_interface { + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* Configuration descriptor information.. */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; + + struct usb_interface *interface; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +/* Device descriptor */ +struct usb_device_descriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct usb_ctrl_setup { + unsigned char bRequestType; + unsigned char bRequest; + unsigned short wValue; + unsigned short wIndex; + unsigned short wLength; +}; + +/* + * Standard requests + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +/* 0x02 is reserved */ +#define USB_REQ_SET_FEATURE 0x03 +/* 0x04 is reserved */ +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Various libusb API related stuff + */ + +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* + * This is supposed to look weird. This file is generated from autoconf + * and I didn't want to make this too complicated. + */ +#define USB_LE16_TO_CPU(x) + +/* Data types */ +/* struct usb_device; */ +/* struct usb_bus; */ + +struct usb_device { + struct usb_device *next, *prev; + + char filename[LIBUSB_PATH_MAX]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; /* Darwin support */ + + unsigned char devnum; + + unsigned char num_children; + struct usb_device **children; +}; + +struct usb_bus { + struct usb_bus *next, *prev; + + char dirname[LIBUSB_PATH_MAX]; + + struct usb_device *devices; + unsigned long location; + + struct usb_device *root_dev; +}; + +/* Version information, Windows specific */ +struct usb_version { + struct { + int major; + int minor; + int micro; + int nano; + } dll; + struct { + int major; + int minor; + int micro; + int nano; + } driver; +}; + + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +#ifndef __USB_C__ +#define usb_busses usb_get_busses() +#endif + + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + /* Function prototypes */ + + /* usb.c */ + usb_dev_handle *usb_open(struct usb_device *dev); + int usb_close(usb_dev_handle *dev); + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ + int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size); + int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout); + int usb_set_configuration(usb_dev_handle *dev, int configuration); + int usb_claim_interface(usb_dev_handle *dev, int interface); + int usb_release_interface(usb_dev_handle *dev, int interface); + int usb_set_altinterface(usb_dev_handle *dev, int alternate); + int usb_resetep(usb_dev_handle *dev, unsigned int ep); + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); + int usb_reset(usb_dev_handle *dev); + + char *usb_strerror(void); + + void usb_init(void); + void usb_set_debug(int level); + int usb_find_busses(void); + int usb_find_devices(void); + struct usb_device *usb_device(usb_dev_handle *dev); + struct usb_bus *usb_get_busses(void); + + + /* Windows specific functions */ + + #define LIBUSB_HAS_INSTALL_SERVICE_NP 1 + int usb_install_service_np(void); + void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 + int usb_uninstall_service_np(void); + void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_INSTALL_DRIVER_NP 1 + int usb_install_driver_np(const char *inf_file); + void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 + int usb_touch_inf_file_np(const char *inf_file); + void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + #define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 + int usb_install_needs_restart_np(void); + + const struct usb_version *usb_get_version(void); + + int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize); + int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + + int usb_submit_async(void *context, char *bytes, int size); + int usb_reap_async(void *context, int timeout); + int usb_reap_async_nocancel(void *context, int timeout); + int usb_cancel_async(void *context); + int usb_free_async(void **context); + + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_H__ */ + diff --git a/librfid_1999/src/rc632.h b/librfid_1999/src/rc632.h new file mode 100644 index 0000000..c7690ed --- /dev/null +++ b/librfid_1999/src/rc632.h @@ -0,0 +1,247 @@ +/* Register definitions for Philips CL RC632 RFID Reader IC + * + * (C) 2005 Harald Welte + * + * Licensed under GNU General Public License, Version 2 + */ + +enum rc632_registers { + RC632_REG_PAGE0 = 0x00, + RC632_REG_COMMAND = 0x01, + RC632_REG_FIFO_DATA = 0x02, + RC632_REG_PRIMARY_STATUS = 0x03, + RC632_REG_FIFO_LENGTH = 0x04, + RC632_REG_SECONDARY_STATUS = 0x05, + RC632_REG_INTERRUPT_EN = 0x06, + RC632_REG_INTERRUPT_RQ = 0x07, + + RC632_REG_PAGE1 = 0x08, + RC632_REG_CONTROL = 0x09, + RC632_REG_ERROR_FLAG = 0x0a, + RC632_REG_COLL_POS = 0x0b, + RC632_REG_TIMER_VALUE = 0x0c, + RC632_REG_CRC_RESULT_LSB = 0x0d, + RC632_REG_CRC_RESULT_MSB = 0x0e, + RC632_REG_BIT_FRAMING = 0x0f, + + RC632_REG_PAGE2 = 0x10, + RC632_REG_TX_CONTROL = 0x11, + RC632_REG_CW_CONDUCTANCE = 0x12, + RC632_REG_MOD_CONDUCTANCE = 0x13, + RC632_REG_CODER_CONTROL = 0x14, + RC632_REG_MOD_WIDTH = 0x15, + RC632_REG_MOD_WIDTH_SOF = 0x16, + RC632_REG_TYPE_B_FRAMING = 0x17, + + RC632_REG_PAGE3 = 0x18, + RC632_REG_RX_CONTROL1 = 0x19, + RC632_REG_DECODER_CONTROL = 0x1a, + RC632_REG_BIT_PHASE = 0x1b, + RC632_REG_RX_THRESHOLD = 0x1c, + RC632_REG_BPSK_DEM_CONTROL = 0x1d, + RC632_REG_RX_CONTROL2 = 0x1e, + RC632_REG_CLOCK_Q_CONTROL = 0x1f, + + RC632_REG_PAGE4 = 0x20, + RC632_REG_RX_WAIT = 0x21, + RC632_REG_CHANNEL_REDUNDANCY = 0x22, + RC632_REG_CRC_PRESET_LSB = 0x23, + RC632_REG_CRC_PRESET_MSB = 0x24, + RC632_REG_TIME_SLOT_PERIOD = 0x25, + RC632_REG_MFOUT_SELECT = 0x26, + RC632_REG_PRESET_27 = 0x27, + + RC632_REG_PAGE5 = 0x28, + RC632_REG_FIFO_LEVEL = 0x29, + RC632_REG_TIMER_CLOCK = 0x2a, + RC632_REG_TIMER_CONTROL = 0x2b, + RC632_REG_TIMER_RELOAD = 0x2c, + RC632_REG_IRQ_PIN_CONFIG = 0x2d, + RC632_REG_PRESET_2E = 0x2e, + RC632_REG_PRESET_2F = 0x2f, + + RC632_REG_PAGE6 = 0x30, + + RC632_REG_PAGE7 = 0x38, + RC632_REG_TEST_ANA_SELECT = 0x3a, + RC632_REG_TEST_DIGI_SELECT = 0x3d, +}; + +enum rc632_reg_command { + RC632_CMD_IDLE = 0x00, + RC632_CMD_WRITE_E2 = 0x01, + RC632_CMD_READ_E2 = 0x03, + RC632_CMD_LOAD_CONFIG = 0x07, + RC632_CMD_LOAD_KEY_E2 = 0x0b, + RC632_CMD_AUTHENT1 = 0x0c, + RC632_CMD_CALC_CRC = 0x12, + RC632_CMD_AUTHENT2 = 0x14, + RC632_CMD_RECEIVE = 0x16, + RC632_CMD_LOAD_KEY = 0x19, + RC632_CMD_TRANSMIT = 0x1a, + RC632_CMD_TRANSCEIVE = 0x1e, + RC632_CMD_STARTUP = 0x3f, +}; + +enum rc632_reg_interrupt { + RC632_INT_LOALERT = 0x01, + RC632_INT_HIALERT = 0x02, + RC632_INT_IDLE = 0x04, + RC632_INT_RX = 0x08, + RC632_INT_TX = 0x10, + RC632_INT_TIMER = 0x20, + RC632_INT_SET = 0x80, +}; + +enum rc632_reg_control { + RC632_CONTROL_FIFO_FLUSH = 0x01, + RC632_CONTROL_TIMER_START = 0x02, + RC632_CONTROL_TIMER_STOP = 0x04, + RC632_CONTROL_CRYPTO1_ON = 0x08, + RC632_CONTROL_POWERDOWN = 0x10, + RC632_CONTROL_STANDBY = 0x20, +}; + +enum rc632_reg_error_flag { + RC632_ERR_FLAG_COL_ERR = 0x01, + RC632_ERR_FLAG_PARITY_ERR = 0x02, + RC632_ERR_FLAG_FRAMING_ERR = 0x04, + RC632_ERR_FLAG_CRC_ERR = 0x08, + RC632_ERR_FLAG_FIFO_OVERFLOW = 0x10, + RC632_ERR_FLAG_ACCESS_ERR = 0x20, + RC632_ERR_FLAG_KEY_ERR = 0x40, +}; + +enum rc632_reg_tx_control { + RC632_TXCTRL_TX1_RF_EN = 0x01, + RC632_TXCTRL_TX2_RF_EN = 0x02, + RC632_TXCTRL_TX2_CW = 0x04, + RC632_TXCTRL_TX2_INV = 0x08, + RC632_TXCTRL_FORCE_100_ASK = 0x10, + + RC632_TXCTRL_MOD_SRC_LOW = 0x00, + RC632_TXCTRL_MOD_SRC_HIGH = 0x20, + RC632_TXCTRL_MOD_SRC_INT = 0x40, + RC632_TXCTRL_MOD_SRC_MFIN = 0x60, +}; + +enum rc632_reg_coder_control { + RC632_CDRCTRL_TXCD_NRZ = 0x00, + RC632_CDRCTRL_TXCD_14443A = 0x01, + RC632_CDRCTRL_TXCD_ICODE_STD = 0x04, + +#define RC632_CDRCTRL_RATE_MASK 0x38 + RC632_CDRCTRL_RATE_848K = 0x00, + RC632_CDRCTRL_RATE_424K = 0x08, + RC632_CDRCTRL_RATE_212K = 0x10, + RC632_CDRCTRL_RATE_106K = 0x18, + RC632_CDRCTRL_RATE_14443B = 0x20, + RC632_CDRCTRL_RATE_15693 = 0x28, + RC632_CDRCTRL_RATE_ICODE_FAST = 0x30, +}; + +enum rc632_erg_type_b_framing { + RC632_TBFRAMING_SOF_10L_2H = 0x00, + RC632_TBFRAMING_SOF_10L_3H = 0x01, + RC632_TBFRAMING_SOF_11L_2H = 0x02, + RC632_TBFRAMING_SOF_11L_3H = 0x03, + + RC632_TBFRAMING_EOF_10 = 0x00, + RC632_TBFRAMING_EOF_11 = 0x20, + + RC632_TBFRAMING_NO_TX_SOF = 0x80, + RC632_TBFRAMING_NO_TX_EOF = 0x40, +}; +#define RC632_TBFRAMING_SPACE_SHIFT 2 +#define RC632_TBFRAMING_SPACE_MASK 7 + +enum rc632_reg_rx_control1 { + RC632_RXCTRL1_GAIN_20DB = 0x00, + RC632_RXCTRL1_GAIN_24DB = 0x01, + RC632_RXCTRL1_GAIN_31DB = 0x02, + RC632_RXCTRL1_GAIN_35DB = 0x03, + + RC632_RXCTRL1_LP_OFF = 0x04, + RC632_RXCTRL1_ISO15693 = 0x08, + RC632_RXCTRL1_ISO14443 = 0x10, + +#define RC632_RXCTRL1_SUBCP_MASK 0xe0 + RC632_RXCTRL1_SUBCP_1 = 0x00, + RC632_RXCTRL1_SUBCP_2 = 0x20, + RC632_RXCTRL1_SUBCP_4 = 0x40, + RC632_RXCTRL1_SUBCP_8 = 0x60, + RC632_RXCTRL1_SUBCP_16 = 0x80, +}; + +enum rc632_reg_decoder_control { + RC632_DECCTRL_MANCHESTER = 0x00, + RC632_DECCTRL_BPSK = 0x01, + + RC632_DECCTRL_RX_INVERT = 0x04, + + RC632_DECCTRL_RXFR_ICODE = 0x00, + RC632_DECCTRL_RXFR_14443A = 0x08, + RC632_DECCTRL_RXFR_15693 = 0x10, + RC632_DECCTRL_RXFR_14443B = 0x18, + + RC632_DECCTRL_ZEROAFTERCOL = 0x20, + + RC632_DECCTRL_RX_MULTIPLE = 0x40, +}; + +enum rc632_reg_bpsk_dem_control { + RC632_BPSKD_TAUB_SHIFT = 0x00, + RC632_BPSKD_TAUB_MASK = 0x03, + + RC632_BPSKD_TAUD_SHIFT = 0x02, + RC632_BPSKD_TAUD_MASK = 0x03, + + RC632_BPSKD_FILTER_AMP_DETECT = 0x10, + RC632_BPSKD_NO_RX_EOF = 0x20, + RC632_BPSKD_NO_RX_EGT = 0x40, + RC632_BPSKD_NO_RX_SOF = 0x80, +}; + +enum rc632_reg_rx_control2 { + RC632_RXCTRL2_DECSRC_LOW = 0x00, + RC632_RXCTRL2_DECSRC_INT = 0x01, + RC632_RXCTRL2_DECSRC_SUBC_MFIN = 0x10, + RC632_RXCTRL2_DECSRC_BASE_MFIN = 0x11, + + RC632_RXCTRL2_AUTO_PD = 0x40, + RC632_RXCTRL2_CLK_I = 0x80, + RC632_RXCTRL2_CLK_Q = 0x00, +}; + +enum rc632_reg_channel_redundancy { + RC632_CR_PARITY_ENABLE = 0x01, + RC632_CR_PARITY_ODD = 0x02, + RC632_CR_TX_CRC_ENABLE = 0x04, + RC632_CR_RX_CRC_ENABLE = 0x08, + RC632_CR_CRC8 = 0x10, + RC632_CR_CRC3309 = 0x20, +}; + +enum rc632_reg_timer_control { + RC632_TMR_START_TX_BEGIN = 0x01, + RC632_TMR_START_TX_END = 0x02, + RC632_TMR_STOP_RX_BEGIN = 0x04, + RC632_TMR_STOP_RX_END = 0x08, +}; + +enum rc632_reg_timer_irq { + RC632_IRQ_LO_ALERT = 0x01, + RC632_IRQ_HI_ALERT = 0x02, + RC632_IRQ_IDLE = 0x04, + RC632_IRQ_RX = 0x08, + RC632_IRQ_TX = 0x10, + RC632_IRQ_TIMER = 0x20, + + RC632_IRQ_SET = 0x80, +}; + +enum rc632_reg_secondary_status { + RC632_SEC_ST_TMR_RUNNING = 0x80, + RC632_SEC_ST_E2_READY = 0x40, + RC632_SEC_ST_CRC_READY = 0x20, +}; diff --git a/librfid_1999/src/rfid.c b/librfid_1999/src/rfid.c new file mode 100644 index 0000000..9df85a0 --- /dev/null +++ b/librfid_1999/src/rfid.c @@ -0,0 +1,114 @@ +/* librfid core + * (C) 2005-2006 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef LIBRFID_STATIC +struct rfid_asic_handle rfid_ah; +struct rfid_layer2_handle rfid_l2h; +struct rfid_protocol_handle rfid_ph; +struct rfid_asic_transport_handle rfid_ath; +struct rfid_reader_handle rfid_rh; +#endif + +#ifndef LIBRFID_FIRMWARE +#ifdef LIBRFID_DEBUG +const char * +rfid_hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} +#endif/*LIBRFID_DEBUG*/ +#else +#define rfid_hexdump(x, y) hexdump(x, y) +#endif + +#if 0 +int rfid_setopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + const void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_ASIC: + case RFID_LEVEL_READER: + return -EINVAL; + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_setopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_setopt(optname, opt, optlen); + break; + default: + return -EINVAL; + break; + } + + return 0; +} + +int rfid_getopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_ASIC: + case RFID_LEVEL_READER: + return -EINVAL; + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_getopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_getopt(optname, opt, optlen); + break; + default: + return -EINVAL; + break; + } + + return 0; +} +#endif + +int rfid_init() +{ + return 0; +} + +void rfid_fini() +{ + /* FIXME: implementation */ +} diff --git a/librfid_1999/src/rfid_access_mifare_classic.c b/librfid_1999/src/rfid_access_mifare_classic.c new file mode 100644 index 0000000..03cb1e5 --- /dev/null +++ b/librfid_1999/src/rfid_access_mifare_classic.c @@ -0,0 +1,230 @@ +#include +#include +#include + +#include +#include + +/* parse encoded data structure into c1/c2/c3 */ +int mfcl_compile_access(u_int8_t *encoded, + const struct mfcl_access_sect *ac) +{ + int b; + u_int8_t c1, c2, c3; + + c1 = c2 = c3 = 0; + + for (b = 0; b < 4; b++) { + if (ac->block[b] & 0x01) + c1 |= (1 << b); + if (ac->block[b] & 0x02) + c2 |= (1 << b); + if (ac->block[b] & 0x04) + c3 |= (1 << b); + } + + DEBUGP("compile: c1=%u c2=%u c3=%u\n", c1, c2, c3); + + encoded[3] = 0x00; + encoded[2] = c2 | (c3 << 4); + encoded[1] = (~c3 & 0xf) | (c1 << 4); + encoded[0] = (~c1 & 0xf) | ((~c2 & 0xf) << 4); + + return 0; +} + +/* parse mifare classic access conditions from card */ +int mfcl_parse_access(struct mfcl_access_sect *ac, u_int8_t *encoded) +{ + int b; + + u_int8_t c1, c2, c3; + + DEBUGP("encoded: %s\n", rfid_hexdump(encoded, 4)); + + c1 = encoded[1] >> 4; + c2 = encoded[2] & 0xf; + c3 = encoded[2] >> 4; + + DEBUGP("c1=0x%x, c2=0x%x, c3=0x%x\n", c1, c2, c3); + + memset(ac, 0, sizeof(*ac)); + for (b = 0; b < 4; b++) { + if (c1 & (1 << b)) + ac->block[b] = 0x1; + if (c2 & (1 << b)) + ac->block[b] |= 0x2; + if (c3 & (1 << b)) + ac->block[b] |= 0x4; + }; + + /* FIXME: verify the inverted access bits */ + + return 0; +} + + +/* functions below here are for our own internal decoded (orthogonal) + * format of access bits */ + +/* In the order of the table 3.7.3 in MFCL Product Specification Rev. 5.1 */ +static const struct mfcl_access_exp_block mfcl_exp_data[] = { + [0] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [2] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [1] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [3] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_KEY_B, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [4] = { + .read = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + }, + [6] = { + .read = MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_KEY_B, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [5] = { + .read = MFCL_ACCESS_KEY_B, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, + [7] = { + .read = MFCL_ACCESS_NEVER, + .write = MFCL_ACCESS_NEVER, + .inc = MFCL_ACCESS_NEVER, + .dec = MFCL_ACCESS_NEVER, + }, +}; + +static const struct mfcl_access_exp_acc mfcl_exp_trailer[] = { + [0] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_A, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_KEY_A, + }, + [2] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [1] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_B, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_KEY_B, + }, + [3] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [4] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_A, + .acc_rd = MFCL_ACCESS_KEY_A, + .acc_wr = MFCL_ACCESS_KEY_A, + .key_b_rd = MFCL_ACCESS_KEY_A, + .key_b_wr = MFCL_ACCESS_KEY_A, + }, + [6] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_KEY_B, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_KEY_B, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_KEY_B, + }, + [5] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_KEY_B, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, + [7] = { + .key_a_rd = MFCL_ACCESS_NEVER, + .key_a_wr = MFCL_ACCESS_NEVER, + .acc_rd = MFCL_ACCESS_KEY_A | MFCL_ACCESS_KEY_B, + .acc_wr = MFCL_ACCESS_NEVER, + .key_b_rd = MFCL_ACCESS_NEVER, + .key_b_wr = MFCL_ACCESS_NEVER, + }, +}; + +const char *mfcl_access_str[] = { + [MFCL_ACCESS_NEVER] = "NEVER", + [MFCL_ACCESS_KEY_A] = "A", + [MFCL_ACCESS_KEY_B] = "B", + [MFCL_ACCESS_KEY_A|MFCL_ACCESS_KEY_B] = "A|B", +}; + +void mfcl_access_to_exp(struct mfcl_access_exp_sect *exp, + const struct mfcl_access_sect *sect) +{ + int b; + for (b = 0; b < 3; b++) + exp->block[b] = mfcl_exp_data[sect->block[b]]; + exp->acc = mfcl_exp_trailer[sect->block[3]]; +} + +char *mfcl_access_exp_stringify(const struct mfcl_access_exp_block *exp) +{ + static char buf[80]; + + sprintf(buf, "READ: %s, WRITE: %s, INC: %s, DEC: %s", + mfcl_access_str[exp->read], + mfcl_access_str[exp->write], + mfcl_access_str[exp->inc], + mfcl_access_str[exp->dec]); + return buf; +} + +char *mfcl_access_exp_acc_stringify(const struct mfcl_access_exp_acc *acc) +{ + static char buf[80]; + + sprintf(buf, "KEY_A_RD: %s, KEY_A_WR: %s, ACC_RD: %s, ACC_WR: %s, " + "KEY_B_RD: %s, KEY_B_WR: %s", + mfcl_access_str[acc->key_a_rd], + mfcl_access_str[acc->key_a_wr], + mfcl_access_str[acc->acc_rd], + mfcl_access_str[acc->acc_wr], + mfcl_access_str[acc->key_b_rd], + mfcl_access_str[acc->key_b_wr]); + return buf; +} diff --git a/librfid_1999/src/rfid_asic_rc632.c b/librfid_1999/src/rfid_asic_rc632.c new file mode 100644 index 0000000..6fa4ee3 --- /dev/null +++ b/librfid_1999/src/rfid_asic_rc632.c @@ -0,0 +1,1644 @@ +/* Generic Philips CL RC632 Routines + * + * (C) 2005-2006 Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" +#include "rc632.h" + +#ifdef __MINGW32__ +#include "usleep.h" +#endif/*__MINGW32__*/ + +#define RC632_TMO_AUTH1 140 + +#define ENTER() DEBUGP("entering\n") +const struct rfid_asic rc632; + +/* Register and FIFO Access functions */ +static int +rc632_reg_write(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + return handle->rath->rat->priv.rc632.fn.reg_write(handle->rath, reg, val); +} + +static int +rc632_reg_read(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t *val) +{ + return handle->rath->rat->priv.rc632.fn.reg_read(handle->rath, reg, val); +} + +static int +rc632_fifo_write(struct rfid_asic_handle *handle, + u_int8_t len, + const u_int8_t *buf, + u_int8_t flags) +{ + return handle->rath->rat->priv.rc632.fn.fifo_write(handle->rath, + len, buf, flags); +} + +static int +rc632_fifo_read(struct rfid_asic_handle *handle, + u_int8_t len, + u_int8_t *buf) +{ + return handle->rath->rat->priv.rc632.fn.fifo_read(handle->rath, len, buf); +} + + +static int +rc632_set_bits(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) + return -1; + + /* if bits are already set, no need to set them again */ + if ((tmp & val) == val) + return 0; + + return rc632_reg_write(handle, reg, (tmp|val)&0xff); +} +static int +rc632_set_bit_mask(struct rfid_asic_handle *handle, + u_int8_t reg, u_int8_t mask, u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) + return ret; + + /* if bits are already like we want them, abort */ + if ((tmp & mask) == val) + return 0; + + return rc632_reg_write(handle, reg, (tmp & ~mask)|(val & mask)); +} + +static int +rc632_clear_bits(struct rfid_asic_handle *handle, + u_int8_t reg, + u_int8_t val) +{ + int ret; + u_int8_t tmp; + + ret = rc632_reg_read(handle, reg, &tmp); + if (ret < 0) { + DEBUGP("error during reg_read(%p, %d):%d\n", + handle, reg, ret); + return -1; + } + /* if bits are already cleared, no need to clear them again */ + if ((tmp & val) == 0) + return 0; + + return rc632_reg_write(handle, reg, (tmp & ~val)&0xff); +} + +static int +rc632_turn_on_rf(struct rfid_asic_handle *handle) +{ + ENTER(); + return rc632_set_bits(handle, RC632_REG_TX_CONTROL, 0x03); +} + +static int +rc632_turn_off_rf(struct rfid_asic_handle *handle) +{ + ENTER(); + return rc632_clear_bits(handle, RC632_REG_TX_CONTROL, 0x03); +} + +static int +rc632_power_up(struct rfid_asic_handle *handle) +{ + ENTER(); + return rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); +} + +static int +rc632_power_down(struct rfid_asic_handle *handle) +{ + return rc632_set_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_POWERDOWN); +} + +/* calculate best 8bit prescaler and divisor for given usec timeout */ +static int best_prescaler(u_int64_t timeout, u_int8_t *prescaler, + u_int8_t *divisor) +{ + u_int8_t best_prescaler, best_divisor, i; + int64_t smallest_diff; + + smallest_diff = LLONG_MAX; + best_prescaler = 0; + + for (i = 0; i < 21; i++) { + u_int64_t clk, tmp_div, res; + int64_t diff; + clk = 13560000 / (1 << i); + tmp_div = (clk * timeout) / 1000000; + tmp_div++; + + if ((tmp_div > 0xff) || (tmp_div > clk)) + continue; + + res = 1000000 / (clk / tmp_div); + diff = res - timeout; + + if (diff < 0) + continue; + + if (diff < smallest_diff) { + best_prescaler = i; + best_divisor = tmp_div; + smallest_diff = diff; + } + } + + *prescaler = best_prescaler; + *divisor = best_divisor; + + DEBUGP("timeout %u usec, prescaler = %u, divisor = %u\n", + timeout, best_prescaler, best_divisor); + + return 0; +} + +static int +rc632_timer_set(struct rfid_asic_handle *handle, + u_int64_t timeout) +{ + int ret; + u_int8_t prescaler, divisor; + + ret = best_prescaler(timeout, &prescaler, &divisor); + + ret = rc632_reg_write(handle, RC632_REG_TIMER_CLOCK, + prescaler & 0x1f); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_TIMER_CONTROL, + RC632_TMR_START_TX_END|RC632_TMR_STOP_RX_BEGIN); + + /* clear timer irq bit */ + ret = rc632_set_bits(handle, RC632_REG_INTERRUPT_RQ, RC632_IRQ_TIMER); + + ret |= rc632_reg_write(handle, RC632_REG_TIMER_RELOAD, divisor); + + return ret; +} + +/* Wait until RC632 is idle or TIMER IRQ has happened */ +static int rc632_wait_idle_timer(struct rfid_asic_handle *handle) +{ + int ret; + u_int8_t irq, cmd; + + while (1) { + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &irq); + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &irq); + ret = rc632_reg_read(handle, RC632_REG_INTERRUPT_RQ, &irq); + if (ret < 0) + return ret; + + /* FIXME: currently we're lazy: If we actually received + * something even after the timer expired, we accept it */ + if (irq & RC632_IRQ_TIMER && !(irq & RC632_IRQ_RX)) { + u_int8_t foo; + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &foo); + if (foo & 0x04) + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &foo); + + return -110; + } + + ret = rc632_reg_read(handle, RC632_REG_COMMAND, &cmd); + if (ret < 0) + return ret; + + if (cmd == 0) + return 0; + + /* poll every millisecond */ + usleep(1000); + } +} + +/* Stupid RC632 implementations don't evaluate interrupts but poll the + * command register for "status idle" */ +static int +rc632_wait_idle(struct rfid_asic_handle *handle, u_int64_t timeout) +{ + u_int8_t cmd = 0xff; + int ret, cycles = 0; +#define USLEEP_PER_CYCLE 128 + + while (cmd != 0) { + ret = rc632_reg_read(handle, RC632_REG_COMMAND, &cmd); + if (ret < 0) + return ret; + + if (cmd == 0) { + /* FIXME: read second time ?? */ + return 0; + } + + { + u_int8_t foo; + rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &foo); + if (foo & 0x04) + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &foo); + } + + /* Abort after some timeout */ + if (cycles > timeout*100/USLEEP_PER_CYCLE) { + return -ETIMEDOUT; + } + + cycles++; + usleep(USLEEP_PER_CYCLE); + } + + return 0; +} + +static int +rc632_transmit(struct rfid_asic_handle *handle, + const u_int8_t *buf, + u_int8_t len, + u_int64_t timeout) +{ + int ret, cur_len; + const u_int8_t *cur_buf = buf; + + if (len > 64) + cur_len = 64; + else + cur_len = len; + + do { + ret = rc632_fifo_write(handle, cur_len, cur_buf, 0x03); + if (ret < 0) + return ret; + + if (cur_buf == buf) { + /* only start transmit first time */ + ret = rc632_reg_write(handle, RC632_REG_COMMAND, + RC632_CMD_TRANSMIT); + if (ret < 0) + return ret; + } + + cur_buf += cur_len; + if (cur_buf < buf + len) { + cur_len = buf - cur_buf; + if (cur_len > 64) + cur_len = 64; + } else + cur_len = 0; + + } while (cur_len); + + return rc632_wait_idle(handle, timeout); +} + +static int +tcl_toggle_pcb(struct rfid_asic_handle *handle) +{ + // FIXME: toggle something between 0x0a and 0x0b + return 0; +} + +static int +rc632_transceive(struct rfid_asic_handle *handle, + const u_int8_t *tx_buf, + u_int8_t tx_len, + u_int8_t *rx_buf, + u_int8_t *rx_len, + u_int64_t timer, + unsigned int toggle) +{ + int ret, cur_tx_len; + u_int8_t rx_avail; + const u_int8_t *cur_tx_buf = tx_buf; + + DEBUGP("timer = %u\n", timer); + + if (tx_len > 64) + cur_tx_len = 64; + else + cur_tx_len = tx_len; + + ret = rc632_timer_set(handle, timer*10); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, 0x00); + /* clear all interrupts */ + ret = rc632_reg_write(handle, RC632_REG_INTERRUPT_RQ, 0x7f); + + do { + ret = rc632_fifo_write(handle, cur_tx_len, cur_tx_buf, 0x03); + if (ret < 0) + return ret; + + if (cur_tx_buf == tx_buf) { + ret = rc632_reg_write(handle, RC632_REG_COMMAND, + RC632_CMD_TRANSCEIVE); + if (ret < 0) + return ret; + } + + cur_tx_buf += cur_tx_len; + if (cur_tx_buf < tx_buf + tx_len) { + u_int8_t fifo_fill; + ret = rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, + &fifo_fill); + if (ret < 0) + return ret; + + cur_tx_len = 64 - fifo_fill; + //printf("refilling tx fifo with %u bytes\n", cur_tx_len); + } else + cur_tx_len = 0; + + } while (cur_tx_len); + + if (toggle == 1) + tcl_toggle_pcb(handle); + + //ret = rc632_wait_idle_timer(handle); + ret = rc632_wait_idle(handle, timer); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_FIFO_LENGTH, &rx_avail); + if (ret < 0) + return ret; + + if (rx_avail > *rx_len) { + //printf("rx_avail(%d) > rx_len(%d), JFYI\n", rx_avail, *rx_len); + } else if (*rx_len > rx_avail) + *rx_len = rx_avail; + + if (rx_avail == 0) { + u_int8_t tmp; + + DEBUGP("rx_len == 0\n"); + + rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &tmp); + rc632_reg_read(handle, RC632_REG_CHANNEL_REDUNDANCY, &tmp); + + return -1; + } + + return rc632_fifo_read(handle, *rx_len, rx_buf); + /* FIXME: discard addidional bytes in FIFO */ +} + +static int +rc632_read_eeprom(struct rfid_asic_handle *handle) +{ + u_int8_t recvbuf[60]; + u_int8_t sndbuf[3]; + int ret; + + sndbuf[0] = 0x00; + sndbuf[1] = 0x00; + sndbuf[2] = 0x3c; + + ret = rc632_fifo_write(handle, 3, sndbuf, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_READ_E2); + if (ret < 0) + return ret; + + usleep(20000); + + ret = rc632_fifo_read(handle, sizeof(recvbuf), recvbuf); + if (ret < 0) + return ret; + + // FIXME: do something with eeprom contents + return ret; +} + +static int +rc632_calc_crc16_from(struct rfid_asic_handle *handle) +{ + u_int8_t sndbuf[2] = { 0x01, 0x02 }; + u_int8_t crc_lsb = 0x00 , crc_msb = 0x00; + int ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_LSB, 0x12); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_MSB, 0xe0); + if (ret < 0) + return ret; + + ret = rc632_fifo_write(handle, sizeof(sndbuf), sndbuf, 3); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_CALC_CRC); + if (ret < 0) + return ret; + + usleep(10000); // FIXME: no checking for cmd completion? + + ret = rc632_reg_read(handle, RC632_REG_CRC_RESULT_LSB, &crc_lsb); + if (ret < 0) + return ret; + + ret = rc632_reg_read(handle, RC632_REG_CRC_RESULT_MSB, &crc_msb); + if (ret < 0) + return ret; + + // FIXME: what to do with crc result? + return ret; +} + + +int +rc632_register_dump(struct rfid_asic_handle *handle, u_int8_t *buf) +{ + int ret; + u_int8_t i; + + for (i = 0; i <= 0x3f; i++) { + ret = rc632_reg_read(handle, i, &buf[i]); + // do we want error checks? + } + return 0; +} + + + +/* generic FIFO access functions (if no more efficient ones provided by + * transport driver) */ + +static int +generic_fifo_write() +{ + // FIXME: implementation (not needed for CM 5121) + return -1; +} + +static int +generic_fifo_read() +{ + // FIXME: implementation (not neded for CM 5121) + return -1; +} + +static int +rc632_init(struct rfid_asic_handle *ah) +{ + int ret; + + /* switch off rf (make sure PICCs are reset at init time) */ + ret = rc632_power_down(ah); + if (ret < 0) + return ret; + + usleep(10000); + + /* switch on rf */ + ret = rc632_power_up(ah); + if (ret < 0) + return ret; + + /* disable register paging */ + ret = rc632_reg_write(ah, 0x00, 0x00); + if (ret < 0) + return ret; + + /* set some sane default values */ + ret = rc632_reg_write(ah, 0x11, 0x5b); + if (ret < 0) + return ret; + + /* switch off rf */ + ret = rc632_turn_off_rf(ah); + if (ret < 0) + return ret; + + usleep(100000); + + /* switch on rf */ + ret = rc632_turn_on_rf(ah); + if (ret < 0) + return ret; + + return 0; +} + +static int +rc632_fini(struct rfid_asic_handle *ah) +{ + int ret; + + /* switch off rf */ + ret = rc632_turn_off_rf(ah); + if (ret < 0) + return ret; + + ret = rc632_power_down(ah); + if (ret < 0) + return ret; + + return 0; +} + +struct rfid_asic_handle * +rc632_open(struct rfid_asic_transport_handle *th) +{ + struct rfid_asic_handle *h; + + h = malloc_asic_handle(sizeof(*h)); + if (!h) + return NULL; + memset(h, 0, sizeof(*h)); + + h->asic = (void*)&rc632; + h->rath = th; + h->fc = h->asic->fc; + /* FIXME: this is only cm5121 specific, since the latency + * down to the RC632 FIFO is too long to refill during TX/RX */ + h->mtu = h->mru = 64; + + if (rc632_init(h) < 0) { + free_asic_handle(h); + return NULL; + } + + return h; +} + +void +rc632_close(struct rfid_asic_handle *h) +{ + rc632_fini(h); + free_asic_handle(h); +} + + +/* + * Philips CL RC632 primitives for ISO 14443-A compliant PICC's + * + * (C) 2005-2006 by Harald Welte + * + */ + +static int +rc632_iso14443a_init(struct rfid_asic_handle *handle) +{ + int ret; + + // FIXME: some fifo work (drain fifo?) + + /* flush fifo (our way) */ + ret = rc632_reg_write(handle, RC632_REG_CONTROL, + RC632_CONTROL_FIFO_FLUSH); + + ret = rc632_reg_write(handle, RC632_REG_TX_CONTROL, + (RC632_TXCTRL_TX1_RF_EN | + RC632_TXCTRL_TX2_RF_EN | + RC632_TXCTRL_TX2_INV | + RC632_TXCTRL_FORCE_100_ASK | + RC632_TXCTRL_MOD_SRC_INT)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CW_CONDUCTANCE, + CM5121_CW_CONDUCTANCE); + if (ret < 0) + return ret; + + /* Since FORCE_100_ASK is set (cf mc073930.pdf), this line may be left out? */ + ret = rc632_reg_write(handle, RC632_REG_MOD_CONDUCTANCE, + CM5121_MOD_CONDUCTANCE); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CODER_CONTROL, + (RC632_CDRCTRL_TXCD_14443A | + RC632_CDRCTRL_RATE_106K)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_MOD_WIDTH, 0x13); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_MOD_WIDTH_SOF, 0x3f); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_TYPE_B_FRAMING, 0x00); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_RX_CONTROL1, + (RC632_RXCTRL1_GAIN_35DB | + RC632_RXCTRL1_ISO14443 | + RC632_RXCTRL1_SUBCP_8)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_DECODER_CONTROL, + (RC632_DECCTRL_MANCHESTER | + RC632_DECCTRL_RXFR_14443A)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_BIT_PHASE, + CM5121_14443A_BITPHASE); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_RX_THRESHOLD, + CM5121_14443A_THRESHOLD); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_BPSK_DEM_CONTROL, 0x00); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_RX_CONTROL2, + (RC632_RXCTRL2_DECSRC_INT | + RC632_RXCTRL2_CLK_Q)); + if (ret < 0) + return ret; + + /* Omnikey proprietary driver has 0x03, but 0x06 is the default reset value ?!? */ + ret = rc632_reg_write(handle, RC632_REG_RX_WAIT, 0x06); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_LSB, 0x63); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CRC_PRESET_MSB, 0x63); + if (ret < 0) + return ret; + + return 0; +} + +static int +rc632_iso14443a_fini(struct iso14443a_handle *handle_14443) +{ + +#if 0 + ret = rc632_turn_off_rf(handle); + if (ret < 0) + return ret; +#endif + + + return 0; +} + + +/* issue a 14443-3 A PCD -> PICC command in a short frame, such as REQA, WUPA */ +static int +rc632_iso14443a_transceive_sf(struct rfid_asic_handle *handle, + u_int8_t cmd, + struct iso14443a_atqa *atqa) +{ + int ret; + u_int8_t tx_buf[1]; + u_int8_t rx_len = 2; + + memset(atqa, 0, sizeof(*atqa)); + + tx_buf[0] = cmd; + + /* transfer only 7 bits of last byte in frame */ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, 0x07); + if (ret < 0) + return ret; + + ret = rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_CRYPTO1_ON); + if (ret < 0) + return ret; + +#if 0 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); + +#endif + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, tx_buf, sizeof(tx_buf), + (u_int8_t *)atqa, &rx_len, + ISO14443A_FDT_ANTICOL_LAST1, 0); + if (ret < 0) { + DEBUGP("error during rc632_transceive()\n"); + return ret; + } + + /* switch back to normal 8bit last byte */ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, 0x00); + if (ret < 0) + return ret; + + if (rx_len != 2) { + DEBUGP("rx_len(%d) != 2\n", rx_len); + return -1; + } + + return 0; +} + +/* transceive regular frame */ +static int +rc632_iso14443ab_transceive(struct rfid_asic_handle *handle, + unsigned int frametype, + const u_int8_t *tx_buf, unsigned int tx_len, + u_int8_t *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + int ret; + u_int8_t rxl; + u_int8_t channel_red; + + if (*rx_len > 0xff) + rxl = 0xff; + else + rxl = *rx_len; + + memset(rx_buf, 0, *rx_len); + + switch (frametype) { + case RFID_14443A_FRAME_REGULAR: + case RFID_MIFARE_FRAME: + channel_red = RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE + |RC632_CR_PARITY_ENABLE|RC632_CR_PARITY_ODD; + break; + case RFID_14443B_FRAME_REGULAR: + channel_red = RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE + |RC632_CR_CRC3309; + break; +#if 0 + case RFID_MIFARE_FRAME: + channel_red = RC632_CR_PARITY_ENABLE|RC632_CR_PARITY_ODD; + break; +#endif + default: + return -EINVAL; + break; + } + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + channel_red); + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, timeout, 0); + *rx_len = rxl; + if (ret < 0) + return ret; + + + return 0; +} + +/* transceive anti collission bitframe */ +static int +rc632_iso14443a_transceive_acf(struct rfid_asic_handle *handle, + struct iso14443a_anticol_cmd *acf, + unsigned int *bit_of_col) +{ + int ret; + u_int8_t rx_buf[64]; + u_int8_t rx_len = sizeof(rx_buf); + u_int8_t rx_align = 0, tx_last_bits, tx_bytes, tx_bytes_total; + u_int8_t boc; + u_int8_t error_flag; + *bit_of_col = ISO14443A_BITOFCOL_NONE; + memset(rx_buf, 0, sizeof(rx_buf)); + + /* disable mifare cryto */ + ret = rc632_clear_bits(handle, RC632_REG_CONTROL, + RC632_CONTROL_CRYPTO1_ON); + if (ret < 0) + return ret; + + /* disable CRC summing */ +#if 0 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); +#endif + if (ret < 0) + return ret; + + tx_last_bits = acf->nvb & 0x07; /* lower nibble indicates bits */ + tx_bytes = ( acf->nvb >> 4 ) & 0x07; + if (tx_last_bits) { + tx_bytes_total = tx_bytes+1; + rx_align = tx_last_bits & 0x07; /* rx frame complements tx */ + } + else + tx_bytes_total = tx_bytes; + + /* set RxAlign and TxLastBits*/ + ret = rc632_reg_write(handle, RC632_REG_BIT_FRAMING, + (rx_align << 4) | (tx_last_bits)); + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, (u_int8_t *)acf, tx_bytes_total, + rx_buf, &rx_len, 0x32, 0); + if (ret < 0) + return ret; + + /* bitwise-OR the two halves of the split byte */ + acf->uid_bits[tx_bytes-2] = ( + (acf->uid_bits[tx_bytes-2] & (0xff >> (8-tx_last_bits))) + | rx_buf[0]); + + /* copy the rest */ + if(rx_len) + memcpy(&acf->uid_bits[tx_bytes-1], &rx_buf[1], rx_len-1); + + /* determine whether there was a collission */ + ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &error_flag); + if (ret < 0) + return ret; + + if (error_flag & RC632_ERR_FLAG_COL_ERR) { + /* retrieve bit of collission */ + ret = rc632_reg_read(handle, RC632_REG_COLL_POS, &boc); + if (ret < 0) + return ret; + + /* bit of collission relative to start of part 1 of + * anticollision frame (!) */ + *bit_of_col = 2*8 + boc; + } + + return 0; +} + +enum rc632_rate { + RC632_RATE_106 = 0x00, + RC632_RATE_212 = 0x01, + RC632_RATE_424 = 0x02, + RC632_RATE_848 = 0x03, +}; + +struct rx_config { + u_int8_t subc_pulses; + u_int8_t rx_coding; + u_int8_t rx_threshold; + u_int8_t bpsk_dem_ctrl; +}; + +struct tx_config { + u_int8_t rate; + u_int8_t mod_width; +}; + +static struct rx_config rx_configs[] = { + { + .subc_pulses = RC632_RXCTRL1_SUBCP_8, + .rx_coding = RC632_DECCTRL_MANCHESTER, + .rx_threshold = 0x88, + .bpsk_dem_ctrl = 0x00, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_4, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_2, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, + { + .subc_pulses = RC632_RXCTRL1_SUBCP_1, + .rx_coding = RC632_DECCTRL_BPSK, + .rx_threshold = 0x50, + .bpsk_dem_ctrl = 0x0c, + }, +}; + +static struct tx_config tx_configs[] = { + { + .rate = RC632_CDRCTRL_RATE_106K, + .mod_width = 0x13, + }, + { + .rate = RC632_CDRCTRL_RATE_212K, + .mod_width = 0x07, + }, + { + .rate = RC632_CDRCTRL_RATE_424K, + .mod_width = 0x03, + }, + { + .rate = RC632_CDRCTRL_RATE_848K, + .mod_width = 0x01, + }, +}; + +static int rc632_iso14443a_set_speed(struct rfid_asic_handle *handle, + unsigned int tx, unsigned int rate) +{ + int rc; + u_int8_t reg; + + + if (!tx) { + /* Rx */ + if (rate > ARRAY_SIZE(rx_configs)) + return -EINVAL; + + rc = rc632_set_bit_mask(handle, RC632_REG_RX_CONTROL1, + RC632_RXCTRL1_SUBCP_MASK, + rx_configs[rate].subc_pulses); + if (rc < 0) + return rc; + + rc = rc632_set_bit_mask(handle, RC632_REG_DECODER_CONTROL, + RC632_DECCTRL_BPSK, + rx_configs[rate].rx_coding); + if (rc < 0) + return rc; + + rc = rc632_reg_write(handle, RC632_REG_RX_THRESHOLD, + rx_configs[rate].rx_threshold); + if (rc < 0) + return rc; + + if (rx_configs[rate].rx_coding == RC632_DECCTRL_BPSK) { + rc = rc632_reg_write(handle, + RC632_REG_BPSK_DEM_CONTROL, + rx_configs[rate].bpsk_dem_ctrl); + if (rc < 0) + return rc; + } + } else { + /* Tx */ + if (rate > ARRAY_SIZE(tx_configs)) + return -EINVAL; + + rc = rc632_set_bit_mask(handle, RC632_REG_CODER_CONTROL, + RC632_CDRCTRL_RATE_MASK, + tx_configs[rate].rate); + if (rc < 0) + return rc; + + rc = rc632_reg_write(handle, RC632_REG_MOD_WIDTH, + tx_configs[rate].mod_width); + if (rc < 0) + return rc; + } + + return 0; +} + +static int rc632_iso14443b_init(struct rfid_asic_handle *handle) +{ + int ret; + + // FIXME: some FIFO work + + /* flush fifo (our way) */ + ret = rc632_reg_write(handle, RC632_REG_CONTROL, + RC632_CONTROL_FIFO_FLUSH); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_TX_CONTROL, + (RC632_TXCTRL_TX1_RF_EN | + RC632_TXCTRL_TX2_RF_EN | + RC632_TXCTRL_TX2_INV | + RC632_TXCTRL_MOD_SRC_INT)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CW_CONDUCTANCE, 0x3f); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_MOD_CONDUCTANCE, 0x04); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_CODER_CONTROL, + (RC632_CDRCTRL_TXCD_NRZ | + RC632_CDRCTRL_RATE_14443B)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_MOD_WIDTH, 0x13); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_MOD_WIDTH_SOF, 0x3f); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_TYPE_B_FRAMING, + (RC632_TBFRAMING_SOF_11L_3H | + (6 << RC632_TBFRAMING_SPACE_SHIFT) | + RC632_TBFRAMING_EOF_11)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_RX_CONTROL1, + (RC632_RXCTRL1_GAIN_35DB | + RC632_RXCTRL1_ISO14443 | + RC632_RXCTRL1_SUBCP_8)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_DECODER_CONTROL, + (RC632_DECCTRL_BPSK | + RC632_DECCTRL_RXFR_14443B)); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_BIT_PHASE, + CM5121_14443B_BITPHASE); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_RX_THRESHOLD, + CM5121_14443B_THRESHOLD); + if (ret < 0) + return ret; + + ret = rc632_reg_write(handle, RC632_REG_BPSK_DEM_CONTROL, + ((0x2 & RC632_BPSKD_TAUB_MASK)<> 4; + key12[i * 2 + 1] = (~ln << 4) | ln; + key12[i * 2] = (~hn << 4) | hn; + } + return 0; +} + +static int +rc632_mifare_set_key(struct rfid_asic_handle *h, const u_int8_t *key) +{ + u_int8_t coded_key[RFID_MIFARE_KEY_CODED_LEN]; + u_int8_t reg; + int ret; + + ret = rc632_mifare_transform_key(key, coded_key); + if (ret < 0) + return ret; + + /* Terminate probably running command */ + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_IDLE); + if (ret < 0) + return ret; + + ret = rc632_fifo_write(h, RFID_MIFARE_KEY_CODED_LEN, coded_key, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_LOAD_KEY); + if (ret < 0) + return ret; + + ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + ret = rc632_reg_read(h, RC632_REG_ERROR_FLAG, ®); + if (ret < 0) + return ret; + + if (reg & RC632_ERR_FLAG_KEY_ERR) + return -EINVAL; + + return 0; +} + +static int +rc632_mifare_auth(struct rfid_asic_handle *h, u_int8_t cmd, u_int32_t serno, + u_int8_t block) +{ + int ret; + struct mifare_authcmd acmd; + u_int8_t reg; + + if (cmd != RFID_CMD_MIFARE_AUTH1A && cmd != RFID_CMD_MIFARE_AUTH1B) { + DEBUGP("invalid auth command\n"); + return -EINVAL; + } + + /* Initialize acmd */ + acmd.block_address = block & 0xff; + acmd.auth_cmd = cmd; + //acmd.serno = htonl(serno); + acmd.serno = serno; + +#if 1 + /* Clear Rx CRC */ + ret = rc632_clear_bits(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE); +#else + /* Clear Rx CRC, Set Tx CRC and Odd Parity */ + ret = rc632_reg_write(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE | RC632_CR_PARITY_ODD | + RC632_CR_PARITY_ENABLE); +#endif + if (ret < 0) + return ret; + + /* Send Authent1 Command */ + ret = rc632_fifo_write(h, sizeof(acmd), (unsigned char *)&acmd, 0x03); + if (ret < 0) + return ret; + + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_AUTHENT1); + if (ret < 0) { + DEBUGP("error during AUTHENT1"); + return ret; + } + + /* Wait until transmitter is idle */ + ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + ret = rc632_reg_read(h, RC632_REG_SECONDARY_STATUS, ®); + if (ret < 0) + return ret; + if (reg & 0x07) { + DEBUGP("bitframe?"); + return -EIO; + } + + /* Clear Tx CRC */ + ret = rc632_clear_bits(h, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_TX_CRC_ENABLE); + if (ret < 0) + return ret; + + /* Send Authent2 Command */ + ret = rc632_reg_write(h, RC632_REG_COMMAND, RC632_CMD_AUTHENT2); + if (ret < 0) + return ret; + + /* Wait until transmitter is idle */ + ret = rc632_wait_idle(h, RC632_TMO_AUTH1); + if (ret < 0) + return ret; + + /* Check whether authentication was successful */ + ret = rc632_reg_read(h, RC632_REG_CONTROL, ®); + if (ret < 0) + return ret; + + if (!(reg & RC632_CONTROL_CRYPTO1_ON)) { + DEBUGP("authentication not successful"); + return -EACCES; + } + + return 0; +} + +/* transceive regular frame */ +static int +rc632_mifare_transceive(struct rfid_asic_handle *handle, + const u_int8_t *tx_buf, unsigned int tx_len, + u_int8_t *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + int ret; + u_int8_t rxl = *rx_len & 0xff; + + DEBUGP("entered\n"); + memset(rx_buf, 0, *rx_len); + +#if 1 + ret = rc632_reg_write(handle, RC632_REG_CHANNEL_REDUNDANCY, + (RC632_CR_PARITY_ENABLE | + RC632_CR_PARITY_ODD | + RC632_CR_TX_CRC_ENABLE | + RC632_CR_RX_CRC_ENABLE)); +#else + ret = rc632_clear_bits(handle, RC632_REG_CHANNEL_REDUNDANCY, + RC632_CR_RX_CRC_ENABLE|RC632_CR_TX_CRC_ENABLE); +#endif + if (ret < 0) + return ret; + + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); + *rx_len = rxl; + if (ret < 0) + return ret; + + + return 0; +} + +const struct rfid_asic rc632 = { + .name = "Philips CL RC632", + .fc = ISO14443_FREQ_CARRIER, + .priv.rc632 = { + .fn = { + .power_up = &rc632_power_up, + .power_down = &rc632_power_down, + .turn_on_rf = &rc632_turn_on_rf, + .turn_off_rf = &rc632_turn_off_rf, + .transceive = &rc632_iso14443ab_transceive, + .iso14443a = { + .init = &rc632_iso14443a_init, + .transceive_sf = &rc632_iso14443a_transceive_sf, + .transceive_acf = &rc632_iso14443a_transceive_acf, + .set_speed = &rc632_iso14443a_set_speed, + }, + .iso14443b = { + .init = &rc632_iso14443b_init, + }, + .iso15693 = { + .init = &rc632_iso15693_init, + }, + .mifare_classic = { + .setkey = &rc632_mifare_set_key, + .auth = &rc632_mifare_auth, + }, + }, + }, +}; diff --git a/librfid_1999/src/rfid_iso14443_common.c b/librfid_1999/src/rfid_iso14443_common.c new file mode 100644 index 0000000..38fed6b --- /dev/null +++ b/librfid_1999/src/rfid_iso14443_common.c @@ -0,0 +1,58 @@ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + + +static unsigned int fsdi_table[] = { 16, 24, 32, 40, 48, 64, 96, 128, 256 }; + +int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi) +{ + /* ISO 14443-4:2000(E) Section 5.1. */ + if (fsdi > sizeof(fsdi_table)/sizeof(unsigned int)) + return -1; + + *fsd = fsdi_table[fsdi]; + return 0; +} + +int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd) +{ + int i; + + for (i = 0; i < sizeof(fsdi_table)/sizeof(unsigned int); i++) { + if (fsdi_table[i] == fsd) { + *fsdi = i; + return 0; + } + } + + return -1; +} + +/* calculate the fsd that is equal or the closest smaller value + * that can be coded as fsd */ +unsigned int iso14443_fsd_approx(unsigned int fsd) +{ + unsigned int tbl_size = sizeof(fsdi_table)/sizeof(unsigned int); + int i; + + for (i = tbl_size-1; i >= 0; i--) { + if (fsdi_table[i] <= fsd) + return fsdi_table[i]; + } + /* not reached: return smallest possible FSD */ + return fsdi_table[0]; +} + diff --git a/librfid_1999/src/rfid_iso14443_common.h b/librfid_1999/src/rfid_iso14443_common.h new file mode 100644 index 0000000..848d983 --- /dev/null +++ b/librfid_1999/src/rfid_iso14443_common.h @@ -0,0 +1,11 @@ +#ifndef __RFID_ISO14443_COMMON_H +#define __RFID_ISO14443_COMMON_H + +int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi); +int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd); +unsigned int iso14443_fsd_approx(unsigned int fsd); + +#define ISO14443_FREQ_CARRIER 13560000 +#define ISO14443_FREQ_SUBCARRIER (ISO14443_FREQ_CARRIER/16) + +#endif diff --git a/librfid_1999/src/rfid_layer2.c b/librfid_1999/src/rfid_layer2.c new file mode 100644 index 0000000..2bbd037 --- /dev/null +++ b/librfid_1999/src/rfid_layer2.c @@ -0,0 +1,136 @@ +/* librfid - layer 2 protocol handler + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include /* for memcpy */ + +#include +#include + +static const struct rfid_layer2 *rfid_layer2s[] = { + [RFID_LAYER2_ISO14443A] = &rfid_layer2_iso14443a, + [RFID_LAYER2_ISO14443B] = &rfid_layer2_iso14443b, + [RFID_LAYER2_ISO15693] = &rfid_layer2_iso15693, +}; + +struct rfid_layer2_handle * +rfid_layer2_init(struct rfid_reader_handle *rh, unsigned int id) +{ + struct rfid_layer2 *p; + + if (id >= ARRAY_SIZE(rfid_layer2s)) { + DEBUGP("unable to find matching layer2 protocol\n"); + return NULL; + } + + p = rfid_layer2s[id]; + return p->fn.init(rh); +} + +int +rfid_layer2_open(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.open) + return 0; + + return ph->l2->fn.open(ph); +} + +int +rfid_layer2_transceive(struct rfid_layer2_handle *ph, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + if (!ph->l2->fn.transceive) + return -EIO; + + return ph->l2->fn.transceive(ph, frametype, tx_buf, len, rx_buf, + rx_len, timeout, flags); +} + +int rfid_layer2_fini(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.fini) + return 0; + + return ph->l2->fn.fini(ph); +} + +int +rfid_layer2_close(struct rfid_layer2_handle *ph) +{ + if (!ph->l2->fn.close) + return 0; + + return ph->l2->fn.close(ph); +} + +int +rfid_layer2_getopt(struct rfid_layer2_handle *ph, int optname, + void *optval, unsigned int *optlen) +{ + if (optname >> 16 == 0) { + unsigned char *optchar = optval; + + switch (optname) { + case RFID_OPT_LAYER2_UID: + if (ph->uid_len < *optlen) + *optlen = ph->uid_len; + memcpy(optchar, ph->uid, *optlen); + break; + default: + return -EINVAL; + break; + } + } else { + if (!ph->l2->fn.getopt) + return -EINVAL; + + return ph->l2->fn.getopt(ph, optname, optval, optlen); + } + return 0; +} + +int +rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname, + const void *optval, unsigned int optlen) +{ + if (optname >> 16 == 0) { + switch (optname) { + default: + return -EINVAL; + break; + } + } else { + if (!ph->l2->fn.setopt) + return -EINVAL; + + return ph->l2->fn.setopt(ph, optname, optval, optlen); + } + return 0; +} + +char *rfid_layer2_name(struct rfid_layer2_handle *l2h) +{ + return l2h->l2->name; +} diff --git a/librfid_1999/src/rfid_layer2_iso14443a.c b/librfid_1999/src/rfid_layer2_iso14443a.c new file mode 100644 index 0000000..f39aa80 --- /dev/null +++ b/librfid_1999/src/rfid_layer2_iso14443a.c @@ -0,0 +1,395 @@ +/* ISO 14443-3 A anticollision implementation + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#ifdef __MINGW32__ +#include +#endif/*__MINGW32__*/ + +#include +#include +#include +#include +#include + +#define TIMEOUT 1236 + +unsigned long randctx[4]={0x22d4a017,0x773a1f44,0xc39e1460,0x9cde8801}; + +/* Transceive a 7-bit short frame */ +int +iso14443a_transceive_sf(struct rfid_layer2_handle *handle, + unsigned char cmd, + struct iso14443a_atqa *atqa) +{ + struct rfid_reader *rdr = handle->rh->reader; + + return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa); +} + +/* Transmit an anticollission bit frame */ +static int +iso14443a_transceive_acf(struct rfid_layer2_handle *handle, + struct iso14443a_anticol_cmd *acf, + unsigned int *bit_of_col) +{ + struct rfid_reader *rdr = handle->rh->reader; + + return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col); +} + +/* Transmit a regular frame */ +static int +iso14443a_transceive(struct rfid_layer2_handle *handle, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return handle->rh->reader->transceive(handle->rh, frametype, tx_buf, + tx_len, rx_buf, rx_len, timeout, flags); +} + +static int +iso14443a_code_nvb_bits(unsigned char *nvb, unsigned int bits) +{ + unsigned int byte_count = bits / 8; + unsigned int bit_count = bits % 8; + + if (byte_count < 2 || byte_count > 7) + return -1; + + *nvb = ((byte_count & 0xf) << 4) | bit_count; + + return 0; +} + +int random_bit(void) +{ + unsigned long e; + + e = randctx[0]; + randctx[0]=randctx[1]; + randctx[1]=(randctx[2]<<19) + (randctx[2]>>13) + randctx[3]; + randctx[2]=randctx[3] ^ randctx[0]; + randctx[3]=e+randctx[1]; + + return randctx[1]&1; +} + +/* first bit is '1', second bit '2' */ +static void +rnd_toggle_bit_in_field(unsigned char *bitfield, unsigned int size, unsigned int bit) +{ + unsigned int byte,rnd; + + if(bit && (bit <= (size*8)) ) + { + rnd=random_bit(); + + DEBUGP("xor'ing bit %u with %u\n",bit,rnd); + bit--; + byte=bit/8; + bit=rnd<<(bit%8); + bitfield[byte] ^= bit; + } +} + + +static int +iso14443a_anticol(struct rfid_layer2_handle *handle) +{ + int ret; + unsigned int uid_size; + struct iso14443a_handle *h = &handle->priv.iso14443a; + struct iso14443a_atqa *atqa = &h->atqa; + struct iso14443a_anticol_cmd acf; + unsigned int bit_of_col; + unsigned char sak[3]; + unsigned int rx_len = sizeof(sak); + char *aqptr = (char *) atqa; + + memset(handle->uid, 0, sizeof(handle->uid)); + memset(sak, 0, sizeof(sak)); + memset(atqa, 0, sizeof(&atqa)); + memset(&acf, 0, sizeof(acf)); + + if (handle->flags & RFID_OPT_LAYER2_WUP) + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_WUPA, atqa); + else + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, atqa); + if (ret < 0) { + h->state = ISO14443A_STATE_REQA_SENT; + DEBUGP("error during transceive_sf: %d\n", ret); + return ret; + } + h->state = ISO14443A_STATE_ATQA_RCVD; + + DEBUGP("ATQA: 0x%02x 0x%02x\n", *aqptr, *(aqptr+1)); + + if (!atqa->bf_anticol) { + h->state = ISO14443A_STATE_NO_BITFRAME_ANTICOL; + DEBUGP("no bitframe anticollission bits set, aborting\n"); + return -1; + } + + if (atqa->uid_size == 2 || atqa->uid_size == 3) + uid_size = 3; + else if (atqa->uid_size == 1) + uid_size = 2; + else + uid_size = 1; + + acf.sel_code = ISO14443A_AC_SEL_CODE_CL1; + + h->state = ISO14443A_STATE_ANTICOL_RUNNING; + h->level = ISO14443A_LEVEL_CL1; + +cascade: + rx_len = sizeof(sak); + iso14443a_code_nvb_bits(&acf.nvb, 16); + + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); + if (ret < 0) + return ret; + + while (bit_of_col != ISO14443A_BITOFCOL_NONE) { + DEBUGP("collision at pos %u\n", bit_of_col); + + iso14443a_code_nvb_bits(&acf.nvb, bit_of_col); + rnd_toggle_bit_in_field(acf.uid_bits, sizeof(acf.uid_bits), bit_of_col); + DEBUGP("acf: nvb=0x%02X uid_bits=%s\n",acf.nvb,rfid_hexdump(acf.uid_bits,sizeof(acf.uid_bits))); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); + if (ret < 0) + return ret; + } + + iso14443a_code_nvb_bits(&acf.nvb, 7*8); + + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, + (unsigned char *)&acf, 7, + (unsigned char *) &sak, &rx_len, + TIMEOUT, 0); + if (ret < 0) + return ret; + + if (sak[0] & 0x04) { + /* Cascade bit set, UID not complete */ + switch (acf.sel_code) { + case ISO14443A_AC_SEL_CODE_CL1: + /* cascading from CL1 to CL2 */ + if (acf.uid_bits[0] != 0x88) { + DEBUGP("Cascade bit set, but UID0 != 0x88\n"); + return -1; + } + memcpy(&handle->uid[0], &acf.uid_bits[1], 3); + acf.sel_code = ISO14443A_AC_SEL_CODE_CL2; + h->level = ISO14443A_LEVEL_CL2; + break; + case ISO14443A_AC_SEL_CODE_CL2: + /* cascading from CL2 to CL3 */ + memcpy(&handle->uid[3], &acf.uid_bits[1], 3); + acf.sel_code = ISO14443A_AC_SEL_CODE_CL3; + h->level = ISO14443A_LEVEL_CL3; + break; + default: + DEBUGP("cannot cascade any further than CL3\n"); + h->state = ISO14443A_STATE_ERROR; + return -1; + break; + } + goto cascade; + + } else { + switch (acf.sel_code) { + case ISO14443A_AC_SEL_CODE_CL1: + /* single size UID (4 bytes) */ + memcpy(&handle->uid[0], &acf.uid_bits[0], 4); + break; + case ISO14443A_AC_SEL_CODE_CL2: + /* double size UID (7 bytes) */ + memcpy(&handle->uid[3], &acf.uid_bits[0], 4); + break; + case ISO14443A_AC_SEL_CODE_CL3: + /* triple size UID (10 bytes) */ + memcpy(&handle->uid[6], &acf.uid_bits[0], 4); + break; + } + } + + h->level = ISO14443A_LEVEL_NONE; + h->state = ISO14443A_STATE_SELECTED; + + { + if (uid_size == 1) + handle->uid_len = 4; + else if (uid_size == 2) + handle->uid_len = 7; + else + handle->uid_len = 10; + + DEBUGP("UID %s\n", rfid_hexdump(handle->uid, handle->uid_len)); + } + + if (sak[0] & 0x20) { + DEBUGP("we have a T=CL compliant PICC\n"); + handle->proto_supported = 1 << RFID_PROTOCOL_TCL; + h->tcl_capable = 1; + } else { + DEBUGP("we have a T!=CL PICC\n"); + handle->proto_supported = (1 << RFID_PROTOCOL_MIFARE_UL)| + (1 << RFID_PROTOCOL_MIFARE_CLASSIC); + h->tcl_capable = 0; + } + + return 0; +} + +static int +iso14443a_hlta(struct rfid_layer2_handle *handle) +{ + int ret; + unsigned char tx_buf[2] = { 0x50, 0x00 }; + unsigned char rx_buf[10]; + unsigned int rx_len = sizeof(rx_buf); + + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, + tx_buf, sizeof(tx_buf), + rx_buf, &rx_len, 1000 /* 1ms */, 0); + if (ret < 0) { + /* "error" case: we don't get somethng back from the card */ + return 0; + } + return -1; +} + +static int +iso14443a_setopt(struct rfid_layer2_handle *handle, int optname, + const void *optval, unsigned int optlen) +{ + int ret = -EINVAL; + struct rfid_reader *rdr = handle->rh->reader; + unsigned int speed; + + switch (optname) { + case RFID_OPT_14443A_SPEED_RX: + if (!rdr->iso14443a.set_speed) + return -ENOTSUP; + speed = *(unsigned int *)optval; + ret = rdr->iso14443a.set_speed(handle->rh, 0, speed); + break; + case RFID_OPT_14443A_SPEED_TX: + if (!rdr->iso14443a.set_speed) + return -ENOTSUP; + speed = *(unsigned int *)optval; + ret = rdr->iso14443a.set_speed(handle->rh, 1, speed); + break; + case RFID_OPT_14443A_WUPA: + if((unsigned int*)optval) + handle->flags |= RFID_OPT_LAYER2_WUP; + else + handle->flags &= ~RFID_OPT_LAYER2_WUP; + ret = 0; + break; + }; + + return ret; +} + +static int +iso14443a_getopt(struct rfid_layer2_handle *handle, int optname, + void *optval, unsigned int *optlen) +{ + int ret = -EINVAL; + struct iso14443a_handle *h = &handle->priv.iso14443a; + struct iso14443a_atqa *atqa = optval; + int *wupa = optval; + + switch (optname) { + case RFID_OPT_14443A_ATQA: + *atqa = h->atqa; + ret = 0; + break; + case RFID_OPT_14443A_WUPA: + *wupa = ((handle->flags & RFID_OPT_LAYER2_WUP) != 0); + ret = 0; + break; + }; + + return ret; +} + + +static struct rfid_layer2_handle * +iso14443a_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + memset(h, 0, sizeof(*h)); + +#ifdef __MINGW32__ + randctx[0] ^= GetTickCount(); +#endif/*__MINGW32__*/ + for(ret=0;ret<23;ret++) + random_bit(); + + h->l2 = &rfid_layer2_iso14443a; + h->rh = rh; + h->priv.iso14443a.state = ISO14443A_STATE_NONE; + h->priv.iso14443a.level = ISO14443A_LEVEL_NONE; + + ret = h->rh->reader->iso14443a.init(h->rh); + if (ret < 0) { + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso14443a_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso14443a = { + .id = RFID_LAYER2_ISO14443A, + .name = "ISO 14443-3 A", + .fn = { + .init = &iso14443a_init, + .open = &iso14443a_anticol, + .transceive = &iso14443a_transceive, + .close = &iso14443a_hlta, + .fini = &iso14443a_fini, + .setopt = &iso14443a_setopt, + .getopt = &iso14443a_getopt, + }, +}; + diff --git a/librfid_1999/src/rfid_layer2_iso14443b.c b/librfid_1999/src/rfid_layer2_iso14443b.c new file mode 100644 index 0000000..e5fb151 --- /dev/null +++ b/librfid_1999/src/rfid_layer2_iso14443b.c @@ -0,0 +1,400 @@ +/* ISO 14443-3 B anticollision implementation + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" + +#define ATQB_TIMEOUT ((256*10e6/ISO14443_FREQ_SUBCARRIER) \ + +(200*10e6/ISO14443_FREQ_SUBCARRIER)) + +#undef ATQB_TIMEOUT +#define ATQB_TIMEOUT 1 + +static inline int +fwi_to_fwt(struct rfid_layer2_handle *h, unsigned int *fwt, unsigned int fwi) +{ + unsigned int multiplier, tmp; + + /* 15 is RFU */ + if (fwi > 14) + return -1; + + /* According to ISO 14443-3:200(E), Chapter 7.9.4.3, the forumala is + * (256 * 16 / fC) * 2^fwi We avoid floating point computations by + * shifting everything into the microsecond range. In integer + * calculations 1000000*256*16/13560000 evaluates to 302 (instead of + * 302.064897), which provides sufficient precision, IMHO. The max + * result is 302 * 16384 (4947968), which fits well within the 31/32 + * bit range of an integer */ + + multiplier = 1 << fwi; /* 2 to the power of fwi */ + + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->rh->ah->asic->fc) * multiplier; +} + +static int +parse_atqb(struct rfid_layer2_handle *h, struct iso14443b_atqb *atqb) +{ + int ret; + + if (atqb->fifty != 0x50) + return -1; + + if (atqb->protocol_info.fo & 0x01) + h->priv.iso14443b.flags |= ISO14443B_CID_SUPPORTED; + if (atqb->protocol_info.fo & 0x02) + h->priv.iso14443b.flags |= ISO14443B_NAD_SUPPORTED; + + ret = fwi_to_fwt(h, &h->priv.iso14443b.fwt, atqb->protocol_info.fwi); + if (ret < 0) { + DEBUGP("invalid fwi %u\n", atqb->protocol_info.fwi); + return ret; + } + + if (atqb->protocol_info.protocol_type == 0x1) { + DEBUGP("we have a T=CL compliant PICC\n"); + h->priv.iso14443b.tcl_capable = 1; + h->proto_supported = (1 << RFID_PROTOCOL_TCL); + } else { + DEBUGP("we have a T!=CL PICC\n"); + h->priv.iso14443b.tcl_capable = 0; + /* FIXME: what protocols do we support? */ + } + + iso14443_fsdi_to_fsd(&h->priv.iso14443b.fsc, + atqb->protocol_info.max_frame_size); + + /* FIXME: speed capability */ + + memcpy(h->uid, atqb->pupi, sizeof(atqb->pupi)); + h->uid_len = sizeof(atqb->pupi); + + return 0; +} + +static int +send_reqb(struct rfid_layer2_handle *h, unsigned char afi, + unsigned int is_wup, unsigned int num_initial_slots) +{ + int ret; + unsigned char reqb[3]; + struct iso14443b_atqb atqb; + unsigned int atqb_len = sizeof(atqb); + unsigned int num_slot_idx = num_initial_slots; + + reqb[0] = 0x05; + reqb[1] = afi; + + for (num_slot_idx = num_initial_slots; num_slot_idx <= 4; + num_slot_idx++) { + reqb[2] = num_slot_idx & 0x07; + if (is_wup) + reqb[2] |= 0x08; + + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + reqb, sizeof(reqb), + (unsigned char *)&atqb, + &atqb_len, ATQB_TIMEOUT, 0); + h->priv.iso14443b.state = ISO14443B_STATE_REQB_SENT; + if (ret < 0) { + DEBUGP("error during transceive of REQB/WUBP\n"); + continue; + } + + /* FIXME: send N-1 slot marker frames */ + + if (atqb_len != sizeof(atqb)) { + DEBUGP("error: atqb_len = %u instead of %Zu\n", + atqb_len, sizeof(atqb)); + continue; + } + + /* FIXME: how to detect a collission at 14443B ? I guess we + * can only rely on the CRC checking (CRCErr in ErrorFlag + * register?) */ + + if (parse_atqb(h, &atqb) >= 0) { + h->priv.iso14443b.state = ISO14443B_STATE_ATQB_RCVD; + return 0; + } + } + + return -1; +} + +static inline unsigned int mbli_to_mbl(struct rfid_layer2_handle *h, + unsigned int mbli) +{ + return (h->priv.iso14443b.fsc * 2 ^ (mbli-1)); +} + +static int +transceive_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, + unsigned int inf_len, unsigned char *rx_data, unsigned int *rx_len) +{ + struct { + struct iso14443b_attrib_hdr attrib; + char buf[256-3]; + } _attrib_buf; + + struct iso14443b_attrib_hdr *attrib = &_attrib_buf.attrib; + unsigned char rx_buf[256]; + unsigned char fsdi; + int ret = 0; + + DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd); + if (rx_len >= rx_len-1) + return -EINVAL; + + /* initialize attrib frame */ + memset(&_attrib_buf, 0, sizeof(_attrib_buf)); + if (inf_len) + memcpy((unsigned char *)attrib+sizeof(*attrib), inf, inf_len); + + attrib->one_d = 0x1d; + memcpy(attrib->identifier, h->uid, 4); + + /* FIXME: do we want to change TR0/TR1 from its default ? */ + /* FIXME: do we want to change SOF/EOF from its default ? */ + + ret = iso14443_fsd_to_fsdi(&fsdi, h->priv.iso14443b.fsd); + if (ret < 0) { + DEBUGP("unable to map FSD(%u) to FSDI\n", + h->priv.iso14443b.fsd); + goto out_rx; + } + attrib->param2.fsdi = fsdi; + + /* FIXME: spd_in / spd_out */ + if (h->priv.iso14443b.tcl_capable == 1) + attrib->param3.protocol_type = 0x1; + + attrib->param4.cid = h->priv.iso14443b.cid & 0xf; + + *rx_len = *rx_len + 1; + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + (unsigned char *) attrib, + sizeof(*attrib)+inf_len, + rx_buf, rx_len, h->priv.iso14443b.fwt, + 0); + h->priv.iso14443b.state = ISO14443B_STATE_ATTRIB_SENT; + if (ret < 0) { + DEBUGP("transceive problem\n"); + goto out_rx; + } + + if ((rx_buf[0] & 0x0f) != h->priv.iso14443b.cid) { + DEBUGP("ATTRIB response with invalid CID %u (should be %u)\n", + rx_buf[0] & 0x0f, h->priv.iso14443b.cid); + ret = -1; + goto out_rx; + } + + h->priv.iso14443b.state = ISO14443B_STATE_SELECTED; + + h->priv.iso14443b.mbl = mbli_to_mbl(h, (rx_data[0] & 0xf0) >> 4); + + *rx_len = *rx_len - 1; + memcpy(rx_data, rx_buf+1, *rx_len); + +out_rx: +out_attrib: + + return ret; +} + +static int +iso14443b_hltb(struct rfid_layer2_handle *h) +{ + int ret; + unsigned char hltb[5]; + unsigned char hltb_resp[1]; + unsigned int hltb_len = 1; + + hltb[0] = 0x50; + memcpy(hltb+1, h->uid, 4); + + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, + hltb, 5, + hltb_resp, &hltb_len, + h->priv.iso14443b.fwt, 0); + h->priv.iso14443b.state = ISO14443B_STATE_HLTB_SENT; + if (ret < 0) { + DEBUGP("transceive problem\n"); + return ret; + } + + if (hltb_len != 1 || hltb_resp[0] != 0x00) { + DEBUGP("bad HLTB response\n"); + return -1; + } + h->priv.iso14443b.state = ISO14443B_STATE_HALTED; + + return 0; +} + +static int +iso14443b_anticol(struct rfid_layer2_handle *handle) +{ + unsigned char afi = 0; /* FIXME */ + int ret; + unsigned char buf[255]; + unsigned int buf_len = sizeof(buf); + + ret = send_reqb(handle, afi, 0, 0); + if (ret < 0) + return ret; + + ret = transceive_attrib(handle, NULL, 0, buf, &buf_len); + if (ret < 0) + return ret; + + return 0; +} + +static struct rfid_layer2_handle * +iso14443b_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + h->l2 = &rfid_layer2_iso14443b; + h->rh = rh; + h->priv.iso14443b.state = ISO14443B_STATE_NONE; + + /* FIXME: if we want to support multiple PICC's, we need some + * fancy allocation scheme for CID's */ + h->priv.iso14443b.cid = 0; + + h->priv.iso14443b.fsd = iso14443_fsd_approx(rh->ah->mru); + DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd); + + /* 14443-3 Section 7.1.6 */ + h->priv.iso14443b.tr0 = (256/ISO14443_FREQ_SUBCARRIER)*10e6; + h->priv.iso14443b.tr1 = (200/ISO14443_FREQ_SUBCARRIER)*10e6; + + ret = h->rh->reader->iso14443b.init(h->rh); + if (ret < 0) { + DEBUGP("error during reader 14443b init\n"); + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso14443b_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + +static int +iso14443b_transceive(struct rfid_layer2_handle *handle, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + DEBUGP("transcieving %u bytes, expecting max %u\n", tx_len, *rx_len); + return handle->rh->reader->transceive(handle->rh, frametype, + tx_buf, tx_len, + rx_buf, rx_len, timeout, flags); +} + +static int +iso14443b_getopt(struct rfid_layer2_handle *handle, + int optname, void *optval, unsigned int *optlen) +{ + unsigned int *opt_ui = optval; + + switch (optname) { + case RFID_OPT_14443B_CID: + *opt_ui = handle->priv.iso14443b.cid; + break; + case RFID_OPT_14443B_FSC: + *opt_ui = handle->priv.iso14443b.fsc; + break; + case RFID_OPT_14443B_FSD: + *opt_ui = handle->priv.iso14443b.fsd; + break; + case RFID_OPT_14443B_FWT: + *opt_ui = handle->priv.iso14443b.fwt; + break; + case RFID_OPT_14443B_TR0: + *opt_ui = handle->priv.iso14443b.tr0; + break; + case RFID_OPT_14443B_TR1: + *opt_ui = handle->priv.iso14443b.tr1; + break; + default: + return -EINVAL; + break; + } + return 0; +} + +static int +iso14443b_setopt(struct rfid_layer2_handle *handle, + int optname, const void *optval, unsigned int optlen) +{ + const unsigned int *opt_ui = optval; + + switch (optname) { + case RFID_OPT_14443B_CID: + handle->priv.iso14443b.cid = (*opt_ui & 0xf); + break; + defaukt: + return -EINVAL; + break; + } + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso14443b = { + .id = RFID_LAYER2_ISO14443B, + .name = "ISO 14443-3 B", + .fn = { + .init = &iso14443b_init, + .open = &iso14443b_anticol, + .transceive = &iso14443b_transceive, + .close = &iso14443b_hltb, + .fini = &iso14443b_fini, + .getopt = &iso14443b_getopt, + .setopt = &iso14443b_setopt, + }, +}; diff --git a/librfid_1999/src/rfid_layer2_iso15693.c b/librfid_1999/src/rfid_layer2_iso15693.c new file mode 100644 index 0000000..f5da8c2 --- /dev/null +++ b/librfid_1999/src/rfid_layer2_iso15693.c @@ -0,0 +1,173 @@ +/* ISO 15693 anticollision implementation + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +struct iso15693_request_read { + struct iso15693_request req; + u_int64_t uid; + u_int8_t blocknum; +} __attribute__ ((packed)); + +#define ISO15693_BLOCK_SIZE_MAX (256/8) +#define ISO15693_RESP_SIZE_MAX (4+ISO15693_BLOCK_SIZE_MAX) + +#if 0 +static int +iso15693_read_block(struct rfid_layer2_handle *handle, + u_int8_t blocknr, u_int32_t *data) +{ + int rc; + struct iso15693_request_read req; + u_int8_t resp[ISO15693_RESP_SIZE_MAX]; + + req.req.flags = 0; + req.command = ISO15693_CMD_READ_BLOCK_SINGLE; + memcpy(&req.uid, handle->..., ISO15693_UID_LEN); + req.blocknum = blocknr; + + /* FIXME: fill CRC if required */ + + rc = iso15693_transceive(... &req, ..., ); + + if (rc < 0) + return rc; + + memcpy(data, resp+1, rc-1); /* FIXME rc-3 in case of CRC */ + + return rc-1; +} + +static int +iso15693_write_block() +{ + struct iso16593_request_read *rreq; + u_int32_t buf[sizeof(req)+ISO15693_BLOCK_SIZE_MAX]; + + rreq = (struct iso15693_request_read *) req; + + rreq->req.flags = ; + rreq->req.command = ISO15693_CMD_WRITE_BLOCK_SINGLE; + memcpy(rreq->uid, handle->, ISO15693_UID_LEN); + rreq->blocknum = blocknr; + memcpy(rreq->); + +} + +static int +iso15693_lock_block() +{ +} + +#endif + +static int +iso15693_anticol(struct rfid_layer2_handle *handle) +{ + return -1; +} + +static int +iso15693_getopt(struct rfid_layer2_handle *handle, + int optname, void *optval, unsigned int optlen) +{ + switch (optname) { + case RFID_OPT_15693_MOD_DEPTH: + case RFID_OPT_15693_VCD_CODING: + case RFID_OPT_15693_VICC_SUBC: + case RFID_OPT_15693_VICC_SPEED: + default: + return -EINVAL; + break; + } + return 0; +} + +static int +iso15693_setopt(struct rfid_layer2_handle *handle, int optname, + const void *optval, unsigned int optlen) +{ + switch (optname) { + case RFID_OPT_15693_MOD_DEPTH: + case RFID_OPT_15693_VCD_CODING: + case RFID_OPT_15693_VICC_SUBC: + case RFID_OPT_15693_VICC_SPEED: + default: + return -EINVAL; + break; + } + return 0; +} + +static int transceive_inventory(struct rfid_layer2_handle *l2h) +{ +} + +static struct rfid_layer2_handle * +iso15693_init(struct rfid_reader_handle *rh) +{ + int ret; + struct rfid_layer2_handle *h = malloc_layer2_handle(sizeof(*h)); + if (!h) + return NULL; + + h->l2 = &rfid_layer2_iso15693; + h->rh = rh; + h->priv.iso15693.state = ISO15693_STATE_NONE; + ret = h->rh->reader->iso15693.init(h->rh); + if (ret < 0) { + free_layer2_handle(h); + return NULL; + } + + return h; +} + +static int +iso15693_fini(struct rfid_layer2_handle *handle) +{ + free_layer2_handle(handle); + return 0; +} + + +const struct rfid_layer2 rfid_layer2_iso15693 = { + .id = RFID_LAYER2_ISO15693, + .name = "ISO 15693", + .fn = { + .init = &iso15693_init, + .open = &iso15693_anticol, + //.transceive = &iso15693_transceive, + //.close = &iso14443a_hlta, + .fini = &iso15693_fini, + .setopt = &iso15693_setopt, + .getopt = &iso15693_getopt, + }, +}; + diff --git a/librfid_1999/src/rfid_proto_mifare_classic.c b/librfid_1999/src/rfid_proto_mifare_classic.c new file mode 100644 index 0000000..e98dc28 --- /dev/null +++ b/librfid_1999/src/rfid_proto_mifare_classic.c @@ -0,0 +1,222 @@ + +/* Mifare Classic implementation, PCD side. + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "rfid_iso14443_common.h" + + +#define MIFARE_UL_CMD_WRITE 0xA2 +#define MIFARE_UL_CMD_READ 0x30 + +/* FIXME */ +#define MIFARE_CL_READ_FWT 100 +#define MIFARE_CL_WRITE_FWT 100 + +static int +mfcl_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + if (page > MIFARE_CL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_CL_CMD_READ; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + sizeof(tx), rx_buf, &real_rx_len, + MIFARE_CL_READ_FWT, 0); + + if (ret < 0) + return ret; + + if (real_rx_len == 1 && *rx_buf == 0x04) + return -EPERM; + + if (real_rx_len < *rx_len) + *rx_len = real_rx_len; + + memcpy(rx_data, rx_buf, *rx_len); + + return ret; +} + +static int +mfcl_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned int i; + unsigned char tx[18]; + unsigned char rx[1]; + unsigned int rx_len = sizeof(rx); + int ret; + + if (page > MIFARE_CL_PAGE_MAX) + return -EINVAL; + + if (tx_len != 16 && tx_len != 4) + return -EINVAL; + + if (tx_len == 16) { + tx[0] = MIFARE_CL_CMD_WRITE16; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + 2, rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx_data, + tx_len, rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + sizeof(tx), rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + } else if (tx_len == 4) { + + tx[0] = MIFARE_CL_CMD_WRITE4; + tx[1] = page & 0xff; + + memcpy(tx+2, tx_data, 4); + + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + 2+4, rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + } + + return ret; +} + +static int +mfcl_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + u_int16_t atqa; + unsigned int atqa_size = sizeof(atqa); + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + if (*optlen < sizeof(*size)) + return -EINVAL; + *optlen = sizeof(*size); + ret = 0; + rfid_layer2_getopt(ph->l2h, RFID_OPT_14443A_ATQA, + (void *) &atqa, &atqa_size); + if (atqa == 0x0004) + *size = 1024; + else if (atqa == 0x0002) + *size = 4096; + else + ret = -EIO; + break; + } + + return ret; +} + +static struct rfid_protocol_handle * +mfcl_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + + if (l2h->l2->id != RFID_LAYER2_ISO14443A) + return NULL; + + if (l2h->uid_len != 4) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int mfcl_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_mfcl = { + .id = RFID_PROTOCOL_MIFARE_CLASSIC, + .name = "Mifare Classic", + .fn = { + .init = &mfcl_init, + .read = &mfcl_read, + .write = &mfcl_write, + .fini = &mfcl_fini, + .getopt = &mfcl_getopt, + }, +}; + +int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key) +{ + if (!ph->l2h->rh->reader->mifare_classic.setkey) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.setkey(ph->l2h->rh, key); +} + +int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block) +{ + u_int32_t serno = *((u_int32_t *)ph->l2h->uid); + + if (!ph->l2h->rh->reader->mifare_classic.auth) + return -ENODEV; + + return ph->l2h->rh->reader->mifare_classic.auth(ph->l2h->rh, cmd, + serno, block); +} diff --git a/librfid_1999/src/rfid_proto_mifare_ul.c b/librfid_1999/src/rfid_proto_mifare_ul.c new file mode 100644 index 0000000..7243c89 --- /dev/null +++ b/librfid_1999/src/rfid_proto_mifare_ul.c @@ -0,0 +1,198 @@ + +/* Mifare Ultralight implementation, PCD side. + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "rfid_iso14443_common.h" + + +/* FIXME */ +#define MIFARE_UL_READ_FWT 100 +#define MIFARE_UL_WRITE_FWT 100 + +static int +mful_read(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *rx_data, unsigned int *rx_len) +{ + unsigned char rx_buf[16]; + unsigned int real_rx_len = sizeof(rx_buf); + unsigned char tx[2]; + int ret; + + if (page > MIFARE_UL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_UL_CMD_READ; + tx[1] = page & 0xff; + + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, + tx, sizeof(tx), rx_buf, + &real_rx_len, MIFARE_UL_READ_FWT, 0); + + if (ret < 0) + return ret; + + if (real_rx_len < *rx_len) + *rx_len = real_rx_len; + + memcpy(rx_data, rx_buf, *rx_len); + + return ret; +} + +static int +mful_write(struct rfid_protocol_handle *ph, unsigned int page, + unsigned char *tx_data, unsigned int tx_len) +{ + unsigned int i; + unsigned char tx[6]; + unsigned char rx[10]; + unsigned int rx_len = sizeof(rx); + int ret; + + if (tx_len != 4 || page > MIFARE_UL_PAGE_MAX) + return -EINVAL; + + tx[0] = MIFARE_UL_CMD_WRITE; + tx[1] = page & 0xff; + + for (i = 0; i < 4; i++) + tx[2+i] = tx_data[i]; + + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, + tx, sizeof(tx), rx, &rx_len, + MIFARE_UL_WRITE_FWT, 0); + + if (ret < 0) + return ret; + + if (rx[0] != MIFARE_UL_RESP_ACK) + return -EIO; + + return ret; +} + +static int +mful_transceive(struct rfid_protocol_handle *ph, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + unsigned int timeout, unsigned int flags) +{ + return -EINVAL; +} + +static int +mful_getopt(struct rfid_protocol_handle *ph, int optname, void *optval, + unsigned int *optlen) +{ + int ret = -EINVAL; + u_int16_t atqa; + unsigned int *size = optval; + + switch (optname) { + case RFID_OPT_PROTO_SIZE: + ret = 0; + *size = 512; + break; + } + + return ret; +} + + +static struct rfid_protocol_handle * +mful_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + u_int16_t atqa; + unsigned int atqa_len = sizeof(atqa); + + if (l2h->l2->id != RFID_LAYER2_ISO14443A) + return NULL; + + /* According to "Type Identification Procedure Rev. 1.3" */ + rfid_layer2_getopt(l2h, RFID_OPT_14443A_ATQA, + &atqa, &atqa_len); + if (atqa != 0x0044) + return NULL; + + /* according to "Functional Specification Rev. 3.0 */ + if (l2h->uid_len != 7) + return NULL; + + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + return ph; +} + +static int mful_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +const struct rfid_protocol rfid_protocol_mful = { + .id = RFID_PROTOCOL_MIFARE_UL, + .name = "Mifare Ultralight", + .fn = { + .init = &mful_init, + .read = &mful_read, + .write = &mful_write, + .fini = &mful_fini, + .getopt = &mful_getopt, + }, +}; + +/* Functions below are not (yet? covered in the generic librfid api */ + + +/* lock a certain page */ +int rfid_mful_lock_page(struct rfid_protocol_handle *ph, unsigned int page) +{ + unsigned char buf[4] = { 0x00, 0x00, 0x00, 0x00 }; + + if (ph->proto != &rfid_protocol_mful) + return -EINVAL; + + if (page < 3 || page > 15) + return -EINVAL; + + if (page > 8) + buf[2] = (1 << page); + else + buf[3] = (1 << (page - 8)); + + return mful_write(ph, MIFARE_UL_PAGE_LOCK, buf, sizeof(buf)); +} + +/* convenience wrapper to lock the otp page */ +int rfid_mful_lock_otp(struct rfid_protocol_handle *ph) +{ + return rfid_mful_lock_page(ph, MIFARE_UL_PAGE_OTP); +} diff --git a/librfid_1999/src/rfid_proto_tcl.c b/librfid_1999/src/rfid_proto_tcl.c new file mode 100644 index 0000000..70259e6 --- /dev/null +++ b/librfid_1999/src/rfid_proto_tcl.c @@ -0,0 +1,817 @@ +/* ISO 14443-4 (T=CL) implementation, PCD side. + * + * (C) 2005-2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rfid_iso14443_common.h" + +#define RFID_MAX_FRAMELEN 256 + +#define is_s_block(x) ((x & 0xc0) == 0xc0) +#define is_r_block(x) ((x & 0xc0) == 0x80) +#define is_i_block(x) ((x & 0xc0) == 0x00) + +static enum rfid_frametype l2_to_frame(unsigned int layer2) +{ + switch (layer2) { + case RFID_LAYER2_ISO14443A: + return RFID_14443A_FRAME_REGULAR; + break; + case RFID_LAYER2_ISO14443B: + return RFID_14443B_FRAME_REGULAR; + break; + } + return 0; +} + +static unsigned int sfgi_to_sfgt(struct rfid_protocol_handle *h, + unsigned char sfgi) +{ + unsigned int multiplier; + unsigned int tmp; + + if (sfgi > 14) + sfgi = 14; + + multiplier = 1 << sfgi; /* 2 to the power of sfgi */ + + /* ISO 14443-4:2000(E) Section 5.2.5: + * (256 * 16 / h->l2h->rh->ah->fc) * (2 ^ sfgi) */ + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->l2h->rh->ah->fc) * multiplier; +} + +static unsigned int fwi_to_fwt(struct rfid_protocol_handle *h, + unsigned char fwi) +{ + unsigned int multiplier, tmp; + + if (fwi > 14) + fwi = 14; + + multiplier = 1 << fwi; /* 2 to the power of fwi */ + + /* ISO 14443-4:2000(E) Section 7.2.: + * (256*16 / h->l2h->rh->ah->fc) * (2 ^ fwi) */ + + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->l2h->rh->ah->fc) * multiplier; +} + +/* 4.9seconds as microseconds (4.9 billion seconds) exceeds 2^32 */ +#define activation_fwt(x) (((u_int64_t)1000000 * 65536 / x->l2h->rh->ah->fc)) +#define deactivation_fwt(x) activation_fwt(x) + +static int +tcl_parse_ats(struct rfid_protocol_handle *h, + unsigned char *ats, unsigned int size) +{ + unsigned char len = ats[0]; + unsigned char t0; + unsigned char *cur; + + if (len == 0 || size == 0) + return -1; + + if (size < len) + len = size; + + h->priv.tcl.ta = 0; + + if (len == 1) { + /* FIXME: assume some default values */ + h->priv.tcl.fsc = 32; + h->priv.tcl.ta = 0x80; /* 0x80 (same d for both dirs) */ + h->priv.tcl.sfgt = sfgi_to_sfgt(h, 0); + if (h->l2h->l2->id == RFID_LAYER2_ISO14443A) { + /* Section 7.2: fwi default for type A is 4 */ + h->priv.tcl.fwt = fwi_to_fwt(h, 4); + } else { + /* Section 7.2: fwi for type B is always in ATQB */ + /* Value is assigned in tcl_connect() */ + /* This function is never called for Type B, + * since Type B has no (R)ATS */ + } + return 0; + } + + /* guarateed to be at least 2 bytes in size */ + + t0 = ats[1]; + cur = &ats[2]; + + iso14443_fsdi_to_fsd(&h->priv.tcl.fsc, t0 & 0x0f); + if (h->priv.tcl.fsc > h->l2h->rh->ah->mtu) + h->priv.tcl.fsc = h->l2h->rh->ah->mtu; + + if (t0 & (1 << 4)) { + /* TA is transmitted */ + h->priv.tcl.ta = *cur++; + } + + if (t0 & (1 << 5)) { + /* TB is transmitted */ + h->priv.tcl.sfgt = sfgi_to_sfgt(h, *cur & 0x0f); + h->priv.tcl.fwt = fwi_to_fwt(h, (*cur & 0xf0) >> 4); + cur++; + } + + if (t0 & (1 << 6)) { + /* TC is transmitted */ + if (*cur & 0x01) { + h->priv.tcl.flags |= TCL_HANDLE_F_NAD_SUPPORTED; + DEBUGP("This PICC supports NAD\n"); + } + if (*cur & 0x02) { + h->priv.tcl.flags |= TCL_HANDLE_F_CID_SUPPORTED; + DEBUGP("This PICC supports CID\n"); + } + cur++; + } + + h->priv.tcl.historical_len = (ats+len) - cur; + h->priv.tcl.historical_bytes = cur; + + return 0; +} + + +/* request an ATS from the PICC */ +static int +tcl_request_ats(struct rfid_protocol_handle *h) +{ + int ret; + unsigned char rats[2]; + unsigned char fsdi; + + if (h->priv.tcl.state != TCL_STATE_INITIAL) + return -1; + + ret = iso14443_fsd_to_fsdi(&fsdi, h->priv.tcl.fsd); + if (ret < 0) { + DEBUGP("unable to encode FSD of %u as FSDI\n", h->priv.tcl.fsd); + return ret; + } + + rats[0] = 0xe0; + rats[1] = (h->priv.tcl.cid & 0x0f) | ((fsdi << 4) & 0xf0); + + /* transceive (with CRC) */ + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + rats, 2, h->priv.tcl.ats, + &h->priv.tcl.ats_len, activation_fwt(h), + TCL_TRANSP_F_TX_CRC); + if (ret < 0) { + DEBUGP("transceive of rats failed\n"); + h->priv.tcl.state = TCL_STATE_RATS_SENT; + /* FIXME: retransmit */ + return ret; + } + h->priv.tcl.state = TCL_STATE_ATS_RCVD; + + ret = tcl_parse_ats(h, h->priv.tcl.ats, h->priv.tcl.ats_len); + if (ret < 0) { + DEBUGP("parsing of ats failed\n"); + return ret; + } + + return 0; +} + +#define ATS_TA_DIV_2 1 +#define ATS_TA_DIV_4 2 +#define ATS_TA_DIV_8 4 + +#define PPS_DIV_8 3 +#define PPS_DIV_4 2 +#define PPS_DIV_2 1 +#define PPS_DIV_1 0 +static unsigned char d_to_di(struct rfid_protocol_handle *h, unsigned char D) +{ + static char DI; + unsigned int speed = h->l2h->rh->reader->iso14443a.speed; + + if ((D & ATS_TA_DIV_8) && (speed & RFID_14443A_SPEED_848K)) + DI = PPS_DIV_8; + else if ((D & ATS_TA_DIV_4) && (speed & RFID_14443A_SPEED_424K)) + DI = PPS_DIV_4; + else if ((D & ATS_TA_DIV_2) && (speed & RFID_14443A_SPEED_212K)) + DI = PPS_DIV_2; + else + DI = PPS_DIV_1; + + return DI; +} + +static unsigned int di_to_speed(unsigned char DI) +{ + switch (DI) { + case PPS_DIV_8: + return RFID_14443A_SPEED_848K; + break; + case PPS_DIV_4: + return RFID_14443A_SPEED_424K; + break; + case PPS_DIV_2: + return RFID_14443A_SPEED_212K; + break; + case PPS_DIV_1: + return RFID_14443A_SPEED_106K; + break; + } +} + +/* start a PPS run (autimatically configure highest possible speed */ +static int +tcl_do_pps(struct rfid_protocol_handle *h) +{ + int ret; + unsigned char ppss[3]; + /* FIXME: this stinks like hell. IF we reduce pps_response size to one, + we'll get stack corruption! */ + unsigned char pps_response[10]; + unsigned int rx_len = 1; + unsigned char Dr, Ds, DrI, DsI; + unsigned int speed; + + if (h->priv.tcl.state != TCL_STATE_ATS_RCVD) + return -1; + + Dr = h->priv.tcl.ta & 0x07; + Ds = h->priv.tcl.ta & 0x70 >> 4; + DEBUGP("Dr = 0x%x, Ds = 0x%x\n", Dr, Ds); + + if (Dr != Ds && !(h->priv.tcl.ta & 0x80)) { + /* device supports different divisors for rx and tx, but not + * really ?!? */ + DEBUGP("PICC has contradictory TA, aborting PPS\n"); + return -1; + }; + + /* ISO 14443-4:2000(E) Section 5.3. */ + + ppss[0] = 0xd0 | (h->priv.tcl.cid & 0x0f); + ppss[1] = 0x11; + ppss[2] = 0x00; + + /* FIXME: deal with different speed for each direction */ + DrI = d_to_di(h, Dr); + DsI = d_to_di(h, Ds); + DEBUGP("DrI = 0x%x, DsI = 0x%x\n", DrI, DsI); + + ppss[2] = (ppss[2] & 0xf0) | (DrI | DsI << 2); + + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + ppss, 3, pps_response, &rx_len, + h->priv.tcl.fwt, TCL_TRANSP_F_TX_CRC); + if (ret < 0) + return ret; + + if (pps_response[0] != ppss[0]) { + DEBUGP("PPS Response != PPSS\n"); + return -1; + } + + speed = di_to_speed(DrI); + + ret = rfid_layer2_setopt(h->l2h, RFID_OPT_14443A_SPEED_RX, + &speed, sizeof(speed)); + if (ret < 0) + return ret; + + ret = rfid_layer2_setopt(h->l2h, RFID_OPT_14443A_SPEED_TX, + &speed, sizeof(speed)); + if (ret < 0) + return ret; + + return 0; +} + + +static int +tcl_build_prologue2(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len, + unsigned char pcb) +{ + *prlg_len = 1; + + *prlg = pcb; + + if (!is_s_block(pcb)) { + if (th->toggle) { + /* we've sent a toggle bit last time */ + th->toggle = 0; + } else { + /* we've not sent a toggle last time: send one */ + th->toggle = 1; + *prlg |= 0x01; + } + } + + if (th->flags & TCL_HANDLE_F_CID_USED) { + /* ISO 14443-4:2000(E) Section 7.1.1.2 */ + *prlg |= TCL_PCB_CID_FOLLOWING; + (*prlg_len)++; + prlg[*prlg_len] = th->cid & 0x0f; + } + + /* nad only for I-block */ + if ((th->flags & TCL_HANDLE_F_NAD_USED) && is_i_block(pcb)) { + /* ISO 14443-4:2000(E) Section 7.1.1.3 */ + /* FIXME: in case of chaining only for first frame */ + *prlg |= TCL_PCB_NAD_FOLLOWING; + prlg[*prlg_len] = th->nad; + (*prlg_len)++; + } + + return 0; +} + +static int +tcl_build_prologue_i(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len) +{ + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + return tcl_build_prologue2(th, prlg, prlg_len, 0x02); +} + +static int +tcl_build_prologue_r(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len, + unsigned int nak) +{ + unsigned char pcb = 0xa2; + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + + if (nak) + pcb |= 0x10; + + return tcl_build_prologue2(th, prlg, prlg_len, pcb); +} + +static int +tcl_build_prologue_s(struct tcl_handle *th, + unsigned char *prlg, unsigned int *prlg_len) +{ + /* ISO 14443-4:2000(E) Section 7.1.1.1 */ + + /* the only S-block from PCD->PICC is DESELECT, + * well, actually there is the S(WTX) response. */ + return tcl_build_prologue2(th, prlg, prlg_len, 0xc2); +} + +/* FIXME: WTXM implementation */ + +static int tcl_prlg_len(struct tcl_handle *th) +{ + int prlg_len = 1; + + if (th->flags & TCL_HANDLE_F_CID_USED) + prlg_len++; + + if (th->flags & TCL_HANDLE_F_NAD_USED) + prlg_len++; + + return prlg_len; +} + +#define max_net_tx_framesize(x) (x->fsc - tcl_prlg_len(x)) + +static int +tcl_connect(struct rfid_protocol_handle *h) +{ + int ret; + + if (h->priv.tcl.state != TCL_STATE_DESELECTED && + h->priv.tcl.state != TCL_STATE_INITIAL) + return -1; + + switch (h->l2h->l2->id) { + case RFID_LAYER2_ISO14443A: + /* Start Type A T=CL Activation Sequence */ + ret = tcl_request_ats(h); + if (ret < 0) + return ret; + + /* Only do PPS if any non-default divisors supported */ + if (h->priv.tcl.ta & 0x77) { + ret = tcl_do_pps(h); + if (ret < 0) + return ret; + } + break; + case RFID_LAYER2_ISO14443B: + /* initialized T=CL state from Type B Activation Data */ + h->priv.tcl.cid = h->l2h->priv.iso14443b.cid; + h->priv.tcl.fsc = h->l2h->priv.iso14443b.fsc; + h->priv.tcl.fsd = h->l2h->priv.iso14443b.fsd; + h->priv.tcl.fwt = h->l2h->priv.iso14443b.fwt; + + /* what about ta? sfgt? */ + + if (h->l2h->priv.iso14443b.flags & ISO14443B_CID_SUPPORTED) + h->priv.tcl.flags |= TCL_HANDLE_F_CID_SUPPORTED; + if (h->l2h->priv.iso14443b.flags & ISO14443B_NAD_SUPPORTED) + h->priv.tcl.flags |= TCL_HANDLE_F_NAD_SUPPORTED; + + switch (h->l2h->priv.iso14443b.state) { + case ISO14443B_STATE_SELECTED: + h->priv.tcl.state = TCL_STATE_ATS_RCVD; + break; + case ISO14443B_STATE_ATTRIB_SENT: + h->priv.tcl.state = TCL_STATE_RATS_SENT; + break; + } + + /* PUPI will be presented as ATS/historical bytes */ + memcpy(h->priv.tcl.ats, h->l2h->uid, 4); + h->priv.tcl.ats_len = 4; + h->priv.tcl.historical_bytes = h->priv.tcl.ats; + + break; + default: + DEBUGP("unsupported l2: %u\n", h->l2h->l2->id); + return -1; + break; + } + + h->priv.tcl.state = TCL_STATE_ESTABLISHED; + + return 0; +} + +static int +tcl_deselect(struct rfid_protocol_handle *h) +{ + /* ISO 14443-4:2000(E) Section 8 */ + int ret; + unsigned char frame[3]; /* 3 bytes prologue, no information */ + unsigned char rx[3]; + unsigned int rx_len = sizeof(rx); + unsigned int prlg_len; + struct tcl_handle *th = &h->priv.tcl; + + if (th->state != TCL_STATE_ESTABLISHED) { + /* FIXME: not sure whether deselect is possible here, + * probably better send a HLTA? */ + } + + /* build DESELECT S-block */ + ret = tcl_build_prologue_s(th, frame, &prlg_len); + if (ret < 0) + return ret; + + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, + frame, prlg_len, rx, + &rx_len, deactivation_fwt(h), + TCL_TRANSP_F_TX_CRC); + if (ret < 0) { + /* FIXME: retransmit, HLT(A|B) */ + return ret; + } + + th->state = TCL_STATE_DESELECTED; + + return 0; +} + +struct fr_buff { + unsigned int frame_len; /* length of frame */ + unsigned int hdr_len; /* length of header within frame */ + unsigned char data[RFID_MAX_FRAMELEN]; +}; + +#define frb_payload(x) (x.data + x.hdr_len) + + +/* RFID transceive buffer. */ +struct rfid_xcvb { + struct rfix_xcvb *next; /* next in queue of buffers */ + + u_int64_t timeout; /* timeout to wait for reply */ + struct fr_buff tx; + struct fr_buff rx; + + //struct rfid_protocol_handle *h; /* connection to which we belong */ +}; + +struct tcl_tx_context { + const unsigned char *tx; + unsigned char *rx; + const unsigned char *next_tx_byte; + unsigned char *next_rx_byte; + unsigned int rx_len; + unsigned int tx_len; + struct rfid_protocol_handle *h; +}; + +#define tcl_ctx_todo(ctx) (ctx->tx_len - (ctx->next_tx_byte - ctx->tx)) + +static int +tcl_refill_xcvb(struct rfid_xcvb *xcvb, struct tcl_tx_context *ctx) +{ + struct tcl_handle *th = &ctx->h->priv.tcl; + + if (ctx->next_tx_byte >= ctx->tx + ctx->tx_len) { + DEBUGP("tyring to refill tx xcvb but no data left!\n"); + return -1; + } + + if (tcl_build_prologue_i(th, xcvb->tx.data, + &xcvb->tx.hdr_len) < 0) + return -1; + + if (tcl_ctx_todo(ctx) > th->fsc - xcvb->tx.hdr_len) + xcvb->tx.frame_len = max_net_tx_framesize(th); + else + xcvb->tx.frame_len = tcl_ctx_todo(ctx); + + memcpy(frb_payload(xcvb->tx), ctx->next_tx_byte, + xcvb->tx.frame_len); + + ctx->next_tx_byte += xcvb->tx.frame_len; + + /* check whether we need to set the chaining bit */ + if (ctx->next_tx_byte < ctx->tx + ctx->tx_len) + xcvb->tx.data[0] |= 0x10; + + /* add hdr_len after copying the net payload */ + xcvb->tx.frame_len += xcvb->tx.hdr_len; + + xcvb->timeout = th->fwt; + + return 0; +} + +static void fill_xcvb_wtxm(struct tcl_handle *th, struct rfid_xcvb *xcvb, + unsigned char inf) +{ + /* Acknowledge WTXM */ + tcl_build_prologue_s(th, xcvb->tx.data, &xcvb->tx.hdr_len); + /* set two bits that make this block a wtx */ + xcvb->tx.data[0] |= 0x30; + xcvb->tx.data[xcvb->tx.hdr_len] = inf; + xcvb->tx.frame_len = xcvb->tx.hdr_len+1; + xcvb->timeout = th->fwt * inf; +} + +static int check_cid(struct tcl_handle *th, struct rfid_xcvb *xcvb) +{ + if (xcvb->rx.data[0] & TCL_PCB_CID_FOLLOWING) { + if (xcvb->rx.data[1] != th->cid) { + DEBUGP("CID %u is not valid, we expected %u\n", + xcvb->rx.data[1], th->cid); + return 0; + } + } + return 1; +} + +static int +tcl_transceive(struct rfid_protocol_handle *h, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + unsigned int timeout, unsigned int flags) +{ + int ret; + + struct rfid_xcvb xcvb; + struct tcl_tx_context tcl_ctx; + struct tcl_handle *th = &h->priv.tcl; + + unsigned char ack[10]; + unsigned int ack_len; + + /* initialize context */ + tcl_ctx.next_tx_byte = tcl_ctx.tx = tx_data; + tcl_ctx.next_rx_byte = tcl_ctx.rx = rx_data; + tcl_ctx.rx_len = *rx_len; + tcl_ctx.tx_len = tx_len; + tcl_ctx.h = h; + + /* initialize xcvb */ + xcvb.timeout = th->fwt; + +tx_refill: + if (tcl_refill_xcvb(&xcvb, &tcl_ctx) < 0) { + ret = -1; + goto out; + } + +do_tx: + xcvb.rx.frame_len = sizeof(xcvb.rx.data); + ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id), + xcvb.tx.data, xcvb.tx.frame_len, + xcvb.rx.data, &xcvb.rx.frame_len, + xcvb.timeout, 0); + + DEBUGP("l2 transceive finished\n"); + if (ret < 0) + goto out; + + if (is_r_block(xcvb.rx.data[0])) { + DEBUGP("R-Block\n"); + + if ((xcvb.rx.data[0] & 0x01) != h->priv.tcl.toggle) { + DEBUGP("response with wrong toggle bit\n"); + goto out; + } + + /* Handle ACK frame in case of chaining */ + if (!check_cid(th, &xcvb)) + goto out; + + goto tx_refill; + } else if (is_s_block(xcvb.rx.data[0])) { + unsigned char inf; + unsigned int prlg_len; + + DEBUGP("S-Block\n"); + /* Handle Wait Time Extension */ + + if (!check_cid(th, &xcvb)) + goto out; + + if (xcvb.rx.data[0] & TCL_PCB_CID_FOLLOWING) { + if (xcvb.rx.frame_len < 3) { + DEBUGP("S-Block with CID but short len\n"); + ret = -1; + goto out; + } + inf = xcvb.rx.data[2]; + } else + inf = xcvb.rx.data[1]; + + if ((xcvb.rx.data[0] & 0x30) != 0x30) { + DEBUGP("S-Block but not WTX?\n"); + ret = -1; + goto out; + } + inf &= 0x3f; /* only lower 6 bits code WTXM */ + if (inf == 0 || (inf >= 60 && inf <= 63)) { + DEBUGP("WTXM %u is RFU!\n", inf); + ret = -1; + goto out; + } + + fill_xcvb_wtxm(th, &xcvb, inf); + /* start over with next transceive */ + goto do_tx; + } else if (is_i_block(xcvb.rx.data[0])) { + unsigned int net_payload_len; + /* we're actually receiving payload data */ + + DEBUGP("I-Block: "); + + if ((xcvb.rx.data[0] & 0x01) != h->priv.tcl.toggle) { + DEBUGP("response with wrong toggle bit\n"); + goto out; + } + + xcvb.rx.hdr_len = 1; + + if (!check_cid(th, &xcvb)) + goto out; + + if (xcvb.rx.data[0] & TCL_PCB_CID_FOLLOWING) + xcvb.rx.hdr_len++; + if (xcvb.rx.data[0] & TCL_PCB_NAD_FOLLOWING) + xcvb.rx.hdr_len++; + + net_payload_len = xcvb.rx.frame_len - xcvb.rx.hdr_len; + DEBUGPC("%u bytes\n", net_payload_len); + memcpy(tcl_ctx.next_rx_byte, &xcvb.rx.data[xcvb.rx.hdr_len], + net_payload_len); + tcl_ctx.next_rx_byte += net_payload_len; + + if (xcvb.rx.data[0] & 0x10) { + /* we're not the last frame in the chain, continue rx */ + DEBUGP("not the last frame in the chain, continue\n"); + ack_len = sizeof(ack); + tcl_build_prologue_r(th, xcvb.tx.data, &xcvb.tx.frame_len, 0); + xcvb.timeout = th->fwt; + goto do_tx; + } + } + +out: + *rx_len = tcl_ctx.next_rx_byte - tcl_ctx.rx; + return ret; +} + +static struct rfid_protocol_handle * +tcl_init(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *th; + unsigned int mru = l2h->rh->ah->mru; + + th = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); + if (!th) + return NULL; + + /* FIXME: mru should be attribute of layer2 (in case it adds/removes + * some overhead */ + memset(th, 0, sizeof(struct rfid_protocol_handle)); + + /* maximum received ats length equals mru of asic/reader */ + th->priv.tcl.state = TCL_STATE_INITIAL; + th->priv.tcl.ats_len = mru; + th->priv.tcl.toggle = 1; + + th->priv.tcl.fsd = iso14443_fsd_approx(mru); + + return th; +} + +static int +tcl_fini(struct rfid_protocol_handle *ph) +{ + free_protocol_handle(ph); + return 0; +} + +int +tcl_getopt(struct rfid_protocol_handle *h, int optname, void *optval, + unsigned int *optlen) +{ + u_int8_t *opt_str = optval; + + switch (optname) { + case RFID_OPT_P_TCL_ATS: + if (h->priv.tcl.ats_len < *optlen) + *optlen = h->priv.tcl.ats_len; + memcpy(opt_str, h->priv.tcl.ats, *optlen); + break; + case RFID_OPT_P_TCL_ATS_LEN: + if (*optlen < sizeof(u_int8_t)) + return -E2BIG; + *optlen = sizeof(u_int8_t); + *opt_str = h->priv.tcl.ats_len & 0xff; + break; + default: + return -EINVAL; + } + + return 0; +} + +int +tcl_setopt(struct rfid_protocol_handle *h, int optname, const void *optval, + unsigned int optlen) +{ + int ret = -EINVAL; + + switch (optname) { + default: + break; + } + + return ret; +} + +const struct rfid_protocol rfid_protocol_tcl = { + .id = RFID_PROTOCOL_TCL, + .name = "ISO 14443-4 / T=CL", + .fn = { + .init = &tcl_init, + .open = &tcl_connect, + .transceive = &tcl_transceive, + .close = &tcl_deselect, + .fini = &tcl_fini, + .getopt = &tcl_getopt, + .setopt = &tcl_setopt, + }, +}; diff --git a/librfid_1999/src/rfid_protocol.c b/librfid_1999/src/rfid_protocol.c new file mode 100644 index 0000000..3cbe8af --- /dev/null +++ b/librfid_1999/src/rfid_protocol.c @@ -0,0 +1,152 @@ +/* librfid - layer 4 protocol handler + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include + +#include +#include + +static const struct rfid_protocol *rfid_protocols[] = { + [RFID_PROTOCOL_MIFARE_CLASSIC] = &rfid_protocol_mfcl, + [RFID_PROTOCOL_MIFARE_UL] = &rfid_protocol_mful, + [RFID_PROTOCOL_TCL] = &rfid_protocol_tcl, +}; + +struct rfid_protocol_handle * +rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id) +{ + struct rfid_protocol *p; + struct rfid_protocol_handle *ph = NULL; + + if (id >= ARRAY_SIZE(rfid_protocols)) + return NULL; + + p = rfid_protocols[id]; + + ph = p->fn.init(l2h); + if (!ph) + return NULL; + + ph->proto = p; + ph->l2h = l2h; + + return ph; +} + +int +rfid_protocol_open(struct rfid_protocol_handle *ph) +{ + if (ph->proto->fn.open) + return ph->proto->fn.open(ph); + return 0; +} + +int +rfid_protocol_transceive(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + unsigned int timeout, unsigned int flags) +{ + return ph->proto->fn.transceive(ph, tx_buf, len, rx_buf, rx_len, + timeout, flags); +} + +int +rfid_protocol_read(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *rx_data, + unsigned int *rx_len) +{ + if (ph->proto->fn.read) + return ph->proto->fn.read(ph, page, rx_data, rx_len); + else + return -EINVAL; +} + +int +rfid_protocol_write(struct rfid_protocol_handle *ph, + unsigned int page, + unsigned char *tx_data, + unsigned int tx_len) +{ + if (ph->proto->fn.write) + return ph->proto->fn.write(ph, page, tx_data, tx_len); + else + return -EINVAL; +} + +int rfid_protocol_fini(struct rfid_protocol_handle *ph) +{ + return ph->proto->fn.fini(ph); +} + +int +rfid_protocol_close(struct rfid_protocol_handle *ph) +{ + if (ph->proto->fn.close) + return ph->proto->fn.close(ph); + return 0; +} + +int +rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname, + void *optval, unsigned int *optlen) +{ + if (optname >> 16 == 0) { + unsigned char *optchar = optval; + + switch (optname) { + default: + return -EINVAL; + break; + } + } else { + if (!ph->proto->fn.getopt) + return -EINVAL; + + return ph->proto->fn.getopt(ph, optname, optval, optlen); + } + return 0; +} + +int +rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname, + const void *optval, unsigned int optlen) +{ + if (optname >> 16 == 0) { + switch (optname) { + default: + return -EINVAL; + break; + } + } else { + if (!ph->proto->fn.setopt) + return -EINVAL; + + return ph->proto->fn.setopt(ph, optname, optval, optlen); + } + return 0; +} + +char *rfid_protocol_name(struct rfid_protocol_handle *ph) +{ + return ph->proto->name; +} diff --git a/librfid_1999/src/rfid_reader.c b/librfid_1999/src/rfid_reader.c new file mode 100644 index 0000000..a8e4001 --- /dev/null +++ b/librfid_1999/src/rfid_reader.c @@ -0,0 +1,67 @@ +/* librfid - core reader handling + * (C) 2005-2006 by Harald Welte + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include + +#include +#include +#include +#include + +static const struct rfid_reader *rfid_readers[] = { +#ifdef ENABLE_CM5121 + [RFID_READER_CM5121] = &rfid_reader_cm5121, +#endif + [RFID_READER_OPENPCD] = &rfid_reader_openpcd, +}; + +struct rfid_reader_handle * +rfid_reader_open(void *data, unsigned int id) +{ + const struct rfid_reader *p; + + if (id >= ARRAY_SIZE(rfid_readers)) { + DEBUGP("unable to find matching reader\n"); + return NULL; + } + + p = rfid_readers[id]; + if (!p) + return NULL; + + return p->open(data); +} + +int +rfid_reader_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_buf, unsigned int len, + unsigned char *rx_buf, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return rh->reader->transceive(rh, frametype, tx_buf, len, rx_buf, + rx_len, timeout, flags); +} + +void +rfid_reader_close(struct rfid_reader_handle *rh) +{ + rh->reader->close(rh); +} diff --git a/librfid_1999/src/rfid_reader_cm5121.c b/librfid_1999/src/rfid_reader_cm5121.c new file mode 100644 index 0000000..1514551 --- /dev/null +++ b/librfid_1999/src/rfid_reader_cm5121.c @@ -0,0 +1,392 @@ +/* Omnikey CardMan 5121 specific RC632 transport layer + * + * (C) 2005-2006 by Harald Welte + * + * The 5121 is an Atmel AT89C5122 based USB CCID reader (probably the same + * design like the 3121). It's CL RC632 is connected via address/data bus, + * not via SPI. + * + * The vendor-supplied reader firmware provides some undocumented extensions + * to CCID (via PC_to_RDR_Escape) that allow access to registers and FIFO of + * the RC632. + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ +#include +#include +#include +#include + +#include + +#ifndef LIBRFID_FIRMWARE + +#include +#include +#include +#include +#include +#include + +#include "cm5121_source.h" + +/* FIXME */ +#include "rc632.h" + +#define SENDBUF_LEN 256+7+10 /* 256bytes max FSD/FSC, plus 7 bytes header, + plus 10 bytes reserve */ +#define RECVBUF_LEN SENDBUF_LEN + +//#define DEBUG_REGISTER + +#ifdef DEBUG_REGISTER +#define DEBUGRC DEBUGPC +#define DEBUGR DEBUGP +#else +#define DEBUGRC(x, args ...) do {} while(0) +#define DEBUGR(x, args ...) do {} while(0) +#endif + +static +int Write1ByteToReg(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char rcvbuf[RECVBUF_LEN]; + size_t retlen = RECVBUF_LEN; + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x01; + sndbuf[3] = 0x00; + sndbuf[4] = 0x00; + sndbuf[5] = 0x00; + sndbuf[6] = reg; + sndbuf[7] = value; + + DEBUGR("reg=0x%02x, val=%02x: ", reg, value); + + if (PC_to_RDR_Escape(rath->data, sndbuf, 8, rcvbuf, + &retlen) == 0) { + DEBUGRC("OK\n"); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int Read1ByteFromReg(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[RECVBUF_LEN]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x00; + sndbuf[3] = 0x00; + sndbuf[4] = 0x01; + sndbuf[5] = 0x00; + sndbuf[6] = reg; + + if (PC_to_RDR_Escape(rath->data, sndbuf, 7, recvbuf, + &retlen) == 0) { + *value = recvbuf[1]; + DEBUGR("reg=0x%02x, val=%02x: ", reg, *value); + DEBUGRC("OK\n"); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int ReadNBytesFromFIFO(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[0x7f]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = 0x00; + sndbuf[3] = 0x00; + sndbuf[4] = num_bytes; + sndbuf[5] = 0x00; + sndbuf[6] = 0x02; + + DEBUGR("num_bytes=%u: ", num_bytes); + if (PC_to_RDR_Escape(rath->data, sndbuf, 7, recvbuf, &retlen) == 0) { + DEBUGRC("%u [%s]\n", retlen, + rfid_hexdump(recvbuf+1, num_bytes)); + memcpy(buf, recvbuf+1, num_bytes); // len == 0x7f + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +static int WriteNBytesToFIFO(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + unsigned char sndbuf[SENDBUF_LEN]; + unsigned char recvbuf[0x7f]; + size_t retlen = sizeof(recvbuf); + + sndbuf[0] = 0x20; + sndbuf[1] = 0x00; + sndbuf[2] = len; + sndbuf[3] = 0x00; + sndbuf[4] = 0x00; + sndbuf[5] = flags; + sndbuf[6] = 0x02; + + DEBUGR("%u [%s]: ", len, rfid_hexdump(bytes, len)); + + memcpy(sndbuf+7, bytes, len); + + if (PC_to_RDR_Escape(rath->data, sndbuf, len+7, recvbuf, &retlen) == 0) { + DEBUGRC("OK (%u [%s])\n", retlen, rfid_hexdump(recvbuf, retlen)); + return 0; + } + + DEBUGRC("ERROR\n"); + return -1; +} + +#if 0 +static int TestFIFO(struct rc632_handle *handle) +{ + unsigned char sndbuf[60]; // 0x3c + + // FIXME: repne stosd, call + + memset(sndbuf, 0, sizeof(sndbuf)); + + if (WriteNBytesToFIFO(handle, sizeof(sndbuf), sndbuf, 0) < 0) + return -1; + + return ReadNBytesFromFIFO(handle, sizeof(sndbuf), sndbuf); +} +#endif + +static int cm5121_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return rh->ah->asic->priv.rc632.fn.transceive(rh->ah, frametype, + tx_data, tx_len, rx_data, + rx_len, timeout, flags); +} + +static int cm5121_transceive_sf(struct rfid_reader_handle *rh, + unsigned char cmd, struct iso14443a_atqa *atqa) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_sf(rh->ah, + cmd, + atqa); +} + +static int +cm5121_transceive_acf(struct rfid_reader_handle *rh, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_acf(rh->ah, + cmd, bit_of_col); +} + +static int +cm5121_14443a_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.init(rh->ah); +} + +static int +cm5121_14443a_set_speed(struct rfid_reader_handle *rh, + unsigned int tx, + unsigned int speed) +{ + u_int8_t rate; + + DEBUGP("setting rate: "); + switch (speed) { + case RFID_14443A_SPEED_106K: + rate = 0x00; + DEBUGPC("106K\n"); + break; + case RFID_14443A_SPEED_212K: + rate = 0x01; + DEBUGPC("212K\n"); + break; + case RFID_14443A_SPEED_424K: + rate = 0x02; + DEBUGPC("424K\n"); + break; + case RFID_14443A_SPEED_848K: + rate = 0x03; + DEBUGPC("848K\n"); + break; + default: + DEBUGPC("invalid\n"); + return -EINVAL; + break; + } + return rh->ah->asic->priv.rc632.fn.iso14443a.set_speed(rh->ah, + tx, rate); +} + +static int +cm5121_14443b_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso14443b.init(rh->ah); +} + +static int +cm5121_15693_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso15693.init(rh->ah); +} + +static int +cm5121_mifare_setkey(struct rfid_reader_handle *rh, const u_int8_t *key) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.setkey(rh->ah, key); +} + +static int +cm5121_mifare_auth(struct rfid_reader_handle *rh, u_int8_t cmd, + u_int32_t serno, u_int8_t block) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.auth(rh->ah, + cmd, serno, block); +} + +struct rfid_asic_transport cm5121_ccid = { + .name = "CM5121 OpenCT", + .priv.rc632 = { + .fn = { + .reg_write = &Write1ByteToReg, + .reg_read = &Read1ByteFromReg, + .fifo_write = &WriteNBytesToFIFO, + .fifo_read = &ReadNBytesFromFIFO, + }, + }, +}; + +static int cm5121_enable_rc632(struct rfid_asic_transport_handle *rath) +{ + unsigned char tx_buf[1] = { 0x01 }; + unsigned char rx_buf[64]; + size_t rx_len = sizeof(rx_buf); + + PC_to_RDR_Escape(rath->data, tx_buf, 1, rx_buf, &rx_len); + + return 0; +} + +static struct rfid_reader_handle * +cm5121_open(void *data) +{ + struct rfid_reader_handle *rh; + struct rfid_asic_transport_handle *rath; + + rh = malloc_reader_handle(sizeof(*rh)); + if (!rh) + return NULL; + memset(rh, 0, sizeof(*rh)); + + rath = malloc_rat_handle(sizeof(*rath)); + if (!rath) + goto out_rh; + memset(rath, 0, sizeof(*rath)); + + rath->rat = &cm5121_ccid; + rh->reader = &rfid_reader_cm5121; + + if (cm5121_source_init(rath) < 0) + goto out_rath; + + if (cm5121_enable_rc632(rath) < 0) + goto out_rath; + + rh->ah = rc632_open(rath); + if (!rh->ah) + goto out_rath; + + DEBUGP("returning %p\n", rh); + return rh; + +out_rath: + free_rat_handle(rath); +out_rh: + free_reader_handle(rh); + + return NULL; +} + +static void +cm5121_close(struct rfid_reader_handle *rh) +{ + struct rfid_asic_transport_handle *rath = rh->ah->rath; + rc632_close(rh->ah); + free_rat_handle(rath); + free_reader_handle(rh); +} + +const struct rfid_reader rfid_reader_cm5121 = { + .name = "Omnikey CardMan 5121 RFID", + .open = &cm5121_open, + .close = &cm5121_close, + .transceive = &cm5121_transceive, + .l2_supported = (1 << RFID_LAYER2_ISO14443A) | + (1 << RFID_LAYER2_ISO14443B) | + (1 << RFID_LAYER2_ISO15693), + .proto_supported = (1 << RFID_PROTOCOL_TCL) | + (1 << RFID_PROTOCOL_MIFARE_UL) | + (1 << RFID_PROTOCOL_MIFARE_CLASSIC), + .iso14443a = { + .init = &cm5121_14443a_init, + .transceive_sf = &cm5121_transceive_sf, + .transceive_acf = &cm5121_transceive_acf, + .speed = RFID_14443A_SPEED_106K | RFID_14443A_SPEED_212K | + RFID_14443A_SPEED_424K, //| RFID_14443A_SPEED_848K, + .set_speed = &cm5121_14443a_set_speed, + }, + .iso14443b = { + .init = &cm5121_14443b_init, + }, + .iso15693 = { + .init = &cm5121_15693_init, + }, + .mifare_classic = { + .setkey = &cm5121_mifare_setkey, + .auth = &cm5121_mifare_auth, + }, +}; + +#endif /* LIBRFID_FIRMWARE */ diff --git a/librfid_1999/src/rfid_reader_cm5121_openct.c b/librfid_1999/src/rfid_reader_cm5121_openct.c new file mode 100644 index 0000000..244ecee --- /dev/null +++ b/librfid_1999/src/rfid_reader_cm5121_openct.c @@ -0,0 +1,54 @@ +/* CM5121 backend for OpenCT virtual slot */ + +#include + +#include +#include + +/* FIXME: get rid of this global crap. In fact this needs to become part of + * struct rfid_reader_handle */ +static ct_lock_handle lock; +static int slot = 1; + +/* this is the sole function required by rfid_reader_cm5121.c */ +int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, size_t tx_len, + unsigned char *rx_buf, size_t *rx_len) +{ + int rc; + ct_handle *h = (ct_handle *) handle; + + rc = ct_card_transact(h, 1, tx_buf, tx_len, rx_buf, *rx_len); + if (rc >= 0) { + *rx_len = rc; + return 0; + } + + return rc; +} + + +int cm5121_source_init(struct rfid_asic_transport_handle *rath) +{ + struct ct_handle *h; + int rc; + unsigned char atr[64]; + + h = ct_reader_connect(0); + if (!h) + return -1; + + rc = ct_card_lock(h, slot, IFD_LOCK_EXCLUSIVE, &lock); + if (rc < 0) + return -1; + + rc = ct_card_reset(h, slot, atr, sizeof(atr)); + if (rc < 0) + return -1; + + rath->data = h; + + return 0; +} + diff --git a/librfid_1999/src/rfid_reader_openpcd.c b/librfid_1999/src/rfid_reader_openpcd.c new file mode 100644 index 0000000..b885d9f --- /dev/null +++ b/librfid_1999/src/rfid_reader_openpcd.c @@ -0,0 +1,563 @@ +/* OpenPCD specific RC632 transport layer + * + * (C) 2006 by Harald Welte + * + * The OpenPCD is an Atmel AT91SAM7Sxx based USB RFID reader. + * It's CL RC632 is connected via SPI. OpenPCD has multiple firmware + * images. This driver is for the "main_dumbreader" firmware. + * + * TODO: + * - put hdl from static variable into asic transport or reader handle + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* FIXME */ +#include "rc632.h" + +#define SENDBUF_LEN (256+4+10) /* 256bytes max FSD/FSC, plus 4 bytes header, + plus 10 bytes reserve */ +#define RECVBUF_LEN SENDBUF_LEN + +static char snd_buf[SENDBUF_LEN]; +static char rcv_buf[RECVBUF_LEN]; +static struct openpcd_hdr *snd_hdr; +static struct openpcd_hdr *rcv_hdr; + +#ifndef LIBRFID_FIRMWARE + +#ifdef __MINGW32__ +#include "libusb_dyn.h" +#else /*__MINGW32__*/ +#include +#endif/*__MINGW32__*/ + +static struct usb_device *dev; +static struct usb_dev_handle *hdl; + +static int openpcd_send_command(u_int8_t cmd, u_int8_t reg, u_int8_t val, + u_int16_t len, const unsigned char *data) +{ + int ret; + u_int16_t cur; + + snd_hdr->cmd = cmd; + snd_hdr->reg = reg; + snd_hdr->val = val; + snd_hdr->flags = OPENPCD_FLAG_RESPOND; + if (data && len) + memcpy(snd_hdr->data, data, len); + + cur = sizeof(*snd_hdr) + len; + + return usb_bulk_write(hdl, OPENPCD_OUT_EP, (char *)snd_hdr, cur, 1000); +} + +static int openpcd_recv_reply(void) +{ + int ret; + + ret = usb_bulk_read(hdl, OPENPCD_IN_EP, rcv_buf, sizeof(rcv_buf), 1000); + + return ret; +} + +static int openpcd_xcv(u_int8_t cmd, u_int8_t reg, u_int8_t val, + u_int16_t len, const unsigned char *data) +{ + int ret; + + ret = openpcd_send_command(cmd, reg, val, len, data); + if (ret < 0) + return ret; + if (ret < sizeof(struct openpcd_hdr)) + return -EINVAL; + + return openpcd_recv_reply(); +} + +struct usb_id { + u_int16_t vid; + u_int16_t pid; +}; + +static const struct usb_id opcd_usb_ids[] = { + { .vid = 0x2342, .pid = 0x0001 }, /* prototypes */ + { .vid = 0x16c0, .pid = 0x076b }, /* first official device id */ +}; + +static struct usb_device *find_opcd_device(void) +{ + struct usb_bus *bus; + + for (bus = usb_get_busses(); bus; bus = bus->next) { + struct usb_device *dev; + for (dev = bus->devices; dev; dev = dev->next) { + int i; + for (i = 0; i < ARRAY_SIZE(opcd_usb_ids); i++) { + const struct usb_id *id = &opcd_usb_ids[i]; + if (dev->descriptor.idVendor == id->vid && + dev->descriptor.idProduct == id->pid) + return dev; + } + } + } + return NULL; +} + +/* RC632 access primitives for librfid inside reader firmware */ + +static int openpcd_reg_write(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + int ret; + + DEBUGP("reg=0x%02x, val=%02x: ", reg, value); + + ret = openpcd_xcv(OPENPCD_CMD_WRITE_REG, reg, value, 0, NULL); + if (ret < 0) + DEBUGPC("ERROR sending command\n"); + else + DEBUGPC("OK\n"); + + return ret; +} + +static int openpcd_reg_read(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + int ret; + + DEBUGP("reg=0x%02x, ", reg); + + ret = openpcd_xcv(OPENPCD_CMD_READ_REG, reg, 0, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command\n"); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGPC("ERROR: short packet\n"); + return ret; + } + + *value = rcv_hdr->val; + DEBUGPC("val=%02x: OK\n", *value); + + return ret; +} + +static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + int ret; + + DEBUGP(" "); + + ret = openpcd_xcv(OPENPCD_CMD_READ_FIFO, 0x00, num_bytes, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command\n"); + return ret; + } + DEBUGPC("ret = %d\n", ret); + + memcpy(buf, rcv_hdr->data, ret - sizeof(struct openpcd_hdr)); + DEBUGPC("len=%d val=%s: OK\n", ret - sizeof(struct openpcd_hdr), + rfid_hexdump(rcv_hdr->data, ret - sizeof(struct openpcd_hdr))); + + return ret; +} + +static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + int ret; + + DEBUGP("len=%u, data=%s\n", len, rfid_hexdump(bytes, len)); + ret = openpcd_xcv(OPENPCD_CMD_WRITE_FIFO, 0, 0, len, bytes); + + return ret; +} + +const struct rfid_asic_transport openpcd_rat = { + .name = "OpenPCD Dumb USB Protocol", + .priv.rc632 = { + .fn = { + .reg_write = &openpcd_reg_write, + .reg_read = &openpcd_reg_read, + .fifo_write = &openpcd_fifo_write, + .fifo_read = &openpcd_fifo_read, + }, + }, +}; + +static int openpcd_get_api_version(struct rfid_reader_handle *rh, u_int8_t *version) +{ + int ret; + + // preset version result to zero + rcv_hdr->val=0; + + ret = openpcd_xcv(OPENPCD_CMD_GET_API_VERSION, 0, 0, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n", ret); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGPC("ERROR: short packet [%i]\n", ret); + return -EINVAL; + } + + *version = rcv_hdr->val; + + return ret; +} + +static int openpcd_get_environment( + struct rfid_reader_handle *rh, + unsigned char num_bytes, + unsigned char *buf) +{ + int ret; + + DEBUGP(" "); + + ret = openpcd_xcv(OPENPCD_CMD_GET_ENVIRONMENT, 0x00, num_bytes, 0, NULL); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n",ret); + return ret; + } + DEBUGPC("ret = %d\n", ret); + + memcpy(buf, rcv_hdr->data, ret - sizeof(struct openpcd_hdr)); + DEBUGPC("len=%d val=%s: OK\n", ret - sizeof(struct openpcd_hdr), + rfid_hexdump(rcv_hdr->data, ret - sizeof(struct openpcd_hdr))); + + return ret; +} + +static int openpcd_set_environment( + struct rfid_reader_handle *rh, + const unsigned char num_bytes, + unsigned char *buf) +{ + int ret; + + ret = openpcd_xcv(OPENPCD_CMD_SET_ENVIRONMENT, 0, 0, num_bytes, buf); + if (ret < 0) { + DEBUGPC("ERROR sending command [%i]\n",ret); + return ret; + } + + if (ret < sizeof(struct openpcd_hdr)) { + DEBUGPC("ERROR: short packet [%i]\n", ret); + return -EINVAL; + } + + return rcv_hdr->val; +} + +static int openpcd_reset(struct rfid_reader_handle *rh) +{ + int ret; + + DEBUGP("reset "); + ret = openpcd_xcv(OPENPCD_CMD_RESET, 0, 0, 0, 0); + + return ret; +} + +#else +/* RC632 access primitives for librfid inside reader firmware */ + +static int openpcd_reg_write(struct rfid_asic_transport_handle *rath, + unsigned char reg, unsigned char value) +{ + return opcd_rc632_reg_write(rath, reg, value); +} + +static int openpcd_reg_read(struct rfid_asic_transport_handle *rath, + unsigned char reg, + unsigned char *value) +{ + return opcd_rc632_reg_read(rath, reg, value); +} + + +static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath, + unsigned char num_bytes, + unsigned char *buf) +{ + return opcd_rc632_fifo_read(rath, num_bytes, buf); +} + +static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath, + unsigned char len, + const unsigned char *bytes, + unsigned char flags) +{ + return opcd_rc632_fifo_write(rath, len, bytes, flags); +} + +const struct rfid_asic_transport openpcd_rat = { + .name = "OpenPCD Firmware RC632 Access", + .priv.rc632 = { + .fn = { + .reg_write = &openpcd_reg_write, + .reg_read = &openpcd_reg_read, + .fifo_write = &openpcd_fifo_write, + .fifo_read = &openpcd_fifo_read, + }, + }, +}; + +#endif /* LIBRFID_FIRMWARE */ + +static int openpcd_transceive(struct rfid_reader_handle *rh, + enum rfid_frametype frametype, + const unsigned char *tx_data, unsigned int tx_len, + unsigned char *rx_data, unsigned int *rx_len, + u_int64_t timeout, unsigned int flags) +{ + return rh->ah->asic->priv.rc632.fn.transceive(rh->ah, frametype, + tx_data, tx_len, + rx_data, rx_len, + timeout, flags); +} + +static int openpcd_transceive_sf(struct rfid_reader_handle *rh, + unsigned char cmd, struct iso14443a_atqa *atqa) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_sf(rh->ah, + cmd, + atqa); +} + +static int +openpcd_transceive_acf(struct rfid_reader_handle *rh, + struct iso14443a_anticol_cmd *cmd, + unsigned int *bit_of_col) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_acf(rh->ah, + cmd, bit_of_col); +} + +static int +openpcd_14443a_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso14443a.init(rh->ah); +} + +static int +openpcd_14443a_set_speed(struct rfid_reader_handle *rh, + unsigned int tx, + unsigned int speed) +{ + u_int8_t rate; + + DEBUGP("setting rate: "); + switch (speed) { + case RFID_14443A_SPEED_106K: + rate = 0x00; + DEBUGPC("106K\n"); + break; + case RFID_14443A_SPEED_212K: + rate = 0x01; + DEBUGPC("212K\n"); + break; + case RFID_14443A_SPEED_424K: + rate = 0x02; + DEBUGPC("424K\n"); + break; + case RFID_14443A_SPEED_848K: + rate = 0x03; + DEBUGPC("848K\n"); + break; + default: + return -EINVAL; + break; + } + return rh->ah->asic->priv.rc632.fn.iso14443a.set_speed(rh->ah, + tx, rate); +} + +static int +openpcd_14443b_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso14443b.init(rh->ah); +} + +static int +openpcd_15693_init(struct rfid_reader_handle *rh) +{ + return rh->ah->asic->priv.rc632.fn.iso15693.init(rh->ah); +} + +static int +openpcd_mifare_setkey(struct rfid_reader_handle *rh, const u_int8_t *key) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.setkey(rh->ah, key); +} + +static int +openpcd_mifare_auth(struct rfid_reader_handle *rh, u_int8_t cmd, + u_int32_t serno, u_int8_t block) +{ + return rh->ah->asic->priv.rc632.fn.mifare_classic.auth(rh->ah, + cmd, serno, block); +} + +static struct rfid_reader_handle * +openpcd_open(void *data) +{ + struct rfid_reader_handle *rh; + struct rfid_asic_transport_handle *rath; + + snd_hdr = (struct openpcd_hdr *)snd_buf; + rcv_hdr = (struct openpcd_hdr *)rcv_buf; + +#ifndef LIBRFID_FIRMWARE + usb_init(); + if (usb_find_busses() < 0) + return NULL; + if (usb_find_devices() < 0) + return NULL; + + dev = find_opcd_device(); + if (!dev) { + DEBUGP("No matching USB device found\n"); + return NULL; + } + + hdl = usb_open(dev); + if (!hdl) { + DEBUGP("Can't open USB device\n"); + return NULL; + } + + if(usb_set_configuration(hdl, 1 ) < 0) + { + DEBUGP("setting config failed\n"); + usb_close( hdl ); + return NULL; + } + + if (usb_claim_interface(hdl, 0) < 0) { + DEBUGP("Can't claim interface\n"); + usb_close(hdl); + return NULL; + } +#endif + + rh = malloc_reader_handle(sizeof(*rh)); + if (!rh) + return NULL; + memset(rh, 0, sizeof(*rh)); + + rath = malloc_rat_handle(sizeof(*rath)); + if (!rath) + goto out_rh; + memset(rath, 0, sizeof(*rath)); + + rath->rat = &openpcd_rat; + rh->reader = &rfid_reader_openpcd; + + rh->ah = rc632_open(rath); + if (!rh->ah) + goto out_rath; + + DEBUGP("returning %p\n", rh); + return rh; + +out_rath: + free_rat_handle(rath); +out_rh: + free_reader_handle(rh); + + return NULL; +} + +static void +openpcd_close(struct rfid_reader_handle *rh) +{ + struct rfid_asic_transport_handle *rath = rh->ah->rath; + + rc632_close(rh->ah); + free_rat_handle(rath); + free_reader_handle(rh); + +#ifndef LIBRFID_FIRMWARE + usb_close(hdl); +#endif +} + +const struct rfid_reader rfid_reader_openpcd = { + .name = "OpenPCD RFID Reader", + .id = RFID_READER_OPENPCD, + .open = &openpcd_open, + .close = &openpcd_close, + +#ifndef LIBRFID_FIRMWARE + .get_api_version = &openpcd_get_api_version, + .get_environment = &openpcd_get_environment, + .set_environment = &openpcd_set_environment, + .reset = &openpcd_reset, +#endif + + .transceive = &openpcd_transceive, + .l2_supported = (1 << RFID_LAYER2_ISO14443A) | + (1 << RFID_LAYER2_ISO14443B) | + (1 << RFID_LAYER2_ISO15693), + .proto_supported = (1 << RFID_PROTOCOL_TCL) | + (1 << RFID_PROTOCOL_MIFARE_UL) | + (1 << RFID_PROTOCOL_MIFARE_CLASSIC), + .iso14443a = { + .init = &openpcd_14443a_init, + .transceive_sf = &openpcd_transceive_sf, + .transceive_acf = &openpcd_transceive_acf, + .speed = RFID_14443A_SPEED_106K | RFID_14443A_SPEED_212K | + RFID_14443A_SPEED_424K, //| RFID_14443A_SPEED_848K, + .set_speed = &openpcd_14443a_set_speed, + }, + .iso14443b = { + .init = &openpcd_14443b_init, + }, + .iso15693 = { + .init = &openpcd_15693_init, + }, + .mifare_classic = { + .setkey = &openpcd_mifare_setkey, + .auth = &openpcd_mifare_auth, + }, +}; diff --git a/librfid_1999/src/rfid_scan.c b/librfid_1999/src/rfid_scan.c new file mode 100644 index 0000000..b19887e --- /dev/null +++ b/librfid_1999/src/rfid_scan.c @@ -0,0 +1,115 @@ +/* RFID scanning implementation + * + * (C) 2006 by Harald Welte + * + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include + +static struct rfid_layer2_handle * +rfid_layer2_scan1(struct rfid_reader_handle *rh, int l2) +{ + struct rfid_layer2_handle *l2h; + + if (rh->reader->l2_supported & (1 << l2)) { + l2h = rfid_layer2_init(rh, l2); + if (!l2h) + return NULL; + if (rfid_layer2_open(l2h) < 0) { + rfid_layer2_fini(l2h); + return NULL; + } else + return l2h; + } + + return NULL; +} + +struct rfid_layer2_handle * +rfid_layer2_scan(struct rfid_reader_handle *rh) +{ + struct rfid_layer2_handle *l2h; + int i; + +#define RFID_LAYER2_MAX 16 + for (i = 0; i < RFID_LAYER2_MAX; i++) { + DEBUGP("testing l2 %u\n", i); + l2h = rfid_layer2_scan1(rh, i); + if (l2h) + return l2h; + } + + return NULL; +} + +static struct rfid_protocol_handle * +rfid_protocol_scan1(struct rfid_layer2_handle *l2h, int proto) +{ + struct rfid_protocol_handle *ph; + + if (l2h->rh->reader->proto_supported & (1 << proto) && + l2h->proto_supported & (1 << proto)) { + ph = rfid_protocol_init(l2h, proto); + if (!ph) + return NULL; + if (rfid_protocol_open(ph) < 0) { + rfid_protocol_fini(ph); + return NULL; + } else + return ph; + } + + return NULL; +} + +struct rfid_protocol_handle * +rfid_protocol_scan(struct rfid_layer2_handle *l2h) +{ + struct rfid_protocol_handle *ph; + int i; + +#define RFID_PROTOCOL_MAX 16 + for (i = 0; i < RFID_PROTOCOL_MAX; i++) { + DEBUGP("testing proto %u\n", i); + ph = rfid_protocol_scan1(l2h, i); + if (ph) + return ph; + } + + return NULL; +} + +/* Scan for any RFID transponder within range of the given reader. + * Abort after the first successfully found transponder. */ +int rfid_scan(struct rfid_reader_handle *rh, + struct rfid_layer2_handle **l2h, + struct rfid_protocol_handle **ph) +{ + *l2h = rfid_layer2_scan(rh); + if (!*l2h) + return 0; + + *ph = rfid_protocol_scan(*l2h); + if (!*ph) + return 2; + + return 3; +} diff --git a/librfid_1999/src/usleep.c b/librfid_1999/src/usleep.c new file mode 100644 index 0000000..9f76bcb --- /dev/null +++ b/librfid_1999/src/usleep.c @@ -0,0 +1,30 @@ +#include +#include + +void usleep(unsigned long usec) +{ + int msec; + + msec=usec/1000; + usec=usec%1000; + + if(msec) + { + if(usec) + msec++; + } + else + { + LARGE_INTEGER current,freq,end; + + QueryPerformanceFrequency(&freq); + QueryPerformanceCounter(&end); + + end.QuadPart+=(freq.QuadPart*usec)/1000000; + while(QueryPerformanceCounter(¤t) && (current.QuadPart<=end.QuadPart)) + { + } + } + + Sleep(msec); +} diff --git a/librfid_1999/src/usleep.h b/librfid_1999/src/usleep.h new file mode 100644 index 0000000..c23bae0 --- /dev/null +++ b/librfid_1999/src/usleep.h @@ -0,0 +1,6 @@ +#ifndef __USLEEP_H__ +#define __USLEEP_H__ + +void usleep(unsigned long usec); + +#endif/*__USLEEP_H__*/ diff --git a/librfid_1999/utils/Makefile.am b/librfid_1999/utils/Makefile.am new file mode 100644 index 0000000..598a6ea --- /dev/null +++ b/librfid_1999/utils/Makefile.am @@ -0,0 +1,25 @@ +INCLUDES = $(all_includes) -I$(top_srcdir)/include + +if ENABLE_FIRMWARE +else +bin_PROGRAMS = librfid-tool mifare-tool librfid-send_script + +noinst_HEADERS = librfid-tool.h + +librfid_tool_SOURCES = librfid-tool.c common.c +librfid_tool_LDADD = ../src/librfid.la + +librfid_send_script_SOURCES= send_script.c +librfid_send_script_LDADD = ../src/librfid.la + +mifare_tool_SOURCES = mifare-tool.c common.c +mifare_tool_LDADD = ../src/librfid.la + +if ENABLE_WIN32 +LINKOPTS = -dynamic -mno-cygwin +librfid_send_script_LDFLAGS = $(LINKOPTS) +librfid_tool_LDFLAGS = $(LINKOPTS) +mifare_tool_LDFLAGS = $(LINKOPTS) +endif + +endif diff --git a/librfid_1999/utils/Makefile.in b/librfid_1999/utils/Makefile.in new file mode 100644 index 0000000..985e2a6 --- /dev/null +++ b/librfid_1999/utils/Makefile.in @@ -0,0 +1,563 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +@ENABLE_FIRMWARE_FALSE@bin_PROGRAMS = librfid-tool$(EXEEXT) \ +@ENABLE_FIRMWARE_FALSE@ mifare-tool$(EXEEXT) \ +@ENABLE_FIRMWARE_FALSE@ librfid-send_script$(EXEEXT) +subdir = utils +DIST_COMMON = $(am__noinst_HEADERS_DIST) $(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 = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__librfid_send_script_SOURCES_DIST = send_script.c +@ENABLE_FIRMWARE_FALSE@am_librfid_send_script_OBJECTS = \ +@ENABLE_FIRMWARE_FALSE@ send_script.$(OBJEXT) +librfid_send_script_OBJECTS = $(am_librfid_send_script_OBJECTS) +@ENABLE_FIRMWARE_FALSE@librfid_send_script_DEPENDENCIES = \ +@ENABLE_FIRMWARE_FALSE@ ../src/librfid.la +librfid_send_script_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_send_script_LDFLAGS) $(LDFLAGS) -o $@ +am__librfid_tool_SOURCES_DIST = librfid-tool.c common.c +@ENABLE_FIRMWARE_FALSE@am_librfid_tool_OBJECTS = \ +@ENABLE_FIRMWARE_FALSE@ librfid-tool.$(OBJEXT) common.$(OBJEXT) +librfid_tool_OBJECTS = $(am_librfid_tool_OBJECTS) +@ENABLE_FIRMWARE_FALSE@librfid_tool_DEPENDENCIES = ../src/librfid.la +librfid_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librfid_tool_LDFLAGS) $(LDFLAGS) -o $@ +am__mifare_tool_SOURCES_DIST = mifare-tool.c common.c +@ENABLE_FIRMWARE_FALSE@am_mifare_tool_OBJECTS = mifare-tool.$(OBJEXT) \ +@ENABLE_FIRMWARE_FALSE@ common.$(OBJEXT) +mifare_tool_OBJECTS = $(am_mifare_tool_OBJECTS) +@ENABLE_FIRMWARE_FALSE@mifare_tool_DEPENDENCIES = ../src/librfid.la +mifare_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(mifare_tool_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librfid_send_script_SOURCES) $(librfid_tool_SOURCES) \ + $(mifare_tool_SOURCES) +DIST_SOURCES = $(am__librfid_send_script_SOURCES_DIST) \ + $(am__librfid_tool_SOURCES_DIST) \ + $(am__mifare_tool_SOURCES_DIST) +am__noinst_HEADERS_DIST = librfid-tool.h +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = $(all_includes) -I$(top_srcdir)/include +@ENABLE_FIRMWARE_FALSE@noinst_HEADERS = librfid-tool.h +@ENABLE_FIRMWARE_FALSE@librfid_tool_SOURCES = librfid-tool.c common.c +@ENABLE_FIRMWARE_FALSE@librfid_tool_LDADD = ../src/librfid.la +@ENABLE_FIRMWARE_FALSE@librfid_send_script_SOURCES = send_script.c +@ENABLE_FIRMWARE_FALSE@librfid_send_script_LDADD = ../src/librfid.la +@ENABLE_FIRMWARE_FALSE@mifare_tool_SOURCES = mifare-tool.c common.c +@ENABLE_FIRMWARE_FALSE@mifare_tool_LDADD = ../src/librfid.la +@ENABLE_FIRMWARE_FALSE@@ENABLE_WIN32_TRUE@LINKOPTS = -dynamic -mno-cygwin +@ENABLE_FIRMWARE_FALSE@@ENABLE_WIN32_TRUE@librfid_send_script_LDFLAGS = $(LINKOPTS) +@ENABLE_FIRMWARE_FALSE@@ENABLE_WIN32_TRUE@librfid_tool_LDFLAGS = $(LINKOPTS) +@ENABLE_FIRMWARE_FALSE@@ENABLE_WIN32_TRUE@mifare_tool_LDFLAGS = $(LINKOPTS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu utils/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +librfid-send_script$(EXEEXT): $(librfid_send_script_OBJECTS) $(librfid_send_script_DEPENDENCIES) + @rm -f librfid-send_script$(EXEEXT) + $(librfid_send_script_LINK) $(librfid_send_script_OBJECTS) $(librfid_send_script_LDADD) $(LIBS) +librfid-tool$(EXEEXT): $(librfid_tool_OBJECTS) $(librfid_tool_DEPENDENCIES) + @rm -f librfid-tool$(EXEEXT) + $(librfid_tool_LINK) $(librfid_tool_OBJECTS) $(librfid_tool_LDADD) $(LIBS) +mifare-tool$(EXEEXT): $(mifare_tool_OBJECTS) $(mifare_tool_DEPENDENCIES) + @rm -f mifare-tool$(EXEEXT) + $(mifare_tool_LINK) $(mifare_tool_OBJECTS) $(mifare_tool_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librfid-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifare-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send_script.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +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-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +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 + +.MAKE: install-am install-strip + +.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-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + 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 + + +# 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: diff --git a/librfid_1999/utils/common.c b/librfid_1999/utils/common.c new file mode 100644 index 0000000..b286af6 --- /dev/null +++ b/librfid_1999/utils/common.c @@ -0,0 +1,125 @@ +#include +#include +#include +#include +#include +//#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "librfid-tool.h" +#include "common.h" + +const char * +hexdump(const void *data, unsigned int len) +{ + static char string[1024]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; len--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } + return string; +} + +static char parse_hexdigit(const char hexdigit) +{ + if (hexdigit <= '9' && hexdigit >= '0') + return hexdigit - '0'; + if (hexdigit <= 'f' && hexdigit >= 'a') + return 10 + (hexdigit - 'a'); + + return 0; +} + +int +hexread(unsigned char *result, const unsigned char *in, unsigned int len) +{ + const unsigned char *pos; + char dig1, dig2; + unsigned char *res = result; + + for (pos = in; pos-in <= len-2; pos+=2) { + if (*pos == ':') { + pos++; + continue; + } + dig1 = *pos; + dig2 = *(pos+1); + + *res++ = parse_hexdigit(dig1) << 4 | parse_hexdigit(dig2); + } + + return (res - result); +} + +struct rfid_reader_handle *rh; +struct rfid_layer2_handle *l2h; +struct rfid_protocol_handle *ph; + +int reader_init(void) +{ + printf("opening reader handle\n"); + rh = rfid_reader_open(NULL, RFID_READER_CM5121); + if (!rh) { + fprintf(stderr, "No Omnikey Cardman 5121 found\n"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if (!rh) { + fprintf(stderr, "No OpenPCD found either\n"); + return -1; + } + } + return 0; +} + +int l2_init(int layer2) +{ + int rc; + + printf("opening layer2 handle\n"); + l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + fprintf(stderr, "error during iso14443a_init\n"); + return -1; + } + + printf("running layer2 anticol\n"); + rc = rfid_layer2_open(l2h); + if (rc < 0) { + fprintf(stderr, "error during layer2_open\n"); + return rc; + } + + return 0; +} + +int l3_init(int protocol) +{ + printf("running layer3 (ats)\n"); + ph = rfid_protocol_init(l2h, protocol); + if (!ph) { + fprintf(stderr, "error during protocol_init\n"); + return -1; + } + if (rfid_protocol_open(ph) < 0) { + fprintf(stderr, "error during protocol_open\n"); + return -1; + } + + printf("we now have layer3 up and running\n"); + + return 0; +} + diff --git a/librfid_1999/utils/common.h b/librfid_1999/utils/common.h new file mode 100644 index 0000000..3dd4cf4 --- /dev/null +++ b/librfid_1999/utils/common.h @@ -0,0 +1,7 @@ +#ifndef __COMMON_H__ +#define __COMMON_H__ + +extern const char * hexdump(const void *data, unsigned int len); +extern int hexread(unsigned char *result, const unsigned char *in, unsigned int len); + +#endif/*__COMMON_H__*/ diff --git a/librfid_1999/utils/librfid-tool.c b/librfid_1999/utils/librfid-tool.c new file mode 100644 index 0000000..020b837 --- /dev/null +++ b/librfid_1999/utils/librfid-tool.c @@ -0,0 +1,552 @@ +/* librfid-tool - a small command-line tool for librfid testing + * + * (C) 2005-2006 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +/*#include */ + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "librfid-tool.h" + + +static int select_mf(void) +{ + unsigned char cmd[] = { 0x00, 0xa4, 0x00, 0x00, 0x02, 0x3f, 0x00, 0x00 }; + unsigned char ret[256]; + unsigned int rlen = sizeof(ret); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%d: [%s]\n", rlen, hexdump(ret, rlen)); + + return 0; +} + + +static int iso7816_get_challenge(unsigned char len) +{ + unsigned char cmd[] = { 0x00, 0x84, 0x00, 0x00, 0x08 }; + unsigned char ret[256]; + unsigned int rlen = sizeof(ret); + + cmd[4] = len; + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%d: [%s]\n", rlen, hexdump(ret, rlen)); + + return 0; +} + +int +iso7816_select_application(void) +{ + unsigned char cmd[] = { 0x00, 0xa4, 0x04, 0x0c, 0x07, + 0xa0, 0x00, 0x00, 0x02, 0x47, 0x10, 0x01 }; + unsigned char resp[7]; + unsigned int rlen = sizeof(resp); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + /* FIXME: parse response */ + printf("%s\n", hexdump(resp, rlen)); + + return 0; +} + +int +iso7816_select_ef(u_int16_t fid) +{ + unsigned char cmd[7] = { 0x00, 0xa4, 0x02, 0x0c, 0x02, 0x00, 0x00 }; + unsigned char resp[7]; + unsigned int rlen = sizeof(resp); + + int rv; + + cmd[5] = (fid >> 8) & 0xff; + cmd[6] = fid & 0xff; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + /* FIXME: parse response */ + printf("%s\n", hexdump(resp, rlen)); + + return 0; +} + +int +iso7816_read_binary(unsigned char *buf, unsigned int *len) +{ + unsigned char cmd[] = { 0x00, 0xb0, 0x00, 0x00, 0x00 }; + unsigned char resp[256]; + unsigned int rlen = sizeof(resp); + + int rv; + + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + if (rv < 0) + return rv; + + printf("%s\n", hexdump(resp, rlen)); + + /* FIXME: parse response, determine whether we need additional reads */ + + /* FIXME: copy 'len' number of response bytes to 'buf' */ + return 0; +} + +/* wrapper function around SELECT EF and READ BINARY */ +int +iso7816_read_ef(u_int16_t fid, unsigned char *buf, unsigned int *len) +{ + int rv; + + rv = iso7816_select_ef(fid); + if (rv < 0) + return rv; + + return iso7816_read_binary(buf, len); +} + +/* mifare ultralight helpers */ +int +mifare_ulight_write(struct rfid_protocol_handle *ph) +{ + unsigned char buf[4] = { 0xa1, 0xa2, 0xa3, 0xa4 }; + + return rfid_protocol_write(ph, 10, buf, 4); +} + +int +mifare_ulight_blank(struct rfid_protocol_handle *ph) +{ + unsigned char buf[4] = { 0x00, 0x00, 0x00, 0x00 }; + int i, ret; + + for (i = 4; i <= MIFARE_UL_PAGE_MAX; i++) { + ret = rfid_protocol_write(ph, i, buf, 4); + if (ret < 0) + return ret; + } + return 0; +} + +static int +mifare_ulight_read(struct rfid_protocol_handle *ph) +{ + unsigned char buf[20]; + unsigned int len = sizeof(buf); + int ret; + int i; + + for (i = 0; i <= MIFARE_UL_PAGE_MAX; i++) { + ret = rfid_protocol_read(ph, i, buf, &len); + if (ret < 0) + return ret; + + printf("Page 0x%x: %s\n", i, hexdump(buf, 4)); + } + return 0; +} + +/* mifare classic helpers */ +static int +mifare_classic_read_sector(struct rfid_protocol_handle *ph, int sector) +{ + unsigned char buf[20]; + unsigned int len = sizeof(buf); + int ret; + int block; + + /* FIXME: make this work for sectors > 31 */ + printf("Reading sector %u\n", sector); + + for (block = sector*4; block < sector*4+4; block++) { + printf("Reading block %u: ", block); + ret = rfid_protocol_read(ph, block, buf, &len); + if(ret == -ETIMEDOUT) + fprintf(stderr, "TIMEOUT\n"); + if (ret < 0) { + printf("Error %d reading\n", ret); + return ret; + } + + printf("Page 0x%x: %s\n", block, hexdump(buf, len)); + } + return 0; +} + +static char *proto_names[] = { + [RFID_PROTOCOL_TCL] = "tcl", + [RFID_PROTOCOL_MIFARE_UL] = "mifare-ultralight", + [RFID_PROTOCOL_MIFARE_CLASSIC] = "mifare-classic", +}; + +static int proto_by_name(const char *name) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(proto_names); i++) { + if (proto_names[i] == NULL) + continue; + if (!strcasecmp(name, proto_names[i])) + return i; + } + return -1; +} + +static char *l2_names[] = { + [RFID_LAYER2_ISO14443A] = "iso14443a", + [RFID_LAYER2_ISO14443B] = "iso14443b", + [RFID_LAYER2_ISO15693] = "iso15693", +}; + +static int l2_by_name(const char *name) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(l2_names); i++) { + if (l2_names[i] == NULL) + continue; + if (!strcasecmp(name, l2_names[i])) + return i; + } + return -1; +} + +static void do_scan(void) +{ + int rc; + unsigned int size; + unsigned int size_len = sizeof(size); + + printf("scanning for RFID token...\n"); + rc = rfid_scan(rh, &l2h, &ph); + if (rc >= 2) { + unsigned char uid_buf[16]; + unsigned int uid_len = sizeof(uid_buf); + rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, + &uid_len); + printf("Layer 2 success (%s): %s\n", rfid_layer2_name(l2h), + hexdump(uid_buf, uid_len)); + } + if (rc >= 3) { + printf("Protocol success (%s)\n", rfid_protocol_name(ph)); + + if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE, + &size, &size_len) == 0) + printf("Size: %u bytes\n", size); + } +} + +#define OPTION_OFFSET 256 + +static struct option original_opts[] = { + { "help", 0, 0, 'h' }, + { "layer2", 1, 0, 'l' }, + { "protocol", 1, 0, 'p' }, + { "scan", 0, 0, 's' }, + { "scan-loop", 0, 0, 'S' }, + {0, 0, 0, 0} +}; + +/* module / option merging code */ +static struct option *opts = original_opts; +static unsigned int global_option_offset = 0; + +static char *program_name; +static char *program_version = LIBRFID_TOOL_VERSION; + +static void free_opts(int reset_offset) +{ + if (opts != original_opts) { + free(opts); + opts = original_opts; + if (reset_offset) + global_option_offset = 0; + } +} + +static struct option * +merge_options(struct option *oldopts, const struct option *newopts, + unsigned int *option_offset) +{ + unsigned int num_old, num_new, i; + struct option *merge; + + for (num_old = 0; oldopts[num_old].name; num_old++); + for (num_new = 0; oldopts[num_new].name; num_new++); + + global_option_offset += OPTION_OFFSET; + *option_offset = global_option_offset; + + merge = malloc(sizeof(struct option) * (num_new + num_old + 1)); + memcpy(merge, oldopts, num_old * sizeof(struct option)); + free_opts(0); /* Release previous options merged if any */ + for (i = 0; i < num_new; i++) { + merge[num_old + i] = newopts[i]; + merge[num_old + i].val += *option_offset; + } + memset(merge + num_old + num_new, 0, sizeof(struct option)); + + return merge; +} + +struct rfidtool_module *find_module(const char *name) +{ + return NULL; +} + +void register_module(struct rfidtool_module *me) +{ + struct rfidtool_module *old; + + if (strcmp(me->version, program_version) != 0) { + fprintf(stderr, "%s: target `%s' v%s (I'm v%s).\n", + program_name, me->name, me->version, program_version); + exit(1); + } + + old = find_module(me->name); + if (old) { + fprintf(stderr, "%s: target `%s' already registered.\n", + program_name, me->name); + exit(1); + } +} + +static void help(void) +{ + printf( " -s --scan scan until first RFID tag is found\n" + " -S --scan-loop endless scanning loop\n" + " -p --protocol {tcl,mifare-ultralight,mifare-classic}\n" + " -l --layer2 {iso14443a,iso14443b,iso15693}\n" + " -h --help\n"); +} + +int main(int argc, char **argv) +{ + int rc; + char buf[0x100]; + int i, len, protocol = -1, layer2 = -1; + +#ifdef __MINGW32__ + program_name = argv[0]; +#else /*__MINGW32__*/ + program_name = basename(argv[0]); +#endif/*__MINGW32__*/ + + printf("%s - (C) 2006 by Harald Welte\n" + "This program is Free Software and has " + "ABSOLUTELY NO WARRANTY\n\n", program_name); + + printf("initializing librfid\n"); + rfid_init(); + + while (1) { + int c, option_index = 0; + c = getopt_long(argc, argv, "hp:l:sS", opts, &option_index); + if (c == -1) + break; + + switch (c) { + case 's': + if (reader_init() < 0) + exit(1); + do_scan(); + exit(0); + break; + case 'S': + if (reader_init() < 0) + exit(1); + while (1) + do_scan(); + exit(0); + break; + case 'p': + protocol = proto_by_name(optarg); + if (protocol < 0) { + fprintf(stderr, "unknown protocol `%s'\n", + optarg); + exit(2); + } + break; + case 'l': + layer2 = l2_by_name(optarg); + if (layer2 < 0) { + fprintf(stderr, "unknown layer2 `%s'\n", + optarg); + exit(2); + } + break; + case 'h': + help(); + exit(0); + break; + } + } + + switch (protocol) { + case RFID_PROTOCOL_MIFARE_UL: + case RFID_PROTOCOL_MIFARE_CLASSIC: + layer2 = RFID_LAYER2_ISO14443A; + break; + case -1: + fprintf(stderr, "you have to specify --protocol\n"); + exit(2); + } + + if (layer2 < 0) { + fprintf(stderr, "you have to specify --layer2\n"); + exit(2); + } + + if (reader_init() < 0) + exit(1); + + if (l2_init(layer2) < 0) + exit(1); + + if (l3_init(protocol) < 0) + exit(1); + + switch (protocol) { + + case RFID_PROTOCOL_TCL: + printf("Protocol T=CL\n"); + /* we've established T=CL at this point */ + printf("selecting Master File\n"); + rc = select_mf(); + if (rc < 0) { + printf("error selecting MF\n"); + break; + } + + printf("Getting random challenge, length 255\n"); + rc = iso7816_get_challenge(0xff); + if (rc < 0) { + printf("error getting random challenge\n"); + break; + } + + printf("selecting Passport application\n"); + rc = iso7816_select_application(); + if (rc < 0) { + printf("error selecting passport application\n"); + break; + } + + printf("selecting EF 0x1e\n"); + rc = iso7816_select_ef(0x011e); + if (rc < 0) { + printf("error selecting EF 0x1e\n"); + break; + } + + printf("selecting EF 0x01\n"); + rc = iso7816_select_ef(0x0101); + if (rc < 0) { + printf("error selecting EF 0x01\n"); + break; + } + + while (1) { + printf("reading EF1\n"); + len = sizeof(buf); + printf("reading ef\n"); + rc = iso7816_read_binary(buf, &len); + if (rc < 0) { + printf("error reading EF\n"); + break; + } + } +#if 0 + for (i = 0; i < 4; i++) + iso7816_get_challenge(0xff); +#endif + break; + case RFID_PROTOCOL_MIFARE_UL: + printf("Protocol Mifare Ultralight\n"); + mifare_ulight_read(ph); +#if 0 + mifare_ulight_blank(ph); + mifare_ulight_write(ph); + mifare_ulight_read(ph); +#endif + break; + case RFID_PROTOCOL_MIFARE_CLASSIC: + printf("Protocol Mifare Classic\n"); + { + int sector; + for (sector = 0; sector < 31; sector++) { + printf("Authenticating sector %u: ", sector); + fflush(stdout); + rc = mfcl_set_key(ph, MIFARE_CL_KEYA_DEFAULT_INFINEON); + if (rc < 0) { + printf("key format error\n"); + exit(1); + } + rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, sector*4); + if (rc < 0) { + printf("mifare auth error\n"); + exit(1); + } else + printf("mifare auth succeeded!\n"); + + mifare_classic_read_sector(ph, sector); + } + } + break; + default: + printf("unknown protocol\n"); + exit(1); + break; + } + + rfid_reader_close(rh); + + exit(0); +} diff --git a/librfid_1999/utils/librfid-tool.h b/librfid_1999/utils/librfid-tool.h new file mode 100644 index 0000000..5ca49d4 --- /dev/null +++ b/librfid_1999/utils/librfid-tool.h @@ -0,0 +1,35 @@ +#ifndef _RFIDTOOL_H +#define _RFIDTOOL_H + +#define _GNU_SOURCE +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + +extern const char * +hexdump(const void *data, unsigned int len); + +extern int +hexread(unsigned char *result, const unsigned char *in, unsigned int len); + +extern struct rfid_reader_handle *rh; +extern struct rfid_layer2_handle *l2h; +extern struct rfid_protocol_handle *ph; + +extern int reader_init(void); +extern int l2_init(int layer2); +extern int l3_init(int protocol); + +#define LIBRFID_TOOL_VERSION "0.1" + +struct rfidtool_module { + struct rfidtool_module *next; + char *name; + char *version; + const struct option *extra_opts; + + unsigned int option_offset; +}; + +#endif /* _REFIDTOOL_H */ diff --git a/librfid_1999/utils/mifare-tool.c b/librfid_1999/utils/mifare-tool.c new file mode 100644 index 0000000..7c3a51e --- /dev/null +++ b/librfid_1999/utils/mifare-tool.c @@ -0,0 +1,230 @@ +/* mifare-tool - a small command-line tool for librfid mifare testing + * + * (C) 2006 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +//#include + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "librfid-tool.h" + +static char *program_name; + +static void help(void) +{ + printf( " -h --help Print this help message\n" + " -r --read Read a mifare sector\n" + " -l --loop-read Loop reading a mifare sector\n" + " -w --write Write a mifare sector\n" + " -k --key Specify mifare access key (in hex tuples)\n"); +} + +static struct option mifare_opts[] = { + { "key", 1, 0, 'k' }, + { "read", 1, 0, 'r' }, + { "loop-read", 1, 0, 'l' }, + { "write", 1 ,0, 'w' }, + { "help", 0, 0, 'h' }, + { 0, 0, 0, 0 } +}; + +static int mifare_cl_auth(unsigned char *key, int page) +{ + int rc; + + rc = mfcl_set_key(ph, key); + if (rc < 0) { + fprintf(stderr, "key format error\n"); + return rc; + } + rc = mfcl_auth(ph, RFID_CMD_MIFARE_AUTH1A, page); + if (rc < 0) { + fprintf(stderr, "mifare auth error\n"); + return rc; + } else + printf("mifare auth succeeded!\n"); + + return 0; +} + +static void mifare_l3(void) +{ + while (l2_init(RFID_LAYER2_ISO14443A) < 0) ; + + printf("ISO14443-3A anticollision succeeded\n"); + + while (l3_init(RFID_PROTOCOL_MIFARE_CLASSIC) < 0) ; + + printf("Mifare card available\n"); +} + +int main(int argc, char **argv) +{ + int len, rc, c, option_index = 0; + unsigned int page,uid,uid_len; + char key[MIFARE_CL_KEY_LEN]; + char buf[MIFARE_CL_PAGE_SIZE]; + +#ifdef __MINGW32__ + program_name = argv[0]; +#else + program_name = basename(argv[0]); +#endif/*__MINGW32__*/ + + memcpy(key, MIFARE_CL_KEYA_DEFAULT_INFINEON, MIFARE_CL_KEY_LEN); + + printf("%s - (C) 2006 by Harald Welte\n" + "This program is Free Software and has " + "ABSOLUTELY NO WARRANTY\n\n", program_name); + + printf("initializing librfid\n"); + rfid_init(); + + if (reader_init() < 0) { + fprintf(stderr, "error opening reader\n"); + exit(1); + } + + while (1) { + c = getopt_long(argc, argv, "k:r:l:w:", mifare_opts, + &option_index); + if (c == -1) + break; + + switch (c) { + case 'k': + hexread(key, optarg, strlen(optarg)); + printf("key: %s\n", hexdump(key, MIFARE_CL_KEY_LEN)); + break; + case 'r': + page = atoi(optarg); + printf("read(key='%s',page=%u):", + hexdump(key, MIFARE_CL_KEY_LEN), page); + len = MIFARE_CL_PAGE_SIZE; + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + exit(1); + + uid_len=sizeof(uid); + uid=0; + if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0) + printf("UID=%08X (len=%u)\n",uid,uid_len); + + len=MIFARE_CL_PAGE_SIZE; + rc = rfid_protocol_read(ph, page, buf, &len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during read\n"); + break; + } + printf("len=%u data=%s\n", len, hexdump(buf, len)); + + if (page & 0x3 == 0x3) { + struct mfcl_access_sect s; + struct mfcl_access_exp_sect es; + int b; + u_int8_t recreated[4]; + mfcl_parse_access(&s, buf+6); + printf("access b0:%u b1:%u b2:%u b3:%u\n", + s.block[0], s.block[1], + s.block[2], s.block[3]); + mfcl_access_to_exp(&es, &s); + for (b = 0; b < 3; b++) + printf("%u: %s\n", b, mfcl_access_exp_stringify(&es.block[b])); + printf("3: %s\n", mfcl_access_exp_acc_stringify(&es.acc)); +#if 0 + mfcl_compile_access(recreated, &s); + printf("recreated; %s\n", hexdump(recreated,4)); +#endif + } + break; + case 'l': + page = atoi(optarg); + printf("read_loop(key='%s',page=%u):\n", + hexdump(key, MIFARE_CL_KEY_LEN), page); + while (1) { + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + continue; + + uid_len=sizeof(uid); + uid=0; + if(rfid_layer2_getopt(l2h,RFID_OPT_LAYER2_UID,&uid,&uid_len)>=0) + printf("UID=%08X (len=%u)\n",uid,uid_len); + + len=MIFARE_CL_PAGE_SIZE; + rc = rfid_protocol_read(ph, page, buf, &len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during read\n"); + continue; + } + printf("%s\n", hexdump(buf, len)); + } + break; + case 'w': + page = atoi(optarg); + len = strlen(argv[optind]); + len = hexread(buf, argv[optind], len); + printf("write(key='%s',page=%u):", + hexdump(key, MIFARE_CL_KEY_LEN), page); + printf(" '%s'(%u):", hexdump(buf, len), len); + mifare_l3(); + if (mifare_cl_auth(key, page) < 0) + exit(1); + rc = rfid_protocol_write(ph, page, buf, len); + if (rc < 0) { + printf("\n"); + fprintf(stderr, "error during write\n"); + break; + } + printf("success\n"); + break; + case 'h': + default: + help(); + } + } + +#if 0 + rfid_protocol_close(ph); + rfid_protocol_fini(ph); + + rfid_layer2_close(l2h); + rfid_layer2_fini(l2h); +#endif + rfid_reader_close(rh); + exit(0); +} + diff --git a/librfid_1999/utils/send_script.c b/librfid_1999/utils/send_script.c new file mode 100644 index 0000000..47de1d6 --- /dev/null +++ b/librfid_1999/utils/send_script.c @@ -0,0 +1,292 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * 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 + */ + +#include +#include +#include +#include +#include +#include + +#define _GNU_SOURCE +#include + +#include +#include +#include +#include + +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static const char * +hexdump(const void *data, unsigned int len) +{ + static char string[2048]; + unsigned char *d = (unsigned char *) data; + unsigned int i, left, llen = len; + + string[0] = '\0'; + left = sizeof(string); + for (i = 0; llen--; i += 3) { + if (i >= sizeof(string) -4) + break; + snprintf(string+i, 4, " %02x", *d++); + } return string; + + if (i >= sizeof(string) -2) + return string; + snprintf(string+i, 2, " "); + i++; llen = len; + + d = (unsigned char *) data; + for (; llen--; i += 1) { + if (i >= sizeof(string) -2) + break; + snprintf(string+i, 2, "%c", isprint(*d) ? *d : '.'); + d++; + } + return string; +} + +static struct rfid_reader_handle *rh; +static struct rfid_layer2_handle *l2h; +static struct rfid_protocol_handle *ph; + +static int init() +{ + unsigned char buf[0x3f]; + int rc; + + printf("initializing librfid\n"); + rfid_init(); + + printf("opening reader handle\n"); + rh = rfid_reader_open(NULL, RFID_READER_CM5121); + if (!rh) { + fprintf(stderr, "error, no cm5121 handle\n"); + return -1; + } + + printf("opening layer2 handle\n"); + l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443A); + //l2h = rfid_layer2_init(rh, RFID_LAYER2_ISO14443B); + if (!l2h) { + fprintf(stderr, "error during iso14443a_init\n"); + return -1; + } + + //rc632_register_dump(rh->ah, buf); + + printf("running layer2 anticol\n"); + rc = rfid_layer2_open(l2h); + if (rc < 0) { + fprintf(stderr, "error during layer2_open\n"); + return rc; + } + + return 0; +} + +static int l3(int protocol) +{ + printf("running layer3 (ats)\n"); + ph = rfid_protocol_init(l2h, protocol); + if (!ph) { + fprintf(stderr, "error during protocol_init\n"); + return -1; + } + if (rfid_protocol_open(ph) < 0) { + fprintf(stderr, "error during protocol_open\n"); + return -1; + } + + printf("we now have layer3 up and running\n"); + + return 0; +} + +static int send_command(char* sbuf, int slen, char* rbuf, int rlen) +{ + int rv; + static int doit; + int answer, c = 0; + + if(doit == 0) { + fprintf(stderr, "?? %s (%i bytes)\n", hexdump(sbuf, slen), slen); + fprintf(stderr, "Execute? (Yes/No/All/Exit) "); + answer = getc(stdin); + if(answer != '\n') do { + c = getc(stdin); + } while(c != '\n' && c != EOF); + switch(answer) { + case 'y': // Fall-through + case 'Y': + case '\n': + // Do nothing + break; + case 'n': // Fall-through + case 'N': + return 0; + break; + case 'a': // Fall-through + case 'A': + doit = 1; + break; + case 'e': // Fall-through + case 'E': + return -1; + break; + default: + return 0; // Default to 'n' + break; + } + } + + printf(">> %s (%i bytes)\n", hexdump(sbuf, slen), slen); + + rv = rfid_protocol_transceive(ph, sbuf, slen, rbuf, &rlen, 0, 0); + if (rv < 0) { + fprintf(stderr, "Error from transceive: %i\n", rv); + return rv; + } + + printf("<< %s (%i bytes)\n", hexdump(rbuf, rlen), rlen); + + if(rlen < 2 || rbuf[rlen-2] != (char)0x90 || rbuf[rlen-1] != 0x00) { + fprintf(stderr, "SW is not 90 00. Ignore (i) or Abort (a)? "); + answer = getc(stdin); + if(answer != '\n') do { + c = getc(stdin); + } while(c != '\n' && c != EOF); + switch(answer) { + case 'i': // Fall-through + case 'I': + case '\n': + // Do nothing + break; + case 'a': // Fall-through + case 'A': + return -1; + break; + default: + return -1; // Default to 'a' + } + } + + return rlen; +} + +static char *nextline(FILE* fh) +{ + int buflen = 1024; // FIXME Might want to increase dynamically? + char *buffer = malloc(buflen); + if (!buffer) { + perror("malloc"); + return 0; + } + + if (!fgets(buffer, buflen, fh)) { + perror("fgets"); + free(buffer); + return 0; + } + + return buffer; +} + +static int unhexchar(char c) { + if ((c - '0') >= 0 && (c - '0') < 10) + return c-'0'; + if ((c - 'a') >= 0 && (c - 'a') < 6) + return 10 + c-'a'; + if ((c - 'A') >= 0 && (c - 'A') < 6) + return 10 + c-'A'; + return -1; +} + +int make_command( const char *line, char **buffer, int *blen ) +{ + int len = strlen(line), pos; + *buffer = malloc( len ); + *blen = 0; + if(!*buffer) { + perror("malloc"); + return 0; + } + + for(pos = 0; pos < len; pos++) { + if(!isxdigit(line[pos])) + continue; + if(! (pos+1 < len) ) + continue; + + (*buffer)[*blen] = unhexchar(line[pos]) * 16 + unhexchar(line[pos+1]); + pos += 1; + *blen += 1; + } + return 1; +} + +int main(int argc, char **argv) +{ + FILE *fh; + int slen, rlen, retval = 0; + char *next, *sbuf, *rbuf; + + if (argc != 2) { + fprintf(stderr, "Syntax: %s scriptfile\n", argv[0]); + exit(1); + } + + fh = fopen(argv[1], "r"); + if (!fh) { + perror("fopen"); + exit(1); + } + + if (init() < 0) + exit(1); + + if (l3(RFID_PROTOCOL_TCL) < 0) + exit(1); + + printf("Protocol T=CL\n"); + /* we've established T=CL at this point */ + + while (next = nextline(fh)) { + if (!(strlen(next) >= 2 && strncmp(next, "//", 2) == 0)) { + if (make_command(next, &sbuf, &slen)) { + rlen = 1024; + rbuf = calloc(rlen, 1); + + retval = send_command(sbuf, slen, rbuf, rlen); + + free(sbuf); + free(rbuf); + } + } + free(next); + + if (retval < 0) + break; + } + + rfid_reader_close(rh); + + exit(0); +} diff --git a/librfid_1999/win32/Makefile.am b/librfid_1999/win32/Makefile.am new file mode 100644 index 0000000..f565f1f --- /dev/null +++ b/librfid_1999/win32/Makefile.am @@ -0,0 +1,15 @@ +LIBVERSION= 0:0:0 + +noinst_HEADERS = openpcd.h +noinst_DATA = openpcd.dll + +INCLUDES = -I$(top_srcdir)/include +LIBRFID_DIR = $(top_builddir)/src/.libs/ +CLEANFILES = $(noinst_DATA) + +.c.o: + $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +.o.dll: + $(CC) -mno-cygwin --add-stdcall-alias -shared -o $@ -L$(LIBRFID_DIR) $< -lrfid -lwinmm -Wl,-no-undefined -Wl,--entry,__cygwin_noncygwin_dll_entry@12 + $(STRIP) --strip-unneeded $@ diff --git a/librfid_1999/win32/Makefile.in b/librfid_1999/win32/Makefile.in new file mode 100644 index 0000000..03341af --- /dev/null +++ b/librfid_1999/win32/Makefile.in @@ -0,0 +1,427 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +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@ +target_triplet = @target@ +subdir = win32 +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 = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DATA = $(noinst_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDENV = @BUILDENV@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIRMWARE_PATH = @FIRMWARE_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENCT_CFLAGS = @OPENCT_CFLAGS@ +OPENCT_LIBS = @OPENCT_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +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@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +to_host_path_cmd = @to_host_path_cmd@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBVERSION = 0:0:0 +noinst_HEADERS = openpcd.h +noinst_DATA = openpcd.dll +INCLUDES = -I$(top_srcdir)/include +LIBRFID_DIR = $(top_builddir)/src/.libs/ +CLEANFILES = $(noinst_DATA) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .dll .o +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu win32/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: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) $(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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean 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-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +.c.o: + $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +.o.dll: + $(CC) -mno-cygwin --add-stdcall-alias -shared -o $@ -L$(LIBRFID_DIR) $< -lrfid -lwinmm -Wl,-no-undefined -Wl,--entry,__cygwin_noncygwin_dll_entry@12 + $(STRIP) --strip-unneeded $@ + +# 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: diff --git a/librfid_1999/win32/openpcd.c b/librfid_1999/win32/openpcd.c new file mode 100644 index 0000000..748b52f --- /dev/null +++ b/librfid_1999/win32/openpcd.c @@ -0,0 +1,389 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define BUILD_DLL +#include "openpcd.h" + +#define LIBMIFARE_MAGIC 0xDEADBEEF + +struct openpcd_state +{ + unsigned int magic; + unsigned int cl_auth; + struct rfid_reader_handle *rh; + struct rfid_layer2_handle *l2h; + struct rfid_protocol_handle *ph; + unsigned char key[MIFARE_CL_KEY_LEN]; + unsigned int uid; +} openpcd_state; + +int openpcd_cl_auth(struct openpcd_state* state ,int page) +{ + int rc; + + if(!state || page<=0 || page>MIFARE_CL_PAGE_MAX ) + return PCDERROR_INVALID_PARAMETER; + + if(!state->ph) + return PCDERROR_CLOSED; + + rc = mfcl_set_key(state->ph, state->key); + if (rc < 0) + return PCDERROR_KEY_FORMAT; + + rc = mfcl_auth(state->ph, state->cl_auth, page); + + return rc<0 ? PCDERROR_KEY_AUTH : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + switch(key_id) + { + case PCDAUTH_KEYID_1A: + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + break; + case PCDAUTH_KEYID_1B: + state->cl_auth=RFID_CMD_MIFARE_AUTH1B; + break; + default: + return PCDERROR_INVALID_PARAMETER; + } + + memcpy(state->key,key,MIFARE_CL_KEY_LEN); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle) +{ + int res; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + state->l2h = rfid_layer2_init(state->rh,RFID_LAYER2_ISO14443A); + if(!state->l2h) + res=PCDERROR_LAYER2_INIT; + else + { + if( rfid_layer2_open(state->l2h)>=0 ) + { + state->ph = rfid_protocol_init(state->l2h,RFID_PROTOCOL_MIFARE_CLASSIC); + + if(state->ph) + { + if(rfid_protocol_open(state->ph)>=0) + return PCDERROR_NONE; + + rfid_protocol_fini(state->ph); + state->ph=NULL; + + res=PCDERROR_LAYER3_OPEN; + } + else + res=PCDERROR_LAYER3_INIT; + + rfid_layer2_close(state->l2h); + } + else + res=PCDERROR_LAYER2_OPEN; + } + + rfid_layer2_fini(state->l2h); + state->l2h=NULL; + + return res; +} + +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + rfid_protocol_close(state->ph); + rfid_protocol_fini(state->ph); + rfid_layer2_close(state->l2h); + rfid_layer2_fini(state->l2h); + + state->ph=NULL; + state->l2h=NULL; + state->uid=0; + + return PCDERROR_NONE; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid) +{ + unsigned int uid_len; + struct openpcd_state *state; + + if(!handle || !uid) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + if(state->ph) + { + uid_len=sizeof(*uid); + if(rfid_layer2_getopt(state->l2h,RFID_OPT_LAYER2_UID,uid,&uid_len)) + return PCDERROR_INVALID_PARAMETER; + else + return uid_len==4 ? PCDERROR_NONE:PCDERROR_READ_FAILED; + } + else + return PCDERROR_CLOSED; +} + +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle) +{ + struct rfid_reader_handle *rh; + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + if(!rh) + return PCDERROR_NO_READER; + + state=(struct openpcd_state*)malloc(sizeof(*state)); + if(state) + { + memset(state,0,sizeof(*state)); + state->magic=LIBMIFARE_MAGIC; + state->rh=rh; + state->cl_auth=RFID_CMD_MIFARE_AUTH1A; + memset(state->key,0xFF,sizeof(state->key)); + + // do initial reset + openpcd_reset_reader((MIFARE_HANDLE)state); + Sleep(1500); + // reopen + state->rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + + *handle=(MIFARE_HANDLE)state; + + return PCDERROR_NONE; + } + else + { + rfid_reader_close(rh); + return PCDERROR_OUT_OF_MEMORY; + } +} + +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if(!handle) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + openpcd_deselect_card(handle); + + openpcd_reset_reader(handle); + Sleep(500); + + state->magic=0; + rfid_reader_close(state->rh); + free(state); + + return PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len) +{ + int res; + unsigned int count; + unsigned char buf[MIFARE_CL_PAGE_SIZE]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + count = sizeof(buf); + res = rfid_protocol_read(state->ph, page, buf, &count); + if(res>=0) + memcpy(data,buf,len); + + if ( res<0 ) + return PCDERROR_READ_FAILED; + else + return count; +} + +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len) +{ + int res; + unsigned char buf[16]; + struct openpcd_state *state; + + if( !handle || !buf || page<0 || page>MIFARE_CL_PAGE_MAX || len<=0 || len>sizeof(buf)) + return PCDERROR_INVALID_PARAMETER; + + state=(struct openpcd_state*)handle; + if ( (res=openpcd_cl_auth(state,page)) < 0) + return res; + + memcpy(buf,data,len); + memset(&buf[len],0,sizeof(buf)-len); + + res = rfid_protocol_write(state->ph, page, buf, sizeof(buf)); + + return (res<0 && res!=-101) ? PCDERROR_WRITE_FAILED : len; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_api_version(MIFARE_HANDLE handle, unsigned int *version) +{ + unsigned char b; + struct openpcd_state *state; + + if( !handle || !version ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + b=0; + + if(state->rh->reader->get_api_version(state->rh,&b)<0) + return PCDERROR_READER_VERSION; + else + { + *version=b; + return PCDERROR_NONE; + } +} + +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->reset(state->rh)<0) ? PCDERROR_WRITE_FAILED : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_get_environment( + MIFARE_HANDLE handle, + unsigned char count, + unsigned char* data + ) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->get_environment(state->rh,count,data)<0) ? PCDERROR_READ_FAILED : PCDERROR_NONE; +} + +EXPORT int EXPORT_CONVENTION openpcd_set_environment( + MIFARE_HANDLE handle, + unsigned char count, + const unsigned char* data) +{ + struct openpcd_state *state; + + if( !handle ) + return PCDERROR_INVALID_PARAMETER; + state=(struct openpcd_state*)handle; + + return (state->rh->reader->set_environment(state->rh,count,data)<0) ? PCDERROR_WRITE_FAILED : PCDERROR_NONE; +} + +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error) +{ + const static char* msg[]={ + "PCDERROR_NONE", // 0 + "PCDERROR_INVALID_PARAMETER", // -1 + "PCDERROR_KEY_FORMAT", // -2 + "PCDERROR_KEY_AUTH", // -3 + "PCDERROR_NO_CARD_FOUND", // -4 + "PCDERROR_LAYER2_INIT", // -5 + "PCDERROR_LAYER2_OPEN", // -6 + "PCDERROR_LAYER3_INIT", // -7 + "PCDERROR_LAYER3_OPEN", // -8 + "PCDERROR_SELECT", // -9 + "PCDERROR_READ_FAILED", // -10 + "PCDERROR_WRITE_FAILED", // -11 + "PCDERROR_CLOSED", // -12 + "PCDERROR_NO_READER", // -13 + "PCDERROR_OUT_OF_MEMORY", // -14 + "PCDERROR_READER_VERSION" // -15 + }; + const int count=sizeof(msg)/sizeof(msg[0]); + + if(error>0) + error=0; + else + error=-error; + + return (error>=count) ? "PCDERROR_UNKNOWN" : (char*)msg[error]; +} diff --git a/librfid_1999/win32/openpcd.def b/librfid_1999/win32/openpcd.def new file mode 100644 index 0000000..2ba78d7 --- /dev/null +++ b/librfid_1999/win32/openpcd.def @@ -0,0 +1,15 @@ +LIBRARY openpcd.dll +EXPORTS + openpcd_open_reader@4 + openpcd_close_reader@4 + openpcd_select_card@4 + openpcd_deselect_card@4 + openpcd_read@16 + openpcd_write@16 + openpcd_get_card_id@8 + openpcd_set_key@12 + openpcd_get_error_text@4 + openpcd_get_api_version@8 + openpcd_get_environment@12 + openpcd_set_environment@12 + openpcd_reset_reader@4 diff --git a/librfid_1999/win32/openpcd.h b/librfid_1999/win32/openpcd.h new file mode 100644 index 0000000..9cedcf2 --- /dev/null +++ b/librfid_1999/win32/openpcd.h @@ -0,0 +1,175 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with OpenPCD RFID reader */ +/* in WIN32 - see http://www.openpcd.org */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#ifndef __OPENPCD_H__ +#define __OPENPCD_H__ + +#ifdef __cplusplus +extern "C" { +#endif/*__cplusplus*/ + +#define EXPORT_CONVENTION __stdcall +#ifdef BUILD_DLL +/* DLL export */ +#define EXPORT __declspec(dllexport) +#else +/* EXE import */ +#define EXPORT __declspec(dllimport) +#endif /*BUILD_DLL*/ + +#define PCDERROR_NONE 0 +#define PCDERROR_INVALID_PARAMETER -1 +#define PCDERROR_KEY_FORMAT -2 +#define PCDERROR_KEY_AUTH -3 +#define PCDERROR_NO_CARD_FOUND -4 +#define PCDERROR_LAYER2_INIT -5 +#define PCDERROR_LAYER2_OPEN -6 +#define PCDERROR_LAYER3_INIT -7 +#define PCDERROR_LAYER3_OPEN -8 +#define PCDERROR_SELECT -9 +#define PCDERROR_READ_FAILED -10 +#define PCDERROR_WRITE_FAILED -11 +#define PCDERROR_CLOSED -12 +#define PCDERROR_NO_READER -13 +#define PCDERROR_OUT_OF_MEMORY -14 +#define PCDERROR_READER_VERSION -15 + +#define PCDAUTH_KEY_LENGTH 6 +#define PCDAUTH_KEYID_1A 0 +#define PCDAUTH_KEYID_1B 1 + +typedef void* MIFARE_HANDLE; + +/*************************************************************************/ +/* */ +/* Six steps for reading/writing to MIFARE cards */ +/* */ +/*************************************************************************/ + +/* Step 1. open reader + + supply the address of your handle variable to retrieve a handle + to the current reader. + */ +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle); + +/* Step 2. set MIFARE classic key + + if your key differs from the default Infineon key (6*0xFF), you can + supply a different key here. The key size is PCDAUTH_KEY_LENGTH bytes. + You can chose to set key_id to PCDAUTH_KEYID_1A or *_1B. + */ +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key); + +/* Step 3. select card + + start the anticollosion to select a card in the reader field - retry if + it fails. Currently supports only on card in the readerv field. + */ +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle); + +/* Step 4. read/write card + + read, write from the selected card - specify the page and supply up to + 16 bytes of payload + */ +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len); +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len); + +/* Step 5. deselect card when done + */ +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle); + +/* Step 6. close reader after deselected card + */ +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle); + + +/*************************************************************************/ +/* */ +/* Support functions */ +/* */ +/*************************************************************************/ + +/* openpcd_get_error_text: + + Used for converting the error code into a string + */ +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error); + + +/* openpcd_get_card_id: + + Get the card id of a selected RFID card + */ +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid); + +/* openpcd_get_api_version: + + Get the USB api version of the reader + */ +EXPORT int EXPORT_CONVENTION openpcd_get_api_version(MIFARE_HANDLE handle,unsigned int *version); + +/* openpcd_reset_reader: + + Reset the attached reader + */ +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle); + +/* openpcd_get_environment + + Store the given data to the nonvolatile reader flash + Returns read data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_get_environment( + MIFARE_HANDLE handle, + unsigned char count, + unsigned char* data +); + +/* openpcd_set_environment + + Read data from nonvolatile reader flash + Returns written data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_set_environment( + MIFARE_HANDLE handle, + unsigned char count, + const unsigned char* data +); + +#ifdef __cplusplus +} +#endif/*__cplusplus*/ +#endif/*__OPENPCD_H__*/ diff --git a/librfid_1999/win32/openpcd.lib b/librfid_1999/win32/openpcd.lib new file mode 100644 index 0000000..017d201 Binary files /dev/null and b/librfid_1999/win32/openpcd.lib differ diff --git a/librfid_win32/api/openpcd.def b/librfid_win32/api/openpcd.def new file mode 100644 index 0000000..2ba78d7 --- /dev/null +++ b/librfid_win32/api/openpcd.def @@ -0,0 +1,15 @@ +LIBRARY openpcd.dll +EXPORTS + openpcd_open_reader@4 + openpcd_close_reader@4 + openpcd_select_card@4 + openpcd_deselect_card@4 + openpcd_read@16 + openpcd_write@16 + openpcd_get_card_id@8 + openpcd_set_key@12 + openpcd_get_error_text@4 + openpcd_get_api_version@8 + openpcd_get_environment@12 + openpcd_set_environment@12 + openpcd_reset_reader@4 diff --git a/librfid_win32/api/openpcd.dll b/librfid_win32/api/openpcd.dll new file mode 100644 index 0000000..fb179ed Binary files /dev/null and b/librfid_win32/api/openpcd.dll differ diff --git a/librfid_win32/api/openpcd.h b/librfid_win32/api/openpcd.h new file mode 100644 index 0000000..d71dc52 --- /dev/null +++ b/librfid_win32/api/openpcd.h @@ -0,0 +1,175 @@ +/*************************************************************************/ +/* */ +/* Mifare support for accessing RFID cards with */ +/* http://www.openpcd.org RFID reader */ +/* */ +/* Copyright (C) 2007 Milosch Meriac */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are*/ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice,*/ +/* this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* The name of the author may not be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE*/ +/* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, */ +/* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ +/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR */ +/* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */ +/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */ +/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING */ +/* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*************************************************************************/ + +#ifndef __OPENPCD_H__ +#define __OPENPCD_H__ + +#ifdef __cplusplus +extern "C" { +#endif/*__cplusplus*/ + +#define EXPORT_CONVENTION __stdcall +#ifdef BUILD_DLL +/* DLL export */ +#define EXPORT __declspec(dllexport) +#else +/* EXE import */ +#define EXPORT __declspec(dllimport) +#endif /*BUILD_DLL*/ + +#define PCDERROR_NONE 0 +#define PCDERROR_INVALID_PARAMETER -1 +#define PCDERROR_KEY_FORMAT -2 +#define PCDERROR_KEY_AUTH -3 +#define PCDERROR_NO_CARD_FOUND -4 +#define PCDERROR_LAYER2_INIT -5 +#define PCDERROR_LAYER2_OPEN -6 +#define PCDERROR_LAYER3_INIT -7 +#define PCDERROR_LAYER3_OPEN -8 +#define PCDERROR_SELECT -9 +#define PCDERROR_READ_FAILED -10 +#define PCDERROR_WRITE_FAILED -11 +#define PCDERROR_CLOSED -12 +#define PCDERROR_NO_READER -13 +#define PCDERROR_OUT_OF_MEMORY -14 +#define PCDERROR_READER_VERSION -15 + +#define PCDAUTH_KEY_LENGTH 6 +#define PCDAUTH_KEYID_1A 0 +#define PCDAUTH_KEYID_1B 1 + +typedef void* MIFARE_HANDLE; + +/*************************************************************************/ +/* */ +/* Six steps for reading/writing to MIFARE cards */ +/* */ +/*************************************************************************/ + +/* Step 1. open reader + + supply the address of your handle variable to retrieve a handle + to the current reader. + */ +EXPORT int EXPORT_CONVENTION openpcd_open_reader(MIFARE_HANDLE *handle); + +/* Step 2. set MIFARE classic key + + if your key differs from the default Infineon key (6*0xFF), you can + supply a different key here. The key size is PCDAUTH_KEY_LENGTH bytes. + You can chose to set key_id to PCDAUTH_KEYID_1A or *_1B. + */ +EXPORT int EXPORT_CONVENTION openpcd_set_key(MIFARE_HANDLE handle,unsigned int key_id,const void* key); + +/* Step 3. select card + + start the anticollosion to select a card in the reader field - retry if + it fails. Currently supports only on card in the readerv field. + */ +EXPORT int EXPORT_CONVENTION openpcd_select_card(MIFARE_HANDLE handle); + +/* Step 4. read/write card + + read, write from the selected card - specify the page and supply up to + 16 bytes of payload + */ +EXPORT int EXPORT_CONVENTION openpcd_read(MIFARE_HANDLE handle,int page, void* data, int len); +EXPORT int EXPORT_CONVENTION openpcd_write(MIFARE_HANDLE handle,int page,const void *data,int len); + +/* Step 5. deselect card when done + */ +EXPORT int EXPORT_CONVENTION openpcd_deselect_card(MIFARE_HANDLE handle); + +/* Step 6. close reader after deselected card + */ +EXPORT int EXPORT_CONVENTION openpcd_close_reader(MIFARE_HANDLE handle); + + +/*************************************************************************/ +/* */ +/* Support functions */ +/* */ +/*************************************************************************/ + +/* openpcd_get_error_text: + + Used for converting the error code into a string + */ +EXPORT char* EXPORT_CONVENTION openpcd_get_error_text(int error); + + +/* openpcd_get_card_id: + + Get the card id of a selected RFID card + */ +EXPORT int EXPORT_CONVENTION openpcd_get_card_id(MIFARE_HANDLE handle,unsigned int *uid); + +/* openpcd_get_api_version: + + Get the USB api version of the reader + */ +EXPORT int EXPORT_CONVENTION openpcd_get_api_version(MIFARE_HANDLE handle,unsigned int *version); + +/* openpcd_reset_reader: + + Reset the attached reader + */ +EXPORT int EXPORT_CONVENTION openpcd_reset_reader(MIFARE_HANDLE handle); + +/* openpcd_get_environment + + Store the given data to the nonvolatile reader flash + Returns read data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_get_environment( + MIFARE_HANDLE handle, + unsigned char count, + unsigned char* data +); + +/* openpcd_set_environment + + Read data from nonvolatile reader flash + Returns written data count at index or error code + */ +EXPORT int EXPORT_CONVENTION openpcd_set_environment( + MIFARE_HANDLE handle, + unsigned char count, + const unsigned char* data +); + +#ifdef __cplusplus +} +#endif/*__cplusplus*/ +#endif/*__OPENPCD_H__*/ diff --git a/librfid_win32/drivers/libusb0.dll b/librfid_win32/drivers/libusb0.dll new file mode 100644 index 0000000..316459a Binary files /dev/null and b/librfid_win32/drivers/libusb0.dll differ diff --git a/librfid_win32/drivers/libusb0.sys b/librfid_win32/drivers/libusb0.sys new file mode 100644 index 0000000..9e44a3b Binary files /dev/null and b/librfid_win32/drivers/libusb0.sys differ diff --git a/librfid_win32/drivers/libusb0_x64.dll b/librfid_win32/drivers/libusb0_x64.dll new file mode 100644 index 0000000..aef485d Binary files /dev/null and b/librfid_win32/drivers/libusb0_x64.dll differ diff --git a/librfid_win32/drivers/libusb0_x64.sys b/librfid_win32/drivers/libusb0_x64.sys new file mode 100644 index 0000000..b7f0f29 Binary files /dev/null and b/librfid_win32/drivers/libusb0_x64.sys differ diff --git a/librfid_win32/drivers/openpcd.cat b/librfid_win32/drivers/openpcd.cat new file mode 100644 index 0000000..dfa3a92 --- /dev/null +++ b/librfid_win32/drivers/openpcd.cat @@ -0,0 +1 @@ +not yet certified. \ No newline at end of file diff --git a/librfid_win32/drivers/openpcd.inf b/librfid_win32/drivers/openpcd.inf new file mode 100644 index 0000000..f618794 --- /dev/null +++ b/librfid_win32/drivers/openpcd.inf @@ -0,0 +1,136 @@ +[Version] +Signature = "$Chicago$" +provider = %manufacturer% +DriverVer = 08/27/2006,0.1.12.0 +CatalogFile = openpcd.cat +CatalogFile.NT = openpcd.cat +CatalogFile.NTAMD64 = openpcd_x64.cat + +Class = LibUsbDevices +ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} + +[ClassInstall] +AddReg=libusb_class_install_add_reg + +[ClassInstall32] +AddReg=libusb_class_install_add_reg + +[libusb_class_install_add_reg] +HKR,,,,"LibUSB-Win32 Devices" +HKR,,Icon,,"-20" + +[Manufacturer] +%manufacturer%=Devices,NT,NTAMD64 + +;-------------------------------------------------------------------------- +; Files +;-------------------------------------------------------------------------- + +[SourceDisksNames] +1 = "Libusb-Win32 Driver Installation Disk",, + +[SourceDisksFiles] +libusb0.sys = 1,, +libusb0.dll = 1,, +libusb0_x64.sys = 1,, +libusb0_x64.dll = 1,, + +[DestinationDirs] +libusb_files_sys = 10,system32\drivers +libusb_files_sys_x64 = 10,system32\drivers +libusb_files_dll = 10,system32 +libusb_files_dll_wow64 = 10,syswow64 +libusb_files_dll_x64 = 10,system32 + +[libusb_files_sys] +libusb0.sys + +[libusb_files_sys_x64] +libusb0.sys,libusb0_x64.sys + +[libusb_files_dll] +libusb0.dll + +[libusb_files_dll_wow64] +libusb0.dll + +[libusb_files_dll_x64] +libusb0.dll,libusb0_x64.dll + +;-------------------------------------------------------------------------- +; Device driver +;-------------------------------------------------------------------------- + +[LIBUSB_DEV] +CopyFiles = libusb_files_sys, libusb_files_dll +AddReg = libusb_add_reg + +[LIBUSB_DEV.NT] +CopyFiles = libusb_files_sys, libusb_files_dll + +[LIBUSB_DEV.NTAMD64] +CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64 + +[LIBUSB_DEV.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NTAMD64.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[LIBUSB_DEV.NTAMD64.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[libusb_add_reg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,libusb0.sys + +; Older versions of this .inf file installed filter drivers. They are not +; needed any more and must be removed +[libusb_del_reg_hw] +HKR,,LowerFilters +HKR,,UpperFilters + +; Device properties +[libusb_add_reg_hw] +HKR,,SurpriseRemovalOK, 0x00010001, 1 + +;-------------------------------------------------------------------------- +; Services +;-------------------------------------------------------------------------- + +[libusb_add_service] +DisplayName = "LibUsb-Win32 - Kernel Driver 08/27/2006, 0.1.12.0" +ServiceType = 1 +StartType = 3 +ErrorControl = 0 +ServiceBinary = %12%\libusb0.sys + +;-------------------------------------------------------------------------- +; Devices +;-------------------------------------------------------------------------- + +[Devices] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + +[Devices.NT] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + +[Devices.NTAMD64] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + + +;-------------------------------------------------------------------------- +; Strings +;-------------------------------------------------------------------------- + +[Strings] +manufacturer = "Bitmanufaktur IT Soutions" diff --git a/librfid_win32/drivers/openpcd_x64.cat b/librfid_win32/drivers/openpcd_x64.cat new file mode 100644 index 0000000..dfa3a92 --- /dev/null +++ b/librfid_win32/drivers/openpcd_x64.cat @@ -0,0 +1 @@ +not yet certified. \ No newline at end of file diff --git a/librfid_win32/examples/VisualC/HelloWorld.sln b/librfid_win32/examples/VisualC/HelloWorld.sln new file mode 100644 index 0000000..f3430e3 --- /dev/null +++ b/librfid_win32/examples/VisualC/HelloWorld.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld.vcproj", "{D227A517-3E51-4CF2-BD63-1271A1083545}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D227A517-3E51-4CF2-BD63-1271A1083545}.Debug|Win32.ActiveCfg = Debug|Win32 + {D227A517-3E51-4CF2-BD63-1271A1083545}.Debug|Win32.Build.0 = Debug|Win32 + {D227A517-3E51-4CF2-BD63-1271A1083545}.Release|Win32.ActiveCfg = Release|Win32 + {D227A517-3E51-4CF2-BD63-1271A1083545}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/librfid_win32/examples/VisualC/HelloWorld.vcproj b/librfid_win32/examples/VisualC/HelloWorld.vcproj new file mode 100644 index 0000000..0bfc145 --- /dev/null +++ b/librfid_win32/examples/VisualC/HelloWorld.vcproj @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/librfid_win32/examples/VisualC/lib/openpcd.lib b/librfid_win32/examples/VisualC/lib/openpcd.lib new file mode 100644 index 0000000..017d201 Binary files /dev/null and b/librfid_win32/examples/VisualC/lib/openpcd.lib differ diff --git a/librfid_win32/examples/VisualC/main.cpp b/librfid_win32/examples/VisualC/main.cpp new file mode 100644 index 0000000..87cd08f --- /dev/null +++ b/librfid_win32/examples/VisualC/main.cpp @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include "..\..\api\openpcd.h" + +MIFARE_HANDLE handle; + +void hexdump (const char *buffer, unsigned int len) +{ + while (len--) + printf (" %02X", (unsigned char)*buffer++); + printf ("\n"); +} + +int main (void) +{ + int res,ErrorCount; + unsigned int uid; +/* const char text1[] = "Hello!", text2[] = "World!", *text;*/ + char buffer[20]; + bool allow_reset,first; + + allow_reset=first=true; + handle=NULL; + ErrorCount=0; + + while(1) + { + if(!handle) + { + if ((res = openpcd_open_reader (&handle)) < 0) + handle=NULL; + else + printf ("STATUS: Reader=%02X\n",(unsigned int)handle); + } + else + { + if ((res = openpcd_select_card (handle)) < 0) + { + // optionally reset reader once after some errors + if(++ErrorCount>3) + { + printf ("ERROR: Can't select card: %s\n", openpcd_get_error_text (res)); + printf ("STATUS: resetting reader\n"); + ErrorCount=0; + + if(allow_reset) + { + allow_reset=false; + openpcd_reset_reader(handle); + } + } + openpcd_close_reader (handle); + handle=NULL; + } + else + { + if(openpcd_get_card_id(handle,&uid)<0) + uid=-1; + + printf ("DONE: selected card [0x%08X]\n",uid); + + if ((res = openpcd_read (handle, 2, buffer, 6)) < 0) + printf ("ERROR: Read card error: %s\n", + openpcd_get_error_text (res)); + else + { + printf ("DONE - %i bytes read:", res); + hexdump (buffer, res); + } + +/* text = strncmp (buffer, text1, 6) ? text1 : text2; + + if ((res = openpcd_write (handle, 2, text, 6)) < 0) + printf ("ERROR: Write card error: %s\n", + openpcd_get_error_text (res)); + else + { + buffer[res] = 0; + printf ("DONE: written %i bytes [%s]\n", res, text); + }*/ + + openpcd_deselect_card (handle); + + printf ("STATUS: deselected card\n"); + } + } + } + + openpcd_close_reader (handle); + printf ("STATUS: closed reader\n"); + + return 0; +} diff --git a/librfid_win32/licenses/cygwin/CYGWIN_LICENSE b/librfid_win32/licenses/cygwin/CYGWIN_LICENSE new file mode 100644 index 0000000..579907e --- /dev/null +++ b/librfid_win32/licenses/cygwin/CYGWIN_LICENSE @@ -0,0 +1,39 @@ +-------------------------------------------------------------------------- +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License (GPL) version 2, as +published by the Free Software Foundation. + +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. +-------------------------------------------------------------------------- + + *** NOTE *** + +In accordance with section 10 of the GPL, Red Hat permits programs whose +sources are distributed under a license that complies with the Open +Source definition to be linked with libcygwin.a without libcygwin.a +itself causing the resulting program to be covered by the GNU GPL. + +This means that you can port an Open Source(tm) application to cygwin, +and distribute that executable as if it didn't include a copy of +libcygwin.a linked into it. Note that this does not apply to the cygwin +DLL itself. If you distribute a (possibly modified) version of the DLL +you must adhere to the terms of the GPL, i.e. you must provide sources +for the cygwin DLL. + +See http://www.opensource.org/docs/definition_plain.html for the precise +Open Source Definition referenced above. + +Red Hat sells a special Cygwin License for customers who are unable to +provide their application in open source code form. For more +information, please see: http://www.redhat.com/software/cygwin/, or call ++1-866-2REDHAT ext. 45300 (toll-free in the US). + +Outside the US call your regional Red Hat office, +see http://www.redhat.com/en_us/USA/home/company/contact/ww/. diff --git a/librfid_win32/licenses/dfu-programmer/AUTHORS b/librfid_win32/licenses/dfu-programmer/AUTHORS new file mode 100644 index 0000000..6d9882f --- /dev/null +++ b/librfid_win32/licenses/dfu-programmer/AUTHORS @@ -0,0 +1,13 @@ +Original Author: + - Weston Schmidt + +Contributors: + - Reinhard Arlt + - at89c5131 chip support + - David Brownell + - compiler flag improvements + - command line argument processing improvements + - debugging system improvements + - significant man page improvements + - support for the at90usb series AVR chips + - the beginnings of the move over to using stdint.h diff --git a/librfid_win32/licenses/dfu-programmer/COPYING b/librfid_win32/licenses/dfu-programmer/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/librfid_win32/licenses/dfu-programmer/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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. diff --git a/librfid_win32/licenses/dfu-programmer/NEWS b/librfid_win32/licenses/dfu-programmer/NEWS new file mode 100644 index 0000000..43d4400 --- /dev/null +++ b/librfid_win32/licenses/dfu-programmer/NEWS @@ -0,0 +1,15 @@ +Release 0.3.0 +* Added support for (AVR) at90usb1287, at90usb1286, at90usb647, at90usb646 + chips. +* Fixes a minor validation bug where the last byte of flash was not being + correctly validated. +Release 0.2.2 +* Minor bug fix for a segmentation fault if only the usage is displayed. +Release 0.2.1 +* Minor bug fixes and documentation updates. +Release 0.2 +* Limited support for the at89c5132, at89c5131 and at89c5130 chip is added. + where the known limitations now have to do with P1_CF, P3_CF, P4_CF not + being supported (read or write). +Release 0.1 +* Initial release diff --git a/librfid_win32/licenses/dfu-programmer/README b/librfid_win32/licenses/dfu-programmer/README new file mode 100644 index 0000000..fbc0bd9 --- /dev/null +++ b/librfid_win32/licenses/dfu-programmer/README @@ -0,0 +1,66 @@ +dfu-programmer is an implementation of the Device Firmware Upgrade class +USB driver that enables firmware upgrades for various USB enabled (with the +correct bootloader) Atmel chips. This program was created because the +Atmel "FLIP" program for flashing devices does not support flashing via USB +on Linux, and because standard DFU loaders do not work for Atmel's chips. + +Check out the Atmel website for more information. They are kind enough to +provide generally correct specifications this implementation is based on. + +The project website is http://dfu-programmer.sourceforge.net and you can +use that to check for updates. + +Currently Supported Chips +========================= +8051 based: + at89c51snd1c + at89c5130 + at89c5131 + at89c5132 + +AVR based: + at90usb1287 + at90usb1286 + at90usb647 + at90usb646 + +Simple install procedure +======================== + + % tar -xzf dfu-programmer-.tar.gz # unpack the sources + % cd dfu-programmer # change to the top-level + # directory + + [ If the source was checked-out from CVS, run the following command ] + % ./bootstrap.sh # regenerate base config + # files + + % ./configure # regenerate configure and + # run it + + [ Optionally you can specify where dfu-programmer gets installed + using the --prefix= option to the ./configure command. See + % ./configure --help for more details. ] + + % make # build dfu-programmer + [ Become root if necessary ] + % make install # install dfu-programmer + +Building RPM Binary Packages +============================ +This section is intended to make it easier for those people that wish to +build RPMs from the source included in this package, but aren't sure how. + +1) Copy dfu-programmer-.tar.gz to your RPM SOURCES directory. Usually + this is /usr/src/redhat/SOURCES/. + +2) Extract or copy dfu-programmer.spec into your RPM SPECS directory. Usually + this is /usr/src/redhat/SPECS/. + +3) In your RPM SPECS directory, issue the command 'rpm -ba dfu-programmer.spec'. + This will cause rpm to extract the dfu-programmer sources to a temporary + directory, build them, and build rpm packages based on the information in + the spec file. The binary rpms will be put into your RPM RPMS directory. + Usually this is /usr/src/redhat/RPMS//. + +If you have any further questions, please refer to the RPM documentation. diff --git a/librfid_win32/licenses/librfid/COPYING b/librfid_win32/licenses/librfid/COPYING new file mode 100644 index 0000000..60549be --- /dev/null +++ b/librfid_win32/licenses/librfid/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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) 19yy 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. diff --git a/librfid_win32/licenses/librfid/README b/librfid_win32/licenses/librfid/README new file mode 100644 index 0000000..18c122e --- /dev/null +++ b/librfid_win32/licenses/librfid/README @@ -0,0 +1,139 @@ +librfid - low-level RFID access library +(C) 2005-2006 by Harald Welte +====================================================================== + +This library intends to provide a reader- and (as much as possible) +PICC / tag independent API for RFID applications. + +1. Supported Prodocols: + +At this early stage of implementaition, it offers only ISO 14443-2, ISO 14443-3 +A and B as well as ISO 14443-4 (T=CL) support. Other protocols, both open +(such as ISO 15693) and proprietary are to be added as soon as I find some +more time. + +2. Supported Readers: + +At this time, the Omnikey Cardman 5121/5321 and the OpenPCD readers are supported. + +2.1 Omnikey Cardman 5121/5321 RFID (http://www.omnikey.de/) + +The cm5121 is a relatively stupid piece of hardware. Basically a contact-based +cm3121 that was enhanced by putting a Philips CL RC632 reader ASIC next to it. +There is no RFID protocol implementation on the cm5121, everything is done on +the host (PC) software. Four primitives (read/write byte/fifo) are provided +via simple PC_to_RDR_Escape CCID messages. + +The cm5321 seems to be an improved version of the 5121, mainly with different +antenna geometrics for better communications reliability. + +2.2 OpenPCD (http://www.openpcd.org/) + +The OpenPCD reader is completely free. You get the full schematics, the PCB +design, and the source code to the device firmware (written in C, to be +compiled with the free GNU toolchain). Also, all required development tools +are available under Free Software licenses! + +In addition, it has various headers for access to the intermediate signal +processing steps. + +This makes it the ideal device to learn and play with RFID, since you don't +have any (proprietary) software interfere and puts you in full control of +everything. + +This is now the primary development target for librfid. However, this doesn't +mean that we don't want to support as many readers as possible. + +Another interesting new option is to cross-compile librfid to fit it _inside_ +the OpenPCD firmware, enabling a fully autonomous RFID stack (and RFID +applications) on the reader, without any requirement for a host PC! + +2.3 Philips Pegoda + +This reader is not yet supported. Some initial experiments have shown that +adding support for it is + +2.x Further Readers + +Support for more devices shouldn't be too difficult to add, provided the +devices are stupid enough. More sophisticated readers like Integrated +Engineering or Philips Pegoda do much of the protocol handling in firmware on a +Microcontroller. This makes them (at least till now) faster, but also of +limited use, especially in education and research. + +So if you happen to run into any other dumb RFID readers, especially those +based on Philips CL RC622, RC531 and RC632, adding support should be very +straightforward. If you want to contract me for implementing a driver +backend, don't hesitate to contact me. + + +3. Building / Installing + +In the default configuration, librfid only includes the driver for the OpenPCD +dumbreader firmware. + +If you want support for Omnikey Cardman 5121/5321, you have to add +'--enable-reader-cm5x21' to the './configure' comannd, _and_ choose the backend +you want to use, either: + +3.1 (new) native CCID backend + +If you add the '--enable-ccid' option to the './configure' command, then the new +native CCID driver (courtesy of Werner Koch) will be linked into the library. +This requires a working libusb with development headers. + +In order to use the reader, you will need to set the permissions of the +respective /proc/bus/usb or /sys/bus/usb files (or run the application as +root, if you trust my code, which you shouldn't). + +If you run udev, just use the 'etc/udev/librfid.rules' udev rulefile, which should +change the group of the usb device to 'users'. + +3.2 (old) OpenCT backend + +This backend has the advantage that it will allow you to use the contact-based +part and the contactless part of the CM5121 simultaneously. However, it requires +a patched version of OpenCT. + +A patch against openct-0.6.7 is available as openct-0.6.7-librfid.patch. + +Please note that while librfid in this configuration _uses_ OpenCT as a +lower-layer transport interface, it doesn't actually provide a virtual reader +interface to it, i.e. you can't use CT-API/OpenCT/PCSC API's to access RFID +transponders. + +In order to use this backend, you need to use the +'--with-openct=/path/to/openct' option. + + +4. Testing + +In the 'utils' directory, you will get a 'librfid-tool' binary. It is very +minimalistic, and mainly an example on how to use the librfid api. For an ICAO +compliant passport, you may try "--layer2 iso14443a --protocol tcl". For a +mifare ultralight transponder, "--layer2 iso14443a --protocol +mifare-ultralight" will give you a full dump of the transponder. + +The most basic command to get started is "librfid-tool --scan" to make it +auto-detect the first available (and supported) transponder + + +5. Help and Support + +If you run into any problems using librfid, the primary contact address is the +mailinglist of librfid developers at librfid-devel@lists.gnumonks.org. Please +note that while the development community is trying to provide the best level +of support, response times might vary. + +You can subscribe to this list at + https://lists.gnumonks.org/mailman/listinfo/librfid-devel + +If you are interested in commercial grade support of librfid, feel free to +contact me privately to discuss your requirements and provide you with a quote. + +6. Licensing + +Pleas read the file LICENSING. + +-- Harald Welte + diff --git a/librfid_win32/licenses/librfid/TODO b/librfid_win32/licenses/librfid/TODO new file mode 100644 index 0000000..649fb96 --- /dev/null +++ b/librfid_win32/licenses/librfid/TODO @@ -0,0 +1,48 @@ +rc632: +- fix handling of timeout (program timer of RC632) +- add a timeout tolerance factor that can be user-specified +- make sure interrupt mode for timer wait works + +cm5121: +- fix handling of TX or RX > 0x7f [buffer length in atmel chip?] + +iso14443a: +[none] + +iso14443b: +- implement 'option 2' frame markers +- test anticollission (need multiple tags) + +iso15693: +- implement anticollision +- implement all the rest + +mifare_clasic: +- test +- try to auto-detect 1k/4k +- try to distinguish mifare ultralight and mifare classic in/after anticol + +tcl: +- implement pps for asymmetric (rx/tx) speeds + +openct: +- add ifdhandler driver + +other: +- implementation of code for various passive tags +- documentation +- add notion of 'asic implementation' for specifying reader-specific + initialization values such as mod_conductance +- abstract a read single block / read multiple block API where l2/proto + layer can provide multi-block function (e.g. iso15693), which will be + emulated in case there only is a single-block function +- switch over to use of rfid_buf structure, similar to linux skb. upper + layers have sufficient headroom in order to have lower layers add protocol + headers in front of a packet +- implement software checksumming support. The reader should be able to + indicate whether it supports hardware checksum generation / verification. +- application software should be able to override hardware csumming on request +- implement some auto-calibration mode where the user is requested to leave a + single PICC/VICC on the reader and the software iterates through various + mod_conductance and bitphase values to see whether it can calibrate to a given + [new] card. The resulting calibration values are printed by the program. diff --git a/librfid_win32/licenses/libusb/AUTHORS.txt b/librfid_win32/licenses/libusb/AUTHORS.txt new file mode 100644 index 0000000..16e3953 --- /dev/null +++ b/librfid_win32/licenses/libusb/AUTHORS.txt @@ -0,0 +1,12 @@ + +Library, Test Programs: + +Stephan Meyer, +Johannes Erdfelt, +Thomas Sailer, + + +Drivers, Services, Installer: + +Stephan Meyer, + diff --git a/librfid_win32/licenses/libusb/COPYING_GPL.txt b/librfid_win32/licenses/libusb/COPYING_GPL.txt new file mode 100644 index 0000000..45645b4 --- /dev/null +++ b/librfid_win32/licenses/libusb/COPYING_GPL.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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. diff --git a/librfid_win32/licenses/libusb/COPYING_LGPL.txt b/librfid_win32/licenses/libusb/COPYING_LGPL.txt new file mode 100644 index 0000000..6d6873c --- /dev/null +++ b/librfid_win32/licenses/libusb/COPYING_LGPL.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; 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. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/librfid_win32/licenses/libusb/README.txt b/librfid_win32/licenses/libusb/README.txt new file mode 100644 index 0000000..9b69ba9 --- /dev/null +++ b/librfid_win32/licenses/libusb/README.txt @@ -0,0 +1,12 @@ + +This is libusb-win32 (http://libusb-win32.sourceforge.net) version 0.1.10.1. +Libusb-win32 is a library that allows userspace application to access USB +devices on Windows operation systems (Win98SE, WinME, Win2k, WinXP). +It is derived from and fully API compatible to libusb available at +http://libusb.sourceforge.net. + +For more information visit the project's web site at: + +http://libusb-win32.sourceforge.net +http://sourceforge.net/projects/libusb-win32 + diff --git a/librfid_win32/tools/librfid-tool.exe b/librfid_win32/tools/librfid-tool.exe new file mode 100644 index 0000000..9becc5c Binary files /dev/null and b/librfid_win32/tools/librfid-tool.exe differ diff --git a/librfid_win32/tools/mifare-tool.exe b/librfid_win32/tools/mifare-tool.exe new file mode 100644 index 0000000..8b51170 Binary files /dev/null and b/librfid_win32/tools/mifare-tool.exe differ diff --git a/openpcd/libusb0.dll b/openpcd/libusb0.dll new file mode 100644 index 0000000..316459a Binary files /dev/null and b/openpcd/libusb0.dll differ diff --git a/openpcd/libusb0.sys b/openpcd/libusb0.sys new file mode 100644 index 0000000..9e44a3b Binary files /dev/null and b/openpcd/libusb0.sys differ diff --git a/openpcd/libusb0_x64.dll b/openpcd/libusb0_x64.dll new file mode 100644 index 0000000..aef485d Binary files /dev/null and b/openpcd/libusb0_x64.dll differ diff --git a/openpcd/libusb0_x64.sys b/openpcd/libusb0_x64.sys new file mode 100644 index 0000000..b7f0f29 Binary files /dev/null and b/openpcd/libusb0_x64.sys differ diff --git a/openpcd/openpcd.cat b/openpcd/openpcd.cat new file mode 100644 index 0000000..dfa3a92 --- /dev/null +++ b/openpcd/openpcd.cat @@ -0,0 +1 @@ +not yet certified. \ No newline at end of file diff --git a/openpcd/openpcd.inf b/openpcd/openpcd.inf new file mode 100644 index 0000000..f618794 --- /dev/null +++ b/openpcd/openpcd.inf @@ -0,0 +1,136 @@ +[Version] +Signature = "$Chicago$" +provider = %manufacturer% +DriverVer = 08/27/2006,0.1.12.0 +CatalogFile = openpcd.cat +CatalogFile.NT = openpcd.cat +CatalogFile.NTAMD64 = openpcd_x64.cat + +Class = LibUsbDevices +ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} + +[ClassInstall] +AddReg=libusb_class_install_add_reg + +[ClassInstall32] +AddReg=libusb_class_install_add_reg + +[libusb_class_install_add_reg] +HKR,,,,"LibUSB-Win32 Devices" +HKR,,Icon,,"-20" + +[Manufacturer] +%manufacturer%=Devices,NT,NTAMD64 + +;-------------------------------------------------------------------------- +; Files +;-------------------------------------------------------------------------- + +[SourceDisksNames] +1 = "Libusb-Win32 Driver Installation Disk",, + +[SourceDisksFiles] +libusb0.sys = 1,, +libusb0.dll = 1,, +libusb0_x64.sys = 1,, +libusb0_x64.dll = 1,, + +[DestinationDirs] +libusb_files_sys = 10,system32\drivers +libusb_files_sys_x64 = 10,system32\drivers +libusb_files_dll = 10,system32 +libusb_files_dll_wow64 = 10,syswow64 +libusb_files_dll_x64 = 10,system32 + +[libusb_files_sys] +libusb0.sys + +[libusb_files_sys_x64] +libusb0.sys,libusb0_x64.sys + +[libusb_files_dll] +libusb0.dll + +[libusb_files_dll_wow64] +libusb0.dll + +[libusb_files_dll_x64] +libusb0.dll,libusb0_x64.dll + +;-------------------------------------------------------------------------- +; Device driver +;-------------------------------------------------------------------------- + +[LIBUSB_DEV] +CopyFiles = libusb_files_sys, libusb_files_dll +AddReg = libusb_add_reg + +[LIBUSB_DEV.NT] +CopyFiles = libusb_files_sys, libusb_files_dll + +[LIBUSB_DEV.NTAMD64] +CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64 + +[LIBUSB_DEV.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NTAMD64.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_DEV.NT.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[LIBUSB_DEV.NTAMD64.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[libusb_add_reg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,libusb0.sys + +; Older versions of this .inf file installed filter drivers. They are not +; needed any more and must be removed +[libusb_del_reg_hw] +HKR,,LowerFilters +HKR,,UpperFilters + +; Device properties +[libusb_add_reg_hw] +HKR,,SurpriseRemovalOK, 0x00010001, 1 + +;-------------------------------------------------------------------------- +; Services +;-------------------------------------------------------------------------- + +[libusb_add_service] +DisplayName = "LibUsb-Win32 - Kernel Driver 08/27/2006, 0.1.12.0" +ServiceType = 1 +StartType = 3 +ErrorControl = 0 +ServiceBinary = %12%\libusb0.sys + +;-------------------------------------------------------------------------- +; Devices +;-------------------------------------------------------------------------- + +[Devices] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + +[Devices.NT] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + +[Devices.NTAMD64] +"OpenPCD.org 13.56MHz RFID Reader"=LIBUSB_DEV, USB\VID_16c0&PID_076b + + +;-------------------------------------------------------------------------- +; Strings +;-------------------------------------------------------------------------- + +[Strings] +manufacturer = "Bitmanufaktur IT Soutions" diff --git a/openpcd/openpcd_x64.cat b/openpcd/openpcd_x64.cat new file mode 100644 index 0000000..dfa3a92 --- /dev/null +++ b/openpcd/openpcd_x64.cat @@ -0,0 +1 @@ +not yet certified. \ No newline at end of file diff --git a/sam7utils/.deps/cmd.Po b/sam7utils/.deps/cmd.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/sam7utils/.deps/cmd.Po @@ -0,0 +1 @@ +# dummy diff --git a/sam7utils/.deps/io_posix.Po b/sam7utils/.deps/io_posix.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/sam7utils/.deps/io_posix.Po @@ -0,0 +1 @@ +# dummy diff --git a/sam7utils/.deps/main.Po b/sam7utils/.deps/main.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/sam7utils/.deps/main.Po @@ -0,0 +1 @@ +# dummy diff --git a/sam7utils/.deps/samba.Po b/sam7utils/.deps/samba.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/sam7utils/.deps/samba.Po @@ -0,0 +1 @@ +# dummy diff --git a/sam7utils/AUTHORS b/sam7utils/AUTHORS new file mode 100644 index 0000000..5f6b52b --- /dev/null +++ b/sam7utils/AUTHORS @@ -0,0 +1 @@ +Copyright (C) 2006 Erik Gilling \ No newline at end of file diff --git a/sam7utils/COPYING b/sam7utils/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/sam7utils/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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. diff --git a/sam7utils/ChangeLog b/sam7utils/ChangeLog new file mode 100644 index 0000000..922bcdb --- /dev/null +++ b/sam7utils/ChangeLog @@ -0,0 +1,47 @@ +2006-07-07 erik gilling + * version 0.1.0 + +2006-07-07 erik gilling + * add boot_from_flash command from Liam + +2006-06-16 erik gilling + * unlock_regions uses nvpsize not sramsiz + +2006-06-16 erik gilling + * fix lock bit detection + +2006-06-16 erik gilling + * fix configure.in to set OS options before looking for headers + * add read and read_manual commands + * add detection for number of lock bits + * fix unlock_regions for devices other than the S64 + * remove exraneous debugging info + * add --exec command line for scriptability + +2006-06-15 erik gilling + * add win32 support (cygwin only for now) + +2006-06-14 erik gilling + * integrate loaders into sam7 binary + +2006-06-14 erik gilling + * remove endian swapping from write_half_word and write_word + +2006-06-13 erik gilling + * rename samba_flash to flash + * add support for 256 byte pages using flash command + +2006-06-13 erik gilling + * add loader code (tested on sam7s64) + +2006-06-09 erik gilling + * correct type matching for sam7x + * first stab at endianness correction (untested) + +2006-06-08 erik gilling + * read cpuid and size flash page + * print out chip info on init + +2005-12-30 erik gilling + * increment version to 0.0.2 + * add manual_upload command which does not use samba.bin diff --git a/sam7utils/INSTALL b/sam7utils/INSTALL new file mode 100644 index 0000000..56b077d --- /dev/null +++ b/sam7utils/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/sam7utils/Makefile b/sam7utils/Makefile new file mode 100644 index 0000000..ee6326d --- /dev/null +++ b/sam7utils/Makefile @@ -0,0 +1,562 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# 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. + + + + +srcdir = . +top_srcdir = . + +pkgdatadir = $(datadir)/sam7utils +pkglibdir = $(libdir)/sam7utils +pkgincludedir = $(includedir)/sam7utils +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = /bin/install -c +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 = i686-pc-mingw32 +host_triplet = i686-pc-mingw32 +target_triplet = i686-pc-mingw32 +LIBOBJDIR = +bin_PROGRAMS = sam7$(EXEEXT) +DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh 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_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_sam7_OBJECTS = main.$(OBJEXT) io_posix.$(OBJEXT) samba.$(OBJEXT) \ + cmd.$(OBJEXT) +sam7_OBJECTS = $(am_sam7_OBJECTS) +sam7_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(sam7_SOURCES) +DIST_SOURCES = $(sam7_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +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 +ACLOCAL = aclocal-1.9 +AMDEP_FALSE = # +AMDEP_TRUE = +AMTAR = tar +AUTOCONF = autoconf +AUTOHEADER = autoheader +AUTOMAKE = automake-1.9 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = grep -E +EXEEXT = .exe +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +IOTYPE = posix +LDFLAGS = +LIBOBJS = +LIBS = -lreadline -lncurses +LTLIBOBJS = +MAKEINFO = makeinfo +OBJEXT = o +PACKAGE = sam7utils +PACKAGE_BUGREPORT = konkers@konkers.net +PACKAGE_NAME = sam7utils +PACKAGE_STRING = sam7utils 0.1.0 +PACKAGE_TARNAME = sam7utils +PACKAGE_VERSION = 0.1.0 +PATH_SEPARATOR = : +SET_MAKE = +SHELL = /bin/sh +STRIP = +VERSION = 0.1.0 +ac_ct_CC = gcc +ac_ct_STRIP = +am__fastdepCC_FALSE = # +am__fastdepCC_TRUE = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-mingw32 +build_alias = +build_cpu = i686 +build_os = mingw32 +build_vendor = pc +datadir = ${prefix}/share +exec_prefix = ${prefix} +host = i686-pc-mingw32 +host_alias = +host_cpu = i686 +host_os = mingw32 +host_vendor = pc +includedir = ${prefix}/include +infodir = ${prefix}/info +install_sh = /D/Visual Studio 2010/Projects/Matomat/sam7utils/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localstatedir = ${prefix}/var +mandir = ${prefix}/man +mkdir_p = mkdir -p -- +oldincludedir = /usr/include +prefix = /usr/local +program_transform_name = s,x,x, +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +sysconfdir = ${prefix}/etc +target = i686-pc-mingw32 +target_alias = +target_cpu = i686 +target_os = mingw32 +target_vendor = pc +AM_CFLAGS = -Wall -Werror +AUTOMAKE_OPTIONS = gnu +sam7_SOURCES = main.c io_posix.c samba.c cmd.c +noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h +EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \ + loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \ + loader/loader.c loader/loader.lds + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +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 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(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: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +sam7$(EXEEXT): $(sam7_OBJECTS) $(sam7_DEPENDENCIES) + @rm -f sam7$(EXEEXT) + $(LINK) $(sam7_LDFLAGS) $(sam7_OBJECTS) $(sam7_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/cmd.Po +include ./$(DEPDIR)/io_posix.Po +include ./$(DEPDIR)/main.Po +include ./$(DEPDIR)/samba.Po + +.c.o: + if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` +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) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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)/driver $(distdir)/loader + @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 + -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-am +all-am: Makefile $(PROGRAMS) $(HEADERS) config.h +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: + +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." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr 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 -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck 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 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: diff --git a/sam7utils/Makefile.am b/sam7utils/Makefile.am new file mode 100644 index 0000000..9865fbf --- /dev/null +++ b/sam7utils/Makefile.am @@ -0,0 +1,12 @@ +AM_CFLAGS = -Wall -Werror + +AUTOMAKE_OPTIONS = gnu + +bin_PROGRAMS = sam7 + +sam7_SOURCES = main.c io_@IOTYPE@.c samba.c cmd.c +noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h + +EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \ + loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \ + loader/loader.c loader/loader.lds \ No newline at end of file diff --git a/sam7utils/Makefile.in b/sam7utils/Makefile.in new file mode 100644 index 0000000..0d5fbb2 --- /dev/null +++ b/sam7utils/Makefile.in @@ -0,0 +1,562 @@ +# 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 = @INSTALL@ +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@ +target_triplet = @target@ +LIBOBJDIR = +bin_PROGRAMS = sam7$(EXEEXT) +DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh 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_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_sam7_OBJECTS = main.$(OBJEXT) io_@IOTYPE@.$(OBJEXT) samba.$(OBJEXT) \ + cmd.$(OBJEXT) +sam7_OBJECTS = $(am_sam7_OBJECTS) +sam7_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(sam7_SOURCES) +DIST_SOURCES = $(sam7_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +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 +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +IOTYPE = @IOTYPE@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +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@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_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@ +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 = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +AM_CFLAGS = -Wall -Werror +AUTOMAKE_OPTIONS = gnu +sam7_SOURCES = main.c io_@IOTYPE@.c samba.c cmd.c +noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h +EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \ + loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \ + loader/loader.c loader/loader.lds + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu 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: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +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 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(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: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +sam7$(EXEEXT): $(sam7_OBJECTS) $(sam7_DEPENDENCIES) + @rm -f sam7$(EXEEXT) + $(LINK) $(sam7_LDFLAGS) $(sam7_OBJECTS) $(sam7_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_@IOTYPE@.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samba.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +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) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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)/driver $(distdir)/loader + @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 + -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-am +all-am: Makefile $(PROGRAMS) $(HEADERS) config.h +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: + +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." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr 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 -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck 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 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: diff --git a/sam7utils/NEWS b/sam7utils/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/sam7utils/README b/sam7utils/README new file mode 100644 index 0000000..2484b3d --- /dev/null +++ b/sam7utils/README @@ -0,0 +1,42 @@ +AT91SAM7 USB specific firmware flash approach + +Milosch Meriac + +sam7utils: (C) 2006 Erik Gilling + + + +To make sure that the SAM7 interface will be recognized +by the Linux Kernel please add the following line to +/etc/modprobe.conf.local (or /etc/modprobe.conf if this +file doesnt exist): + +options usbserial vendor=0x03EB product=0x6124 + + +(Re)Plug your device to make sure it will be detected properly. +Find out which serial port its connected to (see last line +- it's ttyUSB2 in this particular case): + +dmesg | grep ttyUSB + usb 3-1: pl2303 converter now attached to ttyUSB0 + usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB1 + usb 1-7.2: generic converter now attached to ttyUSB2 + + +Install the latest firmware image: + +sam7 -l /dev/ttyUSB2 + Chip Version: 0 + Embedded Processor: ARM7TDMI + NVRAM Region 1 Size: 128 K + NVRAM Region 2 Size: 0 K + SRAM Size: 128 K + Series: AT91SAM7Sxx + Page Size: 256 bytes + Lock Regions: 8 +sam7> set_clock +sam7> unlock_regions + unlocking region 0: done + unlocking region 1: done +sam7> flash myfirmware.img diff --git a/sam7utils/README.OLD b/sam7utils/README.OLD new file mode 100644 index 0000000..e6e2f69 --- /dev/null +++ b/sam7utils/README.OLD @@ -0,0 +1,19 @@ + +If you are running linux, you first need to load the at91 kernel driver: +> insmod driver/at91.ko + +Once that's loaded (or you are using OSX): +> ./sam7 +response = 0d0a +it begins +sam7> set_clock +sam7> unlock_regions +unlocking page 0: done +unlocking page 1: done + + +sam7> manual_flash test.bin +> + + + diff --git a/sam7utils/aclocal.m4 b/sam7utils/aclocal.m4 new file mode 100644 index 0000000..7d473d5 --- /dev/null +++ b/sam7utils/aclocal.m4 @@ -0,0 +1,862 @@ +# generated automatically by aclocal 1.9.6 -*- 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. + +# 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. + +# 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"]) +]) + +# 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 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# 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])]) + +# 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 + diff --git a/sam7utils/at91flash b/sam7utils/at91flash new file mode 100644 index 0000000..ae3af62 --- /dev/null +++ b/sam7utils/at91flash @@ -0,0 +1,26 @@ +#!/bin/bash +# (C) Milosch Meriac 2006 + +UART='/dev/ttyUSB1' +SAM7='/usr/local/bin/sam7' + +if [[ -a $1 ]]; then + + echo "1. please unplug the USB cable and insert the SAM-BA jumper (Pin 1+2)" + echo "2. attach the USB cable" + echo "3. wait ten seconds" + echo "4. unplug the USB cable" + echo "5. remove the SAM-BA jumper" + echo "6. attach the USB cable" + echo "7. wait several seconds to allow the device to be detected by Linux" + echo "8. press [ENTER] to start flashing" + echo -e "9. flashing '$1'...\n" + $SAM7 << ENDOFMYTEXT +set_clock +unlock_regions +flash $1 +ENDOFMYTEXT + + echo '10. done!' +else + echo "can't open flash image file '$1'" diff --git a/sam7utils/cmd.c b/sam7utils/cmd.c new file mode 100644 index 0000000..644b880 --- /dev/null +++ b/sam7utils/cmd.c @@ -0,0 +1,682 @@ +/* + * cmd.c + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + */ + +#include "config.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "samba.h" +#include "cmd.h" + +#include "loader128_data.h" +#include "loader256_data.h" + +#define MANUAL_FLASH + +static int cmd_help( int argc, char *argv[] ); +static int cmd_version( int argc, char *argv[] ); +static int cmd_write_mem( int argc, char *argv[] ); +static int cmd_read_mem( int argc, char *argv[] ); +static int cmd_send_file( int argc, char *argv[] ); +static int cmd_set_clock( int argc, char *argv[] ); +static int cmd_locked_regions( int argc, char *argv[] ); +static int cmd_unlock_regions( int argc, char *argv[] ); +static int cmd_boot_from_flash( int argc, char *argv[] ); +static int cmd_flash( int argc, char *argv[] ); +static int cmd_read( int argc, char *argv[] ); +static int cmd_manual_flash( int argc, char *argv[] ); +static int cmd_manual_read( int argc, char *argv[] ); + +static cmd_t cmds[] = { + {cmd_write_mem, "wb", + "wb ", "write to "}, + + {cmd_read_mem, "rb", + "rb ", "read byte from "}, + + {cmd_write_mem, "ws", + "ws ", "write to "}, + + {cmd_read_mem, "rs", + "rs ", "read short from "}, + + {cmd_write_mem, "ww", + "ww ", "write to "}, + + {cmd_read_mem, "rw", + "rw ", "read word from "}, + + {cmd_send_file, "sf", + "sf ", + "send len bytes of file starting at offset"}, + + {cmd_set_clock, "set_clock", + "set_clock", "set clock as SAM-BA does"}, + {cmd_locked_regions, "locked_regions", + "locked_regions", "display locked regions"}, + {cmd_unlock_regions, "unlock_regions", + "unlock_regions", "unlock all lock regions"}, + {cmd_boot_from_flash, "boot_from_flash", + "boot_from_flash", "et the SAM7X to boot from flashs"}, + {cmd_flash, "flash", + "flash ", "upload to flash using samba.bin"}, + {cmd_read, "read", + "read ", "write bytes at to using R commands"}, + {cmd_manual_flash, "manual_flash", + "manual_flash ", "upload to flash using ww commands"}, + {cmd_manual_read, "manual_read", + "manual_read ", "write bytes at to using rw commands"}, + {cmd_version, "version", + "version", "get boot program version"}, + {cmd_help, "help", + "help", "display help screen"} +}; + +cmd_t *cmd_find( char *name ) +{ + int i; + for( i=0 ; i<(sizeof(cmds)/ + sizeof(*cmds)); i++ ) { + if( !strcmp( name, cmds[i].name ) ) { + return &cmds[i]; + } + } + return NULL; +} + +static int cmd_help( int argc, char *argv[] ) +{ + int i; + for( i=0 ; i<(sizeof(cmds)/ + sizeof(*cmds)); i++ ) { + printf( "%-30s%s\n", cmds[i].invo, cmds[i].help ); + } + + return 0; +} + +static int cmd_write_mem( int argc, char *argv[] ) +{ + unsigned long int addr; + unsigned long int val; + char *endp; + + if( argc != 3 ) { + return CMD_E_WRONG_NUM_ARGS; + } + + addr = strtoul( argv[1], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + val = strtoul( argv[2], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + + switch( argv[0][1] ) { + case 'b': + if( samba_write_byte( addr, (uint8_t) val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + break; + case 's': + if( samba_write_half_word( addr, (uint16_t) val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + break; + case 'w': + if( samba_write_word( addr, (uint32_t) val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + break; + } + + return CMD_E_OK; +} + +static int cmd_read_mem( int argc, char *argv[] ) +{ + unsigned long int addr; + char *endp; + + if( argc != 2 ) { + return CMD_E_WRONG_NUM_ARGS; + } + + addr = strtoul( argv[1], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + switch( argv[0][1] ) { + case 'b': + { + uint8_t val; + if( samba_read_byte( addr, &val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + printf( "%02X\n", val ); + } + break; + case 's': + { + uint16_t val; + + if( samba_read_half_word( addr, &val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + printf( "%04X\n", val ); + } + break; + case 'w': + { + uint32_t val; + if( samba_read_word( addr, &val ) < 0 ) { + return CMD_E_IO_FAILURE; + } + printf( "%08X\n", (unsigned int) val ); + } + break; + } + + return CMD_E_OK; +} + +static int cmd_send_file( int argc, char *argv[] ) +{ + unsigned long int offset; + unsigned long int len; + unsigned long int addr; + char *endp; + uint8_t *data; + int fd; + + if( argc != 5 ) { + return CMD_E_WRONG_NUM_ARGS; + } + + addr = strtoul( argv[1], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + offset = strtoul( argv[3], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + len = strtoul( argv[4], &endp, 0 ); + if( endp == argv[1] || + *endp != '\0' ) { + return CMD_E_INVAL_ARG; + } + + if( (data = (uint8_t *) malloc( len )) == NULL ) { + printf( "can't allocate %d bytes\n", (int)len ); + return CMD_E_NO_MEM; + } + + if( (fd = open( argv[2], O_RDONLY )) < 0 ) { + printf( "can't open file \"%s\": %s\n", argv[2], + strerror( errno ) ); + return CMD_E_BAD_FILE; + } + + lseek( fd, offset, SEEK_SET ); + len = read( fd, data, len ); + + if( samba_send_file( 0x202000, data, len ) < 0 ) { + return CMD_E_IO_FAILURE; + } + + return CMD_E_OK; +} + +static int cmd_version( int argc, char *argv[] ) +{ + char buff[256]; + + if( samba_get_version( buff, 256 ) < 0 ) { + return CMD_E_IO_FAILURE; + } + + printf( "%s\n", buff ); + + return CMD_E_OK; +} + +static int cmd_set_clock( int argc, char *argv[] ) +{ + uint32_t val; + uint8_t val8; + + /* set clock to main clock / 2 */ + if( samba_write_word( 0xFFFFFC30, 0x5 ) < 0 ) { + return -1; + } + + do { + if( samba_read_word( 0xFFFFFC68, &val ) < 0 ) { + return -1; + } + } while( val != 0xD ); + + /* set clock to pll clock / 2 */ + if( samba_write_word( 0xFFFFFC30, 0x7 ) < 0 ) { + return -1; + } + + do { + if( samba_read_word( 0xFFFFFC68, &val ) < 0 ) { + return -1; + } + } while( val != 0xD ); + + + /* read 0x200000 two times because SAM-BA does it */ + if( samba_read_byte( 0x00200000, &val8 ) < 0 ) { + return -1; + } + if( val8 != 0x13 ) { + printf( "warning: magic read 0x00200000 != 0x13\n" ); + } + + if( samba_read_byte( 0x00200000, &val8 ) < 0 ) { + return -1; + } + if( val8 != 0x13 ) { + printf( "warning: magic read 0x00200000 != 0x13\n" ); + } + + + return 0; +} + +static int cmd_locked_regions( int argc, char *argv[] ) +{ + uint32_t val; + int i; + + if( samba_read_word( 0xffffff68, &val ) < 0 ) { + return -1; + } + + + printf( "Locked Regions:" ); + + for( i=0 ; i<16 ; i++ ) { + if( val & 0x00010000 ) { + printf( " %i", i ); + } + val >>= 1; + } + + printf( "\n" ); + + return 0; +} + +static int cmd_unlock_regions( int argc, char *argv[] ) +{ + uint32_t val; + int i; + + if( samba_read_word( 0xffffff68, &val ) < 0 ) { + return -1; + } + + + if( val & 0xffff0000 ) { + /* set up MCLKS to some odd value... hey SAM-BA does it */ + if( samba_write_word( 0xffffff60, 0x00050100 ) < 0 ) { + return -1; + } + + for( i=0 ; i<16 ; i++ ) { + if( val & 0x00010000 ) { + int page = (samba_chip_info.nvpsiz / samba_chip_info.page_size / + samba_chip_info.lock_bits) * i; + + printf( "unlocking region %i:", i ); + + + if( samba_write_word( 0xffffff64, + 0x5a000004 | (page << 8) ) < 0 ) { + return -1; + } + + printf( " done\n" ); + } + val >>= 1; + } + + + /* set up MCLKS back to a sane value */ + if( samba_write_word( 0xffffff60, 0x00480100 ) < 0 ) { + return -1; + } + } + printf( "\n" ); + + return 0; +} + +/* contributed by Liam Staskawicz */ +static int cmd_boot_from_flash( int argc, char *argv[] ) +{ + /* + * word: 5A is key to send any message, + * 02 is GPNVM2 to boot from Flash, + * 0B is "set this bit" + */ + uint32_t val; + + + do { + if( samba_read_word( 0xffffff68, &val ) < 0 ) { + return -1; + } + } while( !val & 0x1 ); + + if( samba_write_word( 0xFFFFFF64, 0x5A00020B ) < 0 ) { + printf( "Couldn't flip the bit to boot from Flash.\n" ); + return -1; + } + return 0; +} + +static int cmd_flash( int argc, char *argv[] ) +{ + struct stat stbuf; + size_t loader_len; + size_t file_len; + size_t i; + uint8_t *buff; + int file_fd; + int read_len; + int ps = samba_chip_info.page_size; + uint8_t *loader_data; + + if( argc != 2 ) { + return CMD_E_WRONG_NUM_ARGS; + } + + if( ps == 128 ) { + loader_data = loader128_data; + loader_len = sizeof( loader128_data ); + } else if( ps == 256 ) { + loader_data = loader256_data; + loader_len = sizeof( loader256_data ); + } else { + printf( "no loader for %d byte pages\n", ps ); + return -1; + } + + if( stat( argv[1], &stbuf ) < 0 ) { + printf( "%s not found\n", argv[1] ); + return -1; + } + + file_len = stbuf.st_size; + + if( (buff = (uint8_t *) malloc( ps ) ) == NULL ) { + printf( "can't alocate buffer of size 0x%x\n", ps ); + goto error0; + } + + if( samba_send_file( 0x00201600, loader_data, loader_len ) < 0 ) { + printf( "could not upload samba.bin\n" ); + goto error1; + } + + if( (file_fd = open( argv[1], O_RDONLY )) < 0 ) { + printf( "can't open %s\n", argv[1] ); + return -1; + } + + for( i=0 ; i. +# 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 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # 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 + +# 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 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + 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 0 ;; + 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 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + 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 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + 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 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + 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 0 ;; + 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 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + 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 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # 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 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + 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 \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + 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 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + 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 0 ;; + *: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 + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + 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 0 ;; + *: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 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 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 + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 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 && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + 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 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + 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 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *: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 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit 0 ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + 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-gnu" && exit 0 + ;; + 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-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + 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="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + 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-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # 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 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + 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 0 ;; + 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 0 ;; + 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 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + 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 0 ;; + i*86:*:5:[78]*) + 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 0 ;; + 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 0 ;; + 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 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + 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 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 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 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *: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 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + 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 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *: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 0 ;; + *: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 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *: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 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit 0 ;; +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"); 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 && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# 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 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + 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: diff --git a/sam7utils/config.h b/sam7utils/config.h new file mode 100644 index 0000000..02c3d8a --- /dev/null +++ b/sam7utils/config.h @@ -0,0 +1,62 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ENDIAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `readline' library (-lreadline). */ +/* #undef HAVE_LIBREADLINE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Name of package */ +#define PACKAGE "sam7utils" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "konkers@konkers.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "sam7utils" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "sam7utils 0.1.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "sam7utils" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.1.0" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.1.0" diff --git a/sam7utils/config.h.in b/sam7utils/config.h.in new file mode 100644 index 0000000..a573faf --- /dev/null +++ b/sam7utils/config.h.in @@ -0,0 +1,61 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `readline' library (-lreadline). */ +#undef HAVE_LIBREADLINE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION diff --git a/sam7utils/config.log b/sam7utils/config.log new file mode 100644 index 0000000..bea8c20 --- /dev/null +++ b/sam7utils/config.log @@ -0,0 +1,587 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by sam7utils configure 0.1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = BlubbFish +uname -m = i686 +uname -r = 1.0.16(0.48/3/2) +uname -s = MINGW32_NT-6.1 +uname -v = 2010-09-29 00:07 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /usr/local/bin +PATH: /mingw/bin +PATH: /bin +PATH: /c/Program Files/PC Connectivity Solution/ +PATH: /c/Program Files/ATI Stream/bin/x86 +PATH: /e/Programme/MikTeX/miktex/bin +PATH: /c/Windows/system32 +PATH: /c/Windows +PATH: /c/Windows/System32/Wbem +PATH: /c/Windows/System32/WindowsPowerShell/v1.0/ +PATH: /e/Programme/SVN/bin/ +PATH: /c/Program Files/ATI Stream/Tools/Stream KernelAnalyzer 1.5/ +PATH: /c/VXIPNP/WinNT/Bin +PATH: /e/Programme/JAF +PATH: /e/Programme/hacker/Nmap +PATH: /c/Program Files/OpenVPN/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1349: checking build system type +configure:1367: result: i686-pc-mingw32 +configure:1375: checking host system type +configure:1389: result: i686-pc-mingw32 +configure:1397: checking target system type +configure:1411: result: i686-pc-mingw32 +configure:1440: checking for a BSD-compatible install +configure:1495: result: /bin/install -c +configure:1506: checking whether build environment is sane +configure:1549: result: yes +configure:1573: WARNING: `missing' script is too old or missing +configure:1614: checking for gawk +configure:1630: found /bin/gawk +configure:1640: result: gawk +configure:1650: checking whether make sets $(MAKE) +configure:1670: result: yes +configure:1888: checking for gcc +configure:1904: found /mingw/bin/gcc +configure:1914: result: gcc +configure:2158: checking for C compiler version +configure:2161: gcc --version &5 +gcc.exe (GCC) 4.5.2 +Copyright (C) 2010 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. + +configure:2164: $? = 0 +configure:2166: gcc -v &5 +Using built-in specs. +COLLECT_GCC=E:\Programme\mingw\bin\gcc.exe +COLLECT_LTO_WRAPPER=e:/programme/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe +Target: mingw32 +Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw +Thread model: win32 +gcc version 4.5.2 (GCC) +configure:2169: $? = 0 +configure:2171: gcc -V &5 +gcc.exe: '-V' option must have argument +configure:2174: $? = 1 +configure:2197: checking for C compiler default output file name +configure:2200: gcc conftest.c >&5 +configure:2203: $? = 0 +configure:2249: result: a.exe +configure:2254: checking whether the C compiler works +configure:2260: ./a.exe +configure:2263: $? = 0 +configure:2280: result: yes +configure:2287: checking whether we are cross compiling +configure:2289: result: no +configure:2292: checking for suffix of executables +configure:2294: gcc -o conftest.exe conftest.c >&5 +configure:2297: $? = 0 +configure:2322: result: .exe +configure:2328: checking for suffix of object files +configure:2349: gcc -c conftest.c >&5 +configure:2352: $? = 0 +configure:2374: result: o +configure:2378: checking whether we are using the GNU C compiler +configure:2402: gcc -c conftest.c >&5 +configure:2408: $? = 0 +configure:2412: test -z + || test ! -s conftest.err +configure:2415: $? = 0 +configure:2418: test -s conftest.o +configure:2421: $? = 0 +configure:2434: result: yes +configure:2440: checking whether gcc accepts -g +configure:2461: gcc -c -g conftest.c >&5 +configure:2467: $? = 0 +configure:2471: test -z + || test ! -s conftest.err +configure:2474: $? = 0 +configure:2477: test -s conftest.o +configure:2480: $? = 0 +configure:2491: result: yes +configure:2508: checking for gcc option to accept ANSI C +configure:2578: gcc -c -g -O2 conftest.c >&5 +configure:2584: $? = 0 +configure:2588: test -z + || test ! -s conftest.err +configure:2591: $? = 0 +configure:2594: test -s conftest.o +configure:2597: $? = 0 +configure:2615: result: none needed +configure:2633: gcc -c -g -O2 conftest.c >&5 +conftest.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' +configure:2639: $? = 1 +configure: failed program was: +| #ifndef __cplusplus +| choke me +| #endif +configure:2783: checking for style of include used by make +configure:2811: result: GNU +configure:2839: checking dependency style of gcc +configure:2929: result: gcc3 +configure:2959: checking for a BSD-compatible install +configure:3014: result: /bin/install -c +configure:3025: checking whether make sets $(MAKE) +configure:3045: result: yes +configure:3076: checking how to run the C preprocessor +configure:3111: gcc -E conftest.c +configure:3117: $? = 0 +configure:3149: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:3155: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "sam7utils" +| #define PACKAGE_TARNAME "sam7utils" +| #define PACKAGE_VERSION "0.1.0" +| #define PACKAGE_STRING "sam7utils 0.1.0" +| #define PACKAGE_BUGREPORT "konkers@konkers.net" +| #define PACKAGE "sam7utils" +| #define VERSION "0.1.0" +| /* end confdefs.h. */ +| #include +configure:3194: result: gcc -E +configure:3218: gcc -E conftest.c +configure:3224: $? = 0 +configure:3256: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:3262: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "sam7utils" +| #define PACKAGE_TARNAME "sam7utils" +| #define PACKAGE_VERSION "0.1.0" +| #define PACKAGE_STRING "sam7utils 0.1.0" +| #define PACKAGE_BUGREPORT "konkers@konkers.net" +| #define PACKAGE "sam7utils" +| #define VERSION "0.1.0" +| /* end confdefs.h. */ +| #include +configure:3306: checking for egrep +configure:3316: result: grep -E +configure:3321: checking for ANSI C header files +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3352: $? = 0 +configure:3356: test -z + || test ! -s conftest.err +configure:3359: $? = 0 +configure:3362: test -s conftest.o +configure:3365: $? = 0 +configure:3454: gcc -o conftest.exe -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:28:7: warning: incompatible implicit declaration of built-in function 'exit' +configure:3457: $? = 0 +configure:3459: ./conftest.exe +configure:3462: $? = 0 +configure:3477: result: yes +configure:3502: checking for sys/types.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for sys/stat.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for stdlib.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for string.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for memory.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for strings.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for inttypes.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for stdint.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3502: checking for unistd.h +configure:3518: gcc -c -g -O2 conftest.c >&5 +configure:3524: $? = 0 +configure:3528: test -z + || test ! -s conftest.err +configure:3531: $? = 0 +configure:3534: test -s conftest.o +configure:3537: $? = 0 +configure:3548: result: yes +configure:3565: checking for stdint.h +configure:3570: result: yes +configure:3727: checking ctype.h usability +configure:3739: gcc -c -g -O2 conftest.c >&5 +configure:3745: $? = 0 +configure:3749: test -z + || test ! -s conftest.err +configure:3752: $? = 0 +configure:3755: test -s conftest.o +configure:3758: $? = 0 +configure:3768: result: yes +configure:3772: checking ctype.h presence +configure:3782: gcc -E conftest.c +configure:3788: $? = 0 +configure:3808: result: yes +configure:3843: checking for ctype.h +configure:3850: result: yes +configure:3877: checking endian.h usability +configure:3889: gcc -c -g -O2 conftest.c >&5 +conftest.c:57:20: fatal error: endian.h: No such file or directory +compilation terminated. +configure:3895: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "sam7utils" +| #define PACKAGE_TARNAME "sam7utils" +| #define PACKAGE_VERSION "0.1.0" +| #define PACKAGE_STRING "sam7utils 0.1.0" +| #define PACKAGE_BUGREPORT "konkers@konkers.net" +| #define PACKAGE "sam7utils" +| #define VERSION "0.1.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_CTYPE_H 1 +| /* end confdefs.h. */ +| #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 +| #include +configure:3918: result: no +configure:3922: checking endian.h presence +configure:3932: gcc -E conftest.c +conftest.c:23:20: fatal error: endian.h: No such file or directory +compilation terminated. +configure:3938: $? = 1 +configure: failed program was: +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "sam7utils" +| #define PACKAGE_TARNAME "sam7utils" +| #define PACKAGE_VERSION "0.1.0" +| #define PACKAGE_STRING "sam7utils 0.1.0" +| #define PACKAGE_BUGREPORT "konkers@konkers.net" +| #define PACKAGE "sam7utils" +| #define VERSION "0.1.0" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_CTYPE_H 1 +| /* end confdefs.h. */ +| #include +configure:3958: result: no +configure:3993: checking for endian.h +configure:4000: result: no +configure:4129: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by sam7utils config.status 0.1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on BlubbFish + +config.status:702: creating Makefile +config.status:806: creating config.h +config.status:1096: executing depfiles commands + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=i686-pc-mingw32 +ac_cv_build_alias=i686-pc-mingw32 +ac_cv_c_compiler_gnu=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext=.exe +ac_cv_header_ctype_h=yes +ac_cv_header_endian_h=no +ac_cv_header_inttypes_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=i686-pc-mingw32 +ac_cv_host_alias=i686-pc-mingw32 +ac_cv_objext=o +ac_cv_path_install='/bin/install -c' +ac_cv_prog_AWK=gawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_egrep='grep -E' +ac_cv_prog_make_make_set=yes +ac_cv_target=i686-pc-mingw32 +ac_cv_target_alias=i686-pc-mingw32 +am_cv_CC_dependencies_compiler_type=gcc3 + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='aclocal-1.9' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='tar' +AUTOCONF='autoconf' +AUTOHEADER='autoheader' +AUTOMAKE='automake-1.9' +AWK='gawk' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFLAGS='-g -O2' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='grep -E' +EXEEXT='.exe' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' +IOTYPE='posix' +LDFLAGS='' +LIBOBJS='' +LIBS='-lreadline -lncurses ' +LTLIBOBJS='' +MAKEINFO='makeinfo' +OBJEXT='o' +PACKAGE='sam7utils' +PACKAGE_BUGREPORT='konkers@konkers.net' +PACKAGE_NAME='sam7utils' +PACKAGE_STRING='sam7utils 0.1.0' +PACKAGE_TARNAME='sam7utils' +PACKAGE_VERSION='0.1.0' +PATH_SEPARATOR=':' +SET_MAKE='' +SHELL='/bin/sh' +STRIP='' +VERSION='0.1.0' +ac_ct_CC='gcc' +ac_ct_STRIP='' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__include='include' +am__leading_dot='.' +am__quote='' +am__tar='${AMTAR} chof - "$$tardir"' +am__untar='${AMTAR} xf -' +bindir='${exec_prefix}/bin' +build='i686-pc-mingw32' +build_alias='' +build_cpu='i686' +build_os='mingw32' +build_vendor='pc' +datadir='${prefix}/share' +exec_prefix='${prefix}' +host='i686-pc-mingw32' +host_alias='' +host_cpu='i686' +host_os='mingw32' +host_vendor='pc' +includedir='${prefix}/include' +infodir='${prefix}/info' +install_sh='/D/Visual Studio 2010/Projects/Matomat/sam7utils/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localstatedir='${prefix}/var' +mandir='${prefix}/man' +mkdir_p='mkdir -p --' +oldincludedir='/usr/include' +prefix='/usr/local' +program_transform_name='s,x,x,' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target='i686-pc-mingw32' +target_alias='' +target_cpu='i686' +target_os='mingw32' +target_vendor='pc' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNISTD_H 1 +#define PACKAGE "sam7utils" +#define PACKAGE_BUGREPORT "konkers@konkers.net" +#define PACKAGE_NAME "sam7utils" +#define PACKAGE_STRING "sam7utils 0.1.0" +#define PACKAGE_TARNAME "sam7utils" +#define PACKAGE_VERSION "0.1.0" +#define STDC_HEADERS 1 +#define VERSION "0.1.0" + +configure: exit 0 diff --git a/sam7utils/config.status b/sam7utils/config.status new file mode 100644 index 0000000..2e3355a --- /dev/null +++ b/sam7utils/config.status @@ -0,0 +1,1187 @@ +#! /bin/sh +# Generated by configure. +# 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-/bin/sh} +## --------------------- ## +## 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 sam7utils $as_me 0.1.0, 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 +config_files=" Makefile" +config_headers=" config.h" +config_commands=" depfiles" + +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 + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +ac_cs_version="\ +sam7utils config.status 0.1.0 +configured by ./configure, generated by GNU Autoconf 2.59, + with options \"\" + +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=. +INSTALL="/bin/install -c" +# 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. + -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 + +if $ac_cs_recheck; then + echo "running /bin/sh ./configure " $ac_configure_extra_args " --no-create --no-recursion" >&6 + exec /bin/sh ./configure $ac_configure_extra_args --no-create --no-recursion +fi + +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="" ac_aux_dir="." + +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { 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_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + 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; } +} + + +# +# 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@,/bin/sh,;t t +s,@PATH_SEPARATOR@,:,;t t +s,@PACKAGE_NAME@,sam7utils,;t t +s,@PACKAGE_TARNAME@,sam7utils,;t t +s,@PACKAGE_VERSION@,0.1.0,;t t +s,@PACKAGE_STRING@,sam7utils 0.1.0,;t t +s,@PACKAGE_BUGREPORT@,konkers@konkers.net,;t t +s,@exec_prefix@,${prefix},;t t +s,@prefix@,/usr/local,;t t +s,@program_transform_name@,s,x,x,,;t t +s,@bindir@,${exec_prefix}/bin,;t t +s,@sbindir@,${exec_prefix}/sbin,;t t +s,@libexecdir@,${exec_prefix}/libexec,;t t +s,@datadir@,${prefix}/share,;t t +s,@sysconfdir@,${prefix}/etc,;t t +s,@sharedstatedir@,${prefix}/com,;t t +s,@localstatedir@,${prefix}/var,;t t +s,@libdir@,${exec_prefix}/lib,;t t +s,@includedir@,${prefix}/include,;t t +s,@oldincludedir@,/usr/include,;t t +s,@infodir@,${prefix}/info,;t t +s,@mandir@,${prefix}/man,;t t +s,@build_alias@,,;t t +s,@host_alias@,,;t t +s,@target_alias@,,;t t +s,@DEFS@,-DHAVE_CONFIG_H,;t t +s,@ECHO_C@,,;t t +s,@ECHO_N@,-n,;t t +s,@ECHO_T@,,;t t +s,@LIBS@,-lreadline -lncurses ,;t t +s,@build@,i686-pc-mingw32,;t t +s,@build_cpu@,i686,;t t +s,@build_vendor@,pc,;t t +s,@build_os@,mingw32,;t t +s,@host@,i686-pc-mingw32,;t t +s,@host_cpu@,i686,;t t +s,@host_vendor@,pc,;t t +s,@host_os@,mingw32,;t t +s,@target@,i686-pc-mingw32,;t t +s,@target_cpu@,i686,;t t +s,@target_vendor@,pc,;t t +s,@target_os@,mingw32,;t t +s,@INSTALL_PROGRAM@,${INSTALL},;t t +s,@INSTALL_SCRIPT@,${INSTALL},;t t +s,@INSTALL_DATA@,${INSTALL} -m 644,;t t +s,@CYGPATH_W@,echo,;t t +s,@PACKAGE@,sam7utils,;t t +s,@VERSION@,0.1.0,;t t +s,@ACLOCAL@,aclocal-1.9,;t t +s,@AUTOCONF@,autoconf,;t t +s,@AUTOMAKE@,automake-1.9,;t t +s,@AUTOHEADER@,autoheader,;t t +s,@MAKEINFO@,makeinfo,;t t +s,@install_sh@,/D/Visual Studio 2010/Projects/Matomat/sam7utils/install-sh,;t t +s,@STRIP@,,;t t +s,@ac_ct_STRIP@,,;t t +s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t +s,@mkdir_p@,mkdir -p --,;t t +s,@AWK@,gawk,;t t +s,@SET_MAKE@,,;t t +s,@am__leading_dot@,.,;t t +s,@AMTAR@,tar,;t t +s,@am__tar@,${AMTAR} chof - "$$tardir",;t t +s,@am__untar@,${AMTAR} xf -,;t t +s,@CC@,gcc,;t t +s,@CFLAGS@,-g -O2,;t t +s,@LDFLAGS@,,;t t +s,@CPPFLAGS@,,;t t +s,@ac_ct_CC@,gcc,;t t +s,@EXEEXT@,.exe,;t t +s,@OBJEXT@,o,;t t +s,@DEPDIR@,.deps,;t t +s,@am__include@,include,;t t +s,@am__quote@,,;t t +s,@AMDEP_TRUE@,,;t t +s,@AMDEP_FALSE@,#,;t t +s,@AMDEPBACKSLASH@,\,;t t +s,@CCDEPMODE@,depmode=gcc3,;t t +s,@am__fastdepCC_TRUE@,,;t t +s,@am__fastdepCC_FALSE@,#,;t t +s,@CPP@,gcc -E,;t t +s,@EGREP@,grep -E,;t t +s,@IOTYPE@,posix,;t t +s,@LIBOBJS@,,;t t +s,@LTLIBOBJS@,,;t t +CEOF + + # 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" + +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; } + sed "/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +} + +: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 + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; 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 + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # 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; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + 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; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + + # Handle all the #define templates only if necessary. + if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then + # If there are no defines, we may have an empty if/fi + : + cat >$tmp/defines.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + fi # grep + + # Handle all the #undef templates + cat >$tmp/undefs.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + # 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 + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + 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; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(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'`/stamp-h$_am_stamp_count +done + +# +# 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 + +{ (exit 0); exit 0; } diff --git a/sam7utils/config.sub b/sam7utils/config.sub new file mode 100644 index 0000000..0f84ac2 --- /dev/null +++ b/sam7utils/config.sub @@ -0,0 +1,1566 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +timestamp='2004-11-30' + +# 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., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, 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 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # 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 0;; + + * ) + 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 \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | 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 | 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 + ;; + 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-* \ + | 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-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | 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-* | 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-*) + ;; + # 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 + ;; + 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*) + # 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 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sam7utils/configure b/sam7utils/configure new file mode 100644 index 0000000..37989a2 --- /dev/null +++ b/sam7utils/configure @@ -0,0 +1,5426 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for sam7utils 0.1.0. +# +# Report bugs to . +# +# 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 + + +# 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='sam7utils' +PACKAGE_TARNAME='sam7utils' +PACKAGE_VERSION='0.1.0' +PACKAGE_STRING='sam7utils 0.1.0' +PACKAGE_BUGREPORT='konkers@konkers.net' + +# 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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os 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 CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP IOTYPE 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_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_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_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# 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 sam7utils 0.1.0 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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of sam7utils 0.1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CC C compiler command + CFLAGS 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 + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_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 +sam7utils configure 0.1.0 +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. +_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 sam7utils $as_me 0.1.0, 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 $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&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. + +# 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/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +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=sam7utils + VERSION=0.1.0 + + +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 -' + + + + + + ac_config_headers="$ac_config_headers config.h" + + + +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); } + +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_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=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 +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="$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 + + +# 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 ${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 + + +case "${host}" in + *-*-darwin* ) + LIBS="$LIBS -framework IOKIT -framework CoreFoundation" + IOTYPE="iokit" + ;; + *-*-cygwin* ) + LIBS="$LIBS -lsetupapi" + IOTYPE="win32" + ;; + * ) + IOTYPE="posix" + ;; +esac + + + +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 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 + + +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 + + + + LIBS="-lreadline -lncurses $LIBS" + + + + + + + + +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 stdint.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 konkers@konkers.net ## +## ---------------------------------- ## +_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 + +else + { echo "$as_me:$LINENO: WARNING: can't find stdint.h" >&5 +echo "$as_me: WARNING: can't find stdint.h" >&2;} +fi + +done + + +for ac_header in ctype.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 konkers@konkers.net ## +## ---------------------------------- ## +_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 endian.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 konkers@konkers.net ## +## ---------------------------------- ## +_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 + + + + + + + ac_config_files="$ac_config_files 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 + +DEFS=-DHAVE_CONFIG_H + +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. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +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__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 sam7utils $as_me 0.1.0, 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 + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +sam7utils config.status 0.1.0 +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" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { 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_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + 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,@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,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;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,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;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,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@IOTYPE@,$IOTYPE,;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_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; 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 + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # 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; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + 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; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # 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 + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + 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; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(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'`/stamp-h$_am_stamp_count +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 + diff --git a/sam7utils/configure.in b/sam7utils/configure.in new file mode 100644 index 0000000..90edfaa --- /dev/null +++ b/sam7utils/configure.in @@ -0,0 +1,41 @@ +AC_INIT([sam7utils], [0.1.0], [konkers@konkers.net]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AM_INIT_AUTOMAKE(sam7utils,0.1.0) +AM_CONFIG_HEADER(config.h) + + +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +case "${host}" in + *-*-darwin* ) + LIBS="$LIBS -framework IOKIT -framework CoreFoundation" + IOTYPE="iokit" + ;; + *-*-cygwin* ) + LIBS="$LIBS -lsetupapi" + IOTYPE="win32" + ;; + * ) + IOTYPE="posix" + ;; +esac + + +AC_HEADER_STDC + +AC_CHECK_LIB(readline, readline,,AC_MSG_ERROR(readline not found)) +AC_CHECK_HEADERS(stdint.h,,AC_MSG_WARN(can't find stdint.h)) +AC_CHECK_HEADERS(ctype.h,,) +AC_CHECK_HEADERS(endian.h,,) + + + +AC_SUBST(IOTYPE) + +AC_OUTPUT(Makefile) diff --git a/sam7utils/depcomp b/sam7utils/depcomp new file mode 100644 index 0000000..ffcd540 --- /dev/null +++ b/sam7utils/depcomp @@ -0,0 +1,529 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-02-09.22 + +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, 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 '/^# [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: diff --git a/sam7utils/driver/Makefile b/sam7utils/driver/Makefile new file mode 100644 index 0000000..6450a81 --- /dev/null +++ b/sam7utils/driver/Makefile @@ -0,0 +1,11 @@ +ifneq ($(KERNELRELEASE),) +obj-m := at91.o +else +KDIR := /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) + +default: + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules +endif + +modules: at91.o \ No newline at end of file diff --git a/sam7utils/driver/at91.c b/sam7utils/driver/at91.c new file mode 100644 index 0000000..84c79b6 --- /dev/null +++ b/sam7utils/driver/at91.c @@ -0,0 +1,360 @@ +/* + * at91 boot program driver + * + * Copyright (C) 2005 Erik Gilling + * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) + * + * 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, version 2. + * + * This driver is based on drivers/usb/usb-skeleton.c + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Define these values to match your devices */ +#define USB_VENDOR_ID_ATMEL 0x03eb +#define USB_DEVICE_ID_SAM7BOOT 0x6124 + +/* table of devices that work with this driver */ +static struct usb_device_id at91_table [] = { + { USB_DEVICE( USB_VENDOR_ID_ATMEL, USB_DEVICE_ID_SAM7BOOT ) }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE (usb, at91_table); + + +/* Get a minor range for your devices from the usb maintainer */ +#define USB_AT91_MINOR_BASE 192 + +/* Structure to hold all of our device specific stuff */ +struct usb_at91 { + struct usb_device * udev; /* the usb device for this device */ + struct usb_interface * interface; /* the interface for this device */ + unsigned char * bulk_in_buffer; /* the buffer to receive data */ + size_t bulk_in_size; /* the size of the receive buffer */ + __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */ + __u8 bulk_out_endpointAddr; /* the address of the bulk out endpoint */ + struct kref kref; +}; +#define to_at91_dev(d) container_of(d, struct usb_at91, kref) + +static struct usb_driver at91_driver; + +static void at91_delete(struct kref *kref) +{ + struct usb_at91 *dev = to_at91_dev(kref); + + usb_put_dev(dev->udev); + kfree (dev->bulk_in_buffer); + kfree (dev); +} + +static int at91_open(struct inode *inode, struct file *file) +{ + struct usb_at91 *dev; + struct usb_interface *interface; + int subminor; + int retval = 0; + + subminor = iminor(inode); + + interface = usb_find_interface(&at91_driver, subminor); + if (!interface) { + err ("%s - error, can't find device for minor %d", + __FUNCTION__, subminor); + retval = -ENODEV; + goto exit; + } + + dev = usb_get_intfdata(interface); + if (!dev) { + retval = -ENODEV; + goto exit; + } + + /* increment our usage count for the device */ + kref_get(&dev->kref); + + /* save our object in the file's private structure */ + file->private_data = dev; + +exit: + return retval; +} + +static int at91_release(struct inode *inode, struct file *file) +{ + struct usb_at91 *dev; + + dev = (struct usb_at91 *)file->private_data; + if (dev == NULL) + return -ENODEV; + + /* decrement the count on our device */ + kref_put(&dev->kref, at91_delete); + return 0; +} + +static ssize_t at91_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +{ + struct usb_at91 *dev; + int retval = 0; + int bytes_read; + + dev = (struct usb_at91 *)file->private_data; + + /* do a blocking bulk read to get data from the device */ + retval = usb_bulk_msg(dev->udev, + usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr), + dev->bulk_in_buffer, + min(dev->bulk_in_size, count), + &bytes_read, 10000); + + /* if the read was successful, copy the data to userspace */ + if (!retval) { + if (copy_to_user(buffer, dev->bulk_in_buffer, bytes_read)) + retval = -EFAULT; + else + retval = bytes_read; + } + + return retval; +} + +static void at91_write_bulk_callback(struct urb *urb, struct pt_regs *regs) +{ + struct usb_at91 *dev; + + dev = (struct usb_at91 *)urb->context; + + /* sync/async unlink faults aren't errors */ + if (urb->status && + !(urb->status == -ENOENT || + urb->status == -ECONNRESET || + urb->status == -ESHUTDOWN)) { + dbg("%s - nonzero write bulk status received: %d", + __FUNCTION__, urb->status); + } + + /* free up our allocated buffer */ + usb_buffer_free(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); +} + +static ssize_t at91_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) +{ + struct usb_at91 *dev; + int retval = 0; + struct urb *urb = NULL; + char *buf = NULL; + + dev = (struct usb_at91 *)file->private_data; + + /* verify that we actually have some data to write */ + if (count == 0) + goto exit; + + /* create a urb, and a buffer for it, and copy the data to the urb */ + urb = usb_alloc_urb(0, GFP_KERNEL); + if (!urb) { + retval = -ENOMEM; + goto error; + } + + buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); + if (!buf) { + retval = -ENOMEM; + goto error; + } + + if (copy_from_user(buf, user_buffer, count)) { + retval = -EFAULT; + goto error; + } + + /* initialize the urb properly */ + usb_fill_bulk_urb(urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + buf, count, at91_write_bulk_callback, dev); + urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + + /* send the data out the bulk port */ + retval = usb_submit_urb(urb, GFP_KERNEL); + if (retval) { + err("%s - failed submitting write urb, error %d", __FUNCTION__, retval); + goto error; + } + + /* release our reference to this urb, the USB core will eventually free it entirely */ + usb_free_urb(urb); + +exit: + return count; + +error: + usb_buffer_free(dev->udev, count, buf, urb->transfer_dma); + usb_free_urb(urb); + return retval; +} + +static struct file_operations at91_fops = { + .owner = THIS_MODULE, + .read = at91_read, + .write = at91_write, + .open = at91_open, + .release = at91_release, +}; + +/* + * usb class driver info in order to get a minor number from the usb core, + * and to have the device registered with devfs and the driver core + */ +static struct usb_class_driver at91_class = { + .name = "usb/at91_%d", + .fops = &at91_fops, + .mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, + .minor_base = USB_AT91_MINOR_BASE, +}; + +static int at91_probe(struct usb_interface *interface, const struct usb_device_id *id) +{ + struct usb_at91 *dev = NULL; + struct usb_host_interface *iface_desc; + struct usb_endpoint_descriptor *endpoint; + size_t buffer_size; + int i; + int retval = -ENOMEM; + + /* allocate memory for our device state and initialize it */ + dev = kmalloc(sizeof(*dev), GFP_KERNEL); + if (dev == NULL) { + err("Out of memory"); + goto error; + } + memset(dev, 0x00, sizeof(*dev)); + kref_init(&dev->kref); + + dev->udev = usb_get_dev(interface_to_usbdev(interface)); + dev->interface = interface; + + /* set up the endpoint information */ + /* use only the first bulk-in and bulk-out endpoints */ + iface_desc = interface->cur_altsetting; + for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { + endpoint = &iface_desc->endpoint[i].desc; + + if (!dev->bulk_in_endpointAddr && + ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) + == USB_DIR_IN) && + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK)) { + /* we found a bulk in endpoint */ + buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); + dev->bulk_in_size = buffer_size; + dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; + dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); + if (!dev->bulk_in_buffer) { + err("Could not allocate bulk_in_buffer"); + goto error; + } + } + + if (!dev->bulk_out_endpointAddr && + ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) + == USB_DIR_OUT) && + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK)) { + /* we found a bulk out endpoint */ + dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; + } + } + if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) { + err("Could not find both bulk-in and bulk-out endpoints"); + goto error; + } + + /* save our data pointer in this interface device */ + usb_set_intfdata(interface, dev); + + /* we can register the device now, as it is ready */ + retval = usb_register_dev(interface, &at91_class); + if (retval) { + /* something prevented us from registering this driver */ + err("Not able to get a minor for this device."); + usb_set_intfdata(interface, NULL); + goto error; + } + + /* let the user know what node this device is now attached to */ + info("USB At91 device now attached to AT91-%d", interface->minor); + return 0; + +error: + if (dev) + kref_put(&dev->kref, at91_delete); + return retval; +} + +static void at91_disconnect(struct usb_interface *interface) +{ + struct usb_at91 *dev; + int minor = interface->minor; + + /* prevent at91_open() from racing at91_disconnect() */ + lock_kernel(); + + dev = usb_get_intfdata(interface); + usb_set_intfdata(interface, NULL); + + /* give back our minor */ + usb_deregister_dev(interface, &at91_class); + + unlock_kernel(); + + /* decrement our usage count */ + kref_put(&dev->kref, at91_delete); + + info("USB At91eton #%d now disconnected", minor); +} + +static struct usb_driver at91_driver = { + .owner = THIS_MODULE, + .name = "at91", + .probe = at91_probe, + .disconnect = at91_disconnect, + .id_table = at91_table, +}; + +static int __init usb_at91_init(void) +{ + int result; + + /* register this driver with the USB subsystem */ + result = usb_register(&at91_driver); + if (result) + err("usb_register failed. Error number %d", result); + + return result; +} + +static void __exit usb_at91_exit(void) +{ + /* deregister this driver with the USB subsystem */ + usb_deregister(&at91_driver); +} + +module_init (usb_at91_init); +module_exit (usb_at91_exit); + +MODULE_LICENSE("GPL"); diff --git a/sam7utils/install-sh b/sam7utils/install-sh new file mode 100644 index 0000000..1a83534 --- /dev/null +++ b/sam7utils/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-02-02.21 + +# 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: diff --git a/sam7utils/io.h b/sam7utils/io.h new file mode 100644 index 0000000..54425e8 --- /dev/null +++ b/sam7utils/io.h @@ -0,0 +1,46 @@ +/* + * io.h + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + */ + +#ifndef __io_h__ +#define __io_h__ + + +#include // for usleep + + +int io_init( char *dev ); +int io_cleanup( void ); +int io_write( void *buff, int len ); +int io_read( void *buff, int len ); +int io_read_response( char *buff, int len ); + + +static inline int io_send_cmd( char *cmd, void *response, int response_len ) +{ + + if( io_write( cmd, strlen( cmd ) ) < 0 ) { + return -1; + } + usleep( 2000 ); + + if( response_len == 0 ) { + return 0; + } + + if( io_read( response, response_len ) < 0 ) { + return -1; + } + + usleep( 2000 ); + return 0; +} + +#endif /* __io_h__ */ diff --git a/sam7utils/io_iokit.c b/sam7utils/io_iokit.c new file mode 100644 index 0000000..6421b1b --- /dev/null +++ b/sam7utils/io_iokit.c @@ -0,0 +1,317 @@ +/* + * io.c + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + */ + +#include "config.h" + +#include + +#include + +#include + +#include +#include +#include + + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "io.h" +#include "samba.h" + + +static mach_port_t masterPort = 0; +static IOUSBDeviceInterface **usbDev = NULL; +static IOUSBInterfaceInterface **intf = NULL; +static UInt8 inPipeRef = 0; +static UInt8 outPipeRef = 0; + +#undef DEBUG_IO + + +int do_intf(io_service_t usbInterfaceRef) +{ + IOReturn err; + IOCFPlugInInterface **iodev; + SInt32 score; + UInt8 numPipes; + int i; + UInt8 direction, number, transferType, interval; + UInt16 maxPacketSize; + + err = IOCreatePlugInInterfaceForService(usbInterfaceRef, + kIOUSBInterfaceUserClientTypeID, + kIOCFPlugInInterfaceID, + &iodev, &score); + if( err || !iodev ) { + printf("unable to create plugin. ret = %08x, iodev = %p\n", err, iodev); + return -1; + } + + err = (*iodev)->QueryInterface(iodev, + CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), + (LPVOID)&intf); + IODestroyPlugInInterface(iodev); + + if (err || !intf) { + printf("unable to create a device interface. ret = %08x, intf = %p\n", + err, intf); + return -1; + } + + err = (*intf)->USBInterfaceOpen(intf); + if (err) { + printf("unable to open interface. ret = %08x\n", err); + return -1; + } + + err = (*intf)->GetNumEndpoints(intf, &numPipes); + if (err) { + printf("unable to get number of endpoints. ret = %08x\n", err); + return -1; + } + + if (numPipes) { + for (i=1; i <= numPipes; i++) { + + err = (*intf)->GetPipeProperties(intf, i, &direction, + &number, &transferType, + &maxPacketSize, &interval); + if (err) { + printf("unable to get pipe properties for pipe %d, err = %08x\n", + i, err); + continue; + } + + if (transferType != kUSBBulk) { + continue; + } + + if ((direction == kUSBIn) && !inPipeRef) { + inPipeRef = i; + } + if ((direction == kUSBOut) && !outPipeRef) { + outPipeRef = i; + } + } + } + + if( !inPipeRef || !outPipeRef ) { + (*intf)->USBInterfaceClose(intf); + (*intf)->Release(intf); + intf = NULL; + return -1; + } + + return 0; +} + + +static int do_dev( io_service_t usbDeviceRef ) +{ + IOReturn err; + IOCFPlugInInterface **iodev; // requires + SInt32 score; + UInt8 numConf; + IOUSBConfigurationDescriptorPtr confDesc; + IOUSBFindInterfaceRequest interfaceRequest; + io_iterator_t iterator; + io_service_t usbInterfaceRef; + + err = IOCreatePlugInInterfaceForService(usbDeviceRef, + kIOUSBDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, &iodev, &score); + if (err || !iodev) { + printf("unable to create plugin. ret = %08x, iodev = %p\n", + err, iodev); + return -1; + } + + err = (*iodev)->QueryInterface(iodev, + CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), + (LPVOID)&usbDev); + IODestroyPlugInInterface(iodev); // done with this + + if (err || !usbDev) { + printf("unable to create a device interface. ret = %08x, dev = %p\n", + err, usbDev); + return -1; + } + + err = (*usbDev)->USBDeviceOpen(usbDev); + if (err) { + printf("unable to open device. ret = %08x\n", err); + return -1; + } + err = (*usbDev)->GetNumberOfConfigurations(usbDev, &numConf); + if (err || !numConf) { + printf("unable to obtain the number of configurations. ret = %08x\n", err); + return -1; + } + + err = (*usbDev)->GetConfigurationDescriptorPtr(usbDev, 0, &confDesc); // get the first config desc (index 0) + if (err) { + printf("unable to get config descriptor for index 0\n"); + return -1; + } + + + err = (*usbDev)->SetConfiguration(usbDev, confDesc->bConfigurationValue); + if (err) { + printf("unable to set the configuration\n"); + return -1; + } + + // requested class + interfaceRequest.bInterfaceClass = kIOUSBFindInterfaceDontCare; + // requested subclass + interfaceRequest.bInterfaceSubClass = kIOUSBFindInterfaceDontCare; + // requested protocol + interfaceRequest.bInterfaceProtocol = kIOUSBFindInterfaceDontCare; + // requested alt setting + interfaceRequest.bAlternateSetting = kIOUSBFindInterfaceDontCare; + + err = (*usbDev)->CreateInterfaceIterator(usbDev, &interfaceRequest, &iterator); + if (err) { + printf("unable to create interface iterator\n"); + return -1; + } + + while( (usbInterfaceRef = IOIteratorNext(iterator)) ) { + if( do_intf( usbInterfaceRef ) == 0 ) { + IOObjectRelease(iterator); + iterator = 0; + return 0; + } + } + + + IOObjectRelease(iterator); + iterator = 0; + return -1; + + +} + +int io_init( char *dev __attribute__((unused)) ) +{ + + kern_return_t err; + CFMutableDictionaryRef matchingDictionary = 0; + CFNumberRef numberRef; + SInt32 idVendor = 0x03eb; + SInt32 idProduct = 0x6124; + io_iterator_t iterator = 0; + io_service_t usbDeviceRef; + + + if( (err = IOMasterPort( MACH_PORT_NULL, &masterPort )) ) { + printf( "could not create master port, err = %08x\n", err ); + return -1; + } + + if( !(matchingDictionary = IOServiceMatching(kIOUSBDeviceClassName)) ) { + printf( "could not create matching dictionary\n" ); + return -1; + } + + if( !(numberRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, + &idVendor)) ) { + printf( "could not create CFNumberRef for vendor\n" ); + return -1; + } + CFDictionaryAddValue( matchingDictionary, CFSTR(kUSBVendorID), numberRef); + CFRelease( numberRef ); + numberRef = 0; + + if( !(numberRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, + &idProduct)) ) { + printf( "could not create CFNumberRef for product\n" ); + return -1; + } + CFDictionaryAddValue( matchingDictionary, CFSTR(kUSBProductID), numberRef); + CFRelease( numberRef ); + numberRef = 0; + + err = IOServiceGetMatchingServices( masterPort, matchingDictionary, &iterator ); + matchingDictionary = 0; // consumed by the above call + + + + if( (usbDeviceRef = IOIteratorNext( iterator )) ) { + printf( "found boot agent\n" ); + + do_dev( usbDeviceRef ); + } else { + printf( "can not find boot agent\n" ); + return -1; + } + + + + IOObjectRelease(usbDeviceRef); + + IOObjectRelease(iterator); + + + return samba_init(); + + + IOObjectRelease(usbDeviceRef); + + IOObjectRelease(iterator); + return -1; +} + + +int io_cleanup( void ) +{ + if( intf ) { + (*intf)->USBInterfaceClose(intf); + (*intf)->Release(intf); + intf = NULL; + } + + if( usbDev ) { + (*usbDev)->USBDeviceClose(usbDev); + (*usbDev)->Release(usbDev); + usbDev = NULL; + } + + return 0; +} + +int io_write( void *buff, int len ) +{ + if( (*intf)->WritePipe( intf, outPipeRef, buff, (UInt32) len ) != + kIOReturnSuccess ) { + printf( "write error\n"); + } + + return len; +} + +int io_read( void *buff, int len ) +{ + + UInt32 size = len; + + if( (*intf)->ReadPipe( intf, inPipeRef, buff, &size ) != + kIOReturnSuccess ) { + printf( "read error\n"); + } + + + return (int) size; +} + diff --git a/sam7utils/io_posix.c b/sam7utils/io_posix.c new file mode 100644 index 0000000..89be541 --- /dev/null +++ b/sam7utils/io_posix.c @@ -0,0 +1,161 @@ +/* + * io.c + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "io.h" +#include "samba.h" + +static int io_fd; + +#define SAM7_TTY "/dev/ttyUSB0" + +#undef DEBUG_IO + +int io_init( char *dev ) +{ + struct termios port_setting; + + if( dev == NULL ) { + dev = SAM7_TTY; + } + // char buff[16]; + + if( (io_fd = open( dev, O_RDWR )) < 0 ) { + printf( "can't open \"%s\": %s\n", dev, strerror( errno ) ); + return -1; + } + + if(tcgetattr(io_fd, &port_setting)!=0) + return -2; + + port_setting.c_iflag = IGNBRK | IGNPAR; + port_setting.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; + port_setting.c_oflag = 0; + port_setting.c_lflag = 0; + + if(tcsetattr(io_fd, TCSAFLUSH, &port_setting)!=0) + return -3; + else + return samba_init(); +} + +int io_cleanup( void ) +{ + close( io_fd ); + + return 0; +} +int io_write( void *buff, int len ) +{ + int write_len = 0; + int ret; + +#ifdef DEBUG_IO + write( STDOUT_FILENO, ">", 1 ); + write( STDOUT_FILENO, buff, len ); + write( STDOUT_FILENO, "\n", 1 ); + +#endif + while( write_len < len ) { + if( (ret = write( io_fd, buff + write_len, len - write_len )) < 0 ) { + return -1; + } + write_len += ret; + } + + return write_len; +} + +int io_read( void *buff, int len ) +{ +#ifdef DEBUG_IO + int i; + char outbuff[16]; + len = read( io_fd, buff, len ); + write( STDOUT_FILENO, "<", 1 ); + for( i=0 ; i 0) && + buff[ read_len - 1 ] == '>' ) { + if( (read_len > 2) && + buff[ read_len - 2 ] == '\r' && + buff[ read_len - 3 ] == '\n' ) { + return buff[read_len - 3] = '\0' ; + return read_len-3 ; + } else { + return buff[read_len - 1] = '\0' ; + return read_len-1 ; + } + } + } + + return read_len; +} +#endif diff --git a/sam7utils/io_win32.c b/sam7utils/io_win32.c new file mode 100644 index 0000000..698e550 --- /dev/null +++ b/sam7utils/io_win32.c @@ -0,0 +1,173 @@ +/* + * io_win32.c + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + * + * USB device enumeration modeled from http://www.delcom-eng.com/downloads/USBPRGMNL.pdf + * + */ + +#include "config.h" + +#define WINVER 0x0500 +#define INITGUID +#include +#include +#include + +#include + +#include "io.h" +#include "samba.h" + + +// {E6EF7DCD-1795-4a08-9FBF-AA78423C26F0} +DEFINE_GUID(USBIODS_GUID, +0xe6ef7dcd, 0x1795, 0x4a08, 0x9f, 0xbf, 0xaa, 0x78, 0x42, 0x3c, 0x26, 0xf0); + +HANDLE io_pipe_in, io_pipe_out; + +int io_init( char *dev ) +{ + char *devname; + + // char buff[16]; + + HDEVINFO hInfo = SetupDiGetClassDevs(&USBIODS_GUID, NULL, + NULL, DIGCF_PRESENT | + DIGCF_INTERFACEDEVICE); + + SP_INTERFACE_DEVICE_DATA Interface_Info; + Interface_Info.cbSize = sizeof(Interface_Info); + // Enumerate device + if( !SetupDiEnumDeviceInterfaces(hInfo, NULL, (LPGUID) + &USBIODS_GUID,0, &Interface_Info ) ) { + printf( "can't find boot agent\n"); + goto error0; + } + + DWORD needed; // get the required lenght + SetupDiGetInterfaceDeviceDetail(hInfo, &Interface_Info, + NULL, 0, &needed, NULL); + PSP_INTERFACE_DEVICE_DETAIL_DATA detail = + (PSP_INTERFACE_DEVICE_DETAIL_DATA) malloc(needed); + if( !detail ) { + printf( "can't find boot agent\n"); + goto error0; + return(-1); + } + + // fill the device details + detail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA); + + if( !SetupDiGetInterfaceDeviceDetail( hInfo, + &Interface_Info,detail, + needed,NULL, NULL )) { + printf( "can't find boot agent\n"); + goto error1; + } + + devname = (char *) malloc( strlen( detail->DevicePath ) + 7 ); + + strcpy( devname, detail->DevicePath ); + strcat( devname, "\\PIPE00" ); + printf( "%s\n", devname ); + + // open out + + io_pipe_out = CreateFile( devname, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, NULL, OPEN_EXISTING, + 0, NULL ); + + if( io_pipe_out == INVALID_HANDLE_VALUE ) { + printf( "can't open output pipe\n" ); + goto error2; + } + + strcpy( devname, detail->DevicePath ); + strcat( devname, "\\PIPE01" ); + + // open in + + io_pipe_in = CreateFile( devname, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, NULL, OPEN_EXISTING, + 0, NULL ); + + if( io_pipe_in == INVALID_HANDLE_VALUE ) { + printf( "can't open input pipe\n" ); + goto error3; + } + + + + + free((PVOID) detail); + free( devname ); + + + + return samba_init(); + + return 0; + // return samba_init(); + + error3: + CloseHandle( io_pipe_out ); + + error2: + free( devname ); + + error1: + free((PVOID) detail); + + error0: + SetupDiDestroyDeviceInfoList(hInfo); + return -1; +} + +int io_cleanup( void ) +{ + CloseHandle( io_pipe_out ); + CloseHandle( io_pipe_in ); + + return 0; +} +int io_write( void *buff, int len ) +{ + int write_len = 0; + DWORD bytes_written; + + while( write_len < len ) { + + if( !WriteFile( io_pipe_out, buff + write_len, + len - write_len, &bytes_written, NULL ) ) { + return -1; + } + write_len += bytes_written; + } + + return write_len; +} + +int io_read( void *buff, int len ) +{ + int read_len = 0; + DWORD bytes_read; + + while( read_len < len ) { + + if( !ReadFile( io_pipe_in, buff + read_len, + len - read_len, &bytes_read, NULL ) ) { + return -1; + } + read_len += bytes_read; + } + + return read_len; +} + diff --git a/sam7utils/loader/Makefile b/sam7utils/loader/Makefile new file mode 100644 index 0000000..c627df7 --- /dev/null +++ b/sam7utils/loader/Makefile @@ -0,0 +1,36 @@ +CC=arm-elf-gcc +LD=arm-elf-ld +AR=arm-elf-ar +AS=arm-elf-as +OBJCOPY=arm-elf-objcopy +OBJDUMP=arm-elf-objdump + +CFLAGS=-nostartfiles -nostdlib -nodefaultlibs -g -O2 +LDFLAGS=-Tloader.lds + +all: loader128.bin loader256.bin + +headers: loader128.bin loader256.bin + gcc -o bin2c bin2c.c + ./bin2c loader128_data < loader128.bin > ../loader128_data.h + ./bin2c loader256_data < loader256.bin > ../loader256_data.h + +loader128.elf: crt0.o loader128.o + ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ + +loader256.elf: crt0.o loader256.o + ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ + + +loader128.o: loader.c + ${CC} ${CFLAGS} -DPAGE_SIZE=128 -c -o $@ $^ + +loader256.o: loader.c + ${CC} ${CFLAGS} -DPAGE_SIZE=256 -c -o $@ $^ + +%.bin: %.elf + ${OBJCOPY} -O binary $^ $@ + +clean: + rm -f loader128.o loader256.o loader128.elf loader256.elf \ + loader128.bin loader256.bin crt0.o bin2c bin2c.exe \ No newline at end of file diff --git a/sam7utils/loader/at91.h b/sam7utils/loader/at91.h new file mode 100644 index 0000000..5f38a53 --- /dev/null +++ b/sam7utils/loader/at91.h @@ -0,0 +1,61 @@ +/* + * loader/at91.h + * + * Copyright (C) 2006 Erik Gilling, 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, version 2. + * + */ + +#define AT91_FLASH_ADDR ((uint32_t *) 0x100000) + +typedef unsigned int uint32_t; +typedef signed int int32_t; + +typedef unsigned short uint16_t; +typedef signed short int16_t; + +typedef unsigned char uint8_t; +typedef signed char int8_t; + +typedef volatile uint32_t arm_reg_t; + +typedef struct { + arm_reg_t rcr; /* 00 - Remap Control Register */ + arm_reg_t asr; /* 04 - Abort Status Rebister */ + arm_reg_t aasr; /* 08 - Abort Address Status Register */ + arm_reg_t res[21]; /* 0C..5C - Reserved */ + arm_reg_t fmr; /* 60 - Flash Mode Register */ + arm_reg_t fcr; /* 64 - Flash Command Register */ + arm_reg_t fsr; /* 68 - Flash Status Register */ +} at91_mc_t; + +extern volatile at91_mc_t mc; + +#define AT91_MC_FMR_FRDY (1<<0) +#define AT91_MC_FMR_LOCKE (1<<2) +#define AT91_MC_FMR_PROGE (1<<3) +#define AT91_MC_FMR_NEBP (1<<7) +#define AT91_MC_FMR_WAIT_STATE_1_2 (0<<8) +#define AT91_MC_FMR_WAIT_STATE_2_3 (1<<8) +#define AT91_MC_FMR_WAIT_STATE_3_4 (2<<8) +#define AT91_MC_FMR_WAIT_STATE_4_4 (3<<8) +#define AT91_MC_FMR_FMCN( x ) (((x)&0xff) << 16) + + +#define AT91_MC_FCR_FCMD_NOP 0x0 +#define AT91_MC_FCR_FCMD_WP 0x1 +#define AT91_MC_FCR_FCMD_SLB 0x2 +#define AT91_MC_FCR_FCMD_WPL 0x3 +#define AT91_MC_FCR_FCMD_CLB 0x4 +#define AT91_MC_FCR_FCMD_EA 0x8 +#define AT91_MC_FCR_FCMD_SGPB 0xb +#define AT91_MC_FCR_FCMD_CGPB 0xd +#define AT91_MC_FCR_FCMD_SSB 0xf + +#define AT91_MC_FCR_PAGEN( x ) (((x)&0x3ff)<<8) + +#define AT91_MC_FCR_KEY (0x5A << 24) + diff --git a/sam7utils/loader/bin2c.c b/sam7utils/loader/bin2c.c new file mode 100644 index 0000000..9e16991 --- /dev/null +++ b/sam7utils/loader/bin2c.c @@ -0,0 +1,30 @@ +#include + +int main( int argc, char *argv[] ) +{ + char *data_name = "data"; + int c; + int i=0; + + if( argc == 2 ) { + data_name = argv[1]; + } + + printf( "uint8_t %s[] = {\n", data_name ); + + while( (c = getchar()) >= 0 ) { + if( i== 0 ) { + printf( "\t" ); + } else if( i%8 == 0 ) { + printf( ",\n\t" ); + } else { + printf( ", " ); + } + i++; + printf( "0x%02x", c ); + } + + printf( "\n};\n" ); + + return 0; +} diff --git a/sam7utils/loader/crt0.S b/sam7utils/loader/crt0.S new file mode 100644 index 0000000..bb0a94f --- /dev/null +++ b/sam7utils/loader/crt0.S @@ -0,0 +1,28 @@ +// +// loader/crt0.S +// +// Copyright (C) 2006 Erik Gilling, 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, version 2. +// +// + .EQU STACK, 0x201C00 + + .code 32 + .align 2 + + .global _entry + .func _entry +_entry: + // init stack + ldr sp, =STACK + + // save lr + stmfd sp!, {lr} + + bl main + + ldmia sp!, {r0} + bx r0 diff --git a/sam7utils/loader/loader.c b/sam7utils/loader/loader.c new file mode 100644 index 0000000..2dc67ff --- /dev/null +++ b/sam7utils/loader/loader.c @@ -0,0 +1,48 @@ +/* + * loader/loader.c + * + * Copyright (C) 2006 Erik Gilling, 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, version 2. + * + */ + +#include "at91.h" + +// SAM-BA apears to write the following data to 0x201400 +// +// 0x00: data0 +// 0x01: data1 +// ... +// PAGE_SIZE-1: last data byte +// PAGE_SIZE : page number to write + + +#define SAMBA_PAGE_BUFF ((uint32_t *) 0x201400) + +int main( void ) +{ + int i; + uint32_t *page_buff = SAMBA_PAGE_BUFF; + // keep this in units of 32 bit words + int page_num = *(page_buff+PAGE_SIZE/4); + int page_offset = page_num * PAGE_SIZE/4; + + // wait for mc to be ready + while( !(mc.fsr & AT91_MC_FMR_FRDY) ) { } + + // write samba page buffer to flash buffer + for( i=0 ; i < (PAGE_SIZE/4) ; i++ ) { + AT91_FLASH_ADDR[ page_offset + i ] = page_buff[i]; + } + + // write page + mc.fcr = AT91_MC_FCR_FCMD_WP | AT91_MC_FCR_PAGEN(page_num) | + AT91_MC_FCR_KEY; + + // dont wait for mc to be ready here so that flash ops can stack + + return 0; +} diff --git a/sam7utils/loader/loader.lds b/sam7utils/loader/loader.lds new file mode 100644 index 0000000..32fcf50 --- /dev/null +++ b/sam7utils/loader/loader.lds @@ -0,0 +1,128 @@ +/***********************************************************************/ +/* */ +/* ROM.ld: Linker Script File */ +/* */ +/***********************************************************************/ +ENTRY(_entry) + +MEMORY +{ + LOADER(rwx) : ORIGIN = 0x00201600, LENGTH = 0xEA00 +} + +/* Section Definitions */ +SECTIONS +{ + + /* first section is .text which is used for code */ + .text : + { + _text = .; + PROVIDE (text = _text); + *crt0.o (.text) /* Startup code */ + *(.text .text.*) /* remaining code */ + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.gcc_except_table) + *(.rodata) /* read-only data (constants) */ + *(.rodata*) + *(.gnu.linkonce.r.*) + } > LOADER + + . = ALIGN(4); + + _etext = . ; + PROVIDE (etext = .); + + /* .data section which is used for initialized data */ + .data : AT (_etext) + { + _data = .; + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) /* mt 4/2005 */ + } > LOADER + + . = ALIGN(4); + _edata = . ; + PROVIDE (edata = .); + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + __bss_start = . ; + __bss_start__ = . ; + *(.bss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); + } > LOADER + + . = ALIGN(4); + __bss_end__ = . ; + PROVIDE (__bss_end = .); + + + + _end = . ; + PROVIDE (end = .); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} + + +PROVIDE(tc = 0xFFFA0000); +PROVIDE(udp = 0xFFFB0000); +PROVIDE(twi = 0xFFFB8000); +PROVIDE(usart0 = 0xFFFC0000); +PROVIDE(usart1 = 0xFFFC4000); +PROVIDE(pwmc = 0xFFFCC000); +PROVIDE(ssc = 0xFFFD4000); +PROVIDE(adc = 0xFFFD8000); +PROVIDE(spi = 0xFFFE0000); +PROVIDE(aic = 0xFFFFF000); +PROVIDE(dbgu = 0xFFFFF200); +PROVIDE(pioa = 0xFFFFF400); +PROVIDE(pmc = 0xFFFFFC00); +PROVIDE(rstc = 0xFFFFFD00); +PROVIDE(rtt = 0xFFFFFD20); +PROVIDE(pit = 0xFFFFFD30); +PROVIDE(wdt = 0xFFFFFD40); +PROVIDE(vreg = 0xFFFFFD60); +PROVIDE(mc = 0xFFFFFF00); + + diff --git a/sam7utils/loader128_data.h b/sam7utils/loader128_data.h new file mode 100644 index 0000000..143de12 --- /dev/null +++ b/sam7utils/loader128_data.h @@ -0,0 +1,18 @@ +uint8_t loader128_data[] = { + 0x0c, 0xd0, 0x9f, 0xe5, 0x00, 0x40, 0x2d, 0xe9, + 0x02, 0x00, 0x00, 0xeb, 0x01, 0x00, 0xbd, 0xe8, + 0x10, 0xff, 0x2f, 0xe1, 0x00, 0x1c, 0x20, 0x00, + 0x30, 0x40, 0x2d, 0xe9, 0x02, 0xe6, 0xa0, 0xe3, + 0x05, 0xeb, 0x8e, 0xe2, 0x80, 0x50, 0x9e, 0xe5, + 0x4c, 0x40, 0x9f, 0xe5, 0x85, 0x02, 0xa0, 0xe1, + 0x68, 0x30, 0x94, 0xe5, 0x01, 0x00, 0x13, 0xe3, + 0xfc, 0xff, 0xff, 0x0a, 0x00, 0x10, 0xa0, 0xe3, + 0x01, 0xc6, 0xa0, 0xe3, 0x01, 0x20, 0x80, 0xe0, + 0x01, 0x31, 0x9e, 0xe7, 0x01, 0x10, 0x81, 0xe2, + 0x1f, 0x00, 0x51, 0xe3, 0x02, 0x31, 0x8c, 0xe7, + 0xf9, 0xff, 0xff, 0xda, 0x05, 0x3b, 0xa0, 0xe1, + 0x23, 0x3b, 0xa0, 0xe1, 0x03, 0x34, 0xa0, 0xe1, + 0x5a, 0x34, 0x83, 0xe3, 0x01, 0x30, 0x83, 0xe3, + 0x00, 0x00, 0xa0, 0xe3, 0x64, 0x30, 0x84, 0xe5, + 0x30, 0x80, 0xbd, 0xe8, 0x00, 0xff, 0xff, 0xff +}; diff --git a/sam7utils/loader256_data.h b/sam7utils/loader256_data.h new file mode 100644 index 0000000..0b5ef0b --- /dev/null +++ b/sam7utils/loader256_data.h @@ -0,0 +1,18 @@ +uint8_t loader256_data[] = { + 0x0c, 0xd0, 0x9f, 0xe5, 0x00, 0x40, 0x2d, 0xe9, + 0x02, 0x00, 0x00, 0xeb, 0x01, 0x00, 0xbd, 0xe8, + 0x10, 0xff, 0x2f, 0xe1, 0x00, 0x1c, 0x20, 0x00, + 0x30, 0x40, 0x2d, 0xe9, 0x02, 0xe6, 0xa0, 0xe3, + 0x05, 0xeb, 0x8e, 0xe2, 0x00, 0x51, 0x9e, 0xe5, + 0x4c, 0x40, 0x9f, 0xe5, 0x05, 0x03, 0xa0, 0xe1, + 0x68, 0x30, 0x94, 0xe5, 0x01, 0x00, 0x13, 0xe3, + 0xfc, 0xff, 0xff, 0x0a, 0x00, 0x10, 0xa0, 0xe3, + 0x01, 0xc6, 0xa0, 0xe3, 0x01, 0x20, 0x80, 0xe0, + 0x01, 0x31, 0x9e, 0xe7, 0x01, 0x10, 0x81, 0xe2, + 0x3f, 0x00, 0x51, 0xe3, 0x02, 0x31, 0x8c, 0xe7, + 0xf9, 0xff, 0xff, 0xda, 0x05, 0x3b, 0xa0, 0xe1, + 0x23, 0x3b, 0xa0, 0xe1, 0x03, 0x34, 0xa0, 0xe1, + 0x5a, 0x34, 0x83, 0xe3, 0x01, 0x30, 0x83, 0xe3, + 0x00, 0x00, 0xa0, 0xe3, 0x64, 0x30, 0x84, 0xe5, + 0x30, 0x80, 0xbd, 0xe8, 0x00, 0xff, 0xff, 0xff +}; diff --git a/sam7utils/main.c b/sam7utils/main.c new file mode 100644 index 0000000..1aef65b --- /dev/null +++ b/sam7utils/main.c @@ -0,0 +1,170 @@ +/* + * main.c + * + * Copyright (C) 2005 Erik Gilling, 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, version 2. + * + */ + +#include "config.h" + +#include +#include +#include +#include + +#include +#include +#include +#ifdef HAVE_CTYPE_H +#include +#endif + +#include +#include + +#include + +#include "io.h" +#include "samba.h" +#include "cmd.h" + +#define SAM7_TTY "/dev/ttyUSB0" + + +static int sam7_parse_line( char *line, char *argv[] ); +static int sam7_handle_line( char *line ); +static void usage( void ); + +#define MAX_CMDS 32 + +int main( int argc, char *argv[] ) +{ + char *cmdline; + char *line = NULL; + char *cmds[MAX_CMDS]; + int n_cmds=0; + int c,i; + + + while( 1 ) { + int option_index; + static struct option long_options[] = { + { "line", 1, 0, 'l' }, + { "help", 0, 0, 'h' }, + { "exec", 1, 0, 'e' } + }; + + c = getopt_long( argc, argv, "l:e:h", long_options, &option_index ); + + if( c == -1 ) { + break; + } + + switch( c ) { + case 'l': + line = optarg; + break; + + case 'e': + if( n_cmds >= MAX_CMDS ) { + printf( "to many commands, increase MAX_CMDS\n" ); + return 1; + } + cmds[n_cmds] = optarg; + n_cmds++; + break; + + case 'h': + usage(); + return 0; + break; + + default: + printf( "unknown option\n" ); + usage(); + return 1; + } + } + + + if( io_init( line ) < 0 ) { + return 1; + } + + if( n_cmds > 0 ) { + for( i=0 ; i " )) ) { + add_history( cmdline ); + sam7_handle_line( cmdline ); + } + } + + io_cleanup(); + + return 0; +} + +static void usage( void ) +{ + printf( "usage: sam7 [options]\n" ); + printf( " -e|--exec execute cmd instead of entering interactive mode.\n"); + printf( " -l|--line specifies the line/tty which the boot agent resides.\n"); + printf( " only used for posix IO.\n" ); + printf( " -h|--help dislay this message and exit.\n"); +} + +static int sam7_parse_line( char *line, char *argv[] ) +{ + char *p = line; + int argc = 0; + + + while( *p ) { + // eat white space + while( *p && isspace( *p ) ) { p++; } + if( ! *p ) { + break; + } + + argv[argc++] = p; + + while( *p && !isspace( *p ) ) { p++; } + if( *p ) { + *p++ = '\0'; + } + } + + return argc; +} + +static int sam7_handle_line( char *line ) +{ + int argc; + char buff[256]; + char *argv[32]; + cmd_t *cmd; + + strncpy( buff, line, 255 ); + buff[255] = '\0'; + + argc = sam7_parse_line( buff, argv ); + + if( argc > 0 ) { + if( (cmd = cmd_find( argv[0] )) != NULL ) { + return cmd->func( argc, argv ); + } + printf( "command %s not found\n", argv[0] ); + return -1; + } + + return 0; +} + diff --git a/sam7utils/missing b/sam7utils/missing new file mode 100644 index 0000000..09edd88 --- /dev/null +++ b/sam7utils/missing @@ -0,0 +1,357 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-02-08.22 + +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, 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 + 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: diff --git a/sam7utils/samba.c b/sam7utils/samba.c new file mode 100644 index 0000000..cc57d67 --- /dev/null +++ b/sam7utils/samba.c @@ -0,0 +1,373 @@ +/* + * samba.c + * + * Copyright (C) 2005,2006 Erik Gilling, 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, version 2. + * + */ + +#include "config.h" + +#include + +#include +#include +#include +#include + +#ifdef HAVE_ENDIAN_H +#include +#endif + +#ifdef HAVE_LOCALENDIAN_H +#include +#endif + +#include "io.h" +#include "samba.h" + + +#ifndef __BYTE_ORDER +# define __LITTLE_ENDIAN 4321 +# define __BIG_ENDIAN 1234 +# ifdef __LITTLE_ENDIAN__ +# define __BYTE_ORDER __LITTLE_ENDIAN +# endif +# ifdef __BIG_ENDIAN__ +# define __BYTE_ORDER __BIG_ENDIAN +# endif +#endif + +#if defined( __BYTE_ORDER ) +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define le2hl(x) (x) +# define le2hs(x) (x) +# endif + +# if __BYTE_ORDER == __BIG_ENDIAN + +# define le2hl(x) \ + ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ + (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ + (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ + (((unsigned long int)(x) & 0xff000000U) >> 24))) + +# define le2hs(x) \ + ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ + (((unsigned short int)(x) & 0xff00) >> 8))) + +# endif +#endif + +#define hl2le(x) le2hl(x) +#define hs2le(x) le2hs(x) + +static const char *eprocs[] = { + /* 000 */ "", + /* 001 */ "ARM946E-S", + /* 010 */ "ARM7TDMI", + /* 011 */ "", + /* 100 */ "ARM920T", + /* 101 */ "ARM926EJ-S", + /* 110 */ "", + /* 111 */ "" +}; + + +#define K 1024 + +static const int nvpsizs[] = { + /* 0000 */ 0, + /* 0001 */ 8 * K, + /* 0010 */ 16 * K, + /* 0011 */ 32 * K, + /* 0100 */ -1, + /* 0101 */ 64 * K, + /* 0110 */ -1, + /* 0111 */ 128 * K, + /* 1000 */ -1, + /* 1001 */ 256 * K, + /* 1010 */ 512 * K, + /* 1011 */ -1, + /* 1100 */ 1024 * K, + /* 1101 */ -1, + /* 1110 */ 2048 * K, + /* 1111 */ -1 +}; + +static const int sramsizs[] = { + /* 0000 */ -1, + /* 0001 */ 1 * K, + /* 0010 */ 2 * K, + /* 0011 */ -1, + /* 0100 */ 112 * K, + /* 0101 */ 4 * K, + /* 0110 */ 80 * K, + /* 0111 */ 160 * K, + /* 1000 */ 8 * K, + /* 1001 */ 16 * K, + /* 1010 */ 32 * K, + /* 1011 */ 64 * K, + /* 1100 */ 128 * K, + /* 1101 */ 256 * K, + /* 1110 */ 96 * K, + /* 1111 */ 512 * K +}; + +static const struct { unsigned id; const char *name; } archs[] = { + {AT91_ARCH_AT75Cxx, "AT75Cxx"}, + {AT91_ARCH_AT91x40, "AT91x40"}, + {AT91_ARCH_AT91x63, "AT91x63"}, + {AT91_ARCH_AT91x55, "AT91x55"}, + {AT91_ARCH_AT91x42, "AT91x42"}, + {AT91_ARCH_AT91x92, "AT91x92"}, + {AT91_ARCH_AT91x34, "AT91x34"}, + {AT91_ARCH_AT91SAM7Axx, "AT91SAM7Axx"}, + {AT91_ARCH_AT91SAM7Sxx, "AT91SAM7Sxx"}, + {AT91_ARCH_AT91SAM7XC, "AT91SAM7XC"}, + {AT91_ARCH_AT91SAM7SExx, "AT91SAM7SExx"}, + {AT91_ARCH_AT91SAM7Lxx, "AT91SAM7Lxx"}, + {AT91_ARCH_AT91SAM7Xxx, "AT91SAM7Xxx"}, + {AT91_ARCH_AT91SAM9xx, "AT91SAM9xx"} +}; + +static char arch_buffer[32]; + +const char *at91_arch_str( int id ) { + int i; + + + for( i=0 ; i<(sizeof(archs)/sizeof(*archs)) ; i++ ) { + if( archs[i].id == id ) { + return archs[i].name; + } + } + + sprintf(arch_buffer,"unkown id [0x%02X]",id); + + return arch_buffer; +} + +at91_chip_info_t samba_chip_info; + +int samba_init( void ) +{ + uint32_t chipid; + uint16_t response; + + if( io_send_cmd( "N#", &response, sizeof( response ) ) < 0 ) { + printf( "can't init boot program: %s\n", strerror( errno ) ); + return -1; + } + + if( samba_read_word( 0xfffff240, &chipid ) < 0 ) { + return -1; + } + + samba_chip_info.version = AT91_CHIPID_VERSION( chipid ); + samba_chip_info.eproc = AT91_CHIPID_EPROC( chipid ); + samba_chip_info.nvpsiz = nvpsizs[AT91_CHIPID_NVPSIZ( chipid )]; + samba_chip_info.nvpsiz2 = nvpsizs[AT91_CHIPID_NVPSIZ2( chipid )]; + samba_chip_info.sramsiz = sramsizs[AT91_CHIPID_SRAMSIZ( chipid )]; + samba_chip_info.arch = AT91_CHIPID_ARCH( chipid ); + + if( samba_chip_info.arch == AT91_ARCH_AT91SAM7Sxx ) { + switch( samba_chip_info.nvpsiz) { + case 32*K: + samba_chip_info.page_size = 128; + samba_chip_info.lock_bits = 8; + break; + + case 64*K: + samba_chip_info.page_size = 128; + samba_chip_info.lock_bits = 16; + break; + + case 128*K: + samba_chip_info.page_size = 256; + samba_chip_info.lock_bits = 8; + break; + + case 256*K: + samba_chip_info.page_size = 256; + samba_chip_info.lock_bits = 16; + break; + + default: + printf( "unknown sam7s flash size %d\n", samba_chip_info.nvpsiz ); + return -1; + } + + } else if( samba_chip_info.arch == AT91_ARCH_AT91SAM7Xxx ) { + switch( samba_chip_info.nvpsiz ) { + case 128*K: + samba_chip_info.page_size = 256; + samba_chip_info.lock_bits = 8; + break; + + case 256*K: + samba_chip_info.page_size = 256; + samba_chip_info.lock_bits = 16; + break; + + default: + printf( "unknown sam7x srflashsize %d\n", samba_chip_info.nvpsiz ); + return -1; + } + } else { + printf( "Page size info of %s not known\n", + at91_arch_str( samba_chip_info.arch ) ); + return -1; + } + + printf("Chip Version: %d\n", samba_chip_info.version ); + printf("Embedded Processor: %s\n", eprocs[samba_chip_info.eproc] ); + printf("NVRAM Region 1 Size: %d K\n", samba_chip_info.nvpsiz / K ); + printf("NVRAM Region 2 Size: %d K\n", samba_chip_info.nvpsiz2 / K ); + printf("SRAM Size: %d K\n", samba_chip_info.sramsiz / K ); + printf("Series: %s\n", at91_arch_str( samba_chip_info.arch ) ); + printf("Page Size: %d bytes\n", samba_chip_info.page_size ); + printf("Lock Regions: %d\n", samba_chip_info.lock_bits ); + + return 0; +} + +int samba_write_byte( uint32_t addr, uint8_t value ) +{ + char cmd[64]; + + snprintf( cmd, 64, "O%08X,%02X#", (unsigned int) addr, + (unsigned int) value ); + + return io_send_cmd( cmd, NULL, 0 ); +} + +int samba_read_byte( uint32_t addr, uint8_t *value ) +{ + char cmd[64]; + + snprintf( cmd, 64, "o%08X,1#", (unsigned int) addr ); + + return io_send_cmd( cmd, value, 1 ); +} + +int samba_write_half_word( uint32_t addr, uint16_t value ) +{ + char cmd[64]; + + snprintf( cmd, 64, "H%08X,%04X#", (unsigned int) addr, + (unsigned int) value ); + + + return io_send_cmd( cmd, NULL, 0 ); +} + +int samba_read_half_word( uint32_t addr, uint16_t *value ) +{ + char cmd[64]; + int err; + + snprintf( cmd, 64, "h%X,2#", (unsigned int) addr ); + + err = io_send_cmd( cmd, value, 2 ); + *value = le2hs( *value ); + + return err; + +} + +int samba_write_word( uint32_t addr, uint32_t value ) +{ + char cmd[64]; + + snprintf( cmd, 64, "W%08X,%08X#", (unsigned int) addr, + (unsigned int) value ); + + return io_send_cmd( cmd, NULL, 0 ); +} + +int samba_read_word( uint32_t addr, uint32_t *value ) +{ + char cmd[64]; + int err; + + snprintf( cmd, 64, "w%08X,4#", (unsigned int) addr ); + + err = io_send_cmd( cmd, value, 4 ); + *value = le2hl( *value ); + + return err; +} + + +int samba_send_file( uint32_t addr, uint8_t *buff, int len ) +{ + char cmd[64]; + int i=0; + + snprintf( cmd, 64, "S%X,%X#", (unsigned int) addr, (unsigned int) len ); + + if( io_write( cmd, strlen( cmd ) ) < 0 ) { + return -1; + } + + usleep( 2000 ); + + for( i=0 ; i +#endif + +#define AT91_CHIPID_VERSION( chipid ) (((chipid)>>0)&0x1f) +#define AT91_CHIPID_EPROC( chipid ) (((chipid)>>5)&0x7) +#define AT91_CHIPID_NVPSIZ( chipid ) (((chipid)>>8)&0xf) +#define AT91_CHIPID_NVPSIZ2( chipid ) (((chipid)>>12)&0xf) +#define AT91_CHIPID_SRAMSIZ( chipid ) (((chipid)>>16)&0xf) +#define AT91_CHIPID_ARCH( chipid ) (((chipid)>>20)&0xff) +#define AT91_CHIPID_NVPTYP( chipid ) (((chipid)>>28)&0x7) +#define AT91_CHIPID_EXT( chipid ) (((chipid)>>31)&0x1) + +#define AT91_ARCH_AT75Cxx 0xF0 +#define AT91_ARCH_AT91x40 0x40 +#define AT91_ARCH_AT91x63 0x63 +#define AT91_ARCH_AT91x55 0x55 +#define AT91_ARCH_AT91x42 0x42 +#define AT91_ARCH_AT91x92 0x92 +#define AT91_ARCH_AT91x34 0x34 +#define AT91_ARCH_AT91SAM7Axx 0x60 +#define AT91_ARCH_AT91SAM7Sxx 0x70 +#define AT91_ARCH_AT91SAM7XC 0x71 +#define AT91_ARCH_AT91SAM7SExx 0x72 +#define AT91_ARCH_AT91SAM7Lxx 0x73 +#define AT91_ARCH_AT91SAM7Xxx 0x75 +#define AT91_ARCH_AT91SAM9xx 0x19 + +typedef struct { + int version; + int eproc; + int nvpsiz; + int nvpsiz2; + int sramsiz; + int arch; + int page_size; + int lock_bits; +} at91_chip_info_t; + +extern at91_chip_info_t samba_chip_info; + +int samba_init( void ); +int samba_write_byte( uint32_t addr, uint8_t value ); +int samba_read_byte( uint32_t addr, uint8_t *value ); +int samba_write_half_word( uint32_t addr, uint16_t value ); +int samba_read_half_word( uint32_t addr, uint16_t *value ); +int samba_write_word( uint32_t addr, uint32_t value ); +int samba_read_word( uint32_t addr, uint32_t *value ); +int samba_send_file( uint32_t addr, uint8_t *buff, int len ); +int samba_recv_file( uint32_t addr, uint8_t *buff, int len ); +int samba_go( uint32_t addr ); +int samba_get_version( char *version, int len ); + +#endif /* __samba_h__ */ diff --git a/sam7utils/stamp-h1 b/sam7utils/stamp-h1 new file mode 100644 index 0000000..4547fe1 --- /dev/null +++ b/sam7utils/stamp-h1 @@ -0,0 +1 @@ +timestamp for config.h diff --git a/sam7utils/test.c b/sam7utils/test.c new file mode 100644 index 0000000..74de8a8 --- /dev/null +++ b/sam7utils/test.c @@ -0,0 +1,3 @@ +int main(void) +{ +}